function updateOnlineCount() { const onlineCount = Math.floor(Math.random() * (5000 - 1000 + 1)) + 1000; document.getElementById('online-count').textContent = `Şu anda ${onlineCount} kişi online!`; } function showNotification() { updateOnlineCount(); const notification = document.getElementById('online-notification'); anime({ targets: notification, opacity: 1, translateY: 0, duration: 1000, easing: 'easeOutElastic(1, .8)' }); setTimeout(() => { anime({ targets: notification, opacity: 0, translateY: 20, duration: 1000, easing: 'easeInExpo' }); }, 5000); } function initializeNotification() { if (typeof anime === 'undefined') { console.error('anime.js kütüphanesi yüklenemedi. Lütfen bağlantıyı kontrol edin.'); return; } showNotification(); setInterval(showNotification, 1000); } // Sayfa yüklendiğinde bildirimi başlat if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initializeNotification); } else { initializeNotification(); }