打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

MediaWiki:Mainpage.js

MediaWiki界面页面

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
$(function(){
    /* 头图控制脚本 */
    var page = document.querySelector("body");
    // 仅在首页执行
    if (page.classList.contains('page-首页')) {
        var mwBody = document.getElementById('content');
        if (mwBody) {
            var newDiv = document.createElement('div');
            newDiv.setAttribute('class', 'header-image-container');
            
            // background-position 设置为 center 20% 向上挪动图片
            // background-size 设置为 110% 确保位移后不露白边
            newDiv.innerHTML = '<div class="header-image" style="' +
                'background-image: linear-gradient(to top, var(--color-surface-0), transparent 50%), url(https://image.kivotosrailway.com/uploads/6990674d5d65c.png);' +
                'background-size: 110% auto;' + 
                'background-position: center 20%;' + 
                'background-repeat: no-repeat;' +
                'height: 36vh;' +
                'margin-bottom: -37vh;' +
                '"></div>';
                
            mwBody.parentNode.insertBefore(newDiv, mwBody);
        }
    }
});