update glare background gradient to use dynamic accent color
This commit is contained in:
parent
fcef393dd8
commit
f24e0de31b
@ -72,7 +72,9 @@ document.querySelectorAll('.card').forEach(card => {
|
|||||||
}
|
}
|
||||||
const gx = ((e.clientX - rect.left) / rect.width * 100).toFixed(1);
|
const gx = ((e.clientX - rect.left) / rect.width * 100).toFixed(1);
|
||||||
const gy = ((e.clientY - rect.top) / rect.height * 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 () {
|
card.addEventListener('mouseleave', function () {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user