// Initialize any global functionality document.addEventListener('DOMContentLoaded', () => { // Mock data loading for demo purposes console.log('AI-Visionary Tube initialized'); // Simulate loading more content when scrolling window.addEventListener('scroll', () => { const { scrollTop, scrollHeight, clientHeight } = document.documentElement; if (scrollTop + clientHeight >= scrollHeight - 5) { // In a real app, this would fetch more content from an API console.log('Loading more content...'); } }); }); // Function to format view counts (e.g., 1200000 -> 1.2M) function formatViewCount(views) { if (views >= 1000000) { return (views / 1000000).toFixed(1) + 'M'; } else if (views >= 1000) { return (views / 1000).toFixed(1) + 'K'; } return views; }