(function () { 'use strict'; function initSnow() { const oldContainers = document.querySelectorAll('#snowfall-container, #tilda-snow, .t-snow'); oldContainers.forEach(el => { if (el.parentNode) el.parentNode.removeChild(el); }); const currentPath = window.location.pathname; if (currentPath.includes('/learn/')) { return; } if (document.getElementById('snowfall-container')) { return; } const container = document.createElement('div'); container.id = 'snowfall-container'; Object.assign(container.style, { position: 'fixed', top: '0', left: '0', width: '100%', height: '100%', pointerEvents: 'none', zIndex: '9999', overflow: 'hidden' }); document.body.appendChild(container); if (!document.getElementById('snowfall-styles')) { const style = document.createElement('style'); style.id = 'snowfall-styles'; style.textContent = ` @keyframes fallSnow { 0% { transform: translateY(-20px) translateX(0); opacity: var(--opacity, 0.8); } 100% { transform: translateY(${window.innerHeight + 100}px) translateX(var(--end-x, 0)); opacity: 0; } } `; document.head.appendChild(style); } const snowflakeCount = 60; for (let i = 0; i < snowflakeCount; i++) { setTimeout(() => { const size = Math.random() * 16 + 8; // 8–24px const opacity = Math.random() * 0.3 + 0.7; // ЯРЧЕ: почти непрозрачные const strokeWidth = Math.random() * 1 + 0.6; // ЯРЧЕ: толще линии const startX = Math.random() * window.innerWidth; const duration = Math.random() * 8 + 12; const delay = Math.random() * 5; const endX = (Math.random() - 0.5) * 180; const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); svg.setAttribute('width', size); svg.setAttribute('height', size); svg.setAttribute('viewBox', '0 0 24 24'); Object.assign(svg.style, { position: 'absolute', top: '0', left: startX + 'px', opacity: opacity, display: 'block', animation: `fallSnow ${duration}s linear ${delay}s infinite`, userSelect: 'none', filter: 'drop-shadow(0 0 2px rgba(255, 255, 255, 0.9))' // 🔆 СВЕЧЕНИЕ! }); svg.style.setProperty('--end-x', endX + 'px'); svg.style.setProperty('--opacity', opacity); svg.innerHTML = ` `; container.appendChild(svg); }, i * 80); } } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initSnow); } else { initSnow(); } let lastPath = window.location.pathname; setInterval(() => { const currentPath = window.location.pathname; if (currentPath === lastPath) return; lastPath = currentPath; const container = document.getElementById('snowfall-container'); if (currentPath.includes('/learn/')) { if (container) container.remove(); } else { if (!container) initSnow(); } }, 1500); })();