MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / resetSnow

Function resetSnow

scripts/letItSnow.js:76–93  ·  view source on GitHub ↗
(snow)

Source from the content-addressed store, hash-verified

74 }
75
76 function resetSnow(snow) {
77 let size = randInt(5, 50);
78 let blur = randInt(0, 7);
79 let xStart = randInt(0, container.clientWidth);
80 let yStart = randInt(-50, 50);
81 let xEnd = xStart + randInt(50, 200);
82 let yEnd = randInt(container.clientHeight / 2, container.clientHeight);
83 let rotateEnd = randInt(-360, 360);
84
85 snow.style.setProperty("--xStart", xStart + "px");
86 snow.style.setProperty("--xEnd", xEnd + "px");
87 snow.style.setProperty("--yStart", yStart + "px");
88 snow.style.setProperty("--yEnd", yEnd + "px");
89 snow.style.setProperty("--rotateEnd", rotateEnd + "deg");
90 snow.style.width = size + "px";
91 snow.style.height = size + "px";
92 snow.style.filter = "blur(" + blur + "px)";
93 }
94
95 let count = 50;
96 let container = document.createElement("div");

Callers 1

letItSnow.jsFile · 0.85

Calls 1

randIntFunction · 0.85

Tested by

no test coverage detected