Dantes (обсуждение | вклад) Нет описания правки |
Dantes (обсуждение | вклад) Нет описания правки Метка: отменено |
||
| Строка 1: | Строка 1: | ||
(function() { | (function() { | ||
if (window.halloweenScriptLoaded) return; | |||
window.halloweenScriptLoaded = true; | |||
var body = document.body; | |||
function createLeaf() { | |||
var leaf = document.createElement('span'); | |||
leaf.className = 'halloween-leaf'; | |||
leaf.innerHTML = '🍂'; | |||
leaf.style.left = Math.random() * window.innerWidth + 'px'; | |||
leaf.style.fontSize = (10 + Math.random() * 20) + 'px'; | |||
leaf.style.opacity = Math.random(); | |||
leaf.style.animationDuration = (5 + Math.random() * 5) + 's'; | |||
} | body.appendChild(leaf); | ||
setTimeout(function() { | |||
body.removeChild(leaf); | |||
}, 10000); | |||
} | |||
function createPumpkin() { | |||
var pumpkin = document.createElement('span'); | |||
pumpkin.className = 'halloween-pumpkin'; | |||
pumpkin.innerHTML = '🎃'; | |||
pumpkin.style.position = 'fixed'; | |||
pumpkin.style.left = Math.random() * window.innerWidth + 'px'; | |||
} | pumpkin.style.top = (window.innerHeight - 50) * Math.random() + 'px'; | ||
pumpkin.style.fontSize = (20 + Math.random() * 30) + 'px'; | |||
pumpkin.style.opacity = 0.8; | |||
body.appendChild(pumpkin); | |||
setTimeout(function() { | |||
body.removeChild(pumpkin); | |||
}, 10000); | |||
} | |||
setInterval(createLeaf, 500); // каждые 0.5 секунды падает лист | |||
setInterval(createPumpkin, 2000); // каждые 2 секунды летает тыква | |||
})(); | })(); | ||
Версия от 17:57, 23 октября 2025
(function() {
if (window.halloweenScriptLoaded) return;
window.halloweenScriptLoaded = true;
var body = document.body;
function createLeaf() {
var leaf = document.createElement('span');
leaf.className = 'halloween-leaf';
leaf.innerHTML = '🍂';
leaf.style.left = Math.random() * window.innerWidth + 'px';
leaf.style.fontSize = (10 + Math.random() * 20) + 'px';
leaf.style.opacity = Math.random();
leaf.style.animationDuration = (5 + Math.random() * 5) + 's';
body.appendChild(leaf);
setTimeout(function() {
body.removeChild(leaf);
}, 10000);
}
function createPumpkin() {
var pumpkin = document.createElement('span');
pumpkin.className = 'halloween-pumpkin';
pumpkin.innerHTML = '🎃';
pumpkin.style.position = 'fixed';
pumpkin.style.left = Math.random() * window.innerWidth + 'px';
pumpkin.style.top = (window.innerHeight - 50) * Math.random() + 'px';
pumpkin.style.fontSize = (20 + Math.random() * 30) + 'px';
pumpkin.style.opacity = 0.8;
body.appendChild(pumpkin);
setTimeout(function() {
body.removeChild(pumpkin);
}, 10000);
}
setInterval(createLeaf, 500); // каждые 0.5 секунды падает лист
setInterval(createPumpkin, 2000); // каждые 2 секунды летает тыква
})();