From aeafd99cf894c13d0e5727407da9c7f11a2f87ea Mon Sep 17 00:00:00 2001 From: yourfriendoss Date: Fri, 5 Dec 2025 21:17:29 +0200 Subject: [PATCH] fix edidy 88x31, make winter --- website/scripts/binkies.ts | 2 +- website/scripts/particles.ts | 84 ++++++++++++++++++++---------------- 2 files changed, 48 insertions(+), 38 deletions(-) diff --git a/website/scripts/binkies.ts b/website/scripts/binkies.ts index f98ec9d..beb3141 100644 --- a/website/scripts/binkies.ts +++ b/website/scripts/binkies.ts @@ -38,7 +38,7 @@ const binky = [ ["https://giikis2.nekoweb.org", "giikis2.png"], ["https://layercake.nekoweb.org", "layercake.gif"], ["https://yoyle.city", "yoyledotcity.png"], - ["https://prigoana.com/", "prigoana"], + ["https://prigoana.com/", "prigoana.png"], [ diff --git a/website/scripts/particles.ts b/website/scripts/particles.ts index 1d04fed..6910646 100644 --- a/website/scripts/particles.ts +++ b/website/scripts/particles.ts @@ -16,6 +16,8 @@ function getRandomArbitrary(min: number, max: number) { return Math.random() * (max - min) + min; } +const isWinter = (new Date()).getMonth() == 11; + class Particle { x: number; y: number; @@ -31,19 +33,15 @@ class Particle { this.id = Math.random(); this.angle = 2 * Math.PI * this.id; // trans flag colors - this.color = ["#5BCEFA", "#F5A9B8", "#FFFFFF"][ + + this.color = isWinter ? + ["#ecfffd", "#d0eceb", "#a0e6ec", "#94f2f4"][ + Math.floor(Math.random() * 4) + ] : ["#5BCEFA", "#F5A9B8", "#FFFFFF"][ Math.floor(Math.random() * 3) ]; - // random pastel color with HSL - /*this.color = - "hsl(" + - 360 * Math.random() + - "," + - (25 + 70 * Math.random()) + - "%," + - (85 + 10 * Math.random()) + - "%)";*/ - const characters = ["+", "⊹", ".", "-"] + + const characters = isWinter ? ["❅", "❆", "❃", "❊", "❉"] : ["+", "⊹", ".", "-"] this.style = characters[Math.floor(Math.random() * characters.length)]; } @@ -55,7 +53,7 @@ class Particle { renderSurfaceContext.save(); renderSurfaceContext.fillStyle = this.color; - renderSurfaceContext.font = Math.floor(this.id * 80) + "px Arial"; + renderSurfaceContext.font = Math.floor(this.id * (isWinter ? 30 : 80)) + "px Arial"; renderSurfaceContext.translate(this.x, this.y); renderSurfaceContext.rotate(2 * Math.PI * this.id); renderSurfaceContext.fillText(this.style, -width2 / 2, 4); @@ -88,33 +86,45 @@ setInterval((e) => { renderSurface.height = document.documentElement.scrollHeight; }, 1000); -let lastMoveTimestamp = 0; +if (isWinter) { + let X = Math.floor(Math.random() * document.documentElement.scrollWidth); -document.documentElement.addEventListener("mousemove", (event) => { - if (Date.now() - lastMoveTimestamp < 20) { - return; - } + setInterval(() => { + X = Math.floor(Math.random() * document.documentElement.scrollWidth); - lastMoveTimestamp = Date.now(); - const particle = new Particle(event.pageX, event.pageY); - particles.push(particle); -}); + const particle = new Particle(X, 0); + particles.push(particle); + }, 200) +} else { + let lastMoveTimestamp = 0; -document.documentElement.addEventListener( - "touchmove", - function (e) { - for (let i = 0; i < e.touches.length; i++) { - if (Date.now() - lastMoveTimestamp < 50) { - return; - } - lastMoveTimestamp = Date.now(); - const touch = e.touches.item(i); - if (!touch) return; - - const particle = new Particle(touch.pageX, touch.pageY); - particles.push(particle); + document.documentElement.addEventListener("mousemove", (event) => { + if (Date.now() - lastMoveTimestamp < 20) { + return; } - }, - false -); + + lastMoveTimestamp = Date.now(); + const particle = new Particle(event.pageX, event.pageY); + particles.push(particle); + }); + + document.documentElement.addEventListener( + "touchmove", + function (e) { + for (let i = 0; i < e.touches.length; i++) { + if (Date.now() - lastMoveTimestamp < 50) { + return; + } + + lastMoveTimestamp = Date.now(); + const touch = e.touches.item(i); + if (!touch) return; + + const particle = new Particle(touch.pageX, touch.pageY); + particles.push(particle); + } + }, + false + ); +}