update glare background gradient to use dynamic accent color

This commit is contained in:
Fabian Schieder 2026-03-02 21:34:11 +01:00
parent fcef393dd8
commit f24e0de31b

View File

@ -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 () {