Dither Dissolve
remocn/dither-dissolveFreeComponent
A dithering shader transition that dissolves one scene into the next.
Install it
npx shadcn@latest add https://www.remocn.dev/r/dither-dissolve.jsonSource
1"use client";23import type {4 TransitionPresentation,5 TransitionPresentationComponentProps,6} from "@remotion/transitions";7import type React from "react";8import { AbsoluteFill, interpolate } from "remotion";9import { ShaderDithering } from "@/components/remocn/shader-dithering";1011const clampOpts = {12 extrapolateLeft: "clamp" as const,13 extrapolateRight: "clamp" as const,14};1516const coverEnvelope = (p: number) =>17 interpolate(p, [0, 0.3, 0.65, 1], [0, 1, 1, 0], clampOpts);1819const coverChildOpacity = (p: number, entering: boolean) =>20 entering21 ? interpolate(p, [0.58, 0.66], [0, 1], clampOpts)22 : interpolate(p, [0.28, 0.36], [1, 0], clampOpts);2324type DitherShape = NonNullable<25 React.ComponentProps<typeof ShaderDithering>["shape"]26>;2728export type DitherDissolveProps = {29 colorBack?: string;30 colorFront?: string;31 shape?: DitherShape;32 speed?: number;33};3435const DitherDissolvePresentation: React.FC<36 TransitionPresentationComponentProps<DitherDissolveProps>37> = ({38 children,39 presentationProgress,40 presentationDirection,41 passedProps,42}) => {43 const {44 colorBack = "#141318",45 colorFront = "#8f88ae",46 shape = "simplex",47 speed = 1.5,48 } = passedProps;49 const entering = presentationDirection === "entering";50 const p = presentationProgress;51 const size = interpolate(p, [0, 1], [1.6, 2.8], clampOpts);5253 return (54 <AbsoluteFill>55 <AbsoluteFill style={{ opacity: coverChildOpacity(p, entering) }}>56 {children}57 </AbsoluteFill>58 {entering ? (59 <AbsoluteFill60 style={{ opacity: coverEnvelope(p), pointerEvents: "none" }}61 >62 <ShaderDithering63 speed={speed}64 colorBack={colorBack}65 colorFront={colorFront}66 shape={shape}67 size={size}68 />69 </AbsoluteFill>70 ) : null}71 </AbsoluteFill>72 );73};7475export function ditherDissolve(76 props: DitherDissolveProps = {},77): TransitionPresentation<DitherDissolveProps> {78 return {79 component: DitherDissolvePresentation,80 props,81 };82}
What it pulls in
npm packages
Other registry items
Files it writes
More from remocn
All 282 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| UI Accordionaccordion | remocn | Components | Free | 1 dep · 2 files | |
| UI AI Prompt Flowai-prompt-flow | remocn | Components | Free | 1 dep | |
| UI Alert Dialogalert-dialog | remocn | Components | Free | 1 dep · 2 files | |
| Animated Bar Chartanimated-bar-chart | remocn | Components | Free | 1 dep | |
| Animated Line Chartanimated-line-chart | remocn | Components | Free | 1 dep | |
| ASCII Dissolveascii-dissolve | remocn | Components | Free | 2 deps | |
| ASCII Renderascii-render | remocn | Components | Free | 1 dep | |
| Backdropbackdrop | remocn | Components | Free | 1 dep |
