Scramble the draft cover when the person starts over.
The sample also uses Button. One command adds them with this item:
draft-cover.tsx
ShuffleDissolve
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | — | The picture URL. Give src or source. |
| source | — | A picture the page already has: an <img>, a <canvas>, an ImageBitmap, or an OffscreenCanvas. | |
| alt | string | — | Names the picture for screen readers while it shows. |
| cross | """anonymous""use-credentials" | — | The CORS mode of a picture on another origin: the grains read its pixels. |
| fit | "contain""cover" | — | How the picture fills the box, as object-fit. Default cover. |
| grain | number | — | The side of one grain in CSS px. A very large box raises it, so the effect stays smooth. |
| dissolved | boolean | — | The picture is gone (controlled). true takes it apart; false brings it back. |
| restore | "instant""play" | — | How the picture comes back: play runs the effect backward, instant shows it at once. Default play. |
| progress | number | — | From 0 (whole) to 1 (gone): a gesture drives the effect and no clock runs. Leave it out to play. |
| seed | number | — | The same seed gives the same motion. Default: from the picture URL. |
| on | — | Called when the last grain has left (or the fade has ended). | |
| on | — | Called when the picture is whole again after a played return. | |
| origin | GrainOrigin | — | Where the effect starts. press is the last press in the picture. |
| spread | number | — | From 0 to 0.85: how much of the effect passes between the first grain that leaves and the last. |
| jitter | number | — | From 0 to 0.85: how much of each grain's start is random. |
| duration | number | — | How long the scramble takes, in ms. Default 1800. |
| amplitude | number | — | From 0 to 2: how high a grain arcs on its jump. 0 is a flat slide. Default 1. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |













