Template:Theme-HJ: Difference between revisions
From HUIJIA FUN
PlurimodSU (talk | contribs) m Refinement |
PlurimodSU (talk | contribs) Sync with zh: ink-green headings; 1px heading rules (full width on h1/h2, fading on h3-h6); Archive Zone mark on h2; no page-title rule; flat language-variant button and dropdown; English-only copy labels |
||
| (9 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
<style> | <style> | ||
/** | /** | ||
* HUIJIA FUN - TIMELESS | * HUIJIA FUN - TIMELESS THEME - HJ V5.0 | ||
* | * VGR Design System: Archive Zone / site-wide default theme | ||
* | * Changes: uses VGR tokens; body text in Zhuque Fangsong; square corners, no shadows; keeps the dot pattern and graded heading rules; | ||
* scroll fade-ins removed; overrides the pink of Timeless and Tabber | |||
*/ | */ | ||
/* | /* === 0. Fonts === | ||
@import url('https://fonts.googleapis.com/css2?family= | Source Sans 3 / Source Serif 4 are the Latin halves of the same families as Noto Sans SC / Noto Serif SC (Source Han Sans / Serif). | ||
Latin first, Chinese second: English italics come from the Latin font, while Chinese stays upright. */ | |||
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Noto+Serif+SC:wght@400;600&family=Source+Sans+3:ital,wght@0,400;0,500;0,700;1,400&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=JetBrains+Mono:wght@400;700&display=swap'); | |||
@import url('https://cdn.jsdelivr.net/npm/[email protected]/style.css'); | |||
/* Zhuque Fangsong: body font. Loaded in character slices, so only the glyphs a page uses are downloaded. SIL OFL 1.1 */ | |||
@import url('https://cdn.jsdelivr.net/npm/@chinese-fonts/[email protected]/dist/ZhuqueFangsong-Regular/result.css'); | |||
/* === 1. Tokens (light) === */ | |||
:root { | :root { | ||
-- | /* Source colors */ | ||
-- | --src-huijia-green: #025F32; | ||
-- | --src-dragon-green: #3B7E3D; | ||
-- | --src-gate-grey: #969682; | ||
-- | --src-plurimod-light: #C1E1A6; | ||
-- | --src-huashao-blue: #002F9C; | ||
-- | |||
-- | /* Semantic colors */ | ||
--font- | --paper: #F3F5F1; | ||
--font-body: | --paper-raised: #FFFFFF; | ||
--font- | --paper-sunk: #E7ECE5; | ||
-- | --ink: #16211B; | ||
--ink-muted: #4C5A51; | |||
--rule: #C9D3CA; | |||
--rule-strong: #7E8B81; | |||
--accent: #025F32; | |||
--accent-fill: #025F32; | |||
--on-accent: #FFFFFF; | |||
--accent-tint: #DCEBD9; | |||
--link: #0B6B3A; | |||
--link-new: #A8432F; | |||
--focus: #002F9C; | |||
--heading: #0F3D27; /* heading text: ink green 12.2:1 */ | |||
--heading-bar: #C8D8C8; /* rule under sidebar group names */ | |||
--heading-line: #8FB39A; /* heading rules: full width on h1/h2, fading from h3 to h6 */ | |||
--dot: #A3B1A8; /* dot pattern on the content card */ | |||
/* Type */ | |||
--font-display: Huiwen, "Source Serif 4", "Noto Serif SC", "Source Han Serif SC", serif; | |||
--font-serif: "Source Serif 4", "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif; | |||
--font-sans: "Source Sans 3", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; | |||
/* Body: Fangsong, the tone of archives and official documents. Falls back to Noto Serif SC if it fails to load */ | |||
--font-body: "Source Serif 4", "Zhuque Fangsong (technical preview)", "Noto Serif SC", "Source Han Serif SC", "FangSong", "STFangsong", serif; | |||
--font-latin: "Cormorant Garamond", "EB Garamond", Georgia, serif; | |||
--font-scripture: "LXGW WenKai Screen", "Kaiti SC", STKaiti, KaiTi, serif; | |||
--font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace; | |||
/* Spacing and radius */ | |||
--space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; | |||
--space-6: 24px; --space-8: 32px; --space-12: 48px; | |||
--radius-none: 0; --radius-xs: 2px; --radius-sm: 4px; --radius-pill: 999px; | |||
/* Point the Timeless / Codex / FlowThread primary-color variables at Huijia Green, replacing the skin's pink */ | |||
--color-primary: var(--accent); | |||
--color-progressive: var(--accent); | |||
--color-progressive--hover: var(--src-dragon-green); | |||
--background-color-progressive: var(--accent-fill); | |||
--border-color-progressive: var(--accent); | |||
--color-link: var(--link); | |||
--color-link--visited: var(--link); | |||
--color-link-red: var(--link-new); | |||
/* Legacy variable names, kept for other templates */ | |||
--mw-primary: var(--accent); | |||
--mw-accent: var(--src-dragon-green); | |||
--mw-link: var(--link); | |||
--mw-border: var(--rule); | |||
--font-heading: var(--font-serif); | |||
--font-code: var(--font-mono); | |||
} | } | ||
/* --- | /* === 1b. Tokens (dark) | ||
Applies only under MediaWiki's night-mode class and does not follow the system setting: | |||
Common.css and other templates are not dark-ready yet, so following the system would leave some elements dark-on-dark. */ | |||
html.skin-theme-clientpref-night { | |||
--paper: #111613; | |||
--paper-raised: #18201B; | |||
--paper-sunk: #0C100E; | |||
--ink: #E4EBE5; | |||
--ink-muted: #A2B0A6; | |||
--rule: #2A352E; | |||
--rule-strong: #667A6C; | |||
--accent: #C1E1A6; | |||
--accent-fill: #3B7E3D; | |||
--accent-tint: #1C2B21; | |||
--link: #8FD3A8; | |||
--link-new: #F0907E; | |||
--focus: #8FB0FF; | |||
--heading: #D2E8C6; | |||
--heading-bar: #2F4033; | |||
--heading-line: #4F7559; | |||
--dot: #2A352E; | |||
color-scheme: dark; | |||
} | |||
/* === 2. Page and body text === */ | |||
body { | body { | ||
background-color: var(-- | background-color: var(--paper); | ||
color: | color: var(--ink); | ||
font-family: var(--font-sans); | |||
font-size: 16px; | |||
line-height: 1.8; | |||
accent-color: var(--accent); | |||
-webkit-font-smoothing: antialiased; | |||
} | |||
/* Body text uses Fangsong; UI elements such as navigation, tables and buttons stay in sans (set in their own sections) */ | |||
.mw-parser-output { | |||
font-family: var(--font-body); | font-family: var(--font-body); | ||
line-height: 1. | font-size: 16px; | ||
- | line-height: 1.9; | ||
letter-spacing: 0.02em; | |||
} | } | ||
.mw-parser-output b, | |||
.mw-parser-output strong { font-family: var(--font-serif); font-weight: 600; letter-spacing: 0; } | |||
/* Chinese has no true italic: stop the browser from faking slanted Chinese; Latin italics work as usual */ | |||
i, em, cite, .mw-parser-output i { font-synthesis: none; } | |||
} | |||
::selection { background: var(--accent-fill); color: var(--on-accent); } | |||
} | |||
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } | |||
} | |||
# | /* === 3. Header === */ | ||
#mw-header-container { | |||
background: var(--paper-raised); | |||
border-bottom: 1px solid var(--rule); | |||
box-shadow: none; | |||
} | } | ||
#p-banner, #p-banner a, .mw-wiki-title { | |||
#p- | font-family: var(--font-sans); | ||
font-weight: 500; | |||
letter-spacing: 0.04em; | |||
color: var(--ink) !important; | |||
} | } | ||
/* | /* === 4. Search box (the only pill shape) === */ | ||
#p-search { | #p-search { | ||
margin: 0 20px !important; | margin: 0 20px !important; | ||
| Line 75: | Line 151: | ||
align-items: center; | align-items: center; | ||
} | } | ||
#searchform { | #searchform { | ||
background: | background: var(--paper-raised) !important; | ||
border: 1px solid var(-- | border: 1px solid var(--rule-strong) !important; | ||
border-radius: | border-radius: var(--radius-pill) !important; | ||
display: flex !important; | display: flex !important; | ||
flex-direction: row !important; | flex-direction: row !important; | ||
align-items: center !important; | align-items: center !important; | ||
padding: 2px 4px 2px | padding: 2px 4px 2px 16px !important; | ||
max-width: 350px; | |||
overflow: hidden; | overflow: hidden; | ||
box-shadow: none !important; | |||
transition: border-color 0.2s ease; | |||
} | } | ||
#searchform:focus-within { | #searchform:focus-within { | ||
border-color: var(-- | border-color: var(--accent) !important; | ||
outline: 2px solid var(--focus); | |||
outline-offset: 2px; | |||
} | } | ||
#simpleSearch { | #simpleSearch { | ||
background: transparent !important; | background: transparent !important; | ||
| Line 101: | Line 176: | ||
align-items: center !important; | align-items: center !important; | ||
} | } | ||
#searchInput { | #searchInput { | ||
background: transparent !important; | background: transparent !important; | ||
border: none !important; | border: none !important; | ||
box-shadow: none !important; | box-shadow: none !important; | ||
font-family: var(--font- | font-family: var(--font-sans); | ||
font-size: | font-size: 14px !important; | ||
padding: 8px 0 !important; | padding: 8px 0 !important; | ||
color: | color: var(--ink) !important; | ||
width: 100% !important; | width: 100% !important; | ||
outline: none; | |||
} | } | ||
#searchInput::placeholder { color: var(--ink-muted); } | |||
/* | /* === 5. Logo === */ | ||
#p-logo, .mw-portlet-logo { | |||
display: flex !important; | |||
justify-content: center; | |||
align-items: center; | |||
padding | padding: 20px 0 !important; | ||
margin-bottom: | margin-bottom: 10px; | ||
} | |||
#p-logo img { | |||
border-radius: var(--radius-none); | |||
box-shadow: none; | |||
} | } | ||
/* | /* === 6. Left and right sidebars === */ | ||
. | .sidebar-chunk { | ||
.mw- | background-color: var(--paper-raised); | ||
border: 1px solid var(--rule); | |||
border-radius: var(--radius-none); | |||
box-shadow: none; | |||
margin-bottom: var(--space-4); | |||
padding: var(--space-4); | |||
} | |||
.sidebar-chunk h2, | |||
.sidebar-chunk h3, | |||
.mw-portlet h3 { | |||
/* Group names (Navigation / Hubs / Setting Zone / Page tools…): Source Serif / Noto Serif SC */ | |||
font-family: var(--font-serif) !important; | |||
font-size: 15px !important; | |||
font-weight: 600 !important; | |||
letter-spacing: 0.1em; | |||
text-transform: none; | |||
color: var(--ink) !important; | |||
border: none !important; | |||
border-bottom: 2px solid var(--heading-bar) !important; | |||
padding-bottom: 6px; | |||
margin-bottom: var(--space-3); | |||
} | |||
.sidebar-chunk li a, | |||
.sidebar-chunk li a span, | |||
.mw-portlet-body li a, | |||
.mw-portlet-body li a span { | |||
/* Nav links: Zhuque Fangsong, matching the body text */ | |||
color: var(--ink) !important; | |||
font-family: var(--font-body) !important; | |||
font-size: 15.5px; | |||
letter-spacing: 0.04em; | |||
} | |||
.sidebar-chunk li a:hover, | |||
.mw-portlet-body li a:hover { | |||
color: var(--accent) !important; | |||
text-decoration: none; | |||
} | |||
.mw- | /* === 7. Content card === */ | ||
border- | #mw-content-wrapper { | ||
background: transparent; | |||
padding-top: 0; | |||
box-shadow: none; | |||
} | |||
#mw-content { | |||
background-color: var(--paper-raised); | |||
/* dot pattern: 1px dots on a 20px grid */ | |||
background-image: radial-gradient(var(--dot) 0px, transparent 1px); | |||
background-size: 20px 20px; | |||
border: 1px solid var(--rule); | |||
border-radius: var(--radius-none); | |||
box-shadow: none; | |||
padding: var(--space-6) var(--space-8); | |||
} | } | ||
.mw- | /* Page tabs (Read / Edit / History / Discussion): the selected tab uses Huijia Green instead of pink */ | ||
#mw-content-block .mw-portlet li a, | |||
#mw-content-block .mw-portlet li a .mw-ui-icon::before { | |||
color: var(--ink-muted) !important; | |||
} | |||
/* Page tab labels (Template / Discussion / Read / Edit / History): Zhuque Fangsong */ | |||
#mw-content-block .mw-portlet li a, | |||
#mw-content-block .mw-portlet li a span { | |||
font-family: var(--font-body) !important; | |||
font-size: 15.5px; | |||
letter-spacing: 0.06em; | |||
} | |||
#mw-content-block .mw-portlet li.selected a, | |||
#mw-content-block .mw-portlet li.selected a .mw-ui-icon::before { | |||
color: var(--accent) !important; | |||
} | |||
#mw-content-block .mw-portlet li.selected a { | |||
box-shadow: none !important; | |||
} | } | ||
#mw-content-block .mw-portlet li a:hover { color: var(--ink) !important; } | |||
/* Language variant button: remove the underline the skin puts under the label; remove the skin's pink shadow from the dropdown */ | |||
#p-variants-desktop h3, | |||
#p-variants-desktop-label { border-bottom: none !important; box-shadow: none !important; } | |||
#p-variants-desktop .dropdown { box-shadow: none !important; } | |||
. | /* Tabber (e.g. the Main Page "Site info / Create a page" tabs) */ | ||
. | .tabber__tab { color: var(--ink-muted) !important; font-family: var(--font-body) !important; font-size: 15.5px; letter-spacing: 0.06em; } | ||
. | .tabber__tab[aria-selected="true"] { color: var(--accent) !important; } | ||
. | .tabber__indicator { background: var(--accent) !important; } | ||
.tabber .tabbernav li a { color: var(--ink-muted) !important; font-family: var(--font-body) !important; letter-spacing: 0.06em; } | |||
.tabber .tabbernav li.tabberactive a { | |||
color: var(--accent) !important; | |||
border-bottom-color: var(--accent) !important; | |||
} | |||
/* === 8. Headings === | |||
Text in ink green (--heading). The page title has no rule. h1/h2: a full-width 1px green-grey rule; h2 gets the Archive Zone mark ■. | |||
h3-h6: a rule of the same color and weight (1px) fading out to the right, shorter and fainter at each level (same approach as Theme-VGR, in Archive Zone green-grey). */ | |||
h1.firstHeading { | h1.firstHeading { | ||
font-family: var(--font- | font-family: var(--font-serif); | ||
color: var(-- | font-size: 30px; | ||
font-weight: 600; | |||
border-bottom: | line-height: 1.3; | ||
padding-bottom: | color: var(--heading) !important; | ||
margin-bottom: | letter-spacing: 0.02em; | ||
border-bottom: none !important; | |||
padding-bottom: 10px; | |||
margin-bottom: var(--space-6); | |||
text-wrap: balance; | |||
} | } | ||
h1. | .mw-parser-output h1, | ||
.mw-parser-output h2, | |||
.mw-parser-output h3, | |||
.mw-parser-output h4, | |||
.mw-parser-output h5, | |||
.mw-parser-output h6 { | |||
font-family: var(--font-serif) !important; | |||
font-weight: 600; | |||
color: var(--heading) !important; | |||
letter-spacing: 0.02em; | |||
text-wrap: balance; | |||
padding-bottom: var(--space-2); | |||
overflow: hidden; | |||
border: none !important; | |||
} | |||
/* h1/h2: full-width 1px rule, same color and weight as the h3-h6 fading rules */ | |||
.mw-parser-output h1, | |||
.mw-parser-output h2 { | |||
background: linear-gradient(var(--heading-line) 0 0) left bottom / 100% 1px no-repeat; | |||
} | |||
.mw-parser-output h1 { | |||
font-size: 26px; | |||
line-height: 1.3; | |||
margin: var(--space-8) 0 var(--space-3); | |||
} | |||
.mw-parser-output h2 { | |||
font-size: 23px; | |||
line-height: 1.35; | |||
margin: var(--space-8) 0 var(--space-3); | |||
} | |||
/* Archive Zone mark: a small solid square (drawn in CSS, font-independent, matching the sidebar ■) */ | |||
.mw-parser-output h2::before { | |||
content: ""; | |||
display: inline-block; | |||
width: 8px; | |||
height: 8px; | |||
margin-right: 12px; | margin-right: 12px; | ||
vertical-align: 0.2em; | |||
background: var(--accent); | |||
} | } | ||
.toc h2::before, #toc h2::before, .mw-parser-output .toctitle h2::before { content: none; display: none; } | |||
.toc h2, #toc h2, .mw-parser-output .toctitle h2 { background: none; } | |||
.mw-parser-output h3 { | |||
color: var(--mw- | font-size: 19px; | ||
line-height: 1.45; | |||
margin: var(--space-6) 0 var(--space-2); | |||
margin- | } | ||
.mw-parser-output h4 { | |||
font-size: 17px; | |||
line-height: 1.5; | |||
color: var(--ink) !important; | |||
margin: var(--space-4) 0 var(--space-2); | |||
} | |||
.mw-parser-output h5 { | |||
font-size: 15px; | |||
line-height: 1.5; | |||
color: var(--ink) !important; | |||
margin: var(--space-4) 0 var(--space-1); | |||
} | |||
.mw-parser-output h6 { | |||
font-family: var(--font-sans) !important; | |||
font-size: 13px; | |||
font-weight: 500; | |||
letter-spacing: 0.08em; | |||
color: var(--ink-muted) !important; | |||
margin: var(--space-4) 0 var(--space-1); | |||
} | } | ||
/* --- 6. | /* h3-h6: fade out to the right */ | ||
.mw-parser-output h3, | |||
.mw-parser-output h4, | |||
.mw-parser-output h5, | |||
.mw-parser-output h6 { position: relative; } | |||
.mw-parser-output h3::after, | |||
.mw-parser-output h4::after, | |||
.mw-parser-output h5::after, | |||
.mw-parser-output h6::after { | |||
content: ""; | |||
display: block; | |||
position: absolute; | |||
left: 0; | |||
bottom: 0; | |||
background: linear-gradient(90deg, var(--heading-line), transparent); | |||
} | |||
.mw-parser-output h3::after { width: 85%; height: 1px; } | |||
.mw-parser-output h4::after { width: 65%; height: 1px; opacity: 0.8; } | |||
.mw-parser-output h5::after { width: 45%; height: 1px; opacity: 0.7; } | |||
.mw-parser-output h6::after { width: 25%; height: 1px; opacity: 0.6; } | |||
#personal h2, | |||
#personal .header-avatar { overflow: visible; } | |||
/* === 9. Links === */ | |||
.mw-parser-output a, | |||
#catlinks a { color: var(--link); text-decoration: none; } | |||
.mw-parser-output a:visited { color: var(--link); } | |||
.mw-parser-output a:hover { text-decoration: underline; text-underline-offset: 3px; } | |||
.mw-parser-output a.new, | |||
.mw-parser-output a.new:visited { color: var(--link-new); } | |||
/* === 10. Code === */ | |||
code { | code { | ||
background-color: | background-color: var(--paper-sunk); | ||
color: | color: var(--ink); | ||
padding: | padding: 2px 6px; | ||
border-radius: | border-radius: var(--radius-xs); | ||
font-family: var(--font- | font-family: var(--font-mono); | ||
font-size: | font-size: 13px; | ||
} | } | ||
pre { | pre { | ||
background-color: | position: relative; | ||
border: 1px solid var(-- | background-color: var(--paper-sunk) !important; | ||
border- | color: var(--ink); | ||
padding | border: 1px solid var(--rule) !important; | ||
border-radius: var(--radius-none); | |||
font-family: var(--font- | padding: var(--space-4) !important; | ||
font-family: var(--font-mono) !important; | |||
font-size: 13px; | |||
line-height: 1.6; | line-height: 1.6; | ||
overflow-x: auto; | overflow-x: auto; | ||
} | } | ||
/* | /* === 11. Tables (override Common.css's solid deep-green header row and zebra striping) === */ | ||
. | .mw-parser-output table.wikitable { | ||
background-color: var(-- | width: auto; | ||
border-radius: var(--mw- | background: var(--paper-raised); | ||
color: var(--ink); | |||
border: none; | |||
padding: | border-top: 2px solid var(--accent); | ||
border-bottom: 1px solid var(--rule-strong); | |||
border-collapse: collapse; | |||
border-radius: var(--radius-none); | |||
box-shadow: none; | |||
overflow: visible; | |||
font-family: var(--font-sans); | |||
font-size: 14px; | |||
} | |||
.mw-parser-output table.wikitable > * > tr > th, | |||
.mw-parser-output table.wikitable > tr > th { | |||
background: transparent; | |||
color: var(--accent); | |||
font-family: var(--font-sans); | |||
font-size: 12px; | |||
font-weight: 700; | |||
letter-spacing: 0.08em; | |||
text-align: left; | |||
padding: 10px 12px; | |||
border: none; | |||
border-bottom: 1px solid var(--rule-strong); | |||
} | } | ||
.mw-parser-output table.wikitable > * > tr > td, | |||
. | .mw-parser-output table.wikitable > tr > td { | ||
color: var(--ink); | |||
padding: 9px 12px; | |||
border: none; | border: none; | ||
border-bottom: 1px solid var(--rule); | |||
vertical-align: top; | |||
} | } | ||
.mw-parser-output table.wikitable > tbody > tr:nth-of-type(even) { background: transparent; } | |||
.mw-parser-output table.wikitable > tbody > tr:last-of-type > td { border-bottom: none; } | |||
.mw-parser-output table.wikitable > tbody > tr:hover td { background: var(--accent-tint); color: var(--ink); } | |||
/* --- | /* === 12. Category bar and footer === */ | ||
#catlinks { | |||
background-color: var(--paper-sunk); | |||
border: 1px solid var(--rule); | |||
border: 1px solid var(-- | border-radius: var(--radius-none); | ||
padding: var(--space-3) var(--space-4); | |||
font-size: 13px; | |||
color: var(--ink-muted); | |||
} | |||
.mw-footer { | |||
background-color: var(--paper-sunk); | |||
color: var(--ink-muted); | |||
border-top: 1px solid var(--rule); | |||
border-radius: var(--radius-none); | |||
margin-top: var(--space-12); | |||
padding: var(--space-6) var(--space-8); | |||
font-size: 13px; | |||
} | } | ||
.mw-footer a { color: var(--ink-muted); } | |||
.mw-footer-container { background: transparent; } | |||
/* === 13. Pink from Common.css (temporary override; better to fix Common.css itself later) === */ | |||
textarea:hover, | |||
textarea:focus-visible { border-color: var(--accent) !important; box-shadow: none !important; } | |||
.navbox th, .navbox-title { background: var(--accent-tint) !important; color: var(--ink); } | |||
.navbox-abovebelow, th.navbox-group, .navbox-subgroup .navbox-title { background: var(--paper-sunk) !important; } | |||
.navbox-subgroup .navbox-group, .navbox-subgroup .navbox-abovebelow { background: var(--paper) !important; } | |||
.navbox-even { background: var(--paper) !important; } | |||
.repost-circle, .repost-circle a.external { color: var(--accent) !important; border-color: var(--accent) !important; } | |||
/* === 14. Mobile (≤850px) === */ | |||
@media screen and (max-width: 850px) { | |||
#mw-content { padding: var(--space-4); } | |||
/* Restore Timeless mobile nav (in case global rules interfere) */ | |||
#mw-mf-page-left, .dropdown, .dropdown-active, | |||
#mw-related-navigation, | |||
#site-tools, #personal { | |||
height: auto !important; | |||
max-height: none !important; | |||
overflow: visible !important; | |||
} | |||
/* Cap the logo size so it can't blow up when the sidebar renders incorrectly */ | |||
#p-logo img { | |||
max-width: 180px !important; | |||
width: auto !important; | |||
height: auto !important; | |||
} | |||
.dropdown .mw-portlet-body, | |||
.dropdown.dropdown-active .mw-portlet-body { | |||
display: block !important; | |||
height: auto !important; | |||
padding: | max-height: 70vh !important; | ||
} | overflow-y: auto !important; | ||
background-color: var(--paper-raised) !important; | |||
border: 1px solid var(--rule) !important; | |||
border-radius: var(--radius-none) !important; | |||
box-shadow: none !important; | |||
z-index: 9999 !important; | |||
position: relative !important; | |||
} | |||
.dropdown-toggle, #ca-more, .mw-ui-icon { | |||
position: relative !important; | |||
z-index: 9999 !important; | |||
} | |||
/* Hide the empty sidebar/portlet shells */ | |||
.sidebar-chunk:empty, | |||
.mw-portlet:empty, | |||
.mw-portlet:not(:has(li)):not(:has(a)) { | |||
display: none !important; | |||
border: none !important; | |||
padding: 0 !important; | |||
margin: 0 !important; | |||
background: none !important; | |||
} | |||
#mw-content-block .sidebar-chunk { | |||
border: none !important; | |||
box-shadow: none !important; | |||
background: transparent !important; | |||
padding: 0 !important; | |||
} | |||
#mw-content-block { background: transparent !important; } | |||
table.wikitable | .mw-parser-output table.wikitable { | ||
display: block; | |||
overflow-x: auto; | |||
white-space: normal; | |||
} | |||
} | } | ||
/* === 15. Reading progress bar and copy button === */ | |||
#reading-progress-container { | |||
position: fixed; | |||
left: 0; | |||
bottom: 0; | |||
width: 100%; | |||
height: 3px; | |||
background: var(--rule); | |||
z-index: 9999; | |||
pointer-events: none; | |||
} | } | ||
#reading-progress-bar { | |||
height: 100%; | |||
width: 0; | |||
background: var(--accent-fill); | |||
} | } | ||
.code-copy-btn { | |||
position: absolute; | |||
top: 8px; | |||
right: 8px; | |||
font-family: var(--font-sans); | |||
border-radius: var(-- | font-size: 12px; | ||
font-weight: 500; | |||
letter-spacing: 0.04em; | |||
padding: 4px 10px; | |||
color: var(--on-accent); | |||
background: var(--accent-fill); | |||
border: none; | |||
border-radius: var(--radius-sm); | |||
cursor: pointer; | |||
opacity: 0; | |||
transition: opacity 0.2s ease; | |||
} | } | ||
pre:hover .code-copy-btn, | |||
.code-copy-btn:focus-visible { opacity: 1; } | |||
@media (prefers-reduced-motion: reduce) { | |||
* { transition: none !important; animation: none !important; } | |||
} | } | ||
</style> | </style> | ||
<script> | <script> | ||
/** | /** | ||
* HUIJIA FUN - UI ENHANCEMENTS ( | * HUIJIA FUN - UI ENHANCEMENTS (v5.0) | ||
* | * Kept: bottom reading progress bar, code copy button | ||
* | * Removed: scroll fade-ins (headings started transparent and vanished if the script failed) | ||
*/ | */ | ||
(function () { | |||
(function() { | |||
"use strict"; | "use strict"; | ||
if (window.__hjThemeLoaded) return; /* don't run twice when a page includes the template twice */ | |||
window.__hjThemeLoaded = true; | |||
var LABEL = { copy: "Copy", done: "Copied", fail: "Copy failed" }; | |||
function initProgressBar() { | |||
if (document.getElementById("reading-progress-container")) return; | |||
var container = document.createElement("div"); | |||
container.id = "reading-progress-container"; | |||
var bar = document.createElement("div"); | |||
bar.id = "reading-progress-bar"; | |||
container.id = | |||
bar.id = | |||
container.appendChild(bar); | container.appendChild(bar); | ||
document.body.appendChild(container); | document.body.appendChild(container); | ||
var ticking = false; | |||
function update() { | |||
var top = window.pageYOffset || document.documentElement.scrollTop; | |||
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight; | |||
bar.style.width = (height > 0 ? (top / height) * 100 : 0) + "%"; | |||
}); | ticking = false; | ||
} | } | ||
window.addEventListener("scroll", function () { | |||
if (!ticking) { ticking = true; window.requestAnimationFrame(update); } | |||
}, { passive: true }); | |||
update(); | |||
} | |||
function initCopyButtons() { | |||
document.querySelectorAll("#mw-content pre").forEach(function (block) { | |||
if (block.querySelector(".code-copy-btn")) return; | |||
if (block.querySelector( | var btn = document.createElement("button"); | ||
btn.type = "button"; | |||
btn.className = | btn.className = "code-copy-btn"; | ||
btn. | btn.textContent = LABEL.copy; | ||
btn.addEventListener("click", function () { | |||
btn.addEventListener( | var clone = block.cloneNode(true); | ||
var own = clone.querySelector(".code-copy-btn"); | |||
if (own) own.remove(); | |||
btn. | var text = clone.textContent.trim(); | ||
setTimeout(() | var done = function (label) { | ||
}); | btn.textContent = label; | ||
setTimeout(function () { btn.textContent = LABEL.copy; }, 2000); | |||
}; | |||
if (navigator.clipboard && navigator.clipboard.writeText) { | |||
navigator.clipboard.writeText(text).then( | |||
function () { done(LABEL.done); }, | |||
function () { done(LABEL.fail); } | |||
); | |||
} else { | |||
done(LABEL.fail); | |||
} | |||
}); | }); | ||
block.appendChild(btn); | block.appendChild(btn); | ||
}); | }); | ||
} | } | ||
function init() { | |||
initProgressBar(); | initProgressBar(); | ||
initCopyButtons(); | initCopyButtons(); | ||
} | |||
}); | |||
if (document.readyState === "loading") { | |||
document.addEventListener("DOMContentLoaded", init); | |||
} else { | |||
init(); | |||
} | |||
})(); | })(); | ||
</script> | </script> | ||
| Line 397: | Line 690: | ||
</includeonly><noinclude>{{Theme-HJ}} | </includeonly><noinclude>{{Theme-HJ}} | ||
==Description== | ==Description== | ||
'''Theme-HJ''' is the theme for HUIJIA FUN's Archive Zone and the site-wide default pages, built strictly on the VGR Design System. Its features: a cool, green-tinted grey paper ground, a "Huijia Green" accent, square corners and no shadows; the content card carries a dot pattern, and headings are set in ink green on thin green-grey rules: full width under level-1 and level-2 headings (level 2 also carries the Archive Zone mark ■), fading out to the right and getting shorter at each level below. | |||
Author: [[User:PlurimodSU| | |||
==Origin== | |||
Author: [[User:PlurimodSU|Marina Malinti]] | |||
===Note=== | ===Note=== | ||
To use this theme on a page, simply add the following code directly to the page's source code: | To use this theme on a page, simply add the following code directly to the page's source code: | ||
<pre>{{Theme-HJ}}</pre> | <pre>{{Theme-HJ}}</pre> | ||
==Test== | |||
A body paragraph with an [[Main Page|internal link]], a [[Nonexistent Page|red link]] and some <code>inline code</code>. ''English italic stays italic; 中文不会被压斜。'' | |||
===Subheading 3=== | |||
====Subheading 4==== | |||
=====Subheading 5===== | |||
======Subheading 6====== | |||
{| class="wikitable" | |||
! Event !! S.C. !! O. | |||
|- | |||
| Sample event A || 1999 || 0 | |||
|- | |||
| Sample event B || 2021 || 22 | |||
|} | |||
<pre>{{Theme-HJ}}</pre> | |||
==Test 2== | |||
===Subheading 3=== | |||
====Subheading 4==== | |||
=====Subheading 5===== | |||
======Subheading 6====== | |||
[[Category:Template-Theme]] | [[Category:Template-Theme]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 10:35, 13 October 2026
Description
Theme-HJ is the theme for HUIJIA FUN's Archive Zone and the site-wide default pages, built strictly on the VGR Design System. Its features: a cool, green-tinted grey paper ground, a "Huijia Green" accent, square corners and no shadows; the content card carries a dot pattern, and headings are set in ink green on thin green-grey rules: full width under level-1 and level-2 headings (level 2 also carries the Archive Zone mark ■), fading out to the right and getting shorter at each level below.
Origin
Author: Marina Malinti
Note
To use this theme on a page, simply add the following code directly to the page's source code:
{{Theme-HJ}}
Test
A body paragraph with an internal link, a red link and some inline code. English italic stays italic; 中文不会被压斜。
Subheading 3
Subheading 4
Subheading 5
Subheading 6
| Event | S.C. | O. |
|---|---|---|
| Sample event A | 1999 | 0 |
| Sample event B | 2021 | 22 |
{{Theme-HJ}}
