// Mobile Menu Toggle document.getElementById('mobileMenuBtn').addEventListener('click', function() { const mobileMenu = document.getElementById('mobileMenu'); mobileMenu.classList.toggle('hidden'); }); // Smooth Scrolling function scrollToSection(sectionId) { document.getElementById(sectionId).scrollIntoView({ behavior: 'smooth' }); } // Navigation Link Clicks document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); const target = document.querySelector(this.getAttribute('href')); if (target) { target.scrollIntoView({ behavior: 'smooth', block: 'start' }); // Close mobile menu if open document.getElementById('mobileMenu').classList.add('hidden'); } }); }); // Modal Functions function openModal(modalId) { document.getElementById(modalId).style.display = 'block'; document.body.style.overflow = 'hidden'; } function closeModal(modalId) { document.getElementById(modalId).style.display = 'none'; document.body.style.overflow = 'auto'; } // Close modal when clicking outside window.addEventListener('click', function(e) { if (e.target.classList.contains('modal')) { e.target.style.display = 'none'; document.body.style.overflow = 'auto'; } }); // Search Functionality document.getElementById('searchInput').addEventListener('input', function(e) { const searchTerm = e.target.value.toLowerCase(); // Simple search implementation if (searchTerm.length > 2) { console.log('Searching for:', searchTerm); // Here you would implement actual search logic } }); // Gallery Functions function openGalleryModal(imageId) { alert('Открытие изображения: ' + imageId); // Here you would implement gallery modal } function loadMoreGallery() { alert('Загрузка дополнительных изображений...'); // Here you would implement loading more gallery items } // Scroll Animations const observerOptions = { threshold: 0.1, rootMargin: '0px 0px -50px 0px' }; const observer = new IntersectionObserver(function(entries) { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.style.opacity = '1'; entry.target.style.transform = 'translateY(0)'; } }); }, observerOptions); // Observe all bento cards and character cards document.querySelectorAll('.bento-card, .character-card').forEach(card => { card.style.opacity = '0'; card.style.transform = 'translateY(30px)'; card.style.transition = 'opacity 0.6s ease, transform 0.6s ease'; observer.observe(card); }); // Form Submission document.querySelector('form').addEventListener('submit', function(e) { e.preventDefault(); alert('Спасибо за ваше сообщение! Мы свяжемся с вами в ближайшее время.'); this.reset(); }); // Add some dynamic behavior document.addEventListener('DOMContentLoaded', function() { // Add loading animation to cards const cards = document.querySelectorAll('.bento-card, .character-card'); cards.forEach((card, index) => { card.style.animationDelay = `${index * 0.1}s`; }); // Update current year in footer const currentYear = new Date().getFullYear(); document.querySelector('footer p:last-child').innerHTML = document.querySelector('footer p:last-child').innerHTML.replace('2025', currentYear); }); // Keyboard navigation document.addEventListener('keydown', function(e) { if (e.key === 'Escape') { // Close any open modals document.querySelectorAll('.modal').forEach(modal => { modal.style.display = 'none'; }); document.body.style.overflow = 'auto'; } }); // Add scroll progress indicator window.addEventListener('scroll', function() { const scrolled = (window.scrollY / (document.documentElement.scrollHeight - window.innerHeight)) * 100; // You could add a progress bar here }); //SEASONS // Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); const target = document.querySelector(this.getAttribute('href')); if (target) { target.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); }); // Add loading animation for episode cards const episodeCards = document.querySelectorAll('.episode-card'); episodeCards.forEach((card, index) => { card.style.animationDelay = `${index * 0.1}s`; card.style.animation = 'fadeInUp 0.6s ease forwards'; }); // CSS animation keyframes const style = document.createElement('style'); style.textContent = ` @keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } } `; document.head.appendChild(style); // Добавляем интерактивность document.addEventListener('DOMContentLoaded', function() { // Анимация появления карточек const cards = document.querySelectorAll('.episode-card'); cards.forEach((card, index) => { card.style.opacity = '0'; card.style.transform = 'translateY(20px)'; setTimeout(() => { card.style.transition = 'all 0.6s ease'; card.style.opacity = '1'; card.style.transform = 'translateY(0)'; }, index * 200); }); // Эффект hover для карточек персонажей const characterCards = document.querySelectorAll('.character-card'); characterCards.forEach(card => { card.addEventListener('mouseenter', function() { this.style.transform = 'translateX(10px) scale(1.02)'; }); card.addEventListener('mouseleave', function() { this.style.transform = 'translateX(0) scale(1)'; }); }); });