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:
parent
433eac58f1
commit
b33bde6b0e
1 changed files with 2 additions and 1 deletions
|
|
@ -13,4 +13,5 @@
|
|||
|
||||
.animated-hue-bg {
|
||||
animation: hue-rotate 60s linear infinite;
|
||||
animation-delay: var(--random-delay, 0s);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue