The trick here was creating a function that takes GSAP eases and converts them to CSS linear() π₯
A flicker effect is a GSAP RoughEase that gets converted π¨βπ¬
Once you generate different custom easings, you can drop them in and use them elsewhere π€
Flicker effects with modern CSS in 2024 π
1. Animate opacity
2. Use custom linear() timing π₯
:root { --flicker: linear(0 0% 0.5%, 0.1723 0.7925% ... ); }
.flicker {
animation: dim 4s infinite var(--flicker) alternate;
}
@βkeyframes dim { opacity: 0.25; }