MediaWiki:Common.js: Perbedaan antara revisi
Tidak ada ringkasan suntingan Tanda: Suntingan perangkat seluler Suntingan peramban seluler |
Tidak ada ringkasan suntingan Tanda: Suntingan perangkat seluler Suntingan peramban seluler |
||
| Baris 1.327: | Baris 1.327: | ||
/* ========================================================== | /* ========================================================== | ||
🌙 MIPPEDIA DARK MODE ENGINE | 🌙 MIPPEDIA DARK MODE ENGINE V3 - FULL REPAIR | ||
Fix: | Fix: Infobox, Tabel Data, Footer Lisensi, & Mobile Header | ||
========================================================== */ | ========================================================== */ | ||
(function() { | (function() { | ||
var darkModeStyles = ` | var darkModeStyles = ` | ||
/* 1. Global | /* 1. Reset Global */ | ||
body.mippedia-dark, | body.mippedia-dark, | ||
.mippedia-dark #content, | .mippedia-dark #content, | ||
.mippedia-dark | .mippedia-dark .pagelib-hentry, | ||
.mippedia-dark . | .mippedia-dark .mw-body { | ||
background-color: #121212 !important; | background-color: #121212 !important; | ||
color: #e0e0e0 !important; | color: #e0e0e0 !important; | ||
} | } | ||
/* 2. | /* 2. INFOBOX & TABEL FIX (Berdasarkan Screenshot lo) */ | ||
.mippedia-dark . | .mippedia-dark .infobox, | ||
.mippedia-dark . | .mippedia-dark table.wikitable, | ||
.mippedia-dark .mw-parser-output table, | |||
.mippedia-dark .mw- | .mippedia-dark table { | ||
.mippedia-dark | |||
background-color: #1e1e1e !important; | background-color: #1e1e1e !important; | ||
color: #e0e0e0 !important; | |||
border-color: #333 !important; | |||
} | |||
.mippedia-dark .infobox th, | |||
.mippedia-dark table th, | |||
.mippedia-dark .infobox .infobox-header { | |||
background-color: #252525 !important; | |||
color: #ffffff !important; | |||
} | |||
.mippedia-dark .infobox td, .mippedia-dark table td { | |||
border-color: #333 !important; | border-color: #333 !important; | ||
} | } | ||
/* 3. | /* 3. FOOTER & LISENSI FIX (Bagian bawah yang masih putih) */ | ||
.mippedia-dark . | .mippedia-dark .minerva-footer, | ||
.mippedia-dark . | .mippedia-dark .last-modified-bar, | ||
.mippedia-dark . | .mippedia-dark #footer, | ||
.mippedia-dark .post-content.footer-content { | |||
background-color: #181818 !important; | background-color: #181818 !important; | ||
border- | color: #bbbbbb !important; | ||
border-top: 1px solid #333 !important; | |||
} | |||
.mippedia-dark .license { color: #888 !important; } | |||
/* 4. HALAMAN TERKAIT & CARD REPAIR */ | |||
.mippedia-dark .ext-related-articles-card, | |||
.mippedia-dark .mw-ui-card { | |||
background-color: #1e1e1e !important; | |||
border: 1px solid #333 !important; | |||
} | } | ||
/* | /* 5. TEKS & LINK SINKRONISASI */ | ||
.mippedia-dark h1, .mippedia-dark h2, .mippedia-dark h3 | .mippedia-dark h1, .mippedia-dark h2, .mippedia-dark h3 { color: #ffffff !important; } | ||
.mippedia-dark a { color: #8ab4f8 !important; } | .mippedia-dark a { color: #8ab4f8 !important; } | ||
.mippedia-dark a | .mippedia-dark a.new { color: #ff8080 !important; } /* Link merah buat halaman kosong */ | ||
.mippedia-dark .mw-ui-button { background-color: # | .mippedia-dark .mw-ui-button { background-color: #3498db !important; color: #fff !important; } | ||
/* | /* 6. TOMBOL SAKLAR (Gue bikin lebih rapi) */ | ||
#darkmode-toggle { | #darkmode-toggle { | ||
position: fixed; | position: fixed; | ||
bottom: | bottom: 90px; | ||
right: | right: 15px; | ||
width: | width: 48px; | ||
height: | height: 48px; | ||
background: #3498db; | background: #3498db; | ||
color: white; | color: white; | ||
border-radius: 50%; | border-radius: 50%; | ||
text-align: center; | text-align: center; | ||
line-height: | line-height: 48px; | ||
font-size: | font-size: 22px; | ||
cursor: pointer; | cursor: pointer; | ||
z-index: | z-index: 100000; | ||
box-shadow: 0 4px | box-shadow: 0 4px 12px rgba(0,0,0,0.6); | ||
transition: 0.3s | transition: 0.3s; | ||
} | } | ||
.mippedia-dark #darkmode-toggle { background: #f1c40f; color: #333; } | .mippedia-dark #darkmode-toggle { background: #f1c40f; color: #333; } | ||
| Baris 1.394: | Baris 1.410: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
var $toggle = $('<div id="darkmode-toggle">🌙</div>'); | if (!$('#darkmode-toggle').length) { | ||
var $toggle = $('<div id="darkmode-toggle">🌙</div>'); | |||
$('body').append($toggle); | |||
} | |||
if (localStorage.getItem('mip-dark-mode') === 'enabled') { | if (localStorage.getItem('mip-dark-mode') === 'enabled') { | ||
$('body').addClass('mippedia-dark'); | $('body').addClass('mippedia-dark'); | ||
$toggle.html('☀️'); | $('#darkmode-toggle').html('☀️'); | ||
} | } | ||
$toggle.on('click', function() { | $('#darkmode-toggle').on('click', function() { | ||
$('body').toggleClass('mippedia-dark'); | $('body').toggleClass('mippedia-dark'); | ||
if ($('body').hasClass('mippedia-dark')) { | if ($('body').hasClass('mippedia-dark')) { | ||