From 367c84466937c2c1a1f251875a396cc1cc819d22 Mon Sep 17 00:00:00 2001 From: 8BitBiscotti Date: Thu, 12 Dec 2024 13:50:04 +0100 Subject: [PATCH] made synthwave pixelated --- globalScript.js | 10 +++ index.html | 2 +- loadingScreen.js | 7 +- navBar.css | 1 + pxDensity.js | 4 +- synthwaveEffect.js | 178 +++++++++++++++++++++++++++++++++++---------- 6 files changed, 160 insertions(+), 42 deletions(-) diff --git a/globalScript.js b/globalScript.js index aac365f..8013bcd 100644 --- a/globalScript.js +++ b/globalScript.js @@ -13,6 +13,16 @@ function randomInt(min, max) { } +function clampNearest(n, mul) { + if(n > 0) + return Math.ceil(n / mul) * mul; + else if( n < 0) + return Math.floor(n / mul) * mul; + else + return 0; +} + + function showGrid() { let canvasEl = document.createElement("canvas") canvasEl.width = window.innerWidth diff --git a/index.html b/index.html index eba2bc3..0264a37 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ - +