From 27c420d986804895f55169460542fdd01971cbd2 Mon Sep 17 00:00:00 2001 From: William Entriken Date: Tue, 5 Dec 2023 11:33:59 -0500 Subject: [PATCH] fix square hover --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 8aea8eac9..2d5edd759 100644 --- a/index.html +++ b/index.html @@ -123,8 +123,8 @@ const positionDiv = document.getElementById("position"); const tooltipDiv = document.getElementById("tooltip"); const whereToGoAnchor = document.getElementById("wheretogo"); - const x = Math.min(Math.max(Math.floor((e.clientX - theImage.x) / 10), 0), 99); - const y = Math.min(Math.max(Math.floor((e.clientY - theImage.y) / 10), 0), 99); + const x = Math.min(Math.max(Math.floor((e.clientX - theImage.x / 2) / 10), 0), 99); + const y = Math.min(Math.max(Math.floor((e.clientY - theImage.y / 2) / 10), 0), 99); const squareNumber = x + y * 100 + 1; positionDiv.style.left = x * 10 + "px"; positionDiv.style.top = y * 10 + "px"; @@ -151,7 +151,7 @@ // Animate the electric fence let fence = new Set(); let litUpEdge = new Set(); - let wasEverLitUp = new Set([1]); + let wasEverLitUp = new Set(); function lightUpFence(edge) { // Unlight old