Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "disc-pop",
"title": "Disc Pop",
"description": "A disc pops open from a play button into a full video player scene.",
"dependencies": [
"remotion",
"@remotion/google-fonts",
"@remotion/transitions"
],
"registryDependencies": ["@remocn/gsh"],
"files": [
{
"path": "registry/remocn/disc-pop/index.tsx",
"content": "\"use client\";\n\nimport { loadFont as loadFigtree } from \"@remotion/google-fonts/Figtree\";\nimport { loadFont as loadGeistMono } from \"@remotion/google-fonts/GeistMono\";\nimport { loadFont as loadSerif } from \"@remotion/google-fonts/InstrumentSerif\";\nimport {\n linearTiming,\n type TransitionPresentation,\n type TransitionPresentationComponentProps,\n TransitionSeries,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n random,\n spring,\n staticFile,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport type { GradientParams } from \"@/lib/remocn/gsh/gradient-engine\";\nimport { GshGround } from \"@/lib/remocn/gsh/gsh-ground\";\nimport type { GshPresetId } from \"@/lib/remocn/gsh/presets\";\n\nconst figtree = loadFigtree(\"normal\", {\n weights: [\"300\", \"400\"],\n subsets: [\"latin\"],\n});\nconst mono = loadGeistMono(\"normal\", { weights: [\"400\"], subsets: [\"latin\"] });\nconst serif = loadSerif(\"normal\", { weights: [\"400\"], subsets: [\"latin\"] });\n\nconst CLAMP = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n} as const;\n\nexport type DiscGlyph =\n | \"play\"\n | \"spark\"\n | \"plus\"\n | \"arrow\"\n | \"note\"\n | \"cursor\"\n | \"check\"\n | \"wave\";\n\nexport type DiscPopProps = {\n colors?: string[];\n glyphColors?: string[];\n glyphs?: DiscGlyph[];\n cell?: number;\n seed?: string;\n swap?: number;\n};\n\nexport const discPopDefaults: Required<DiscPopProps> = {\n colors: [\"#FF5A1F\", \"#B7A6FF\", \"#2F6BFF\", \"#F2EDE4\"],\n glyphColors: [\"#9E2A06\", \"#5A44C4\", \"#0B2D8F\", \"#1A1814\"],\n glyphs: [\"play\", \"spark\", \"note\", \"arrow\", \"plus\", \"cursor\", \"wave\", \"check\"],\n cell: 0.46,\n seed: \"disc\",\n swap: 0.46,\n};\n\nconst GLYPH_PATHS: Record<DiscGlyph, React.ReactNode> = {\n play: <path d=\"M8 5.5v13l10.5-6.5z\" fill=\"currentColor\" />,\n spark: (\n <path\n d=\"M12 2.5c.8 5.6 3.3 8.1 9 9-5.7.9-8.2 3.4-9 9-.8-5.6-3.3-8.1-9-9 5.7-.9 8.2-3.4 9-9z\"\n fill=\"currentColor\"\n />\n ),\n plus: (\n <path\n d=\"M12 4v16M4 12h16\"\n stroke=\"currentColor\"\n strokeWidth={2.6}\n strokeLinecap=\"round\"\n fill=\"none\"\n />\n ),\n arrow: (\n <path\n d=\"M7 17L17 7M9 7h8v8\"\n stroke=\"currentColor\"\n strokeWidth={2.4}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n ),\n note: (\n <path\n d=\"M9 17.5V5.5l10-2v12M9 17.5a2.75 2.75 0 11-5.5 0 2.75 2.75 0 015.5 0zM19 15.5a2.75 2.75 0 11-5.5 0 2.75 2.75 0 015.5 0z\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n ),\n cursor: (\n <path\n d=\"M5.5 3.5l13 7.2-5.8 1.6-2.6 5.6z\"\n fill=\"currentColor\"\n strokeLinejoin=\"round\"\n />\n ),\n check: (\n <path\n d=\"M4.5 12.5l5 5 10-11\"\n stroke=\"currentColor\"\n strokeWidth={2.6}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n ),\n wave: (\n <path\n d=\"M3 12h2.5M7.5 8v8M11.5 4.5v15M15.5 8.5v7M19.5 11v2\"\n stroke=\"currentColor\"\n strokeWidth={2.4}\n strokeLinecap=\"round\"\n fill=\"none\"\n />\n ),\n};\n\ntype Disc = {\n x: number;\n y: number;\n r: number;\n color: number;\n glyph: number;\n inAt: number;\n outRank: number;\n tilt: number;\n};\n\nfunction layoutDiscs(W: number, H: number, props: Required<DiscPopProps>) {\n const target = Math.min(W, H) * props.cell;\n const cols = Math.max(2, Math.round(W / target));\n const rows = Math.max(2, Math.round(H / target));\n const cw = W / cols;\n const ch = H / rows;\n const half = Math.hypot(cw, ch) / 2;\n const jx = cw * 0.14;\n const jy = ch * 0.14;\n const discs: Disc[] = [];\n for (let r = 0; r < rows; r++) {\n for (let c = 0; c < cols; c++) {\n const i = r * cols + c;\n const ox = (random(`${props.seed}-x-${i}`) - 0.5) * 2 * jx;\n const oy = (random(`${props.seed}-y-${i}`) - 0.5) * 2 * jy;\n discs.push({\n x: (c + 0.5) * cw + ox,\n y: (r + 0.5) * ch + oy,\n r:\n (half + Math.hypot(jx, jy)) *\n (1.04 + random(`${props.seed}-r-${i}`) * 0.2),\n color: (i * 3 + r) % props.colors.length,\n glyph: i % props.glyphs.length,\n inAt: random(`${props.seed}-o-${i}`),\n outRank: 0,\n tilt: (random(`${props.seed}-t-${i}`) - 0.5) * 40,\n });\n }\n }\n const byIn = [...discs].sort((a, b) => a.inAt - b.inAt);\n byIn.forEach((d, k) => {\n d.inAt = k;\n });\n const byOut = [...discs].sort(\n (a, b) =>\n Math.hypot(a.x - W / 2, a.y - H / 2) -\n Math.hypot(b.x - W / 2, b.y - H / 2),\n );\n byOut.forEach((d, k) => {\n d.outRank = k;\n });\n return byIn;\n}\n\nconst POP = { mass: 0.5, damping: 12, stiffness: 200 };\nconst EXIT = Easing.bezier(0.55, 0, 1, 0.45);\n\nfunction Discs({\n p,\n duration,\n props,\n}: {\n p: number;\n duration: number;\n props: Required<DiscPopProps>;\n}) {\n const { width: W, height: H, fps } = useVideoConfig();\n const discs = layoutDiscs(W, H, props);\n const n = discs.length;\n const frame = p * duration;\n const swapFrame = props.swap * duration;\n const inWindow = Math.max(1, swapFrame - 5);\n const outStart = props.swap + 0.02;\n const outSpan = 0.97 - outStart;\n const outLen = 0.15;\n return (\n <AbsoluteFill style={{ overflow: \"hidden\" }}>\n {discs.map((d) => {\n const start = (d.inAt / Math.max(1, n - 1)) * inWindow;\n const s = spring({ frame: frame - start, fps, config: POP });\n const o0 =\n outStart + (d.outRank / Math.max(1, n - 1)) * (outSpan - outLen);\n const q = interpolate(p, [o0, o0 + outLen], [0, 1], CLAMP);\n const out =\n q < 0.25\n ? 1 + Math.sin((q / 0.25) * (Math.PI / 2)) * 0.05\n : 1.05 * (1 - EXIT((q - 0.25) / 0.75));\n const scale = s * (q > 0 ? out : 1);\n if (scale <= 0.001) return null;\n const size = d.r * 2;\n const glyphSize = d.r * 0.42;\n return (\n <div\n key={`${d.x}-${d.y}`}\n style={{\n position: \"absolute\",\n left: d.x - d.r,\n top: d.y - d.r,\n width: size,\n height: size,\n borderRadius: \"50%\",\n background: props.colors[d.color],\n transform: `scale(${scale})`,\n display: \"grid\",\n placeItems: \"center\",\n boxShadow: `0 ${glyphSize * 0.12}px ${glyphSize * 0.5}px rgba(0,0,0,0.18)`,\n }}\n >\n <svg\n viewBox=\"0 0 24 24\"\n width={glyphSize}\n height={glyphSize}\n style={{\n color: props.glyphColors[d.color % props.glyphColors.length],\n transform: `rotate(${(d.tilt * (1 - Math.min(1, s))).toFixed(2)}deg)`,\n }}\n aria-hidden\n >\n {GLYPH_PATHS[props.glyphs[d.glyph]]}\n </svg>\n </div>\n );\n })}\n </AbsoluteFill>\n );\n}\n\nconst DiscPopPresentation: React.FC<\n TransitionPresentationComponentProps<DiscPopProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n presentationDurationInFrames,\n passedProps,\n}) => {\n const props = { ...discPopDefaults, ...passedProps };\n const p = presentationProgress;\n\n if (presentationDirection === \"exiting\") {\n const shrink = interpolate(p, [0, props.swap], [1, 0.95], {\n ...CLAMP,\n easing: Easing.bezier(0.55, 0, 1, 0.45),\n });\n return (\n <AbsoluteFill\n style={{\n opacity: p < props.swap ? 1 : 0,\n transform: `scale(${shrink})`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n }\n\n const settle = interpolate(p, [props.swap, 1], [1.05, 1], {\n ...CLAMP,\n easing: Easing.bezier(0.22, 1, 0.36, 1),\n });\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n opacity: p >= props.swap ? 1 : 0,\n transform: `scale(${settle})`,\n }}\n >\n {children}\n </AbsoluteFill>\n {p > 0 && p < 1 ? (\n <Discs\n p={p}\n duration={Math.max(1, presentationDurationInFrames)}\n props={props}\n />\n ) : null}\n </AbsoluteFill>\n );\n};\n\nexport function discPop(\n props: DiscPopProps = {},\n): TransitionPresentation<DiscPopProps> {\n return { component: DiscPopPresentation, props };\n}\n\ntype Theme = \"dark\" | \"light\";\n\nconst T = {\n dark: {\n ink: \"#F1F0F5\",\n muted: \"rgba(241,240,245,0.58)\",\n faint: \"rgba(241,240,245,0.34)\",\n card: \"rgba(20,19,26,0.86)\",\n raised: \"rgba(255,255,255,0.05)\",\n line: \"rgba(255,255,255,0.09)\",\n highlight: \"inset 0 1px 0 rgba(255,255,255,0.07)\",\n shadow:\n \"0 1px 2px rgba(0,0,0,0.35), 0 12px 32px rgba(0,0,0,0.35), 0 40px 80px rgba(0,0,0,0.3)\",\n accent: \"#FF5A1F\",\n groundA: \"nightfold\" as GshPresetId,\n groundB: \"europa\" as GshPresetId,\n },\n light: {\n ink: \"#18171C\",\n muted: \"rgba(24,23,28,0.56)\",\n faint: \"rgba(24,23,28,0.36)\",\n card: \"rgba(255,255,255,0.94)\",\n raised: \"rgba(24,23,28,0.04)\",\n line: \"rgba(24,23,28,0.09)\",\n highlight: \"inset 0 1px 0 rgba(255,255,255,1)\",\n shadow:\n \"0 1px 2px rgba(20,20,30,0.06), 0 10px 28px rgba(20,20,30,0.08), 0 32px 64px rgba(20,20,30,0.08)\",\n accent: \"#FF5A1F\",\n groundA: \"paper-crease\" as GshPresetId,\n groundB: \"glasswork\" as GshPresetId,\n },\n};\n\nconst A_BEATS = { greet: -5, card: 1, typeFrom: 10, typeCps: 3, send: 45 };\nconst B_BEATS = { toolbar: 12, title: 18, bar: 18 };\n\nfunction Stroke({\n d,\n size,\n color,\n fill,\n}: {\n d: string;\n size: number;\n color: string;\n fill?: boolean;\n}) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill={fill ? color : \"none\"}\n stroke={fill ? \"none\" : color}\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n >\n <path d={d} />\n </svg>\n );\n}\n\nconst UI_ICONS = {\n plus: \"M12 5v14M5 12h14\",\n chevron: \"M7 10l5 5 5-5\",\n mic: \"M12 4a2.5 2.5 0 012.5 2.5v5a2.5 2.5 0 01-5 0v-5A2.5 2.5 0 0112 4zM6.5 11a5.5 5.5 0 0011 0M12 16.5V20\",\n send: \"M12 19V5M6 11l6-6 6 6\",\n file: \"M7 3.5h6.5L18 8v12.5H7zM13.5 3.5V8H18\",\n close: \"M7 7l10 10M17 7L7 17\",\n play: \"M8 5.5v13l10.5-6.5z\",\n volume: \"M4 9.5h3.5L12 5.5v13l-4.5-4H4zM15.5 9a4 4 0 010 6\",\n export: \"M12 15V4M7.5 8.5L12 4l4.5 4.5M5 14v5.5h14V14\",\n sliders: \"M5 7h9M18 7h1M5 17h3M12 17h7M16 5v4M10 15v4\",\n};\n\nfunction PromptScene({\n theme,\n greeting,\n prompt,\n ground,\n groundParams,\n}: {\n theme: Theme;\n greeting: [string, string];\n prompt: string;\n ground?: GshPresetId;\n groundParams?: Partial<GradientParams>;\n}) {\n const frame = useCurrentFrame();\n const { width: W, height: H, fps, durationInFrames } = useVideoConfig();\n const c = T[theme];\n const tall = H > W;\n const u = tall ? W / 760 : H / 640;\n const cardW = tall ? W * 0.86 : Math.min(W * 0.58, 780 * u);\n const greet = spring({\n frame: frame - A_BEATS.greet,\n fps,\n config: { mass: 0.8, damping: 18, stiffness: 160 },\n });\n const card = spring({\n frame: frame - A_BEATS.card,\n fps,\n config: { mass: 1, damping: 26, stiffness: 120 },\n });\n const chars = Math.floor(\n Math.max(0, frame - A_BEATS.typeFrom) * A_BEATS.typeCps,\n );\n const typed = prompt.slice(0, chars);\n const caretOn = chars < prompt.length || Math.floor(frame / 8) % 2 === 0;\n const press = spring({\n frame: frame - A_BEATS.send,\n fps,\n config: { mass: 0.5, damping: 12, stiffness: 200 },\n });\n const pressScale =\n frame < A_BEATS.send\n ? 1\n : 1 - Math.sin(Math.min(1, press) * Math.PI) * 0.12;\n const push = interpolate(frame, [0, durationInFrames], [1, 1.04], CLAMP);\n const text: React.CSSProperties = {\n fontFamily: figtree.fontFamily,\n fontWeight: 400,\n color: c.ink,\n };\n return (\n <AbsoluteFill>\n <GshGround\n preset={ground ?? c.groundA}\n params={groundParams}\n timeOffset={3}\n timeScale={0.5}\n />\n <AbsoluteFill\n style={{\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: 34 * u,\n transform: `scale(${push})`,\n }}\n >\n <div\n style={{\n ...text,\n fontWeight: 300,\n fontSize: (tall ? 64 : 54) * u,\n letterSpacing: \"-0.035em\",\n lineHeight: 1.06,\n textAlign: \"center\",\n transform: `translateY(${(1 - greet) * 24 * u}px)`,\n opacity: Math.min(1, greet * 1.4),\n filter: `blur(${(Math.max(0, 1 - greet) * 6).toFixed(2)}px)`,\n }}\n >\n {greeting[0]}\n <br />\n {greeting[1]}\n <span style={{ color: c.accent }}>.</span>\n </div>\n <div\n style={{\n width: cardW,\n borderRadius: 18 * u,\n background: c.card,\n border: `1px solid ${c.line}`,\n boxShadow: `${c.highlight}, ${c.shadow}`,\n padding: 16 * u,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 14 * u,\n transform: `translateY(${(1 - card) * 40 * u}px) scale(${0.97 + card * 0.03})`,\n opacity: Math.min(1, card * 1.5),\n }}\n >\n <div\n style={{\n alignSelf: \"flex-start\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 10 * u,\n padding: `${7 * u}px ${10 * u}px`,\n borderRadius: 10 * u,\n border: `1px solid ${c.line}`,\n background: c.raised,\n }}\n >\n <div\n style={{\n width: 30 * u,\n height: 30 * u,\n borderRadius: 7 * u,\n background: \"linear-gradient(140deg, #ff8a4c, #ff5a1f)\",\n display: \"grid\",\n placeItems: \"center\",\n }}\n >\n <Stroke d={UI_ICONS.file} size={16 * u} color=\"#fff\" />\n </div>\n <div\n style={{ display: \"flex\", flexDirection: \"column\", gap: 2 * u }}\n >\n <span style={{ ...text, fontSize: 14 * u }}>brand-kit.zip</span>\n <span style={{ ...text, fontSize: 12 * u, color: c.faint }}>\n Logo, colours, 6 shots\n </span>\n </div>\n <Stroke d={UI_ICONS.close} size={14 * u} color={c.faint} />\n </div>\n <div\n style={{\n ...text,\n fontSize: 19 * u,\n lineHeight: 1.45,\n minHeight: 19 * u * 1.45 * 2,\n letterSpacing: \"-0.005em\",\n }}\n >\n {typed}\n <span\n style={{\n display: \"inline-block\",\n width: 2 * u,\n height: 19 * u * 1.15,\n marginLeft: 2 * u,\n verticalAlign: \"text-bottom\",\n background: c.accent,\n opacity: caretOn ? 1 : 0,\n }}\n />\n </div>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 14 * u }}>\n <Stroke d={UI_ICONS.plus} size={18 * u} color={c.muted} />\n <span style={{ ...text, fontSize: 14 * u, color: c.muted }}>\n Model\n </span>\n <Stroke d={UI_ICONS.chevron} size={13 * u} color={c.faint} />\n <div style={{ flex: 1 }} />\n <span style={{ ...text, fontSize: 14 * u, color: c.muted }}>\n Film\n </span>\n <Stroke d={UI_ICONS.chevron} size={13 * u} color={c.faint} />\n <Stroke d={UI_ICONS.mic} size={18 * u} color={c.muted} />\n <div\n style={{\n width: 34 * u,\n height: 34 * u,\n borderRadius: 9 * u,\n background: c.accent,\n display: \"grid\",\n placeItems: \"center\",\n transform: `scale(${pressScale})`,\n boxShadow: \"0 4px 14px rgba(255,90,31,0.35)\",\n }}\n >\n <Stroke d={UI_ICONS.send} size={17 * u} color=\"#fff\" />\n </div>\n </div>\n </div>\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n\nfunction PlayerScene({\n theme,\n image,\n overline,\n title,\n ground,\n groundParams,\n}: {\n theme: Theme;\n image: string;\n overline: string;\n title: string;\n ground?: GshPresetId;\n groundParams?: Partial<GradientParams>;\n}) {\n const frame = useCurrentFrame();\n const { width: W, height: H, fps, durationInFrames } = useVideoConfig();\n const c = T[theme];\n const tall = H > W;\n const u = tall ? W / 760 : H / 640;\n const cardW = tall ? W * 0.84 : Math.min(W * 0.62, H * 1.1);\n const cardH = tall ? H * 0.6 : cardW * 0.56;\n const bar = spring({\n frame: frame - B_BEATS.toolbar,\n fps,\n config: { mass: 0.5, damping: 12, stiffness: 200 },\n });\n const words = title.split(\" \");\n const progress = interpolate(\n frame,\n [B_BEATS.bar, durationInFrames],\n [0.04, 0.42],\n CLAMP,\n );\n const push = interpolate(frame, [0, durationInFrames], [1, 1.035], CLAMP);\n const imgDrift = interpolate(\n frame,\n [0, durationInFrames],\n [1.08, 1.0],\n CLAMP,\n );\n const text: React.CSSProperties = {\n fontFamily: figtree.fontFamily,\n fontWeight: 400,\n color: c.ink,\n };\n const chip: React.CSSProperties = {\n ...text,\n display: \"flex\",\n alignItems: \"center\",\n gap: 7 * u,\n fontSize: 14 * u,\n padding: `${7 * u}px ${12 * u}px`,\n borderRadius: 9 * u,\n border: `1px solid ${c.line}`,\n background: c.card,\n boxShadow: c.highlight,\n };\n return (\n <AbsoluteFill>\n <GshGround\n preset={ground ?? c.groundB}\n params={groundParams}\n timeOffset={5}\n timeScale={0.5}\n />\n <AbsoluteFill\n style={{\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: 16 * u,\n transform: `scale(${push})`,\n }}\n >\n <div\n style={{\n width: cardW,\n display: \"flex\",\n gap: 10 * u,\n transform: `translateY(${(1 - bar) * 14 * u}px)`,\n opacity: Math.min(1, bar * 1.5),\n }}\n >\n <div style={chip}>16:9</div>\n <div style={chip}>\n <Stroke d={UI_ICONS.sliders} size={15 * u} color={c.muted} />\n Change details\n </div>\n <div style={{ flex: 1 }} />\n <div\n style={{\n ...chip,\n background: theme === \"dark\" ? \"#F1F0F5\" : \"#18171C\",\n color: theme === \"dark\" ? \"#18171C\" : \"#F1F0F5\",\n border: \"none\",\n }}\n >\n <Stroke\n d={UI_ICONS.export}\n size={15 * u}\n color={theme === \"dark\" ? \"#18171C\" : \"#F1F0F5\"}\n />\n Export\n </div>\n </div>\n <div\n style={{\n width: cardW,\n height: cardH,\n borderRadius: 16 * u,\n overflow: \"hidden\",\n position: \"relative\",\n boxShadow: `0 0 0 1px ${c.line}, ${c.shadow}`,\n }}\n >\n <Img\n src={image}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n transform: `scale(${imgDrift})`,\n }}\n />\n <AbsoluteFill\n style={{\n background:\n \"linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,0.55) 100%)\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: 28 * u,\n right: 28 * u,\n bottom: 64 * u,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8 * u,\n }}\n >\n <span\n style={{\n fontFamily: mono.fontFamily,\n fontSize: 13 * u,\n letterSpacing: \"0.14em\",\n color: \"rgba(255,255,255,0.72)\",\n }}\n >\n {overline}\n </span>\n <div\n style={{\n fontFamily: serif.fontFamily,\n fontWeight: 400,\n fontSize: (tall ? 76 : 58) * u,\n lineHeight: 1,\n letterSpacing: \"-0.02em\",\n color: \"#fff\",\n }}\n >\n {words.map((w, i) => {\n const s = spring({\n frame: frame - B_BEATS.title - i * 3,\n fps,\n config: { mass: 0.8, damping: 18, stiffness: 160 },\n });\n return (\n <span\n key={`${w}-${i}`}\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n paddingBottom: \"0.1em\",\n marginBottom: \"-0.1em\",\n verticalAlign: \"bottom\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n transform: `translateY(${(1 - s) * 100}%)`,\n }}\n >\n {w}\n {i < words.length - 1 ? \" \" : \"\"}\n </span>\n </span>\n );\n })}\n </div>\n </div>\n <div\n style={{\n position: \"absolute\",\n left: 24 * u,\n right: 24 * u,\n bottom: 18 * u,\n display: \"flex\",\n alignItems: \"center\",\n gap: 14 * u,\n }}\n >\n <Stroke d={UI_ICONS.play} size={18 * u} color=\"#fff\" fill />\n <Stroke d={UI_ICONS.volume} size={18 * u} color=\"#fff\" />\n <span\n style={{\n fontFamily: mono.fontFamily,\n fontSize: 13 * u,\n color: \"rgba(255,255,255,0.8)\",\n }}\n >\n 0:0{Math.min(9, Math.floor(progress * 12))} / 0:12\n </span>\n <div\n style={{\n flex: 1,\n height: 3 * u,\n borderRadius: 3 * u,\n background: \"rgba(255,255,255,0.25)\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: `${progress * 100}%`,\n borderRadius: 3 * u,\n background: \"#fff\",\n }}\n />\n </div>\n </div>\n </div>\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n\nexport type DiscPopDemoProps = {\n theme?: Theme;\n greeting?: [string, string];\n prompt?: string;\n image?: string;\n overline?: string;\n title?: string;\n discs?: DiscPopProps;\n groundA?: GshPresetId;\n groundAParams?: Partial<GradientParams>;\n groundB?: GshPresetId;\n groundBParams?: Partial<GradientParams>;\n sceneA?: number;\n sceneB?: number;\n transition?: number;\n};\n\nexport const DISC_POP_DEMO = { sceneA: 84, sceneB: 84, transition: 30 };\n\nconst LIGHT_DISCS: DiscPopProps = {\n colors: [\"#FF5A1F\", \"#C7B9FF\", \"#2F6BFF\", \"#18171C\"],\n glyphColors: [\"#FFE1D2\", \"#4B36B8\", \"#D9E4FF\", \"#F2EDE4\"],\n};\n\nexport function DiscPopDemo({\n theme = \"dark\",\n greeting = [\"Hi there.\", \"What are you launching\"],\n prompt = \"Make a launch film for our piano app: bold title, three product shots, calm ending.\",\n image = staticFile(\"templates/product-showcase/gallery.jpg\"),\n overline = \"LAUNCH FILM · 01\",\n title = \"Keys, in an afternoon.\",\n discs,\n groundA,\n groundAParams,\n groundB,\n groundBParams,\n sceneA = DISC_POP_DEMO.sceneA,\n sceneB = DISC_POP_DEMO.sceneB,\n transition = DISC_POP_DEMO.transition,\n}: DiscPopDemoProps) {\n const presentation = discPop({\n ...(theme === \"light\" ? LIGHT_DISCS : {}),\n ...discs,\n });\n return (\n <AbsoluteFill\n style={{ backgroundColor: theme === \"light\" ? \"#eeece8\" : \"#07060c\" }}\n >\n <TransitionSeries>\n <TransitionSeries.Sequence durationInFrames={sceneA}>\n <PromptScene\n theme={theme}\n greeting={greeting}\n prompt={prompt}\n ground={groundA}\n groundParams={groundAParams}\n />\n </TransitionSeries.Sequence>\n <TransitionSeries.Transition\n presentation={presentation}\n timing={linearTiming({ durationInFrames: transition })}\n />\n <TransitionSeries.Sequence durationInFrames={sceneB}>\n <PlayerScene\n theme={theme}\n image={image}\n overline={overline}\n title={title}\n ground={groundB}\n groundParams={groundBParams}\n />\n </TransitionSeries.Sequence>\n </TransitionSeries>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/disc-pop.tsx"
}
],
"type": "registry:component"
}