Paper Sticker
A taped paper chip that slaps onto the scene over two stop-motion poses, keeping a hand-placed tilt and per-pose wobble.
Source
components/kuchi/paper-sticker.tsx
1"use client";23import type React from "react";4import { useCurrentFrame } from "remotion";5import {6 DEFAULT_STEP,7 hashRange,8 paperJitter,9 steppedRamp,10} from "@/lib/kuchi/stop-motion";1112export interface PaperStickerProps {13 children: React.ReactNode;14 at?: number;15 seed?: string;16 padding?: string;17 background?: string;18 borderColor?: string;19 maxTilt?: number;20 step?: number;21}2223export function PaperSticker({24 children,25 at = 0,26 seed = "sticker",27 padding = "10px 16px",28 background = "#fbfaf6",29 borderColor = "rgba(38,36,44,0.55)",30 maxTilt = 2.6,31 step = DEFAULT_STEP,32}: PaperStickerProps) {33 const frame = useCurrentFrame();34 const progress = steppedRamp(frame, at, at + 2 * step, { step });35 if (progress === 0) return null;3637 const tilt = hashRange(`${seed}:rot`, -maxTilt, maxTilt);38 const jitter = paperJitter(frame, `sticker:${seed}`, {39 amp: 0.7,40 rotAmp: 0.2,41 step,42 });4344 return (45 <div46 style={{47 display: "inline-block",48 padding,49 background,50 border: `1px solid ${borderColor}`,51 borderRadius: 3,52 boxShadow: "0 2px 5px rgba(38,36,44,0.14)",53 translate: `${jitter.x}px ${jitter.y}px`,54 rotate: `${tilt + jitter.rot}deg`,55 scale: `${progress < 1 ? 1.12 : 1}`,56 }}57 >58 {children}59 </div>60 );61}









