MediaWiki:Vector.css:修订间差异

来自格里芬Wiki
无编辑摘要
无编辑摘要
第22行: 第22行:
     color: #202122 !important;
     color: #202122 !important;
}
}
```css
/* =========================================================
  Vector 2022 - 功能栏点击上滑效果
  ========================================================= */
/* 右侧功能栏按钮 */
.vector-header-end .vector-dropdown-label {
    transition:
        transform 0.16s ease,
        background-color 0.18s ease;
}
/* 鼠标悬停 */
.vector-header-end .vector-dropdown-label:hover {
    transform: translateY(-1px);
}
/* 点击 / 选中瞬间 */
.vector-header-end .vector-dropdown-label:active {
    transform: translateY(-3px);
}
/* 如果菜单处于展开状态,让按钮保持轻微上移 */
.vector-header-end .vector-dropdown[aria-expanded="true"]
.vector-dropdown-label {
    transform: translateY(-2px);
}
```





2026年8月7日 (五) 05:46的版本

```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;
}

```css
/* =========================================================
   Vector 2022 - 功能栏点击上滑效果
   ========================================================= */

/* 右侧功能栏按钮 */
.vector-header-end .vector-dropdown-label {
    transition:
        transform 0.16s ease,
        background-color 0.18s ease;
}

/* 鼠标悬停 */
.vector-header-end .vector-dropdown-label:hover {
    transform: translateY(-1px);
}

/* 点击 / 选中瞬间 */
.vector-header-end .vector-dropdown-label:active {
    transform: translateY(-3px);
}


/* 如果菜单处于展开状态,让按钮保持轻微上移 */
.vector-header-end .vector-dropdown[aria-expanded="true"]
.vector-dropdown-label {
    transform: translateY(-2px);
}
```



/* =========================================================
   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
   ========================================================= */
```