Dantes (обсуждение | вклад) Нет описания правки |
Dantes (обсуждение | вклад) Нет описания правки Метка: отменено |
||
| Строка 3: | Строка 3: | ||
var month = today.getMonth() + 1; | var month = today.getMonth() + 1; | ||
if (month === 10 || month === 11) { | if (month === 10 || month === 11) { | ||
mw.loader.load('/w/index.php?title=MediaWiki:Test.css&action=raw&ctype=text/css'); | mw.loader.load('/w/index.php?title=MediaWiki:Test.css&action=raw&ctype=text/css'); | ||
mw.hook('wikipage.content').add(function($content) { | mw.hook('wikipage.content').add(function($content) { | ||
var leaves = document.createElement('div'); | var leaves = document.createElement('div'); | ||
leaves.className = 'halloween-leaves'; | leaves.className = 'halloween-leaves'; | ||
document.body.appendChild(leaves); | document.body.appendChild(leaves); | ||
for (var i = 0; i < 30; i++) { | |||
for (var i = 0; i < | |||
var leaf = document.createElement('span'); | var leaf = document.createElement('span'); | ||
leaf.className = 'halloween-leaf'; | leaf.className = 'halloween-leaf'; | ||
leaf.innerHTML = | leaf.innerHTML = ['🍂','🍁','🦇','🕸️'][Math.floor(Math.random()*4)]; | ||
leaf.style.left = | leaf.style.left = Math.random()*100+'%'; | ||
leaf.style.animationDelay = (Math.random()* | leaf.style.animationDelay = (Math.random()*5)+'s'; | ||
leaf.style.fontSize = ( | leaf.style.fontSize = (12+Math.random()*24)+'px'; | ||
leaves.appendChild(leaf); | leaves.appendChild(leaf); | ||
} | } | ||
| Строка 26: | Строка 22: | ||
var firstHeading = document.getElementById('firstHeading'); | var firstHeading = document.getElementById('firstHeading'); | ||
if (firstHeading) { | if (firstHeading) { | ||
var pumpkin = document.createElement('span'); | |||
pumpkin.className = 'halloween-pumpkin'; | |||
pumpkin.innerHTML = ' 🎃 '; | |||
firstHeading.appendChild(pumpkin); | |||
} | } | ||
var audioContainer = document.createElement('div'); | |||
audioContainer.className = 'halloween-audio-container'; | |||
var audioPlayer = document.createElement('audio'); | |||
audioPlayer.controls = true; | |||
audioPlayer.autoplay = true; | |||
audioPlayer.loop = true; | |||
audioPlayer.src = 'https://cdn.pixabay.com/download/audio/2025/10/16/audio_c3bd91ff88.mp3?filename=halloween-scary-music-421082.mp3'; | |||
audioPlayer.type = 'audio/mp3'; | |||
audioContainer.appendChild(audioPlayer); | |||
document.body.appendChild(audioContainer); | |||
var links = document.getElementsByTagName('a'); | var links = document.getElementsByTagName('a'); | ||
for (var | for (var i = 0; i < links.length; i++) { | ||
links[ | links[i].style.transition = 'color 0.3s ease, text-shadow 0.3s ease'; | ||
links[ | links[i].onmouseover = function() { this.style.color = '#ffa500'; this.style.textShadow = '0 0 8px #ffa500'; }; | ||
links[i].onmouseout = function() { this.style.color = ''; this.style.textShadow = ''; }; | |||
links[ | |||
} | } | ||
}); | }); | ||
} | } | ||
})(); | })(); | ||
Версия от 19:27, 23 октября 2025
(function() {
var today = new Date();
var month = today.getMonth() + 1;
if (month === 10 || month === 11) {
mw.loader.load('/w/index.php?title=MediaWiki:Test.css&action=raw&ctype=text/css');
mw.hook('wikipage.content').add(function($content) {
var leaves = document.createElement('div');
leaves.className = 'halloween-leaves';
document.body.appendChild(leaves);
for (var i = 0; i < 30; i++) {
var leaf = document.createElement('span');
leaf.className = 'halloween-leaf';
leaf.innerHTML = ['🍂','🍁','🦇','🕸️'][Math.floor(Math.random()*4)];
leaf.style.left = Math.random()*100+'%';
leaf.style.animationDelay = (Math.random()*5)+'s';
leaf.style.fontSize = (12+Math.random()*24)+'px';
leaves.appendChild(leaf);
}
var firstHeading = document.getElementById('firstHeading');
if (firstHeading) {
var pumpkin = document.createElement('span');
pumpkin.className = 'halloween-pumpkin';
pumpkin.innerHTML = ' 🎃 ';
firstHeading.appendChild(pumpkin);
}
var audioContainer = document.createElement('div');
audioContainer.className = 'halloween-audio-container';
var audioPlayer = document.createElement('audio');
audioPlayer.controls = true;
audioPlayer.autoplay = true;
audioPlayer.loop = true;
audioPlayer.src = 'https://cdn.pixabay.com/download/audio/2025/10/16/audio_c3bd91ff88.mp3?filename=halloween-scary-music-421082.mp3';
audioPlayer.type = 'audio/mp3';
audioContainer.appendChild(audioPlayer);
document.body.appendChild(audioContainer);
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
links[i].style.transition = 'color 0.3s ease, text-shadow 0.3s ease';
links[i].onmouseover = function() { this.style.color = '#ffa500'; this.style.textShadow = '0 0 8px #ffa500'; };
links[i].onmouseout = function() { this.style.color = ''; this.style.textShadow = ''; };
}
});
}
})();