Skip to content

Image reveal

A large image comes into view. The example uses a duration of 1000 ms, because a large element needs more time than a small one to look smooth.

Sunrise over the hills

Your system reduces motion, so the preview does not animate. The code still follows your choices.

Effect
Fine-tune
1000ms
0ms
Photo.jsx
import { Reveal } from "@awesome-reveal/react";
import { blur } from "@awesome-reveal/react/keyframes";
export function Photo({ src, alt, width, height, caption }) {
return (
<Reveal as="figure" className="photo" keyframes={blur()} duration={1000}>
<img src={src} alt={alt} width={width} height={height} loading="lazy" />
<figcaption>{caption}</figcaption>
</Reveal>
);
}

wipe and circle are custom keyframes: arrays that animate clip-path. The code puts each array in a constant next to the imports, so the markup stays short.

End the keyframes at a shape that shows the whole image, such as inset(0). Do not end them at {}. clip-path interpolates only between basic shapes, and its resting value none is not a basic shape. With {}, the image appears at once halfway through the animation.

blur, wipe and circle repaint the image on each frame in some engines. On a large image, test them on a slow device. If the animation stutters, use scale or fade.