From 77d866f3c9e854f196b72c8b5bb854de2a18de69 Mon Sep 17 00:00:00 2001 From: Sangelo Date: Tue, 11 Jun 2024 23:37:17 +0200 Subject: [PATCH] [c] debug change to red on hover and not always --- src/lib/modules/ModCards.svelte | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/modules/ModCards.svelte b/src/lib/modules/ModCards.svelte index a815bd0..b75c7c9 100644 --- a/src/lib/modules/ModCards.svelte +++ b/src/lib/modules/ModCards.svelte @@ -17,11 +17,15 @@ function checkOverflow() { const modCards = document.querySelectorAll('.mod-card'); modCards.forEach((modCard) => { - if (modCard.scrollHeight > modCard.offsetHeight) { - modCard.style.backgroundColor = 'red'; - } else { + modCard.addEventListener('mouseover', () => { + if (modCard.scrollHeight > modCard.offsetHeight) { + modCard.style.backgroundColor = 'red'; + } + }); + + modCard.addEventListener('mouseout', () => { modCard.style.backgroundColor = ''; - } + }); }); }