Cloud Reveal
v1.0.0An image hidden under drifting mist. The pointer clears a soft hole that grows while it stays and closes again when it leaves. Shows the plain image under reduced motion.
Installation
Run once in your project root to configure paths and dependencies:
npx vectorvesper initDownloads and registers the component in your project:
npx vectorvesper add cloud-revealIf installing manually or managing your package lock:
npm install @vectorvesper/motion threeUsage
A hero that makes the visitor look for the picture: a launch reveal, a teaser, an editorial cover. Set the mist to your page colour so the image seems to sit under the page itself.
Import
Usage
Do
- Match color to the background around it, so the mist reads as part of the page.
- Lower opacity to let a faint version of the image show through before anyone points at it.
Don't
- Do not put essential content only in the image: until someone points at it, the mist hides it.
WebGL — render it on the client only
On Next.js, load it with ssr: false from a Client Component, as below. Vite apps need nothing extra.
prefers-reduced-motion and provides a graceful fallback.Props
An image hidden under drifting mist. The pointer clears a soft, ragged hole that grows while it stays and closes again when it leaves.
<CloudReveal />
The image and the mist over it. Fills the area, which is 100svh tall unless you size it.
| Prop | Type | Default | Description |
|---|---|---|---|
src* | string | — | The image under the mist. It fills the area the way `object-fit: cover` does. |
alt* | string | — | What the image shows, for screen readers. |
position | string | "50% 50%" | Which part of the image stays in view when it is cropped, as CSS `object-position`. |
color | string | "#f4f3f0" | The colour of the mist. |
opacity | number | 1 | How much of the image the mist hides, 0 to 1. |
radius | number | 0.3 | The size of the opening, as a share of the height. |
softness | number | 0.1 | How soft the opening's edge is. |
roughness | number | 0.15 | How ragged the opening's edge is. |
scale | number | 4 | How fine the mist's grain is. |
speed | number | 0.5 | How fast the mist drifts. |
distortion | number | 0 | How much the image ripples around the opening. |
className | string | — | Sizes the area. Without a height it is 100svh tall. |
style | React.CSSProperties | — | Inline styles for the area. A height here wins over the default. |
children | React.ReactNode | — | Content drawn over the mist. |