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 61: | Baris 61: | ||
/* 2. Notif Rekomendasi Pintar (Bottom Toast) - Versi Rapi */ | |||
/* 2. Notif Rekomendasi Pintar (Bottom Toast) */ | |||
$(document).ready(function() { | $(document).ready(function() { | ||
if (mw.config.get('wgIsArticle') && mw.config.get('wgNamespaceNumber') === 0) { | if (mw.config.get('wgIsArticle') && mw.config.get('wgNamespaceNumber') === 0) { | ||
| Baris 85: | Baris 68: | ||
if($(window).scrollTop() + $(window).height() > $(document).height() - 100) { | if($(window).scrollTop() + $(window).height() > $(document).height() - 100) { | ||
if ($('#exit-recommend').length === 0) { | if ($('#exit-recommend').length === 0) { | ||
var toast = $('<div id="exit-recommend" style="position:fixed; bottom: | // POSISI DIUBAH: bottom jadi 140px biar di atas tombol Back to Top | ||
toast.html('<b>Suka artikel ini?</b>< | var toast = $('<div id="exit-recommend" style="position:fixed; bottom:140px; left:20px; right:20px; background:#36c; color:#fff; padding:15px; border-radius:12px; z-index:9998; box-shadow:0 4px 15px rgba(0,0,0,0.3); animation: slideUp 0.5s ease; border-left: 5px solid #ff0;"></div>'); | ||
toast.html('<div style="font-size:1.1em; margin-bottom:5px;"><b>Suka artikel ini?</b></div><div style="font-size:0.9em; margin-bottom:10px;">Coba cek halaman lainnya di Mippedia!</div><a href="/wiki/Special:Random" style="display:inline-block; background:#ff0; color:#000; padding:5px 15px; border-radius:20px; text-decoration:none; font-weight:bold; font-size:0.9em;">Klik di Sini »</a>'); | |||
$('body').append(toast); | $('body').append(toast); | ||
// Hilang otomatis dalam | // Hilang otomatis dalam 10 detik biar puas baca | ||
setTimeout(function() { $('#exit-recommend').fadeOut(); }, | setTimeout(function() { $('#exit-recommend').fadeOut(); }, 10000); | ||
} | } | ||
} | } | ||
| Baris 96: | Baris 80: | ||
} | } | ||
}); | }); | ||