User:CannonProductions/monacobookbeta.js: Difference between revisions
From MediaWiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
/* | /* ===== TFWiki Mobile Fix Pack (MonacoBookBeta-ish) ===== */ | ||
@media (max-width: 720px) { | |||
/* --- Base layout: full width, no weird centering --- */ | |||
html, body { | |||
width: 100% !important; | |||
max-width: 100% !important; | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
overflow-x: visible !important; | |||
} | |||
#globalWrapper, | |||
#column-content, | |||
#content, | |||
#bodyContent { | |||
width: 100% !important; | |||
max-width: 100% !important; | |||
min-width: 0 !important; | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
box-sizing: border-box !important; | |||
} | |||
// | /* breathing room for article text */ | ||
#content, #bodyContent { | |||
padding-left: 10px !important; | |||
padding-right: 10px !important; | |||
overflow-x: hidden !important; | |||
} | |||
// | /* keep "more" / action menus able to overflow */ | ||
#p-cactions, | |||
#p-cactions .pBody, | |||
#column-content { | |||
overflow: visible !important; | |||
} | |||
#p-cactions { | |||
position: relative !important; | |||
z-index: 10000 !important; | |||
} | |||
/* Main Page columns stack */ | |||
#mw-content-text .mainleft, | |||
#mw-content-text .mainright { | |||
float: none !important; | |||
width: auto !important; | |||
max-width: 100% !important; | |||
margin: 0 !important; | |||
box-sizing: border-box !important; | |||
text-align: center; | |||
} | } | ||
/* Media in the ARTICLE never forces overflow */ | |||
#mw-content-text img, | |||
#mw-content-text video, | |||
#mw-content-text iframe { | |||
max-width: 100% !important; | |||
height: auto !important; | |||
} | |||
.thumb, .thumbinner { | |||
max-width: 100% !important; | |||
box-sizing: border-box !important; | |||
} | } | ||
/* Wide tables/navboxes scroll */ | |||
#mw-content-text table.wikitable, | |||
#mw-content-text .navbox, | |||
#mw-content-text table.navbox { | |||
display: block !important; | |||
max-width: 100% !important; | |||
overflow-x: auto !important; | |||
-webkit-overflow-scrolling: touch; | |||
} | } | ||
// | /* long text doesn't blow width */ | ||
.mw-parser-output { | |||
overflow-wrap: anywhere !important; | |||
word-break: break-word !important; | |||
} | |||
pre, code { | |||
white-space: pre-wrap !important; | |||
word-break: break-word !important; | |||
} | } | ||
/* --- Full-screen sidebar overlay --- */ | |||
#column-one { | |||
position: fixed !important; | |||
left: 0 !important; | |||
width: 100vw !important; | |||
max-width: 100vw !important; | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
overflow-y: auto !important; | |||
overflow-x: hidden !important; | |||
-webkit-overflow-scrolling: touch; | |||
z-index: 999999 !important; | |||
background: #fff !important; | |||
box-sizing: border-box !important; | |||
} | |||
/* Make sidebar contents stretch full width */ | |||
#column-one .portlet, | |||
#column-one .pBody, | |||
#column-one ul, | |||
#column-one form, | |||
#column-one fieldset { | |||
width: 100% !important; | |||
max-width: 100% !important; | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
float: none !important; | |||
box-sizing: border-box !important; | |||
} | |||
#column-one ul { | |||
list-style: none !important; | |||
} | |||
#column-one li a { | |||
display: block !important; | |||
width: 100% !important; | |||
box-sizing: border-box !important; | |||
padding: 14px 16px !important; | |||
font-size: 18px !important; | |||
line-height: 1.2 !important; | |||
border-bottom: 1px solid rgba(0,0,0,0.10) !important; | |||
text-decoration: none !important; | |||
} | } | ||
// | /* Search area padding + full-width controls */ | ||
#p-search .pBody { padding: 12px 16px !important; } | |||
#column-one #searchInput, | |||
#column-one input[type="text"], | |||
#column-one input[type="search"] { | |||
width: 100% !important; | |||
max-width: 100% !important; | |||
font-size: 18px !important; | |||
padding: 12px 12px !important; | |||
box-sizing: border-box !important; | |||
} | } | ||
#column-one input[type="submit"], | |||
#column-one input[type="button"], | |||
#column-one button { | |||
width: 100% !important; | |||
max-width: 100% !important; | |||
display: block !important; | |||
font-size: 18px !important; | |||
padding: 14px 12px !important; | |||
margin: 10px 0 0 0 !important; | |||
box-sizing: border-box !important; | |||
} | } | ||
/* --- Banner ad: DO NOT let CSS fight the scaling JS --- */ | |||
#top-ad { | |||
width: 100% !important; | |||
overflow: hidden !important; | |||
} | } | ||
#top-ad iframe { | |||
max-width: none !important; /* key */ | |||
height: 60px !important; | |||
border: 0 !important; | |||
display: block !important; | |||
} | } | ||
/* ===== The ACTUAL GOAL: menu shifts under hamburger bar when open ===== */ | |||
:root { --tf-hamburger-h: 52px; } /* tweak if needed */ | |||
html.tf-nav-open #column-one { | |||
top: var(--tf-hamburger-h) !important; | |||
height: calc(100vh - var(--tf-hamburger-h)) !important; | |||
} | |||
/* When nav is open, hide banner ad entirely */ | |||
html.tf-nav-open #top-ad { | |||
display: none !important; | |||
} | } | ||
} | |||
Revision as of 12:58, 30 December 2025
/* ===== TFWiki Mobile Fix Pack (MonacoBookBeta-ish) ===== */
@media (max-width: 720px) {
/* --- Base layout: full width, no weird centering --- */
html, body {
width: 100% !important;
max-width: 100% !important;
margin: 0 !important;
padding: 0 !important;
overflow-x: visible !important;
}
#globalWrapper,
#column-content,
#content,
#bodyContent {
width: 100% !important;
max-width: 100% !important;
min-width: 0 !important;
margin: 0 !important;
padding: 0 !important;
box-sizing: border-box !important;
}
/* breathing room for article text */
#content, #bodyContent {
padding-left: 10px !important;
padding-right: 10px !important;
overflow-x: hidden !important;
}
/* keep "more" / action menus able to overflow */
#p-cactions,
#p-cactions .pBody,
#column-content {
overflow: visible !important;
}
#p-cactions {
position: relative !important;
z-index: 10000 !important;
}
/* Main Page columns stack */
#mw-content-text .mainleft,
#mw-content-text .mainright {
float: none !important;
width: auto !important;
max-width: 100% !important;
margin: 0 !important;
box-sizing: border-box !important;
text-align: center;
}
/* Media in the ARTICLE never forces overflow */
#mw-content-text img,
#mw-content-text video,
#mw-content-text iframe {
max-width: 100% !important;
height: auto !important;
}
.thumb, .thumbinner {
max-width: 100% !important;
box-sizing: border-box !important;
}
/* Wide tables/navboxes scroll */
#mw-content-text table.wikitable,
#mw-content-text .navbox,
#mw-content-text table.navbox {
display: block !important;
max-width: 100% !important;
overflow-x: auto !important;
-webkit-overflow-scrolling: touch;
}
/* long text doesn't blow width */
.mw-parser-output {
overflow-wrap: anywhere !important;
word-break: break-word !important;
}
pre, code {
white-space: pre-wrap !important;
word-break: break-word !important;
}
/* --- Full-screen sidebar overlay --- */
#column-one {
position: fixed !important;
left: 0 !important;
width: 100vw !important;
max-width: 100vw !important;
margin: 0 !important;
padding: 0 !important;
overflow-y: auto !important;
overflow-x: hidden !important;
-webkit-overflow-scrolling: touch;
z-index: 999999 !important;
background: #fff !important;
box-sizing: border-box !important;
}
/* Make sidebar contents stretch full width */
#column-one .portlet,
#column-one .pBody,
#column-one ul,
#column-one form,
#column-one fieldset {
width: 100% !important;
max-width: 100% !important;
margin: 0 !important;
padding: 0 !important;
float: none !important;
box-sizing: border-box !important;
}
#column-one ul {
list-style: none !important;
}
#column-one li a {
display: block !important;
width: 100% !important;
box-sizing: border-box !important;
padding: 14px 16px !important;
font-size: 18px !important;
line-height: 1.2 !important;
border-bottom: 1px solid rgba(0,0,0,0.10) !important;
text-decoration: none !important;
}
/* Search area padding + full-width controls */
#p-search .pBody { padding: 12px 16px !important; }
#column-one #searchInput,
#column-one input[type="text"],
#column-one input[type="search"] {
width: 100% !important;
max-width: 100% !important;
font-size: 18px !important;
padding: 12px 12px !important;
box-sizing: border-box !important;
}
#column-one input[type="submit"],
#column-one input[type="button"],
#column-one button {
width: 100% !important;
max-width: 100% !important;
display: block !important;
font-size: 18px !important;
padding: 14px 12px !important;
margin: 10px 0 0 0 !important;
box-sizing: border-box !important;
}
/* --- Banner ad: DO NOT let CSS fight the scaling JS --- */
#top-ad {
width: 100% !important;
overflow: hidden !important;
}
#top-ad iframe {
max-width: none !important; /* key */
height: 60px !important;
border: 0 !important;
display: block !important;
}
/* ===== The ACTUAL GOAL: menu shifts under hamburger bar when open ===== */
:root { --tf-hamburger-h: 52px; } /* tweak if needed */
html.tf-nav-open #column-one {
top: var(--tf-hamburger-h) !important;
height: calc(100vh - var(--tf-hamburger-h)) !important;
}
/* When nav is open, hide banner ad entirely */
html.tf-nav-open #top-ad {
display: none !important;
}
}

