Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: icon pic
dev_wandry10d0420666a5
diff --git a/components/docs/icons-gallery.tsx b/components/docs/icons-gallery.tsxindex abc3b107..f187e523 100644--- a/components/docs/icons-gallery.tsx+++ b/components/docs/icons-gallery.tsx@@ -22,6 +22,7 @@ import { DownloadIconStatic } from "@/registry/remocn/icon-download";import { ExternalLinkIconStatic } from "@/registry/remocn/icon-external-link";import { FlameIconStatic } from "@/registry/remocn/icon-flame";import { HeartIconStatic } from "@/registry/remocn/icon-heart";+import { ImageIconStatic } from "@/registry/remocn/icon-image";import { InfoIconStatic } from "@/registry/remocn/icon-info";import { LoaderIconStatic } from "@/registry/remocn/icon-loader";import { MicIconStatic } from "@/registry/remocn/icon-mic";@@ -214,6 +215,12 @@ export const ICONS: IconEntry[] = [category: "Media & playback",Static: CameraIconStatic,},+ {+ name: "icon-image",+ label: "Image",+ category: "Media & playback",+ Static: ImageIconStatic,+ },{name: "icon-heart",label: "Heart",diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex bb07e5bd..d4803f1d 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -38,6 +38,7 @@ import { iconDownloadConfig } from "@/registry/remocn/icon-download/config";import { iconExternalLinkConfig } from "@/registry/remocn/icon-external-link/config";import { iconFlameConfig } from "@/registry/remocn/icon-flame/config";import { iconHeartConfig } from "@/registry/remocn/icon-heart/config";+import { iconImageConfig } from "@/registry/remocn/icon-image/config";import { iconInfoConfig } from "@/registry/remocn/icon-info/config";import { iconLoaderConfig } from "@/registry/remocn/icon-loader/config";import { iconMicConfig } from "@/registry/remocn/icon-mic/config";@@ -684,6 +685,13 @@ const registry: Record<string, RegistryEntry> = {})),config: iconHeartConfig,},+ "icon-image": {+ load: () =>+ import("@/registry/remocn/icon-image").then((m) => ({+ default: m.ImageIcon,+ })),+ config: iconImageConfig,+ },"icon-info": {load: () =>import("@/registry/remocn/icon-info").then((m) => ({diff --git a/registry/remocn/icon-image/config.ts b/registry/remocn/icon-image/config.tsnew file mode 100644index 00000000..466f9f23--- /dev/null+++ b/registry/remocn/icon-image/config.ts@@ -0,0 +1,44 @@+import { type ComponentConfig, FPS } from "@/lib/customizer-config";++export const iconImageConfig: ComponentConfig = {+ componentName: "ImageIcon",+ importPath: "@/components/remocn/icon-image",+ controls: {+ animation: {+ type: "select",+ default: "both",+ options: ["draw", "action", "both"],+ label: "Animation",+ },+ loop: {+ type: "boolean",+ default: false,+ label: "Loop",+ },+ size: {+ type: "number",+ default: 48,+ min: 24,+ max: 200,+ step: 4,+ label: "Size",+ },+ color: {+ type: "color",+ default: "#171717",+ label: "Color",+ },+ strokeWidth: {+ type: "number",+ default: 2,+ min: 1,+ max: 3,+ step: 0.25,+ label: "Stroke width",+ },+ },+ durationInFrames: 75,+ fps: FPS,+ compositionWidth: 48,+ compositionHeight: 48,+};diff --git a/registry/remocn/icon-image/index.tsx b/registry/remocn/icon-image/index.tsxnew file mode 100644index 00000000..291074ea--- /dev/null+++ b/registry/remocn/icon-image/index.tsx@@ -0,0 +1,147 @@+"use client";++import { Easing, interpolate } from "remotion";+import {+ drawnPathProps,+ type IconAnimationProps,+ useIconAnimation,+} from "@/lib/remocn-icons";++const FRAME_PATH =+ "M5 3H19A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3Z";+const SUN_PATH = "M9 7 A2 2 0 0 1 11 9 A2 2 0 0 1 9 11 A2 2 0 0 1 7 9 A2 2 0 0 1 9 7";+const MOUNTAIN_PATH = "M6 21 15.086 11.914A2 2 0 0 1 17.914 11.914L21 15";++const TIMINGS = {+ drawDurationInFrames: 18,+ actionDelayInFrames: 2,+ actionDurationInFrames: 20,+ loop: false,+} as const;++export function ImageIcon({+ animation = "both",+ loop,+ speed,+ size = 48,+ color = "currentColor",+ strokeWidth = 2,+ className,+}: IconAnimationProps) {+ const { drawProgress, scaleIn, actionProgress, actionFrame } =+ useIconAnimation({ animation, loop, speed }, TIMINGS);++ const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);++ const frameDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.out(Easing.quad),+ });+ const sunDraw = interpolate(linearDraw, [0.444, 0.778], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.out(Easing.quad),+ });+ const mountainDraw = interpolate(linearDraw, [0.556, 1], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.out(Easing.quad),+ });++ const acting = animation !== "draw" && actionFrame >= 0;++ const mountainProgress = acting+ ? interpolate(actionProgress, [0, 0.6], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.out(Easing.quad),+ })+ : mountainDraw;+ const sunShiftY = acting+ ? interpolate(actionProgress, [0, 0.6, 0.9], [1, -0.5, 0], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.out(Easing.quad),+ })+ : 0;+ const sunOpacity = acting+ ? interpolate(actionProgress, [0, 0.5], [0.6, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ })+ : 1;++ const frame = drawnPathProps(FRAME_PATH, frameDraw);+ const sun = drawnPathProps(SUN_PATH, acting ? 1 : sunDraw);+ const mountain = drawnPathProps(MOUNTAIN_PATH, mountainProgress);++ const scale = 0.85 + 0.15 * scaleIn;++ return (+ <svg+ className={className}+ width={size}+ height={size}+ viewBox="0 0 24 24"+ fill="none"+ stroke={color}+ strokeWidth={strokeWidth}+ strokeLinecap="round"+ strokeLinejoin="round"+ style={{+ overflow: "visible",+ transformOrigin: "center",+ transform: `scale(${scale})`,+ }}+ >+ <path+ d={FRAME_PATH}+ strokeDasharray={frame.strokeDasharray}+ strokeDashoffset={frame.strokeDashoffset}+ />+ <g transform={`translate(0 ${sunShiftY})`} opacity={sunOpacity}>+ <path+ d={SUN_PATH}+ strokeDasharray={sun.strokeDasharray}+ strokeDashoffset={sun.strokeDashoffset}+ />+ </g>+ <path+ d={MOUNTAIN_PATH}+ strokeDasharray={mountain.strokeDasharray}+ strokeDashoffset={mountain.strokeDashoffset}+ />+ </svg>+ );+}++export function ImageIconStatic({+ size = 48,+ color = "currentColor",+ strokeWidth = 2,+ className,+}: {+ size?: number;+ color?: string;+ strokeWidth?: number;+ className?: string;+}) {+ return (+ <svg+ className={className}+ width={size}+ height={size}+ viewBox="0 0 24 24"+ fill="none"+ stroke={color}+ strokeWidth={strokeWidth}+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <rect width="18" height="18" x="3" y="3" rx="2" ry="2" />+ <circle cx="9" cy="9" r="2" />+ <path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />+ </svg>+ );+}diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex e2072699..3b11c353 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -1834,6 +1834,21 @@}]},+ {+ "name": "icon-image",+ "type": "registry:component",+ "title": "Image",+ "description": "Animated Lucide image icon — the frame draws on, then the mountain redraws and the sun drifts into place like a photo developing.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/icons-core"],+ "files": [+ {+ "path": "icon-image/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/icon-image.tsx"+ }+ ]+ },{"name": "icon-sparkles","type": "registry:component",