MediaWiki:Common.js

From yangwa
Revision as of 09:02, 11 April 2025 by Yangwalab (talk | contribs) (Created page with "// Only run on Main Page if (mw.config.get('wgPageName') === 'Main_Page') { const style = document.createElement('style'); style.innerHTML = ` body { background-color: #ffffcc !important; } #mw-head-base, #mw-head, #p-personal, #mw-navigation { position: fixed !important; top: auto !important; bottom: 0 !important; width: 100%; z-index: 999; background-color: #f8f9fa; padding...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// Only run on Main Page
if (mw.config.get('wgPageName') === 'Main_Page') {
    const style = document.createElement('style');
    style.innerHTML = `
    body {
        background-color: #ffffcc !important;
    }

    #mw-head-base,
    #mw-head,
    #p-personal,
    #mw-navigation {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        width: 100%;
        z-index: 999;
        background-color: #f8f9fa;
        padding: 10px 20px;
        box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
        display: flex !important;
        justify-content: space-between;
        align-items: center;
    }

    #bodyContent {
        margin-bottom: 140px !important;
    }

    .vector-page-title {
        display: none !important;
    }

    .mw-logo-wordmark {
        display: none !important;
    }
    `;
    document.head.appendChild(style);
}