Skip to main content
CSS Tip

Add a Wobbling Animation to your Images

Use shape() and my fancy frames generator to create an infinite wobbling animation for images or any elements. It's a single-element implementation with simple code.

CSS-only woobling effect

img {
animation: shape 4s linear infinite;
}
@keyframes shape {
0%,to {clip-path: shape(/* from the generator */)}
33.3% {clip-path: shape(/* from the generator */)}
66.6% {clip-path: shape(/* from the generator */)}
}

All you have to do is fix the granularity, then generate three different shapes. The same granularity will ensure the same number of curves/points, allowing the browser to have a smooth transition between the shapes.

See the Pen Untitled by Temani Afif (@t_afif) on CodePen.


More CSS Tips