MediaWiki:Common.js:修订间差异
来自Fuckrooms Wiki
无编辑摘要 标签:手工回退 |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
(function(){ | |||
window.snowflakes = window.snowflakes || []; | |||
function createSnow(){ | |||
const chars = ['🍀','☘️','🍃','🌿']; | |||
function | function spawn(){ | ||
const flake = document.createElement('div'); | |||
flake.style = `position:fixed;top:-30px;color:#fff;z-index:9999; | |||
pointer-events:none;user-select:none;font-size:${Math.random()*15+10}px; | |||
left:${Math.random()*100}%;opacity:${Math.random()*0.5+0.5}; | |||
animation:snowFall ${Math.random()*8+5}s linear infinite`; | |||
flake.textContent = chars[Math.floor(Math.random()*chars.length)]; | |||
document.body.appendChild(flake); | |||
snowflakes.push(flake); | |||
} | } | ||
setInterval(spawn, 500); | |||
setTimeout(() => { setInterval(spawn, 3000) }, 10000); | |||
} | |||
if(!document.getElementById('snowStyle')){ | |||
const style = document.createElement('style'); | |||
style.id = 'snowStyle'; | |||
style.textContent = `@keyframes snowFall { | |||
0%{transform:translateY(-30px) rotate(0deg)} | |||
100%{transform:translateY(120vh) rotate(720deg)} | |||
}`; | |||
document.head.appendChild(style); | |||
} | |||
document.addEventListener('visibilitychange', () => { | |||
if(!document.hidden && snowflakes.length < 20) createSnow(); | |||
}); | |||
createSnow(); | |||
})(); | })(); | ||
2025年4月14日 (一) 13:44的版本
(function(){
window.snowflakes = window.snowflakes || [];
function createSnow(){
const chars = ['🍀','☘️','🍃','🌿'];
function spawn(){
const flake = document.createElement('div');
flake.style = `position:fixed;top:-30px;color:#fff;z-index:9999;
pointer-events:none;user-select:none;font-size:${Math.random()*15+10}px;
left:${Math.random()*100}%;opacity:${Math.random()*0.5+0.5};
animation:snowFall ${Math.random()*8+5}s linear infinite`;
flake.textContent = chars[Math.floor(Math.random()*chars.length)];
document.body.appendChild(flake);
snowflakes.push(flake);
}
setInterval(spawn, 500);
setTimeout(() => { setInterval(spawn, 3000) }, 10000);
}
if(!document.getElementById('snowStyle')){
const style = document.createElement('style');
style.id = 'snowStyle';
style.textContent = `@keyframes snowFall {
0%{transform:translateY(-30px) rotate(0deg)}
100%{transform:translateY(120vh) rotate(720deg)}
}`;
document.head.appendChild(style);
}
document.addEventListener('visibilitychange', () => {
if(!document.hidden && snowflakes.length < 20) createSnow();
});
createSnow();
})();