Hide unnecessary scrollbars in SplatNet 3

https://github.com/samuelthomas2774/nxapi/issues/24
This commit is contained in:
Samuel Elliott 2022-09-20 20:51:13 +01:00
parent 6f84981018
commit e5fe9b389e
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
4 changed files with 38 additions and 4 deletions

View File

@ -6,6 +6,21 @@ const debug = createDebug('app:preload-webservice:quirks:splatnet2');
const SPLATNET2_WEBSERVICE_ID = 5741031244955648;
if (webservice.id === SPLATNET2_WEBSERVICE_ID) {
const style = window.document.createElement('style');
style.textContent = `
.popup-dim {
/* Hide the horizonal scroll bar that only appears during the popup animation */
overflow-x: hidden;
}
`;
document.addEventListener('DOMContentLoaded', () => {
// Always show the scroll bar for the document root since no scrollable containers are used anywhere
(document.scrollingElement as HTMLElement).style.overflowY = 'scroll';
window.document.head.appendChild(style);
});
events.on('window:refresh', () => {
const refresh_button = document.querySelector<HTMLElement>('.refresh-button');

View File

@ -12,6 +12,25 @@ if (webservice.id === SPLATNET3_WEBSERVICE_ID) {
[class*=NavigationBar_exitButton] {
display: none;
}
[class*=App_App] {
/* Hide scroll bars in the main app container, which includes the title bar that should always be fixed */
overflow: auto;
}
[class*=InAppContent_children] {
/* Maybe hide scroll bars in the main content container */
overflow-y: auto;
/* Hide the horizonal scroll bar that only appears during the page sliding transition */
overflow-x: hidden;
}
[class*=SwipableView_swipableViewItem] {
/* Maybe hide scroll bars in swipable views (e.g. in the schedules page) */
overflow-y: auto;
}
[class*=StyledModal_Container] {
/* Maybe hide the scroll bar in modals */
overflow-y: auto;
}
`;
document.addEventListener('DOMContentLoaded', () => {