Hello everyone! Since it's December, I thought I'd share this code with you. Once you've uploaded everything to the right place, all you have to do is type /snow in the chat and it will start to snow. You can turn it off by typing it again. Presentation: https://youtu.be/8Poe_VW3-oc Copy this code to the bottom of function_main.js:
/ --- Snow on/off --- //
window.snowEnabled = false;
// --- Snow start ---
window.startSnow = function() {
if (document.getElementById('snow_effect')) return;
let snow = document.createElement("div");
snow.id = "snow_effect";
snow.style.position = "fixed";
snow.style.top = 0;
snow.style.left = 0;
snow.style.width = "100%";
snow.style.height = "100%";
snow.style.pointerEvents = "none";
snow.style.zIndex = "999999";
document.body.appendChild(snow);
for (let i = 0; i < 80; i++) {
let flake = document.createElement("div");
flake.className = "flake";
flake.style.left = (Math.random() * 100) + "vw";
flake.style.animationDuration = (3 + Math.random() * 5) + "s";
flake.style.opacity = (0.3 + Math.random()).toFixed(2);
flake.style.fontSize = (10 + Math.random() * 20) + "px";
flake.style.animationDelay = (Math.random() * 5) + "s";
flake.innerHTML = "";
snow.appendChild(flake);
}
};
// --- Snow start ---
window.stopSnow = function() {
let snow = document.getElementById('snow_effect');
if (snow) snow.remove();
};Copy this to the bottom of the css/main.css file:
#snow_effect .flake {
position: absolute;
top: -5vh;
color: #fff;
animation-name: fall;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
@keyframes fall {
0% { transform: translateY(0); }
100% { transform: translateY(110vh) rotate(360deg); }
}
snowfall.zip