I couldn’t figure out a way to do this using only CSS. With that said, maybe I didn’t try hard enough either! I can imagine it may be possible to have one keyframe suddenly change the CSS variable colors and the gradient stop back to its original value! After I typed this out, I’m actually certain it is possible haha. I’ll see what I can do about it.
Changing the stripes isn’t smooth for, I’m guessing, custom CSS properties/variables aren’t animatable. I would need to create many more intermediate keyframes to have the value for --offset gradually change from 0px to 20px.
As for the colors, I tried to create a way to swap them. That doesn’t work. I wonder if it is simply not supported to have one CSS variable set to the value of another CSS variable. That doesn’t seem right, so I’m making a mistake somewhere.
My general idea was to have all of your initial rings start out as rings-as-circles that overlap each other, then have each one animate out to the edge. At the end of the animation you just reset everything.
Creating engaging and entertaining content for designers and developers since 1998.