From 814c960afdc8b0e31583cc2748631fe16e6adc27 Mon Sep 17 00:00:00 2001 From: mzelder Date: Mon, 29 Jul 2024 21:17:41 +0200 Subject: [PATCH] updateforcommit --- .DS_Store | Bin 6148 -> 6148 bytes script.js | 23 +++-------------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/.DS_Store b/.DS_Store index b3b014a6d5efd055851893cc00ca5c5635bfb57d..a0c5856ee18e387ce7a50e26e4dae9adb235126e 100644 GIT binary patch delta 47 zcmZoMXffCj%*423atKo)w?uWdrJ1FUf{Cfo1{>8GHo#QV* E0Bpk#7ytkO diff --git a/script.js b/script.js index b3e1a19..8e2b9ab 100644 --- a/script.js +++ b/script.js @@ -29,7 +29,7 @@ document.addEventListener("DOMContentLoaded", () => { const fanHalfHeight = fanHeight / 2; // Create obstacles columns - createColumns(4); + createColumns(3); const lamp = document.querySelectorAll(".lamp"); const plant = document.querySelectorAll(".plant"); const lampHitBox = document.querySelectorAll(".lamp-hitbox"); @@ -75,7 +75,7 @@ document.addEventListener("DOMContentLoaded", () => { let distance = Math.sqrt(dx * dx + dy * dy); // Define a force multiplier (adjust as needed) - let forceMultiplier = 2; + let forceMultiplier = 5; // Calculate the potential new position of trash let newLeft = trash.offsetLeft - (dx / distance * forceMultiplier); @@ -88,7 +88,7 @@ document.addEventListener("DOMContentLoaded", () => { if (newTop >= margin && newTop + trash.offsetHeight <= bodyHeight - margin) { trash.style.top = newTop + "px"; } - }, 5); + }, 10); // Function to calculate fan angle and update its position function updateFanPositionAndAngle() { @@ -193,21 +193,4 @@ document.addEventListener("DOMContentLoaded", () => { }); }); } - - function getViewPort() { - return { - width: window.innerWidth, - height: window.innerHeight - }; - } - - function resizeElements() { - const { width, height } = getViewPort(); - - trash.style.width = `${width * trashSize}px`; - - fan.style.width = `${width * fanSize}vh`; - fan.style.height = `${height * fanSize}vh`; - - } });