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": "icon-clock",
"title": "Clock",
"description": "Animated Lucide clock icon — the face draws on, then the hands sweep through discrete ticks. Loops by default.",
"dependencies": ["remotion"],
"registryDependencies": ["@remocn/icons-core"],
"files": [
{
"path": "registry/remocn-icons/icon-clock/index.tsx",
"content": "\"use client\";\n\nimport { Easing, interpolate } from \"remotion\";\nimport {\n drawnPathProps,\n type IconAnimationProps,\n useIconAnimation,\n} from \"@/lib/remocn-icons\";\n\nconst FACE_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst HANDS_PATH = \"M12 6v6l4 2\";\nconst MINUTE_PATH = \"M12 6V12\";\nconst HOUR_PATH = \"M12 12 16 14\";\n\nconst CENTER = 12;\nconst STEPS = 4;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nexport function ClockIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const faceDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const handsDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const scaled = actionProgress * STEPS;\n const stepIndex = Math.floor(scaled);\n const frac = scaled - stepIndex;\n const eased = interpolate(frac, [0, 0.55, 1], [0, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const tick = acting ? ((stepIndex + eased) / STEPS) * 360 : 0;\n\n const face = drawnPathProps(FACE_PATH, acting ? 1 : faceDraw);\n const minute = drawnPathProps(MINUTE_PATH, acting ? 1 : handsDraw);\n const hour = drawnPathProps(HOUR_PATH, acting ? 1 : handsDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FACE_PATH}\n strokeDasharray={face.strokeDasharray}\n strokeDashoffset={face.strokeDashoffset}\n />\n <path\n d={HOUR_PATH}\n strokeDasharray={hour.strokeDasharray}\n strokeDashoffset={hour.strokeDashoffset}\n />\n <g transform={`rotate(${tick} ${CENTER} ${CENTER})`}>\n <path\n d={MINUTE_PATH}\n strokeDasharray={minute.strokeDasharray}\n strokeDashoffset={minute.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nexport function ClockIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={HANDS_PATH} />\n </svg>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/icon-clock.tsx"
}
],
"type": "registry:component"
}