Cool svg animation insight.
Hello dear front-end engineers,
Can you give me some insight on how this cool effect is implemented in nextjs.org.
7 Replies
probably a gif/video have you tried
to inspect it?
it's an svg with animated linear gradients
yes it is an svg with animated gradients.
The gradient part is pretty straightforward. I am curious about how do I animate the gradient.
i think they alter the coordinates using requestAnimationFrame
i dragged it into figma
I've managed to do a simple animation that kinda resembles to this with an svg element and Vanilla js
I control the x1 attribute in linearGradient using setTimeout:
nice but i highly recommend using requestAnimationFrame for animations
Thanks!! I'll check it out