(function () { 'use strict'; function initSantaSleigh() { const currentPath = window.location.pathname; if (currentPath.includes('/learn/')) return; if (document.getElementById('santa-sleigh-container')) return; // === Контейнер для саней === const container = document.createElement('div'); container.id = 'santa-sleigh-container'; Object.assign(container.style, { position: 'fixed', bottom: '10px', left: '0', width: '100%', height: '180px', pointerEvents: 'none', zIndex: '10000', overflow: 'hidden' }); document.body.appendChild(container); // === SVG: Санки + Дед Мороз + Олени === const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); svg.setAttribute('width', '500'); svg.setAttribute('height', '120'); svg.setAttribute('viewBox', '0 0 500 120'); svg.style.cssText = ` position: absolute; bottom: 0; left: -550px; animation: sleighRide 35s linear infinite; `; // Вся сцена svg.innerHTML = ` `; container.appendChild(svg); // === ПОЗДРАВЛЕНИЕ === const greeting = document.createElement('div'); greeting.id = 'new-year-greeting'; greeting.textContent = 'С Новым годом!'; greeting.style.cssText = ` position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%) scale(0.7); color: white; font-family: 'Arial', 'Helvetica', sans-serif; font-size: 32px; font-weight: bold; white-space: nowrap; opacity: 0; z-index: 10001; text-shadow: 0 0 10px rgba(0,0,0,0.7), 0 3px 6px rgba(0,0,0,0.9); animation: greetingPop 2.5s cubic-bezier(0.34, 1.5, 0.7, 1) 4s forwards; `; document.body.appendChild(greeting); // === СТИЛИ АНИМАЦИЙ === if (!document.getElementById('santa-sleigh-styles')) { const style = document.createElement('style'); style.id = 'santa-sleigh-styles'; style.textContent = ` @keyframes sleighRide { 0% { transform: translateX(-600px); } 100% { transform: translateX(calc(100vw + 200px)); } } @keyframes greetingPop { 0% { opacity: 0; transform: translateX(-50%) scale(0.5); bottom: 80px; } 70% { transform: translateX(-50%) scale(1.1); } 100% { opacity: 1; transform: translateX(-50%) scale(1); bottom: 120px; } } `; document.head.appendChild(style); } } // Запуск if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initSantaSleigh); } else { initSantaSleigh(); } // Отслеживание навигации let lastPath = window.location.pathname; setInterval(() => { const path = window.location.pathname; if (path === lastPath) return; lastPath = path; const sleigh = document.getElementById('santa-sleigh-container'); const greeting = document.getElementById('new-year-greeting'); if (path.includes('/learn/')) { if (sleigh) sleigh.remove(); if (greeting) greeting.remove(); } else { if (!sleigh) initSantaSleigh(); } }, 1500); })();