Use CSS custom property for cleaner random animation delay

- Move animation-delay to CSS using custom property --random-delay
- JavaScript still required to generate random value (CSS has no random functions)
- Cleaner separation between styling (CSS) and logic (JavaScript)
- Maintains same functionality with better organization
This commit is contained in:
Glen Maddern 2025-06-21 13:58:11 +10:00
commit b33bde6b0e

View file

@ -13,4 +13,5 @@
.animated-hue-bg {
animation: hue-rotate 60s linear infinite;
animation-delay: var(--random-delay, 0s);
}