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": "button-to-card",
"title": "Button to Card",
"description": "A button expands into a store card row with product images, prices and status.",
"dependencies": ["remotion", "@remotion/google-fonts"],
"registryDependencies": ["@remocn/gsh"],
"files": [
{
"path": "registry/remocn/button-to-card/index.tsx",
"content": "\"use client\";\n\nimport { loadFont as loadMono } from \"@remotion/google-fonts/GeistMono\";\nimport { loadFont as loadHanken } from \"@remotion/google-fonts/HankenGrotesk\";\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\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 hanken = loadHanken(\"normal\", {\n weights: [\"300\", \"400\"],\n subsets: [\"latin\"],\n});\nconst mono = loadMono(\"normal\", { weights: [\"400\"], subsets: [\"latin\"] });\n\nconst ENTER = Easing.bezier(0.32, 0.72, 0, 1);\nconst EXIT = Easing.bezier(0.55, 0, 1, 0.45);\nconst MOVE = Easing.bezier(0.65, 0, 0.35, 1);\nconst CAM = Easing.bezier(0.87, 0, 0.13, 1);\nconst HEAVY = { mass: 1, damping: 26, stiffness: 120 };\nconst CARD = { mass: 0.8, damping: 18, stiffness: 160 };\nconst CHIP = { mass: 0.5, damping: 12, stiffness: 200 };\nconst MORPH = { damping: 200 };\n\nconst B = {\n pill: -8,\n press: 18,\n morph: 22,\n fields: 24,\n title: 36,\n carry: 50,\n price: 54,\n drop: 78,\n status: 88,\n save: 96,\n shrink: 102,\n pops: [106, 110, 114],\n header: 108,\n live: 120,\n end: 162,\n};\n\nconst ramp = (f: number, start: number, dur: number, easing = ENTER) =>\n interpolate(f, [start, start + dur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\nconst mix = (a: number, b: number, t: number) => a + (b - a) * t;\n\nconst dip = (f: number, at: number, depth: number) =>\n 1 - depth * ramp(f, at, 3, MOVE) + depth * ramp(f, at + 3, 9, ENTER);\n\ninterface Rect {\n x: number;\n y: number;\n w: number;\n h: number;\n r: number;\n}\n\nconst lerpRect = (a: Rect, b: Rect, t: number): Rect => ({\n x: mix(a.x, b.x, t),\n y: mix(a.y, b.y, t),\n w: mix(a.w, b.w, t),\n h: mix(a.h, b.h, t),\n r: mix(a.r, b.r, t),\n});\n\nconst line = (color: string, w = 1.5) => ({\n fill: \"none\",\n stroke: color,\n strokeWidth: w,\n strokeLinecap: \"round\" as const,\n strokeLinejoin: \"round\" as const,\n});\n\nfunction DirBlur({ id, x, y }: { id: string; x: number; y: number }) {\n return (\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <filter id={id} x=\"-20%\" y=\"-20%\" width=\"140%\" height=\"140%\">\n <feGaussianBlur stdDeviation={`${x} ${y}`} />\n </filter>\n </svg>\n );\n}\n\nfunction Cursor({ size }: { size: number }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width={size}\n height={size}\n style={{ display: \"block\", overflow: \"visible\" }}\n aria-hidden\n >\n <path\n d=\"M5 3.5 18.6 11l-6 1.7-3 5.9L5 3.5Z\"\n fill=\"#141110\"\n stroke=\"#ffffff\"\n strokeWidth={1.5}\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport interface ButtonToCardProps {\n theme?: \"dark\" | \"light\";\n accent?: string;\n buttonLabel?: string;\n name?: string;\n price?: string;\n images?: string[];\n others?: { name: string; price: string }[];\n storeName?: string;\n ground?: GshPresetId;\n groundParams?: Partial<GradientParams>;\n}\n\nexport function ButtonToCard({\n theme = \"dark\",\n accent = \"#f2552c\",\n buttonLabel = \"Add an item\",\n name = \"Ceramic pitcher\",\n price = \"$48.00\",\n images = [\n staticFile(\"templates/brand-guidelines/ceramics.jpg\"),\n staticFile(\"templates/brand-guidelines/chair.jpg\"),\n staticFile(\"templates/product-showcase/sculpture.jpg\"),\n staticFile(\"templates/brand-guidelines/materials.jpg\"),\n ],\n others = [\n { name: \"Oak stool\", price: \"$120.00\" },\n { name: \"Arch sculpture\", price: \"$86.00\" },\n { name: \"Material kit\", price: \"$32.00\" },\n ],\n storeName = \"Studio Goods\",\n ground,\n groundParams,\n}: ButtonToCardProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const dark = theme === \"dark\";\n const portrait = height > width * 1.2;\n const stageW = portrait ? 720 : 1280;\n const stageH = portrait ? 1280 : 720;\n const k = width / stageW;\n\n const ink = dark ? \"#f7f0ea\" : \"#1c1612\";\n const muted = dark ? \"rgba(247,240,234,0.52)\" : \"rgba(28,22,18,0.5)\";\n const faint = dark ? \"rgba(247,240,234,0.3)\" : \"rgba(28,22,18,0.3)\";\n const hair = dark ? \"rgba(255,236,220,0.1)\" : \"rgba(70,40,20,0.1)\";\n const field = dark ? \"rgba(255,236,220,0.045)\" : \"#fbf8f5\";\n const surface = dark\n ? \"linear-gradient(180deg, rgba(40,31,27,0.9) 0%, rgba(22,17,15,0.94) 100%)\"\n : \"linear-gradient(180deg, #ffffff 0%, #fffcf9 100%)\";\n const slotFill = dark ? \"rgba(255,236,220,0.04)\" : \"#f8f2ec\";\n const shadow = dark\n ? \"inset 0 1px 0 rgba(255,240,225,0.07), 0 1px 2px rgba(0,0,0,0.4), 0 14px 32px rgba(0,0,0,0.35), 0 50px 110px rgba(20,6,0,0.55)\"\n : \"inset 0 1px 0 #ffffff, 0 1px 2px rgba(120,60,20,0.08), 0 12px 28px rgba(150,80,30,0.1), 0 44px 100px rgba(150,80,30,0.16)\";\n const btnInk = dark ? \"#1a1411\" : \"#ffffff\";\n\n const all = [{ name, price }, ...others].slice(0, 4);\n const count = all.length;\n const cols = portrait ? 2 : count;\n const tileW = portrait ? 296 : 252;\n const tileH = portrait ? 372 : 340;\n const gap = portrait ? 20 : 22;\n const imgInset = 12;\n const tileImg = tileW - imgInset * 2;\n const rows = Math.ceil(count / cols);\n const gridW = cols * tileW + (cols - 1) * gap;\n const gridH = rows * tileH + (rows - 1) * gap;\n const headH = 64;\n const groupH = headH + gridH;\n const gridTop = -groupH / 2 + headH + (portrait ? 0 : 14);\n const tileRect = (i: number): Rect => ({\n x: -gridW / 2 + (i % cols) * (tileW + gap),\n y: gridTop + Math.floor(i / cols) * (tileH + gap),\n w: tileW,\n h: tileH,\n r: 24,\n });\n\n const cardW = portrait ? 620 : 940;\n const cardH = portrait ? 980 : 560;\n const cardRect: Rect = {\n x: -cardW / 2,\n y: -cardH / 2,\n w: cardW,\n h: cardH,\n r: 30,\n };\n const pillRect: Rect = { x: -132, y: -32, w: 264, h: 64, r: 32 };\n const mediaCard: Rect = portrait\n ? { x: 14, y: 14, w: cardW - 28, h: 400, r: 16 }\n : { x: 14, y: 14, w: 440, h: cardH - 28, r: 16 };\n const mediaTile: Rect = {\n x: imgInset,\n y: imgInset,\n w: tileImg,\n h: tileImg,\n r: 12,\n };\n const col = portrait\n ? { x: 36, y: 444, w: cardW - 72 }\n : { x: 494, y: 40, w: cardW - 494 - 40 };\n\n const pillIn = spring({ frame: frame - B.pill, fps, config: CARD });\n const morph = spring({\n frame: frame - B.morph,\n fps,\n config: MORPH,\n durationInFrames: 22,\n });\n const shrink = spring({\n frame: frame - B.shrink,\n fps,\n config: HEAVY,\n durationInFrames: 26,\n });\n const shrinkPrev = spring({\n frame: frame - 1 - B.shrink,\n fps,\n config: HEAVY,\n durationInFrames: 26,\n });\n const press = dip(frame, B.press, 0.07);\n let box = lerpRect(pillRect, cardRect, morph);\n box = lerpRect(box, tileRect(0), shrink);\n const t0 = tileRect(0);\n const shrinkV = Math.abs(shrink - shrinkPrev);\n const shrinkBlurX = Math.min(6, shrinkV * Math.abs(cardRect.x - t0.x) * 0.2);\n const shrinkBlurY = Math.min(6, shrinkV * Math.abs(cardRect.y - t0.y) * 0.2);\n\n const pillLabel = 1 - ramp(frame, B.morph, 6, EXIT);\n const fieldIn = (i: number) => ramp(frame, B.fields + i * 3, 12);\n const cardContent = 1 - ramp(frame, B.shrink, 8, EXIT);\n const tileContent = ramp(frame, B.shrink + 12, 12);\n const media = lerpRect(mediaCard, mediaTile, shrink);\n\n const typedName = name.slice(0, Math.max(0, frame - B.title));\n const typedPrice = price.slice(\n 0,\n Math.max(0, Math.floor((frame - B.price) / 1.5)),\n );\n const nameCaret = frame >= B.title - 4 && frame < B.price;\n const priceCaret = frame >= B.price && frame < B.status;\n const caretBlink = Math.floor(frame / 8) % 2 === 0 ? 1 : 0.2;\n const statusOn = spring({ frame: frame - B.status, fps, config: CHIP });\n\n const mediaCx = cardRect.x + mediaCard.x + mediaCard.w / 2;\n const mediaCy = cardRect.y + mediaCard.y + mediaCard.h / 2;\n const startPt = portrait ? { x: 300, y: 720 } : { x: 720, y: 360 };\n const carry = spring({\n frame: frame - B.carry,\n fps,\n config: { mass: 0.9, damping: 20, stiffness: 90 },\n });\n const carryPrev = spring({\n frame: frame - 1 - B.carry,\n fps,\n config: { mass: 0.9, damping: 20, stiffness: 90 },\n });\n const hover = { x: mediaCx + 40, y: mediaCy - 20 };\n const arc = Math.sin(Math.PI * Math.min(1, carry)) * (portrait ? 60 : -80);\n const drop = spring({ frame: frame - B.drop, fps, config: CARD });\n let ix = mix(startPt.x, hover.x, carry);\n let iy = mix(startPt.y, hover.y, carry) + arc;\n const vx = Math.abs(carry - carryPrev) * Math.abs(hover.x - startPt.x);\n const vy = Math.abs(carry - carryPrev) * Math.abs(hover.y - startPt.y);\n ix = mix(ix, mediaCx, drop);\n iy = mix(iy, mediaCy, drop);\n const carriedW = mix(portrait ? 220 : 200, mediaCard.w, Math.min(1, drop));\n const carriedH = mix(portrait ? 170 : 240, mediaCard.h, Math.min(1, drop));\n const carriedRot = mix(mix(14, -5, carry), 0, Math.min(1, drop));\n const placed = frame >= B.drop + 10;\n const slotHot =\n ramp(frame, B.carry + 16, 8) * (1 - ramp(frame, B.drop + 4, 8, EXIT));\n const breathe = 1 + 0.012 * Math.sin((frame - B.carry) / 3.2) * slotHot;\n\n const btnX = cardRect.x + col.x + col.w - 90;\n const btnY = cardRect.y + cardH - (portrait ? 64 : 64);\n const cursorPath: [number, number, number][] = [\n [-6, 200, 170],\n [B.press - 2, 40, 14],\n [B.morph + 8, 40, 14],\n [B.morph + 24, startPt.x + 60, startPt.y + 50],\n [B.carry, startPt.x + 40, startPt.y + 40],\n [B.drop + 10, mediaCx + 120, mediaCy + 90],\n [B.save - 4, btnX + 10, btnY + 6],\n [B.shrink, btnX + 10, btnY + 6],\n [B.shrink + 18, btnX + 140, btnY + 120],\n ];\n const cAt = (i: 1 | 2) =>\n interpolate(\n frame,\n cursorPath.map((c) => c[0]),\n cursorPath.map((c) => c[i]),\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: MOVE,\n },\n );\n const attach =\n ramp(frame, B.carry - 2, 6) * (1 - ramp(frame, B.drop + 2, 8, EXIT));\n const pointerX = mix(cAt(1), ix + 30, attach);\n const pointerY = mix(cAt(2), iy + 40, attach);\n const cursorOpacity =\n ramp(frame, -6, 8) * (1 - ramp(frame, B.shrink + 6, 8, EXIT));\n const cursorScale = dip(frame, B.press, 0.16) * dip(frame, B.save, 0.16);\n const saveDip = dip(frame, B.save, 0.06);\n\n const headerIn = ramp(frame, B.header, 14);\n const liveIn = spring({ frame: frame - B.live, fps, config: CHIP });\n\n const camPill = 1 - ramp(frame, B.morph - 4, 26, CAM);\n const gridFocus = spring({\n frame: frame - B.shrink,\n fps,\n config: HEAVY,\n });\n const settle = spring({ frame: frame + 8, fps, config: HEAVY });\n const push =\n (portrait ? 1.7 : 2.1) * camPill +\n (1 - camPill) +\n 0.035 * ramp(frame, B.shrink + 10, B.end - B.shrink, Easing.linear);\n const rotX = mix(10, 4, settle) - 2 * gridFocus + Math.sin(frame / 40) * 0.5;\n const rotY =\n mix(-14, -4, settle) + 5 * morph * (1 - gridFocus) - 3 * gridFocus;\n\n const resolvedParams: Partial<GradientParams> | undefined =\n groundParams ??\n (ground || dark\n ? undefined\n : {\n kind: \"mist\",\n background: \"#faf5ef\",\n colors: [\"#ffb27a\", \"#ffd9bd\", \"#fff4ea\", \"#e0773a\"],\n });\n const resolvedPreset: GshPresetId | undefined =\n ground ?? (dark ? \"hearth\" : undefined);\n\n const labelStyle: React.CSSProperties = {\n fontSize: 15,\n color: muted,\n letterSpacing: \"0.01em\",\n marginBottom: 8,\n };\n const inputStyle = (active: boolean): React.CSSProperties => ({\n height: 52,\n borderRadius: 12,\n background: field,\n border: `1px solid ${active ? accent : hair}`,\n boxShadow: active\n ? `0 0 0 4px color-mix(in oklab, ${accent} 16%, transparent)`\n : dark\n ? \"inset 0 1px 0 rgba(255,240,225,0.03)\"\n : \"inset 0 1px 2px rgba(70,40,20,0.04)\",\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n gap: 10,\n fontSize: 20,\n color: ink,\n letterSpacing: \"-0.01em\",\n });\n const caret = (on: boolean) =>\n on ? (\n <span\n style={{\n width: 2,\n height: 24,\n marginLeft: 1,\n background: accent,\n opacity: caretBlink,\n }}\n />\n ) : null;\n\n const fieldGap = portrait ? 96 : 92;\n const fieldsTop = portrait ? 92 : 104;\n\n const tileInfo = (n: { name: string; price: string }, op: number) => (\n <div\n style={{\n position: \"absolute\",\n left: 16,\n right: 16,\n top: tileImg + imgInset + 14,\n opacity: op,\n transform: `translateY(${mix(10, 0, op)}px)`,\n }}\n >\n <div\n style={{\n fontSize: 20,\n color: ink,\n whiteSpace: \"nowrap\",\n letterSpacing: \"-0.015em\",\n }}\n >\n {n.name}\n </div>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n marginTop: 8,\n }}\n >\n <span\n style={{ fontSize: 16, color: muted, fontFamily: mono.fontFamily }}\n >\n {n.price}\n </span>\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontSize: 15,\n color: muted,\n }}\n >\n <span\n style={{\n width: 7,\n height: 7,\n borderRadius: 4,\n background: \"#3fb37f\",\n }}\n />\n Active\n </span>\n </div>\n </div>\n );\n\n return (\n <AbsoluteFill style={{ fontFamily: hanken.fontFamily, overflow: \"hidden\" }}>\n <GshGround\n preset={resolvedPreset}\n params={resolvedParams}\n timeOffset={3}\n timeScale={0.45}\n />\n <DirBlur id=\"btc-shrink\" x={shrinkBlurX} y={shrinkBlurY} />\n <DirBlur\n id=\"btc-carry\"\n x={Math.min(6, vx * 0.12) * (1 - Math.min(1, drop))}\n y={Math.min(6, vy * 0.12) * (1 - Math.min(1, drop))}\n />\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: stageW,\n height: stageH,\n transform: `scale(${k})`,\n transformOrigin: \"0 0\",\n perspective: 2000,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: stageW / 2,\n top: stageH / 2,\n width: 0,\n height: 0,\n transformStyle: \"preserve-3d\",\n transform: `scale(${push}) rotateX(${rotX}deg) rotateY(${rotY}deg)`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: -gridW / 2,\n width: gridW,\n top: gridTop - headH - 6,\n height: headH,\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n opacity: headerIn,\n transform: `translateY(${mix(18, 0, headerIn)}px)`,\n filter: `blur(${mix(6, 0, headerIn)}px)`,\n }}\n >\n <span\n style={{\n fontSize: portrait ? 36 : 38,\n fontWeight: 300,\n color: ink,\n letterSpacing: \"-0.035em\",\n }}\n >\n {storeName}\n </span>\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n height: 30,\n padding: \"0 13px\",\n borderRadius: 15,\n background: accent,\n color: \"#fff\",\n fontSize: 16,\n transform: `scale(${liveIn})`,\n opacity: Math.min(1, liveIn * 2),\n boxShadow: `inset 0 1px 0 rgba(255,255,255,0.3), 0 6px 18px color-mix(in oklab, ${accent} 40%, transparent)`,\n }}\n >\n <span\n style={{\n width: 7,\n height: 7,\n borderRadius: 4,\n background: \"#fff\",\n }}\n />\n Live\n </span>\n <span style={{ flex: 1 }} />\n {portrait ? null : (\n <span style={{ fontSize: 17, color: muted }}>\n {count} products\n </span>\n )}\n <span\n style={{\n height: 38,\n padding: \"0 16px\",\n borderRadius: 12,\n border: `1px solid ${hair}`,\n background: dark ? \"rgba(255,236,220,0.05)\" : \"#ffffff\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 16,\n color: ink,\n }}\n >\n View store\n <svg viewBox=\"0 0 24 24\" width={15} height={15} aria-hidden>\n <path d=\"M8 16 16 8M9 8h7v7\" {...line(ink, 1.6)} />\n </svg>\n </span>\n </div>\n\n {all.slice(1).map((n, j) => {\n const i = j + 1;\n const r = tileRect(i);\n const at = B.pops[j] ?? B.pops[B.pops.length - 1] + j * 4;\n const pop = spring({ frame: frame - at, fps, config: CARD });\n return (\n <div\n key={n.name}\n style={{\n position: \"absolute\",\n left: r.x,\n top: r.y,\n width: r.w,\n height: r.h,\n borderRadius: r.r,\n background: surface,\n border: `1px solid ${hair}`,\n boxShadow: shadow,\n overflow: \"hidden\",\n opacity: frame >= at ? Math.min(1, pop * 1.8) : 0,\n transform: `translateY(${mix(48, 0, pop)}px) scale(${mix(0.82, 1, pop)})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: mediaTile.x,\n top: mediaTile.y,\n width: mediaTile.w,\n height: mediaTile.h,\n borderRadius: mediaTile.r,\n overflow: \"hidden\",\n background: slotFill,\n }}\n >\n <Img\n src={images[i % images.length]}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n }}\n />\n </div>\n {tileInfo(n, 1)}\n </div>\n );\n })}\n\n <div\n style={{\n position: \"absolute\",\n left: box.x,\n top: box.y,\n width: box.w,\n height: box.h,\n borderRadius: box.r,\n background: surface,\n border: `1px solid ${hair}`,\n boxShadow: shadow,\n overflow: \"hidden\",\n opacity: Math.min(1, pillIn * 1.6),\n transform: `translateY(${mix(40, 0, pillIn)}px) scale(${press})`,\n filter:\n shrinkBlurX + shrinkBlurY > 0.4\n ? \"url(#btc-shrink)\"\n : undefined,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: (box.w - pillRect.w) / 2,\n top: (box.h - pillRect.h) / 2,\n width: pillRect.w,\n height: pillRect.h,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 10,\n color: ink,\n fontSize: 22,\n letterSpacing: \"-0.01em\",\n opacity: pillLabel,\n transform: `scale(${mix(1, 1.25, 1 - pillLabel)})`,\n }}\n >\n <span\n style={{\n width: 26,\n height: 26,\n borderRadius: 13,\n background: accent,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <svg viewBox=\"0 0 24 24\" width={16} height={16} aria-hidden>\n <path d=\"M12 6v12M6 12h12\" {...line(\"#fff\", 2)} />\n </svg>\n </span>\n {buttonLabel}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: media.x,\n top: media.y,\n width: media.w,\n height: media.h,\n borderRadius: media.r,\n background: slotFill,\n overflow: \"hidden\",\n opacity: fieldIn(0),\n transform: `scale(${breathe})`,\n outline: placed\n ? undefined\n : `1.5px dashed ${slotHot > 0.3 ? accent : faint}`,\n outlineOffset: -10,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 14,\n color: muted,\n fontSize: 17,\n opacity: placed ? 0 : 1,\n transform: `translateY(${-8 * slotHot}px)`,\n }}\n >\n <div\n style={{\n width: 52,\n height: 52,\n borderRadius: 14,\n border: `1px solid ${hair}`,\n background: dark ? \"rgba(255,236,220,0.05)\" : \"#ffffff\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n boxShadow: dark\n ? undefined\n : \"0 2px 6px rgba(70,40,20,0.06)\",\n }}\n >\n <svg viewBox=\"0 0 24 24\" width={24} height={24} aria-hidden>\n <path\n d=\"M12 15V5M8 9l4-4 4 4M5 15v3a1.5 1.5 0 0 0 1.5 1.5h11A1.5 1.5 0 0 0 19 18v-3\"\n {...line(slotHot > 0.5 ? accent : ink)}\n />\n </svg>\n </div>\n <span style={{ color: ink, fontSize: 18 }}>\n Drop an image here\n </span>\n <span style={{ marginTop: -8 }}>or click to browse</span>\n </div>\n {placed ? (\n <Img\n src={images[0]}\n style={{\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n }}\n />\n ) : null}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: col.x,\n top: col.y,\n width: col.w,\n height: cardH - col.y,\n opacity: cardContent,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n opacity: fieldIn(1),\n transform: `translateY(${mix(14, 0, fieldIn(1))}px)`,\n }}\n >\n <div style={{ flex: 1 }}>\n <div\n style={{\n fontSize: 30,\n fontWeight: 300,\n color: ink,\n letterSpacing: \"-0.03em\",\n }}\n >\n New product\n </div>\n <div style={{ fontSize: 16, color: muted, marginTop: 4 }}>\n {storeName} · Catalog\n </div>\n </div>\n <div\n style={{\n position: \"relative\",\n height: 30,\n padding: \"0 12px\",\n borderRadius: 15,\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n fontSize: 15,\n color: statusOn > 0.5 ? \"#2f9b6a\" : muted,\n background:\n statusOn > 0.5\n ? \"rgba(63,179,127,0.14)\"\n : dark\n ? \"rgba(255,236,220,0.06)\"\n : \"rgba(70,40,20,0.05)\",\n transform: `scale(${frame >= B.status ? mix(0.8, 1, statusOn) : 1})`,\n }}\n >\n <span\n style={{\n width: 7,\n height: 7,\n borderRadius: 4,\n background: statusOn > 0.5 ? \"#3fb37f\" : faint,\n }}\n />\n {statusOn > 0.5 ? \"Active\" : \"Draft\"}\n </div>\n </div>\n\n {[\n {\n label: \"Title\",\n body: (\n <div style={inputStyle(nameCaret)}>\n {typedName ? (\n <span style={{ whiteSpace: \"pre\" }}>{typedName}</span>\n ) : (\n <span style={{ color: faint }}>\n {nameCaret ? \"\" : \"Short sleeve t-shirt\"}\n </span>\n )}\n {caret(nameCaret)}\n </div>\n ),\n },\n {\n label: \"Price\",\n body: (\n <div style={inputStyle(priceCaret)}>\n <span\n style={{\n fontFamily: mono.fontFamily,\n fontSize: 19,\n whiteSpace: \"pre\",\n color: typedPrice ? ink : faint,\n }}\n >\n {typedPrice || \"$0.00\"}\n </span>\n {caret(priceCaret)}\n <span style={{ flex: 1 }} />\n <span\n style={{\n fontFamily: mono.fontFamily,\n fontSize: 15,\n color: muted,\n }}\n >\n USD\n </span>\n </div>\n ),\n },\n {\n label: \"Category\",\n body: (\n <div style={inputStyle(false)}>\n <span\n style={{\n height: 30,\n padding: \"0 12px\",\n borderRadius: 8,\n background: dark\n ? \"rgba(255,236,220,0.08)\"\n : \"rgba(70,40,20,0.06)\",\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 16,\n }}\n >\n Ceramics\n </span>\n <span\n style={{\n height: 30,\n padding: \"0 12px\",\n borderRadius: 8,\n background: dark\n ? \"rgba(255,236,220,0.08)\"\n : \"rgba(70,40,20,0.06)\",\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 16,\n }}\n >\n Tableware\n </span>\n <span style={{ flex: 1 }} />\n <svg\n viewBox=\"0 0 24 24\"\n width={18}\n height={18}\n aria-hidden\n >\n <path d=\"m7 10 5 5 5-5\" {...line(muted)} />\n </svg>\n </div>\n ),\n },\n ].map((f, i) => (\n <div\n key={f.label}\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: fieldsTop + i * fieldGap,\n opacity: fieldIn(i + 2),\n transform: `translateY(${mix(16, 0, fieldIn(i + 2))}px)`,\n }}\n >\n <div style={labelStyle}>{f.label}</div>\n {f.body}\n </div>\n ))}\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: portrait ? 36 : 38,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n gap: 10,\n opacity: fieldIn(5),\n transform: `translateY(${mix(14, 0, fieldIn(5))}px)`,\n }}\n >\n <span style={{ fontSize: 16, color: muted, flex: 1 }}>\n Unsaved changes\n </span>\n <div\n style={{\n height: 48,\n padding: \"0 20px\",\n borderRadius: 14,\n border: `1px solid ${hair}`,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 18,\n color: ink,\n }}\n >\n Discard\n </div>\n <div\n style={{\n height: 48,\n padding: \"0 22px\",\n borderRadius: 14,\n background: ink,\n color: btnInk,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 18,\n transform: `scale(${saveDip})`,\n boxShadow: dark\n ? \"inset 0 1px 0 rgba(255,255,255,0.5), 0 8px 20px rgba(0,0,0,0.3)\"\n : \"inset 0 1px 0 rgba(255,255,255,0.15), 0 8px 20px rgba(28,22,18,0.2)\",\n }}\n >\n Add to store\n </div>\n </div>\n </div>\n\n {tileInfo({ name, price }, tileContent)}\n </div>\n\n {frame >= B.carry - 2 && !placed ? (\n <div\n style={{\n position: \"absolute\",\n left: ix - carriedW / 2,\n top: iy - carriedH / 2,\n width: carriedW,\n height: carriedH,\n borderRadius: mix(14, mediaCard.r, Math.min(1, drop)),\n overflow: \"hidden\",\n transform: `rotate(${carriedRot}deg)`,\n opacity: ramp(frame, B.carry - 2, 6),\n boxShadow: `0 ${mix(30, 4, Math.min(1, drop))}px ${mix(50, 10, Math.min(1, drop))}px rgba(30,10,0,${dark ? 0.55 : 0.3})`,\n border: `${mix(4, 0, Math.min(1, drop))}px solid #ffffff`,\n filter: \"url(#btc-carry)\",\n }}\n >\n <Img\n src={images[0]}\n style={{ width: \"100%\", height: \"100%\", objectFit: \"cover\" }}\n />\n </div>\n ) : null}\n\n <div\n style={{\n position: \"absolute\",\n left: pointerX,\n top: pointerY,\n opacity: cursorOpacity,\n transformOrigin: \"5px 4px\",\n transform: `scale(${cursorScale})`,\n filter: \"drop-shadow(0 4px 8px rgba(0,0,0,0.3))\",\n }}\n >\n <Cursor size={32} />\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n\nexport default ButtonToCard;\n",
"type": "registry:component",
"target": "components/remocn/button-to-card.tsx"
}
],
"type": "registry:component"
}