Reel
A fixed centered card where images stack on the z-axis and each blooms open over the last via a centre-out mask.
Source
components/kuchi/reel.tsx
1"use client";23import {4 AbsoluteFill,5 Easing,6 Img,7 interpolate,8 useCurrentFrame,9 useVideoConfig,10} from "remotion";1112const clamp = {13 extrapolateLeft: "clamp" as const,14 extrapolateRight: "clamp" as const,15};16const EASE_OUT = Easing.out(Easing.cubic);1718export type ReelProps = {19 images?: string[];20 width?: number;21 height?: number;22 radius?: number;23 step?: number;24 reveal?: number;25 objectPosition?: string;26 background?: string;27};2829export function Reel({30 images = ["https://kuchi-media.kalarislabs.com/components/art/art-01.svg", "https://kuchi-media.kalarislabs.com/components/art/art-04.svg", "https://kuchi-media.kalarislabs.com/components/art/art-07.svg", "https://kuchi-media.kalarislabs.com/components/art/art-10.svg"],31 width = 1180,32 height = 676,33 radius = 16,34 step = 20,35 reveal = 13,36 objectPosition = "top",37 background = "#050506",38}: ReelProps) {39 const frame = useCurrentFrame();40 const { width: compWidth, height: compHeight } = useVideoConfig();41 const left = (compWidth - width) / 2;42 const top = (compHeight - height) / 2;4344 return (45 <AbsoluteFill>46 {images.map((src, i) => {47 const p = interpolate(frame, [i * step, i * step + reveal], [0, 1], {48 ...clamp,49 easing: EASE_OUT,50 });51 if (p <= 0) return null;52 const inset = (1 - p) * 50;53 const imgScale = interpolate(p, [0, 1], [1.08, 1], clamp);54 return (55 <div56 key={i}57 style={{58 position: "absolute",59 left,60 top,61 width,62 height,63 zIndex: i,64 clipPath: `inset(${inset}% ${inset}% round ${radius}px)`,65 WebkitClipPath: `inset(${inset}% ${inset}% round ${radius}px)`,66 background,67 boxShadow: "0 30px 80px rgba(0,0,0,0.6)",68 willChange: "clip-path",69 }}70 >71 <Img72 src={src}73 style={{74 width: "100%",75 height: "100%",76 objectFit: "cover",77 objectPosition,78 scale: `${imgScale}`,79 willChange: "transform",80 }}81 />82 <div83 style={{84 position: "absolute",85 inset: 0,86 borderRadius: radius,87 border: "1px solid rgba(255,255,255,0.08)",88 }}89 />90 </div>91 );92 })}93 </AbsoluteFill>94 );95}









