MediaWiki:Vector.css:修订间差异
AsahinaShikure(讨论 | 贡献) (创建页面,内容为“→此处所有CSS将为使用Vector皮肤的用户加载: ```css /* ========================================================= Griffin Wiki MediaWiki:Vector.css Vector 2022 Complete Visual Enhancement ========================================================= 基础: - Vector 2022 - 白色主题 - 现代化视觉增强 - 轻量动画 - Sidebar / Main Menu 动画 - 首页专属视觉 ======================================…”) |
AsahinaShikure(讨论 | 贡献) 无编辑摘要 |
||
| 第1行: | 第1行: | ||
```css | ```css | ||
/* ========================================================= | /* ========================================================= | ||
Griffin Wiki | Griffin Wiki | ||
MediaWiki:Vector.css | MediaWiki:Vector.css | ||
Vector 2022 Complete Visual Enhancement | Vector 2022 Complete Visual Enhancement | ||
--------------------------------------------------------- | |||
White UI / Animation / Sidebar / Header / Main Page | |||
========================================================= */ | ========================================================= */ | ||
| 第39行: | 第31行: | ||
background: #ffffff !important; | background: #ffffff !important; | ||
border-bottom: 1px solid #eaecf0; | border-bottom: 1px solid #eaecf0; | ||
transition: | transition: | ||
background-color 0.25s ease, | background-color 0.25s ease, | ||
border-color 0.25s ease, | |||
box-shadow 0.25s ease; | |||
} | } | ||
.vector-header-container:hover { | .vector-header-container:hover { | ||
box-shadow: 0 4px 18px rgba(0, 0, 0, 0. | box-shadow: | ||
0 4px 18px rgba(0, 0, 0, 0.055); | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
03. PAGE | 03. PAGE ENTER ANIMATION | ||
--------------------------------------------------------- | |||
只淡入,不使用 translateY, | |||
防止页面进入时出现“向下移动”的感觉。 | |||
========================================================= */ | ========================================================= */ | ||
.mw-page-container { | .mw-page-container, | ||
animation: griffinPageFade 0. | .mw-content-container { | ||
animation: | |||
griffinPageFade 0.3s ease-out; | |||
} | } | ||
| 第61行: | 第60行: | ||
from { | from { | ||
opacity: 0; | opacity: 0; | ||
} | } | ||
to { | to { | ||
opacity: 1; | opacity: 1; | ||
} | } | ||
} | } | ||
/* | /* 防止动画导致页面整体位移 */ | ||
.mw-page-container, | |||
.mw-content-container, | |||
.vector-body { | |||
transform: none; | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
04. GLOBAL TRANSITIONS | |||
========================================================= */ | ========================================================= */ | ||
| 第107行: | 第90行: | ||
.vector-pinnable-element, | .vector-pinnable-element, | ||
.infobox, | .infobox, | ||
.thumbinner | .thumbinner { | ||
transition: | transition: | ||
color 0.2s ease, | color 0.2s ease, | ||
| 第120行: | 第102行: | ||
/* ========================================================= | /* ========================================================= | ||
05. LINKS | |||
========================================================= */ | ========================================================= */ | ||
| 第134行: | 第116行: | ||
color: #2956b8; | color: #2956b8; | ||
} | } | ||
.mw-parser-output a:hover { | .mw-parser-output a:hover { | ||
| 第144行: | 第123行: | ||
/* ========================================================= | /* ========================================================= | ||
06. BUTTONS | |||
========================================================= */ | ========================================================= */ | ||
| 第151行: | 第130行: | ||
input[type="button"]:hover, | input[type="button"]:hover, | ||
.mw-ui-button:hover { | .mw-ui-button:hover { | ||
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08); | box-shadow: | ||
0 3px 10px rgba(0, 0, 0, 0.08); | |||
} | } | ||
| 第163行: | 第143行: | ||
/* ========================================================= | /* ========================================================= | ||
07. LEFT SIDEBAR | |||
========================================================= */ | ========================================================= */ | ||
| 第182行: | 第162行: | ||
transform 0.2s ease; | transform 0.2s ease; | ||
} | } | ||
.vector-sidebar .vector-pinnable-element:hover { | .vector-sidebar .vector-pinnable-element:hover { | ||
background: rgba(51, 102, 255, 0.025); | background: | ||
rgba(51, 102, 255, 0.025); | |||
} | } | ||
| 第195行: | 第173行: | ||
.vector-sidebar .vector-menu-heading { | .vector-sidebar .vector-menu-heading { | ||
cursor: pointer; | cursor: pointer; | ||
border-radius: 6px; | border-radius: 6px; | ||
| 第204行: | 第183行: | ||
.vector-sidebar .vector-menu-heading:hover { | .vector-sidebar .vector-menu-heading:hover { | ||
background: rgba(51, 102, 255, 0.06); | background: | ||
rgba(51, 102, 255, 0.06); | |||
} | } | ||
| 第216行: | 第196行: | ||
/* ========================================================= | /* ========================================================= | ||
08. SIDEBAR EXPAND / COLLAPSE | |||
========================================================= */ | ========================================================= */ | ||
/* | /* | ||
Vector 2022 | 不使用 display:none / visibility:hidden, | ||
避免破坏 Vector 2022 原本的菜单控制逻辑。 | |||
*/ | */ | ||
| 第236行: | 第216行: | ||
/* | /* 展开状态 */ | ||
.vector-sidebar | .vector-sidebar | ||
| 第246行: | 第226行: | ||
/* 菜单项目 */ | /* Sidebar 菜单项目 */ | ||
.vector-sidebar | .vector-sidebar | ||
| 第257行: | 第237行: | ||
/* | /* 展开后的轻微滑入 */ | ||
.vector-sidebar | .vector-sidebar | ||
| 第267行: | 第247行: | ||
/* | /* Stagger */ | ||
.vector-sidebar | .vector-sidebar | ||
| 第307行: | 第287行: | ||
/* ========================================================= | /* ========================================================= | ||
09. LOGO LEFT MAIN MENU | |||
========================================================= */ | ========================================================= */ | ||
/* | /* | ||
Logo 左侧的主菜单按钮。 | |||
不改变 MediaWiki 原本的显示机制。 | |||
*/ | */ | ||
.vector-header-start button, | |||
.vector-header-start .mw-ui-icon { | |||
transition: | |||
transform 0.15s ease, | |||
background-color 0.2s ease, | |||
box-shadow 0.2s ease; | |||
} | |||
.vector-header-start button:hover { | |||
transform: scale(1.04); | |||
} | |||
.vector-header-start button:active { | |||
transform: scale(0.92); | |||
} | |||
/* 主菜单 */ | |||
.vector-main-menu, | .vector-main-menu, | ||
| 第321行: | 第320行: | ||
transition: | transition: | ||
opacity 0. | opacity 0.22s ease, | ||
transform 0. | transform 0.22s ease, | ||
box-shadow 0. | box-shadow 0.22s ease; | ||
} | } | ||
/* | /* 已知的打开状态 */ | ||
.vector-main-menu--open, | .vector-main-menu--open, | ||
.vector-main-menu.vector-menu-open, | .vector-main-menu.vector-menu-open, | ||
#vector-main-menu-dropdown.vector-menu | #vector-main-menu-dropdown.vector-menu-open { | ||
opacity: 1; | opacity: 1; | ||
transform: translateY(0) scale(1); | transform: | ||
translateY(0) | |||
scale(1); | |||
box-shadow: | |||
0 8px 24px rgba(0, 0, 0, 0.10); | |||
} | } | ||
| 第343行: | 第346行: | ||
#vector-main-menu a { | #vector-main-menu a { | ||
transition: | transition: | ||
color 0. | color 0.18s ease, | ||
background-color 0. | background-color 0.18s ease, | ||
transform 0. | transform 0.18s ease; | ||
} | } | ||
.vector-main-menu a:hover, | .vector-main-menu a:hover, | ||
| 第359行: | 第358行: | ||
/* ========================================================= | /* ========================================================= | ||
11. | 10. RIGHT HEADER CONTROLS | ||
========================================================= */ | |||
/* | |||
Vector 2022 右侧通常包括: | |||
- 搜索 | |||
- 用户菜单 | |||
- 外观 | |||
- 工具 | |||
- 更多 | |||
这里只做视觉反馈,不接管菜单的 display 状态。 | |||
*/ | |||
.vector-header-end button, | |||
.vector-header-end .vector-dropdown-label { | |||
transition: | |||
transform 0.12s ease, | |||
background-color 0.18s ease, | |||
box-shadow 0.18s ease, | |||
color 0.18s ease; | |||
} | |||
/* Hover */ | |||
.vector-header-end button:hover, | |||
.vector-header-end .vector-dropdown-label:hover { | |||
background: | |||
rgba(51, 102, 255, 0.055); | |||
border-radius: 6px; | |||
} | |||
/* 点击 */ | |||
.vector-header-end button:active, | |||
.vector-header-end .vector-dropdown-label:active { | |||
transform: scale(0.94); | |||
} | |||
/* ========================================================= | |||
11. RIGHT DROPDOWN MENUS | |||
========================================================= */ | ========================================================= */ | ||
/* | |||
.vector- | 重点: | ||
不使用 opacity:0 或 pointer-events:none | |||
去强制隐藏菜单。 | |||
MediaWiki 自己负责打开 / 关闭。 | |||
CSS 只负责打开后的视觉动画。 | |||
*/ | |||
.vector-dropdown-content { | |||
transform-origin: top right; | |||
transition: | transition: | ||
transform 0. | transform 0.18s ease, | ||
opacity 0.18s ease, | |||
box-shadow 0.2s ease; | box-shadow 0.2s ease; | ||
} | } | ||
.vector- | |||
transform: scale(1. | /* Vector Dropdown 打开 */ | ||
.vector-dropdown.vector-dropdown--open | |||
.vector-dropdown-content { | |||
transform: | |||
translateY(0) | |||
scale(1); | |||
box-shadow: | |||
0 8px 24px rgba(0, 0, 0, 0.12); | |||
} | |||
/* Dropdown 内容 */ | |||
.vector-dropdown-content .mw-list-item a { | |||
transition: | |||
background-color 0.16s ease, | |||
color 0.16s ease, | |||
padding-left 0.16s ease; | |||
} | |||
/* Dropdown Hover */ | |||
.vector-dropdown-content .mw-list-item a:hover { | |||
background: | |||
rgba(51, 102, 255, 0.06); | |||
padding-left: 4px; | |||
} | } | ||
.vector- | |||
transform | /* ========================================================= | ||
12. VECTOR POPUPS | |||
========================================================= */ | |||
.vector-popup { | |||
transition: | |||
opacity 0.18s ease, | |||
transform 0.18s ease, | |||
box-shadow 0.2s ease; | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
13. MAIN HEADING | |||
========================================================= */ | ========================================================= */ | ||
| 第395行: | 第486行: | ||
from { | from { | ||
opacity: 0; | opacity: 0; | ||
} | } | ||
to { | to { | ||
opacity: 1; | opacity: 1; | ||
} | } | ||
} | } | ||
/* | /* 标题底部渐变线 */ | ||
.mw-first-heading::after { | .mw-first-heading::after { | ||
| 第419行: | 第508行: | ||
border-radius: 3px; | border-radius: 3px; | ||
background: linear-gradient( | background: | ||
linear-gradient( | |||
90deg, | |||
#3366ff, | |||
#6f7cff, | |||
#ff4fa3 | |||
); | |||
transform-origin: left; | transform-origin: left; | ||
animation: griffinTitleLine 0. | animation: | ||
griffinTitleLine 0.55s ease-out; | |||
} | } | ||
| 第445行: | 第536行: | ||
/* ========================================================= | /* ========================================================= | ||
14. SECTION HEADINGS | |||
========================================================= */ | ========================================================= */ | ||
| 第458行: | 第549行: | ||
from { | from { | ||
opacity: 0; | opacity: 0; | ||
} | } | ||
to { | to { | ||
opacity: 1; | opacity: 1; | ||
} | } | ||
} | } | ||
| 第491行: | 第580行: | ||
transform-origin: center; | transform-origin: center; | ||
animation: griffinHeadingBar 0.4s ease-out forwards; | animation: | ||
griffinHeadingBar 0.4s ease-out forwards; | |||
} | } | ||
| 第504行: | 第594行: | ||
/* ========================================================= | /* ========================================================= | ||
15. INFOBOX | |||
========================================================= */ | ========================================================= */ | ||
| 第523行: | 第613行: | ||
/* | /* Hover */ | ||
.infobox:hover { | .infobox:hover { | ||
transform: translateY(-2px); | transform: translateY(-2px); | ||
border-color: #b8c2d9; | border-color: | ||
#b8c2d9; | |||
box-shadow: | box-shadow: | ||
| 第535行: | 第626行: | ||
/* | /* 顶部扫描线 */ | ||
.infobox::before { | .infobox::before { | ||
| 第548行: | 第639行: | ||
height: 2px; | height: 2px; | ||
background: linear-gradient( | background: | ||
linear-gradient( | |||
90deg, | |||
transparent, | |||
rgba(51, 102, 255, 0.25), | |||
rgba(255, 79, 163, 0.25), | |||
transparent | |||
); | |||
animation: | animation: | ||
| 第572行: | 第664行: | ||
/* ========================================================= | /* ========================================================= | ||
16. IMAGES | |||
========================================================= */ | ========================================================= */ | ||
| 第597行: | 第689行: | ||
/* ========================================================= | /* ========================================================= | ||
17. LIST INTERACTION | |||
========================================================= */ | ========================================================= */ | ||
| 第606行: | 第698行: | ||
.mw-parser-output li:hover { | .mw-parser-output li:hover { | ||
transform: translateX(2px); | transform: | ||
translateX(2px); | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
18. INPUT / SEARCH | |||
========================================================= */ | ========================================================= */ | ||
| 第626行: | 第719行: | ||
textarea:focus, | textarea:focus, | ||
select:focus { | select:focus { | ||
border-color: #3366cc; | border-color: | ||
#3366cc; | |||
box-shadow: | box-shadow: | ||
| 第636行: | 第730行: | ||
/* ========================================================= | /* ========================================================= | ||
19. MAIN PAGE | |||
========================================================= */ | ========================================================= */ | ||
/* | /* | ||
以下仅作用于: | |||
Main Page | |||
配合主页中的: | |||
<div class="mainpage-banner"> | <div class="mainpage-banner"> | ||
... | ... | ||
| 第669行: | 第751行: | ||
/* ========================================================= | /* ========================================================= | ||
20. MAIN PAGE BANNER | 20. MAIN PAGE HERO BANNER | ||
========================================================= */ | ========================================================= */ | ||
| 第683行: | 第765行: | ||
70px 30px; | 70px 30px; | ||
min-height: 220px; | min-height: | ||
220px; | |||
display: flex; | display: | ||
flex; | |||
flex-direction: column; | flex-direction: | ||
column; | |||
justify-content: center; | justify-content: | ||
center; | |||
align-items: center; | align-items: | ||
center; | |||
text-align: center; | text-align: | ||
center; | |||
color: #ffffff !important; | color: | ||
#ffffff !important; | |||
border-radius: 12px; | border-radius: | ||
12px; | |||
background: | background: | ||
| 第708行: | 第798行: | ||
/* ========================================================= | /* ========================================================= | ||
21. MAIN PAGE | 21. MAIN PAGE HERO IMAGE | ||
========================================================= */ | ========================================================= */ | ||
/* | /* | ||
======================================================== | |||
请修改这里 | |||
======================================================== | |||
将下面: | |||
https://example.com/your-banner.jpg | https://example.com/your-banner.jpg | ||
换成你的 Wiki 横幅图片 URL。 | |||
*/ | */ | ||
| 第731行: | 第825行: | ||
url("https://example.com/your-banner.jpg"); | url("https://example.com/your-banner.jpg"); | ||
background-size: cover; | background-size: | ||
cover; | |||
background-position: center; | background-position: | ||
center; | |||
background-repeat: no-repeat; | background-repeat: | ||
no-repeat; | |||
filter: brightness(0.72); | filter: | ||
brightness(0.72); | |||
transform: scale(1.03); | transform: | ||
scale(1.03); | |||
transition: | transition: | ||
| 第746行: | 第845行: | ||
/* Banner Hover | /* Banner Hover */ | ||
body.page-Main_Page .mainpage-banner:hover::before { | body.page-Main_Page .mainpage-banner:hover::before { | ||
transform: scale(1.07); | transform: | ||
scale(1.07); | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
22. | 22. HERO DARK OVERLAY | ||
========================================================= */ | ========================================================= */ | ||
| 第773行: | 第873行: | ||
); | ); | ||
pointer-events: none; | pointer-events: | ||
none; | |||
} | } | ||
/* | /* Hero 内容位于图片上方 */ | ||
body.page-Main_Page .mainpage-banner > * { | body.page-Main_Page .mainpage-banner > * { | ||
position: relative; | position: | ||
relative; | |||
z-index: 2; | z-index: | ||
2; | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
23. | 23. HERO TITLE | ||
========================================================= */ | ========================================================= */ | ||
body.page-Main_Page .mainpage-banner h1 { | body.page-Main_Page .mainpage-banner h1 { | ||
margin: 0 0 12px; | margin: | ||
0 0 12px; | |||
font-size: 2.8em; | font-size: | ||
2.8em; | |||
font-weight: 700; | font-weight: | ||
700; | |||
letter-spacing: 1px; | letter-spacing: | ||
1px; | |||
color: #ffffff !important; | color: | ||
#ffffff !important; | |||
text-shadow: | text-shadow: | ||
| 第811行: | 第919行: | ||
from { | from { | ||
opacity: 0; | opacity: 0; | ||
} | } | ||
to { | to { | ||
opacity: 1; | opacity: 1; | ||
} | } | ||
} | } | ||
/* | /* Hero 副标题 */ | ||
body.page-Main_Page .mainpage-banner em, | body.page-Main_Page .mainpage-banner em, | ||
body.page-Main_Page .mainpage-banner p { | body.page-Main_Page .mainpage-banner p { | ||
color: rgba(255, 255, 255, 0.90) !important; | color: | ||
rgba(255, 255, 255, 0.90) !important; | |||
text-shadow: | text-shadow: | ||
| 第837行: | 第944行: | ||
body.page-Main_Page .mainpage-intro { | body.page-Main_Page .mainpage-intro { | ||
max-width: 900px; | max-width: | ||
900px; | |||
margin: | margin: | ||
| 第845行: | 第953行: | ||
20px 24px; | 20px 24px; | ||
background: #f8f9fa; | background: | ||
#f8f9fa; | |||
border: | border: | ||
| 第853行: | 第962行: | ||
10px; | 10px; | ||
line-height: 1.8; | line-height: | ||
1.8; | |||
box-shadow: | box-shadow: | ||
| 第865行: | 第975行: | ||
from { | from { | ||
opacity: 0; | opacity: 0; | ||
} | } | ||
to { | to { | ||
opacity: 1; | opacity: 1; | ||
} | } | ||
} | } | ||
| 第880行: | 第988行: | ||
body.page-Main_Page .mainpage-module { | body.page-Main_Page .mainpage-module { | ||
background: #ffffff; | background: | ||
#ffffff; | |||
border: | border: | ||
| 第907行: | 第1,016行: | ||
body.page-Main_Page .mainpage-module:hover { | body.page-Main_Page .mainpage-module:hover { | ||
transform: translateY(-3px); | transform: | ||
translateY(-3px); | |||
border-color: | border-color: | ||
| 第920行: | 第1,030行: | ||
body.page-Main_Page .mainpage-module h2 { | body.page-Main_Page .mainpage-module h2 { | ||
margin-top: 0; | margin-top: | ||
0; | |||
padding-bottom: | padding-bottom: | ||
| 第931行: | 第1,042行: | ||
/* ========================================================= | /* ========================================================= | ||
26. MAIN PAGE TWO | 26. MAIN PAGE TWO COLUMNS | ||
========================================================= */ | ========================================================= */ | ||
body.page-Main_Page .mainpage-columns { | body.page-Main_Page .mainpage-columns { | ||
display: flex; | display: | ||
flex; | |||
align-items: flex-start; | align-items: | ||
flex-start; | |||
gap: 18px; | gap: | ||
18px; | |||
} | } | ||
body.page-Main_Page .mainpage-left { | body.page-Main_Page .mainpage-left { | ||
flex: 2; | flex: | ||
min-width: 0; | 2; | ||
min-width: | |||
0; | |||
} | } | ||
body.page-Main_Page .mainpage-right { | body.page-Main_Page .mainpage-right { | ||
flex: 1; | flex: | ||
min-width: 0; | 1; | ||
min-width: | |||
0; | |||
} | } | ||
| 第972行: | 第1,092行: | ||
/* ========================================================= | /* ========================================================= | ||
28. MAIN PAGE RESPONSIVE | 28. MAIN PAGE LINKS | ||
========================================================= */ | |||
body.page-Main_Page a { | |||
color: | |||
#3366cc; | |||
} | |||
body.page-Main_Page a:hover { | |||
color: | |||
#2956b8; | |||
text-decoration: | |||
underline; | |||
} | |||
/* ========================================================= | |||
29. RESPONSIVE - TABLET | |||
========================================================= */ | ========================================================= */ | ||
| 第978行: | 第1,116行: | ||
body.page-Main_Page .mainpage-columns { | body.page-Main_Page .mainpage-columns { | ||
flex-direction: column; | flex-direction: | ||
column; | |||
} | } | ||
body.page-Main_Page .mainpage-left, | body.page-Main_Page .mainpage-left, | ||
body.page-Main_Page .mainpage-right { | body.page-Main_Page .mainpage-right { | ||
width: 100%; | width: | ||
100%; | |||
} | } | ||
body.page-Main_Page .mainpage-banner { | body.page-Main_Page .mainpage-banner { | ||
min-height: 180px; | min-height: | ||
180px; | |||
padding: | padding: | ||
| 第1,001行: | 第1,142行: | ||
/* ========================================================= | /* ========================================================= | ||
30. RESPONSIVE - MOBILE | |||
========================================================= */ | ========================================================= */ | ||
| 第1,007行: | 第1,148行: | ||
.mw-content-container { | .mw-content-container { | ||
padding-left: 12px; | padding-left: | ||
padding-right: 12px; | 12px; | ||
padding-right: | |||
12px; | |||
} | } | ||
| 第1,041行: | 第1,185行: | ||
/* ========================================================= | /* ========================================================= | ||
31. ACCESSIBILITY / REDUCED MOTION | |||
========================================================= */ | ========================================================= */ | ||
@media (prefers-reduced-motion: reduce) { | |||
html { | |||
scroll-behavior: | |||
auto; | |||
} | |||
*, | *, | ||
*::before, | *::before, | ||
*::after { | *::after { | ||
animation-duration: 0.001ms !important; | animation-duration: | ||
animation-iteration-count: 1 !important; | 0.001ms !important; | ||
transition-duration: 0.001ms | |||
animation-iteration-count: | |||
1 !important; | |||
transition-duration: | |||
0.001ms !important; | |||
} | } | ||
} | } | ||
2026年8月7日 (五) 05:41的版本
```css
/* =========================================================
Griffin Wiki
MediaWiki:Vector.css
Vector 2022 Complete Visual Enhancement
---------------------------------------------------------
White UI / Animation / Sidebar / Header / Main Page
========================================================= */
/* =========================================================
01. GLOBAL BASE
========================================================= */
html {
scroll-behavior: smooth;
}
body {
background: #ffffff !important;
color: #202122 !important;
}
/* =========================================================
02. VECTOR 2022 HEADER
========================================================= */
.vector-header-container {
background: #ffffff !important;
border-bottom: 1px solid #eaecf0;
transition:
background-color 0.25s ease,
border-color 0.25s ease,
box-shadow 0.25s ease;
}
.vector-header-container:hover {
box-shadow:
0 4px 18px rgba(0, 0, 0, 0.055);
}
/* =========================================================
03. PAGE ENTER ANIMATION
---------------------------------------------------------
只淡入,不使用 translateY,
防止页面进入时出现“向下移动”的感觉。
========================================================= */
.mw-page-container,
.mw-content-container {
animation:
griffinPageFade 0.3s ease-out;
}
@keyframes griffinPageFade {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* 防止动画导致页面整体位移 */
.mw-page-container,
.mw-content-container,
.vector-body {
transform: none;
}
/* =========================================================
04. GLOBAL TRANSITIONS
========================================================= */
a,
button,
input,
select,
textarea,
.mw-ui-button,
.vector-menu-heading,
.vector-pinnable-element,
.infobox,
.thumbinner {
transition:
color 0.2s ease,
background-color 0.2s ease,
border-color 0.2s ease,
box-shadow 0.25s ease,
transform 0.2s ease,
opacity 0.2s ease;
}
/* =========================================================
05. LINKS
========================================================= */
a {
color: #3366cc;
}
a:visited {
color: #6b5cff;
}
a:hover {
color: #2956b8;
}
.mw-parser-output a:hover {
text-decoration: underline;
}
/* =========================================================
06. BUTTONS
========================================================= */
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.mw-ui-button:hover {
box-shadow:
0 3px 10px rgba(0, 0, 0, 0.08);
}
button:active,
input[type="submit"]:active,
input[type="button"]:active,
.mw-ui-button:active {
transform: scale(0.97);
}
/* =========================================================
07. LEFT SIDEBAR
========================================================= */
.vector-sidebar {
background: #fbfbfb !important;
border-right: 1px solid #eaecf0;
}
/* Sidebar 模块 */
.vector-sidebar .vector-pinnable-element {
border-radius: 8px;
transition:
background-color 0.2s ease,
box-shadow 0.2s ease,
transform 0.2s ease;
}
.vector-sidebar .vector-pinnable-element:hover {
background:
rgba(51, 102, 255, 0.025);
}
/* Sidebar 标题 */
.vector-sidebar .vector-menu-heading {
cursor: pointer;
border-radius: 6px;
transition:
background-color 0.2s ease,
color 0.2s ease,
padding-left 0.2s ease;
}
.vector-sidebar .vector-menu-heading:hover {
background:
rgba(51, 102, 255, 0.06);
}
/* Sidebar 链接 */
.vector-sidebar a:hover {
padding-left: 4px;
}
/* =========================================================
08. SIDEBAR EXPAND / COLLAPSE
========================================================= */
/*
不使用 display:none / visibility:hidden,
避免破坏 Vector 2022 原本的菜单控制逻辑。
*/
.vector-sidebar
.vector-pinnable-element
.vector-menu-content {
overflow: hidden;
transition:
max-height 0.35s ease,
opacity 0.25s ease,
transform 0.25s ease;
}
/* 展开状态 */
.vector-sidebar
.vector-pinnable-element.vector-menu-open
.vector-menu-content {
opacity: 1;
transform: translateY(0);
}
/* Sidebar 菜单项目 */
.vector-sidebar
.vector-pinnable-element
.vector-menu-content li {
transition:
opacity 0.22s ease,
transform 0.22s ease;
}
/* 展开后的轻微滑入 */
.vector-sidebar
.vector-pinnable-element.vector-menu-open
.vector-menu-content li {
opacity: 1;
transform: translateX(0);
}
/* Stagger */
.vector-sidebar
.vector-pinnable-element.vector-menu-open
.vector-menu-content li:nth-child(1) {
transition-delay: 0.02s;
}
.vector-sidebar
.vector-pinnable-element.vector-menu-open
.vector-menu-content li:nth-child(2) {
transition-delay: 0.04s;
}
.vector-sidebar
.vector-pinnable-element.vector-menu-open
.vector-menu-content li:nth-child(3) {
transition-delay: 0.06s;
}
.vector-sidebar
.vector-pinnable-element.vector-menu-open
.vector-menu-content li:nth-child(4) {
transition-delay: 0.08s;
}
.vector-sidebar
.vector-pinnable-element.vector-menu-open
.vector-menu-content li:nth-child(5) {
transition-delay: 0.10s;
}
.vector-sidebar
.vector-pinnable-element.vector-menu-open
.vector-menu-content li:nth-child(6) {
transition-delay: 0.12s;
}
/* =========================================================
09. LOGO LEFT MAIN MENU
========================================================= */
/*
Logo 左侧的主菜单按钮。
不改变 MediaWiki 原本的显示机制。
*/
.vector-header-start button,
.vector-header-start .mw-ui-icon {
transition:
transform 0.15s ease,
background-color 0.2s ease,
box-shadow 0.2s ease;
}
.vector-header-start button:hover {
transform: scale(1.04);
}
.vector-header-start button:active {
transform: scale(0.92);
}
/* 主菜单 */
.vector-main-menu,
#vector-main-menu,
#vector-main-menu-dropdown {
transform-origin: top left;
transition:
opacity 0.22s ease,
transform 0.22s ease,
box-shadow 0.22s ease;
}
/* 已知的打开状态 */
.vector-main-menu--open,
.vector-main-menu.vector-menu-open,
#vector-main-menu-dropdown.vector-menu-open {
opacity: 1;
transform:
translateY(0)
scale(1);
box-shadow:
0 8px 24px rgba(0, 0, 0, 0.10);
}
/* 主菜单项目 */
.vector-main-menu a,
#vector-main-menu a {
transition:
color 0.18s ease,
background-color 0.18s ease,
transform 0.18s ease;
}
.vector-main-menu a:hover,
#vector-main-menu a:hover {
transform: translateX(3px);
}
/* =========================================================
10. RIGHT HEADER CONTROLS
========================================================= */
/*
Vector 2022 右侧通常包括:
- 搜索
- 用户菜单
- 外观
- 工具
- 更多
这里只做视觉反馈,不接管菜单的 display 状态。
*/
.vector-header-end button,
.vector-header-end .vector-dropdown-label {
transition:
transform 0.12s ease,
background-color 0.18s ease,
box-shadow 0.18s ease,
color 0.18s ease;
}
/* Hover */
.vector-header-end button:hover,
.vector-header-end .vector-dropdown-label:hover {
background:
rgba(51, 102, 255, 0.055);
border-radius: 6px;
}
/* 点击 */
.vector-header-end button:active,
.vector-header-end .vector-dropdown-label:active {
transform: scale(0.94);
}
/* =========================================================
11. RIGHT DROPDOWN MENUS
========================================================= */
/*
重点:
不使用 opacity:0 或 pointer-events:none
去强制隐藏菜单。
MediaWiki 自己负责打开 / 关闭。
CSS 只负责打开后的视觉动画。
*/
.vector-dropdown-content {
transform-origin: top right;
transition:
transform 0.18s ease,
opacity 0.18s ease,
box-shadow 0.2s ease;
}
/* Vector Dropdown 打开 */
.vector-dropdown.vector-dropdown--open
.vector-dropdown-content {
transform:
translateY(0)
scale(1);
box-shadow:
0 8px 24px rgba(0, 0, 0, 0.12);
}
/* Dropdown 内容 */
.vector-dropdown-content .mw-list-item a {
transition:
background-color 0.16s ease,
color 0.16s ease,
padding-left 0.16s ease;
}
/* Dropdown Hover */
.vector-dropdown-content .mw-list-item a:hover {
background:
rgba(51, 102, 255, 0.06);
padding-left: 4px;
}
/* =========================================================
12. VECTOR POPUPS
========================================================= */
.vector-popup {
transition:
opacity 0.18s ease,
transform 0.18s ease,
box-shadow 0.2s ease;
}
/* =========================================================
13. MAIN HEADING
========================================================= */
.mw-first-heading {
position: relative;
padding-bottom: 10px;
animation:
griffinTitleFade 0.45s ease-out;
}
@keyframes griffinTitleFade {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* 标题底部渐变线 */
.mw-first-heading::after {
content: "";
display: block;
width: 60px;
height: 3px;
margin-top: 8px;
border-radius: 3px;
background:
linear-gradient(
90deg,
#3366ff,
#6f7cff,
#ff4fa3
);
transform-origin: left;
animation:
griffinTitleLine 0.55s ease-out;
}
@keyframes griffinTitleLine {
from {
width: 0;
opacity: 0;
}
to {
width: 60px;
opacity: 1;
}
}
/* =========================================================
14. SECTION HEADINGS
========================================================= */
.mw-parser-output h2 {
position: relative;
animation:
griffinSectionFade 0.3s ease-out;
}
@keyframes griffinSectionFade {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* H2 左侧装饰条 */
.mw-parser-output h2::before {
content: "";
position: absolute;
left: -10px;
top: 50%;
width: 3px;
height: 16px;
border-radius: 3px;
background: #3366ff;
transform:
translateY(-50%)
scaleY(0);
transform-origin: center;
animation:
griffinHeadingBar 0.4s ease-out forwards;
}
@keyframes griffinHeadingBar {
to {
transform:
translateY(-50%)
scaleY(1);
}
}
/* =========================================================
15. INFOBOX
========================================================= */
.infobox {
position: relative;
overflow: hidden;
background: #f8f9fa !important;
border: 1px solid #c8ccd1;
transition:
transform 0.25s ease,
box-shadow 0.25s ease,
border-color 0.25s ease;
}
/* Hover */
.infobox:hover {
transform: translateY(-2px);
border-color:
#b8c2d9;
box-shadow:
0 8px 22px rgba(0, 0, 0, 0.10);
}
/* 顶部扫描线 */
.infobox::before {
content: "";
position: absolute;
top: 0;
left: -50%;
width: 200%;
height: 2px;
background:
linear-gradient(
90deg,
transparent,
rgba(51, 102, 255, 0.25),
rgba(255, 79, 163, 0.25),
transparent
);
animation:
griffinScanline 5s linear infinite;
}
@keyframes griffinScanline {
from {
transform: translateX(0);
}
to {
transform: translateX(50%);
}
}
/* =========================================================
16. IMAGES
========================================================= */
.thumbinner {
transition:
transform 0.25s ease,
box-shadow 0.25s ease;
}
.thumbinner:hover {
box-shadow:
0 6px 18px rgba(0, 0, 0, 0.08);
}
.thumbinner img {
transition:
transform 0.25s ease;
}
.thumbinner img:hover {
transform: scale(1.02);
}
/* =========================================================
17. LIST INTERACTION
========================================================= */
.mw-parser-output li {
transition:
transform 0.15s ease;
}
.mw-parser-output li:hover {
transform:
translateX(2px);
}
/* =========================================================
18. INPUT / SEARCH
========================================================= */
input,
textarea,
select {
transition:
border-color 0.2s ease,
box-shadow 0.2s ease,
background-color 0.2s ease;
}
input:focus,
textarea:focus,
select:focus {
border-color:
#3366cc;
box-shadow:
0 0 0 2px rgba(51, 102, 204, 0.12);
outline: none;
}
/* =========================================================
19. MAIN PAGE
========================================================= */
/*
以下仅作用于:
Main Page
配合主页中的:
<div class="mainpage-banner">
...
</div>
*/
body.page-Main_Page .mw-body {
max-width: 1200px;
}
/* =========================================================
20. MAIN PAGE HERO BANNER
========================================================= */
body.page-Main_Page .mainpage-banner {
position: relative;
overflow: hidden;
margin:
10px 0 30px;
padding:
70px 30px;
min-height:
220px;
display:
flex;
flex-direction:
column;
justify-content:
center;
align-items:
center;
text-align:
center;
color:
#ffffff !important;
border-radius:
12px;
background:
#1f2a44;
box-shadow:
0 8px 28px rgba(0, 0, 0, 0.12);
}
/* =========================================================
21. MAIN PAGE HERO IMAGE
========================================================= */
/*
========================================================
请修改这里
========================================================
将下面:
https://example.com/your-banner.jpg
换成你的 Wiki 横幅图片 URL。
*/
body.page-Main_Page .mainpage-banner::before {
content: "";
position: absolute;
inset: 0;
z-index: 0;
background-image:
url("https://example.com/your-banner.jpg");
background-size:
cover;
background-position:
center;
background-repeat:
no-repeat;
filter:
brightness(0.72);
transform:
scale(1.03);
transition:
transform 8s ease;
}
/* Banner Hover */
body.page-Main_Page .mainpage-banner:hover::before {
transform:
scale(1.07);
}
/* =========================================================
22. HERO DARK OVERLAY
========================================================= */
body.page-Main_Page .mainpage-banner::after {
content: "";
position: absolute;
inset: 0;
z-index: 1;
background:
linear-gradient(
180deg,
rgba(15, 25, 55, 0.28),
rgba(15, 25, 55, 0.62)
);
pointer-events:
none;
}
/* Hero 内容位于图片上方 */
body.page-Main_Page .mainpage-banner > * {
position:
relative;
z-index:
2;
}
/* =========================================================
23. HERO TITLE
========================================================= */
body.page-Main_Page .mainpage-banner h1 {
margin:
0 0 12px;
font-size:
2.8em;
font-weight:
700;
letter-spacing:
1px;
color:
#ffffff !important;
text-shadow:
0 2px 12px rgba(0, 0, 0, 0.55);
animation:
griffinHeroTitle 0.7s ease-out;
}
@keyframes griffinHeroTitle {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Hero 副标题 */
body.page-Main_Page .mainpage-banner em,
body.page-Main_Page .mainpage-banner p {
color:
rgba(255, 255, 255, 0.90) !important;
text-shadow:
0 1px 8px rgba(0, 0, 0, 0.4);
}
/* =========================================================
24. MAIN PAGE INTRO
========================================================= */
body.page-Main_Page .mainpage-intro {
max-width:
900px;
margin:
0 auto 30px;
padding:
20px 24px;
background:
#f8f9fa;
border:
1px solid #eaecf0;
border-radius:
10px;
line-height:
1.8;
box-shadow:
0 2px 8px rgba(0, 0, 0, 0.04);
animation:
griffinIntroFade 0.5s ease-out;
}
@keyframes griffinIntroFade {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* =========================================================
25. MAIN PAGE MODULES
========================================================= */
body.page-Main_Page .mainpage-module {
background:
#ffffff;
border:
1px solid #eaecf0;
border-radius:
10px;
padding:
18px 20px;
margin-bottom:
18px;
box-shadow:
0 2px 8px rgba(0, 0, 0, 0.035);
transition:
transform 0.25s ease,
box-shadow 0.25s ease,
border-color 0.25s ease;
}
/* Module Hover */
body.page-Main_Page .mainpage-module:hover {
transform:
translateY(-3px);
border-color:
#d5daf0;
box-shadow:
0 8px 22px rgba(0, 0, 0, 0.08);
}
/* Module 标题 */
body.page-Main_Page .mainpage-module h2 {
margin-top:
0;
padding-bottom:
8px;
border-bottom:
1px solid #eaecf0;
}
/* =========================================================
26. MAIN PAGE TWO COLUMNS
========================================================= */
body.page-Main_Page .mainpage-columns {
display:
flex;
align-items:
flex-start;
gap:
18px;
}
body.page-Main_Page .mainpage-left {
flex:
2;
min-width:
0;
}
body.page-Main_Page .mainpage-right {
flex:
1;
min-width:
0;
}
/* =========================================================
27. MAIN PAGE LIST
========================================================= */
body.page-Main_Page .mainpage-module li {
margin-bottom:
6px;
transition:
transform 0.15s ease;
}
body.page-Main_Page .mainpage-module li:hover {
transform:
translateX(3px);
}
/* =========================================================
28. MAIN PAGE LINKS
========================================================= */
body.page-Main_Page a {
color:
#3366cc;
}
body.page-Main_Page a:hover {
color:
#2956b8;
text-decoration:
underline;
}
/* =========================================================
29. RESPONSIVE - TABLET
========================================================= */
@media (max-width: 900px) {
body.page-Main_Page .mainpage-columns {
flex-direction:
column;
}
body.page-Main_Page .mainpage-left,
body.page-Main_Page .mainpage-right {
width:
100%;
}
body.page-Main_Page .mainpage-banner {
min-height:
180px;
padding:
50px 20px;
}
body.page-Main_Page .mainpage-banner h1 {
font-size:
2.2em;
}
}
/* =========================================================
30. RESPONSIVE - MOBILE
========================================================= */
@media (max-width: 640px) {
.mw-content-container {
padding-left:
12px;
padding-right:
12px;
}
body.page-Main_Page .mainpage-banner {
margin:
5px 0 20px;
border-radius:
8px;
min-height:
160px;
padding:
40px 15px;
}
body.page-Main_Page .mainpage-banner h1 {
font-size:
1.9em;
letter-spacing:
0.5px;
}
body.page-Main_Page .mainpage-module {
padding:
15px;
}
}
/* =========================================================
31. ACCESSIBILITY / REDUCED MOTION
========================================================= */
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior:
auto;
}
*,
*::before,
*::after {
animation-duration:
0.001ms !important;
animation-iteration-count:
1 !important;
transition-duration:
0.001ms !important;
}
}
/* =========================================================
END OF GRIFFIN WIKI VECTOR.CSS
========================================================= */
```