From f24e0de31b5a275c32645821922c1369ddc08ec5 Mon Sep 17 00:00:00 2001 From: Fabian Schieder Date: Mon, 2 Mar 2026 21:34:11 +0100 Subject: [PATCH] update glare background gradient to use dynamic accent color --- assets/js/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/js/main.js b/assets/js/main.js index 8bf1ddc..b7c3ead 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -72,7 +72,9 @@ document.querySelectorAll('.card').forEach(card => { } const gx = ((e.clientX - rect.left) / rect.width * 100).toFixed(1); const gy = ((e.clientY - rect.top) / rect.height * 100).toFixed(1); - glare.style.background = `radial-gradient(circle at ${gx}% ${gy}%, rgba(255,255,255,0.12) 0%, transparent 65%)`; + + const accent = getComputedStyle(this).getPropertyValue('--accent').trim() || '#6366f1'; + glare.style.background = `radial-gradient(circle at ${gx}% ${gy}%, color-mix(in srgb, ${accent} 35%, white) 0%, transparent 65%)`; }); card.addEventListener('mouseleave', function () {