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": "design-audit",
"title": "Design Audit",
"description": "A full design review in one scene: redlines and issue boxes, a scan that ships the fix, a camera push into one card with specs and tokens, then layout guides.",
"dependencies": ["remotion"],
"registryDependencies": ["@remocn/audit-core"],
"files": [
{
"path": "registry/remocn/design-audit/index.tsx",
"content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n AUDIT_COLORS,\n AuditClock,\n DEMO,\n DEMO_WINDOW,\n DemoDashboard,\n easeInOut,\n FONT,\n GuideMarks,\n type GuideSpec,\n type Issue,\n IssueMarks,\n type Measure,\n MeasureMarks,\n progress,\n type RadiusMark,\n type Rect,\n ScanBand,\n SplitAt,\n Spotlight,\n TokenMarks,\n type TokenSpec,\n useAuditFrame,\n VersionChip,\n} from \"@/lib/remocn/audit-core\";\n\nexport type DesignAuditMarks = {\n measures?: Measure[];\n radii?: RadiusMark[];\n};\n\nexport type DesignAuditFocus = {\n /** Element the camera pushes in on. */\n rect: Rect;\n measures?: Measure[];\n radii?: RadiusMark[];\n tokens?: TokenSpec[];\n};\n\nexport type DesignAuditProps = {\n /** UI before the fix, 1280x720. Defaults to a demo dashboard with drifted spacing. */\n before?: ReactNode;\n /** The fixed UI, same layout. */\n after?: ReactNode;\n /** Red redlines drawn over `before`. */\n beforeMarks?: DesignAuditMarks;\n /** Off-spec elements boxed on `before`. */\n issues?: Issue[];\n /** Blue redlines over `after`, shown once the scan lands. */\n afterMarks?: DesignAuditMarks;\n /** Close-up the camera pushes into, with its specs and tokens. `null` skips the zoom. */\n focus?: DesignAuditFocus | null;\n /** Guides drawn after the camera pulls back. */\n guides?: GuideSpec | null;\n /** Four step names lit one by one across the top. */\n steps?: string[];\n /** Name next to the version chip. Empty hides the top bar. */\n brand?: string;\n versions?: [string, string];\n auditColor?: string;\n fixColor?: string;\n scanColor?: string;\n background?: string;\n speed?: number;\n};\n\nexport const designAuditDefaults = {\n steps: [\"Audit\", \"Layout\", \"Components\", \"Tokens\"],\n brand: \"Synergy\",\n versions: [\"v1.0\", \"v2.0\"] as [string, string],\n auditColor: AUDIT_COLORS.audit,\n fixColor: AUDIT_COLORS.fix,\n scanColor: AUDIT_COLORS.scan,\n background: AUDIT_COLORS.stage,\n speed: 1,\n};\n\nconst T = {\n redline: 14,\n audit: 34,\n scan: 72,\n scanLength: 64,\n zoomIn: 156,\n callouts: 180,\n tokens: 208,\n zoomOut: 252,\n guides: 278,\n};\n\nexport const designAuditLength = 332;\n\nexport function DesignAudit(props: DesignAuditProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction Scene({\n before,\n after,\n beforeMarks,\n issues,\n afterMarks,\n focus,\n guides,\n steps = designAuditDefaults.steps,\n brand = designAuditDefaults.brand,\n versions = designAuditDefaults.versions,\n auditColor = designAuditDefaults.auditColor,\n fixColor = designAuditDefaults.fixColor,\n scanColor = designAuditDefaults.scanColor,\n background = designAuditDefaults.background,\n}: DesignAuditProps) {\n const frame = useAuditFrame();\n const demo = !before && !after;\n const redBefore = beforeMarks ?? (demo ? DEMO.before : {});\n const blueAfter = afterMarks ?? (demo ? DEMO.after : {});\n const flagged = issues ?? (demo ? DEMO.before.issues : []);\n const zoomed = focus === undefined ? (demo ? DEMO.after.focus : null) : focus;\n const grid =\n guides === undefined ? (demo ? DEMO.after.guides : null) : guides;\n\n const y = easeInOut(frame, [T.scan, T.scan + T.scanLength], [-20, 760]);\n const band = easeInOut(\n frame,\n [T.scan - 4, T.scan + 2, T.scan + T.scanLength - 8, T.scan + T.scanLength],\n [0, 1, 1, 0],\n );\n const enter = progress(frame, 0, 18);\n const zoom = zoomed\n ? easeInOut(\n frame,\n [T.zoomIn, T.zoomIn + 22, T.zoomOut, T.zoomOut + 22],\n [0, 1, 1, 0],\n )\n : 0;\n const card = zoomed?.rect ?? { x: 640, y: 360, w: 0, h: 0 };\n const center = { x: card.x + card.w / 2 + 40, y: card.y + card.h / 2 + 46 };\n const camera = `translate(${(640 - center.x) * zoom}px, ${(360 - center.y) * zoom}px) scale(${1 + zoom * 1.35})`;\n const fadeOut = (at: number) => easeInOut(frame, [at - 10, at], [1, 0]);\n\n const active =\n frame < T.scan ? 0 : frame < T.zoomIn ? 1 : frame < T.tokens ? 2 : 3;\n\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n <AbsoluteFill\n style={{\n transform: camera,\n transformOrigin: `${center.x}px ${center.y}px`,\n }}\n >\n <AbsoluteFill\n style={{\n opacity: enter,\n transform: `translateY(${(1 - enter) * 18}px) scale(${0.97 + 0.03 * enter})`,\n }}\n >\n <SplitAt\n y={y}\n bottom={\n <>\n {before ?? <DemoDashboard v={1} />}\n <MeasureMarks\n measures={redBefore.measures ?? []}\n radii={redBefore.radii}\n color={auditColor}\n start={T.redline}\n />\n <IssueMarks\n issues={flagged}\n color={auditColor}\n start={T.audit}\n />\n </>\n }\n top={\n <>\n {after ?? <DemoDashboard v={2} />}\n <AbsoluteFill\n style={{ opacity: zoomed ? fadeOut(T.zoomIn) : 1 }}\n >\n <MeasureMarks\n measures={blueAfter.measures ?? []}\n radii={blueAfter.radii}\n color={fixColor}\n start={-200}\n />\n </AbsoluteFill>\n </>\n }\n />\n <ScanBand y={y} color={scanColor} opacity={band} />\n {zoomed && (\n <>\n <Spotlight rect={zoomed.rect} color={background} opacity={zoom} />\n {frame >= T.callouts && (\n <AbsoluteFill style={{ opacity: fadeOut(T.zoomOut + 6) }}>\n <MeasureMarks\n measures={zoomed.measures ?? []}\n radii={zoomed.radii}\n color={fixColor}\n start={T.callouts}\n stagger={4}\n />\n <TokenMarks tokens={zoomed.tokens ?? []} start={T.tokens} />\n </AbsoluteFill>\n )}\n </>\n )}\n {grid && (\n <GuideMarks guides={grid} color={fixColor} start={T.guides} />\n )}\n </AbsoluteFill>\n </AbsoluteFill>\n {brand && (\n <AbsoluteFill style={{ opacity: enter * (1 - zoom) }}>\n <VersionChip\n brand={brand}\n versions={versions}\n fixed={y > 36}\n colors={[auditColor, fixColor]}\n />\n <StepBar\n steps={steps}\n active={active}\n colors={[auditColor, fixColor]}\n />\n </AbsoluteFill>\n )}\n </AbsoluteFill>\n );\n}\n\nfunction StepBar({\n steps,\n active,\n colors,\n}: {\n steps: string[];\n active: number;\n colors: [string, string];\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n right: 1280 - DEMO_WINDOW.x - DEMO_WINDOW.w,\n top: 28,\n display: \"flex\",\n gap: 18,\n fontSize: 12.5,\n }}\n >\n {steps.map((step, i) => {\n const on = i <= active;\n return (\n <span\n key={step}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n color: on ? AUDIT_COLORS.ink : \"#99A0AE\",\n fontWeight: i === active ? 600 : 400,\n }}\n >\n <span\n style={{\n width: 6,\n height: 6,\n borderRadius: 3,\n background: on\n ? active === 0\n ? colors[0]\n : colors[1]\n : \"#E1E4EA\",\n }}\n />\n {step}\n </span>\n );\n })}\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/design-audit.tsx"
}
],
"type": "registry:component"
}