From c44a3830145670652126cf8cddc1926d57cfcc44 Mon Sep 17 00:00:00 2001 From: David Haz Date: Fri, 18 Jul 2025 14:42:26 +0300 Subject: [PATCH] fix problems with chromagrid --- .../Components/ChromaGrid/ChromaGrid.vue | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/content/Components/ChromaGrid/ChromaGrid.vue b/src/content/Components/ChromaGrid/ChromaGrid.vue index 499b4d3..9185a3c 100644 --- a/src/content/Components/ChromaGrid/ChromaGrid.vue +++ b/src/content/Components/ChromaGrid/ChromaGrid.vue @@ -144,8 +144,10 @@ const handleCardClick = (url?: string) => { const handleCardMove = (e: MouseEvent) => { const c = e.currentTarget as HTMLElement; const rect = c.getBoundingClientRect(); - c.style.setProperty('--mouse-x', `${e.clientX - rect.left}px`); - c.style.setProperty('--mouse-y', `${e.clientY - rect.top}px`); + const x = e.clientX - rect.left; + const y = e.clientY - rect.top; + c.style.setProperty('--mouse-x', `${x}px`); + c.style.setProperty('--mouse-y', `${y}px`); }; const spotlightStyle = { @@ -183,11 +185,14 @@ const fadeStyle = {
-
- + +
+
+