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 319: | Baris 319: | ||
::-moz-selection { background: #36c; color: #fff; } | ::-moz-selection { background: #36c; color: #fff; } | ||
`).appendTo("head"); | `).appendTo("head"); | ||
/* 1. Smart Status Toaster (Info Update Artikel) */ | |||
$(document).ready(function() { | |||
if (mw.config.get('wgIsArticle') && mw.config.get('wgNamespaceNumber') === 0) { | |||
// Ambil data kapan terakhir disunting | |||
var lastEdit = $('.mw-stats-lastedit, #footer-info-lastmod').text(); | |||
if (!lastEdit) return; | |||
// Bikin Toaster yang eksklusif | |||
var $statusToaster = $('<div id="status-toaster" style="position:fixed; top:80px; left:50%; transform:translateX(-50%); background:rgba(255,255,255,0.95); border:1px solid #36c; padding:8px 20px; border-radius:25px; z-index:9999; box-shadow:0 4px 15px rgba(0,0,0,0.1); display:none; backdrop-filter:blur(10px); transition: all 0.5s ease;">' + | |||
'<span style="color:#36c; font-weight:bold; font-size:12px;">ℹ️ INFO:</span> ' + | |||
'<span style="font-size:12px; color:#555;">Artikel ini diperbarui ' + lastEdit.split('pada')[1] + '</span>' + | |||
'</div>'); | |||
$('body').append($statusToaster); | |||
// Munculin dikit terus ilang (Premium Style) | |||
setTimeout(function() { | |||
$statusToaster.fadeIn().delay(4000).fadeOut(); | |||
}, 2000); | |||
} | |||
}); | |||
/* 2. Page Loading Bar (Top Slim Bar) */ | |||
$(document).ready(function() { | |||
var $loadingBar = $('<div id="top-loading-bar" style="position:fixed; top:0; left:0; height:3px; background:#ff0; z-index:10000; width:0; transition: width 0.4s ease;"></div>'); | |||
$('body').append($loadingBar); | |||
// Simulasikan loading saat berpindah halaman | |||
$loadingBar.css('width', '100%'); | |||
setTimeout(function() { | |||
$loadingBar.fadeOut(); | |||
}, 600); | |||
}); | |||
/* 3. Auto-Hide Sidebar Mobile (Sleek Mode) */ | |||
$(document).ready(function() { | |||
// Biar navigasi kiri di Minerva nggak gampang kepencet pas lagi fokus baca | |||
$('.mw-ui-icon-minerva-mainmenu').css('transition', 'transform 0.3s ease'); | |||
$(window).scroll(function() { | |||
if ($(this).scrollTop() > 100) { | |||
$('.mw-ui-icon-minerva-mainmenu').css('opacity', '0.5'); | |||
} else { | |||
$('.mw-ui-icon-minerva-mainmenu').css('opacity', '1'); | |||
} | |||
}); | |||
}); | |||