Effects Fancy Stable

DatamoshTransition

.md

Page-transition overlay that looks like a corrupted video decode: a fixed grid of columns, narrow on the left and wide on the right, fills with flat blocks of saturated colour that fall, snap open through the middle of the frame and squeeze shut again; cover() drops the columns over the page right to left and reveal() lets them fall away, both as promises for any router's navigation hook

Preview

Installation

pnpm add fancy-ui-svelte
import { DatamoshTransition } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { DatamoshTransition } from 'fancy-ui-svelte';
</script>

<DatamoshTransition />

Examples

Basic Usage

Variants

Every cover shape, column sweep and palette preset.

Sunset

A vector trace of a sunset photo that sets into dusk. With the picture source on, the tiles decode the scene being left.

Props

PropTypeDefaultDescription
colors "broadcast" | "sunset" | "thermal" | "mono" | "acid" | string[]"broadcast"Palette preset or colour list, hex or rgb(); the lightest and darkest colours recur most often
variant "curtain" | "rise" | "split" | "interlace""curtain"Shape of the cover: drop from the top, climb from the bottom, open from the centre line, or alternate curtain and rise per column
sweep "right" | "left" | "center" | "edges" | "random""right"Order the columns move in: from the right, from the left, out from the middle, in from both sides, or a seeded shuffle
source string | HTMLImageElement | HTMLCanvasElement-Picture to decode: tiles take their colours from it, auto-levelled and saturated, instead of the palette; URLs must be same-origin or CORS-enabled
seed number1Seed for the colour order; same seed, same strip
columns number11Number of columns
power number1.65Column edge exponent: 1 is a uniform grid, higher widens the columns to the right
tiles number15Tiles per column stack, forced odd so one tile takes the centre
coverDuration number380Time for one column to cover, in ms
revealDuration number480Time for one column to clear, in ms
stagger number28Delay between neighbouring columns in ms, rightmost first
speed number1Speed of the falling tiles
contained booleanfalseFill the positioned parent instead of the viewport
zIndex number9999Stacking order of the overlay
phase "idle" | "covering" | "covered" | "revealing""idle"Current phase; bindable, read-only
oncovered () => void-Called once the page is fully covered
onrevealed () => void-Called once the page is fully revealed
ref HTMLDivElement | nullnullBindable overlay element
class string-Additional classes on the overlay