added starfalls / shooting stars

This commit is contained in:
2025-01-25 14:14:25 +01:00
parent fbcd8254ba
commit 2d5a5416ba
5 changed files with 141 additions and 5 deletions
+5
View File
@@ -31,6 +31,11 @@ function randomInt(min, max) {
}
function randomBool(probablity) {
return Math.random() <= probablity
}
function clampNearest(n, mul) {
if(n > 0)
return Math.ceil(n / mul) * mul;
+7 -4
View File
@@ -1,12 +1,15 @@
let pxDensity = parseFloat(getComputedStyle(document.body).getPropertyValue("--pxDensity"))
let pxDensityDefined = false
let densityWidth = document.documentElement.clientWidth / 256
let densityHeight = document.documentElement.clientHeight / 164
let pxWidth = 256
let pxHeight = 164
let densityWidth = document.documentElement.clientWidth / pxWidth
let densityHeight = document.documentElement.clientHeight / pxHeight
function calcPixelDensity() {
densityWidth = document.documentElement.clientWidth / 256
densityHeight = document.documentElement.clientHeight / 164
densityWidth = document.documentElement.clientWidth / pxWidth
densityHeight = document.documentElement.clientHeight / pxHeight
let widest = Math.max(densityWidth, densityHeight)