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": "shards-to-grid",
"title": "Shards to Grid",
"description": "Shards of images snap into a media grid with a \"Every frame, written in code\" label.",
"dependencies": ["remotion", "@remotion/google-fonts"],
"registryDependencies": ["@remocn/gsh"],
"files": [
{
"path": "registry/remocn/shards-to-grid/index.tsx",
"content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Geist\";\nimport { loadFont as loadMono } from \"@remotion/google-fonts/GeistMono\";\nimport { useMemo } 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 geist = loadFont(\"normal\", {\n weights: [\"300\", \"400\"],\n subsets: [\"latin\"],\n});\nconst mono = loadMono(\"normal\", {\n weights: [\"400\"],\n subsets: [\"latin\"],\n});\n\nexport interface ShardsToGridProps {\n images?: string[];\n title?: string;\n status?: string;\n headline?: string;\n labels?: string[];\n theme?: \"dark\" | \"light\";\n background?: string;\n accent?: string;\n blooms?: string[];\n ground?: GshPresetId;\n groundParams?: Partial<GradientParams>;\n}\n\nconst THEMES = {\n dark: {\n preset: \"film-blue\" as GshPresetId,\n groundOffset: 4,\n window: \"13,14,19\",\n surface: \"#15161c\",\n ink: \"238,240,246\",\n chip: \"rgba(255,255,255,0.07)\",\n pill: \"rgba(18,20,28,0.66)\",\n pillInk: \"#eef0f6\",\n pillEdge: \"rgba(255,255,255,0.12)\",\n shadow: \"2,3,12\",\n shadowAlpha: 0.55,\n },\n light: {\n preset: \"paper-crease\" as GshPresetId,\n groundOffset: 2,\n window: \"248,247,243\",\n surface: \"#fbfaf7\",\n ink: \"22,23,28\",\n chip: \"rgba(20,20,30,0.06)\",\n pill: \"rgba(255,255,255,0.78)\",\n pillInk: \"#17181d\",\n pillEdge: \"rgba(20,20,30,0.08)\",\n shadow: \"40,40,70\",\n shadowAlpha: 0.22,\n },\n};\n\nconst DEFAULT_IMAGES = [\n \"templates/product-showcase/gallery.jpg\",\n \"templates/brand-guidelines/materials.jpg\",\n \"reel/reel-3.jpg\",\n \"templates/product-showcase/sculpture.jpg\",\n \"hero.png\",\n \"templates/launch-anything/horizon.jpg\",\n \"templates/brand-guidelines/ceramics.jpg\",\n \"reel/reel-5.jpg\",\n \"studio.png\",\n \"templates/launch-anything/desk.jpg\",\n \"templates/product-showcase/courtyard.jpg\",\n \"templates/brand-guidelines/chair.jpg\",\n];\n\nconst BEATS = [\n { name: \"enter\", at: 0 },\n { name: \"drift\", at: 66 },\n { name: \"morph\", at: 60 },\n { name: \"converge\", at: 62 },\n { name: \"snap\", at: 84 },\n { name: \"content\", at: 84 },\n { name: \"end\", at: 144 },\n] as const;\ntype BeatName = (typeof BEATS)[number][\"name\"];\nconst beat = (n: BeatName) => BEATS.find((b) => b.name === n)?.at ?? 0;\n\nconst CARD = { mass: 0.8, damping: 18, stiffness: 160 };\nconst CHIP = { mass: 0.5, damping: 12, stiffness: 200 };\nconst HEAVY = { mass: 1, damping: 26, stiffness: 120 };\nconst MORPH = { damping: 200 };\nconst TYPE_IN = Easing.bezier(0.32, 0.72, 0, 1);\nconst MOVE = Easing.bezier(0.65, 0, 0.35, 1);\nconst CLAMP = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n} as const;\n\nconst REMOCN_R_PATH =\n \"M 0.01 0.81 C 0.01 1.73, 0.36 2.79, 1.09 4.13 C 4.91 11.04, 13.45 17.16, 21.7 18.9 C 22.94 19.16, 23.18 19.16, 51.39 19.27 C 76.07 19.36, 80.02 19.4, 81.32 19.57 C 89.89 20.69, 96.2 24.68, 99.38 31.01 C 103.19 38.56, 102.53 50.1, 97.91 57.07 C 94.66 61.96, 89.68 64.99, 83.26 66 C 82.81 66.07, 70.18 66.83, 55.2 67.69 C 24.82 69.43, 27.03 69.23, 24.18 70.4 C 19.9 72.15, 14.84 75.7, 10.65 79.89 C 4.86 85.68, 1.3 91.91, 0.25 98.13 C 0.12 98.85, 0.08 103.13, 0.04 116.66 L 0 134.26 9.5 134.26 L 19 134.26 19.05 119.41 C 19.1 103.27, 19.08 103.82, 19.82 101.04 C 21.79 93.65, 27.86 88.75, 36.45 87.63 C 37.23 87.53, 39.41 87.5, 43.57 87.53 C 50.12 87.59, 50.75 87.65, 53.22 88.45 C 56.61 89.56, 59.67 91.86, 62.02 95.07 C 62.52 95.76, 69.35 103.85, 77.2 113.07 C 85.04 122.28, 91.63 130.04, 91.85 130.32 C 92.07 130.59, 92.5 131.34, 92.82 131.97 C 93.52 133.35, 94.11 133.93, 95.06 134.13 C 95.5 134.23, 98.97 134.26, 106.36 134.23 L 117.01 134.19 100.82 113.07 C 91.91 101.45, 84.52 91.78, 84.39 91.57 C 83.36 89.89, 83.66 87.53, 85.09 86 C 85.79 85.25, 86.36 84.94, 88.07 84.38 C 96.18 81.72, 104.15 76.62, 109.97 70.36 C 120.59 58.93, 124.06 44.32, 119.44 30.43 C 114.59 15.81, 101.93 4.02, 87.64 0.83 C 83.93 0.01, 88.09 0.08, 41.85 0.04 L 0.01 0 0.01 0.81 Z\";\n\nconst SHARDS = 32;\nconst CELLS = 5;\n\ntype Rect = { x: number; y: number; w: number; h: number };\ntype Kind = \"image\" | \"accent\" | \"type\" | \"wave\" | \"swatch\";\n\nconst LAND_CELLS: Rect[] = [\n { x: 0, y: 0, w: 0.48, h: 1 },\n { x: 0.5, y: 0, w: 0.3, h: 0.56 },\n { x: 0.82, y: 0, w: 0.18, h: 0.56 },\n { x: 0.5, y: 0.58, w: 0.18, h: 0.42 },\n { x: 0.7, y: 0.58, w: 0.3, h: 0.42 },\n];\nconst TALL_CELLS: Rect[] = [\n { x: 0, y: 0, w: 1, h: 0.44 },\n { x: 0, y: 0.46, w: 0.58, h: 0.3 },\n { x: 0.6, y: 0.46, w: 0.4, h: 0.3 },\n { x: 0, y: 0.78, w: 0.4, h: 0.22 },\n { x: 0.42, y: 0.78, w: 0.58, h: 0.22 },\n];\n\nconst LAND_CLUSTERS = [\n { x: -0.56, y: -0.36, n: 9, r: 0.22 },\n { x: 0.5, y: -0.5, n: 6, r: 0.18 },\n { x: -0.4, y: 0.52, n: 7, r: 0.2 },\n { x: 0.64, y: 0.3, n: 6, r: 0.18 },\n { x: 0.1, y: -0.66, n: 4, r: 0.12 },\n];\nconst TALL_CLUSTERS = [\n { x: -0.46, y: -0.5, n: 9, r: 0.3 },\n { x: 0.52, y: -0.3, n: 6, r: 0.26 },\n { x: -0.48, y: 0.34, n: 7, r: 0.28 },\n { x: 0.46, y: 0.58, n: 6, r: 0.26 },\n { x: 0.12, y: -0.8, n: 4, r: 0.18 },\n];\nconst ASPECTS = [1.6, 1.33, 0.75, 1, 2.1, 0.62, 1.45, 0.8];\nconst SWATCH = [\"#e6dac8\", \"#b48a62\", \"#4b5a47\", \"#1d2230\"];\n\nfunction Fragment({\n kind,\n w,\n h,\n surface,\n ink,\n accent,\n seed,\n}: {\n kind: Kind;\n w: number;\n h: number;\n surface: string;\n ink: string;\n accent: string;\n seed: number;\n}) {\n const u = Math.min(w, h);\n if (kind === \"swatch\") {\n return (\n <div style={{ position: \"absolute\", inset: 0, display: \"flex\" }}>\n {[...SWATCH, accent].map((c) => (\n <span key={c} style={{ flex: 1, backgroundColor: c }} />\n ))}\n </div>\n );\n }\n if (kind === \"wave\") {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n backgroundColor: surface,\n display: \"flex\",\n alignItems: \"center\",\n gap: w * 0.022,\n padding: `0 ${w * 0.09}px`,\n }}\n >\n {Array.from({ length: 16 }, (_, k) => {\n const v =\n 0.18 +\n 0.82 *\n Math.abs(Math.sin(seed * 3.1 + k * 0.9) * Math.cos(k * 0.37));\n return (\n <span\n key={`b-${k}`}\n style={{\n flex: 1,\n height: `${v * 62}%`,\n borderRadius: w,\n backgroundColor: k === 6 ? accent : `rgba(${ink},0.55)`,\n }}\n />\n );\n })}\n </div>\n );\n }\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n backgroundColor: surface,\n padding: u * 0.12,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n color: `rgb(${ink})`,\n }}\n >\n <span\n style={{\n fontFamily: geist.fontFamily,\n fontWeight: 300,\n fontSize: u * 0.52,\n lineHeight: 0.9,\n letterSpacing: \"-0.04em\",\n }}\n >\n Aa\n </span>\n <span\n style={{\n fontFamily: mono.fontFamily,\n fontSize: u * 0.11,\n color: `rgba(${ink},0.5)`,\n whiteSpace: \"nowrap\",\n }}\n >\n Geist 300\n </span>\n </div>\n );\n}\n\nfunction RemocnR({ height, color }: { height: number; color: string }) {\n return (\n <svg\n viewBox=\"0 0 124.06 134.26\"\n height={height}\n width={(height * 124.06) / 134.26}\n style={{ display: \"block\", flexShrink: 0 }}\n aria-hidden\n >\n <path fill={color} d={REMOCN_R_PATH} />\n </svg>\n );\n}\n\nfunction PlayIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" aria-hidden>\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10.5\"\n fill=\"none\"\n stroke={color}\n strokeWidth=\"1.5\"\n />\n <path d=\"M10 8.4 L15.6 12 L10 15.6 Z\" fill={color} />\n </svg>\n );\n}\n\nfunction PlayOutline({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" aria-hidden>\n <path\n d=\"M8 5.8 L18 12 L8 18.2 Z\"\n fill=\"none\"\n stroke={color}\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport function ShardsToGrid({\n images,\n title = \"Launch v1\",\n status = \"Assembling\",\n headline = \"Every frame, written in code.\",\n labels = [\"Motion\", \"Type\", \"Sound\", \"Play reel\", \"Brand\"],\n theme = \"dark\",\n background,\n accent = \"#3B5BFD\",\n blooms,\n ground,\n groundParams,\n}: ShardsToGridProps) {\n const frame = useCurrentFrame();\n const { width: W, height: H, fps } = useVideoConfig();\n const t = THEMES[theme];\n const light = theme === \"light\";\n const srcs =\n images && images.length > 0 ? images : DEFAULT_IMAGES.map(staticFile);\n const portrait = H > W;\n const cx = W / 2;\n const cy = H / 2;\n const unit = portrait ? W / 1080 : W / 1280;\n const shadow = (a: number) => `rgba(${t.shadow},${a * t.shadowAlpha})`;\n const sp = (at: number, config: Partial<typeof CARD>) =>\n spring({ frame: frame - at, fps, config });\n\n const win: Rect = portrait\n ? { x: W * 0.05, y: H * 0.13, w: W * 0.9, h: H * 0.74 }\n : { x: W * 0.11, y: H * 0.1, w: W * 0.78, h: H * 0.8 };\n const bar = portrait ? H * 0.042 : H * 0.07;\n const pad = portrait ? W * 0.03 : W * 0.014;\n const content: Rect = {\n x: win.x + pad,\n y: win.y + bar,\n w: win.w - pad * 2,\n h: win.h - bar - pad,\n };\n const gapPx = pad * 0.75;\n const layout = portrait ? TALL_CELLS : LAND_CELLS;\n const cells = layout.map((c) => ({\n x: content.x + c.x * content.w + (c.x > 0 ? gapPx / 2 : 0),\n y: content.y + c.y * content.h + (c.y > 0 ? gapPx / 2 : 0),\n w:\n c.w * content.w -\n (c.x > 0 ? gapPx / 2 : 0) -\n (c.x + c.w < 1 ? gapPx / 2 : 0),\n h:\n c.h * content.h -\n (c.y > 0 ? gapPx / 2 : 0) -\n (c.y + c.h < 1 ? gapPx / 2 : 0),\n }));\n const cellRadius = portrait ? W * 0.022 : W * 0.011;\n\n const shards = useMemo(() => {\n const clusters = portrait ? TALL_CLUSTERS : LAND_CLUSTERS;\n const owner: number[] = [];\n clusters.forEach((c, ci) => {\n for (let k = 0; k < c.n; k++) owner.push(ci);\n });\n const cellCluster = [0, 1, 2, 3, 0];\n return Array.from({ length: SHARDS }, (_, i) => {\n const isCell = i < CELLS;\n const ci = isCell\n ? (cellCluster[i] as number)\n : (owner[(i * 7) % owner.length] as number);\n const c = clusters[ci] as (typeof clusters)[number];\n const g1 = random(`sg-g1-${i}`) + random(`sg-g2-${i}`) - 1;\n const g2 = random(`sg-g3-${i}`) + random(`sg-g4-${i}`) - 1;\n let nx = c.x * 0.86 + g1 * c.r * 1.6;\n let ny = c.y * 0.86 + g2 * c.r * (portrait ? 1.1 : 1.6);\n const clearX = portrait ? 0.7 : 0.44;\n const clearY = portrait ? 0.15 : 0.24;\n if (Math.abs(nx) < clearX && Math.abs(ny) < clearY) {\n ny = Math.sign(ny || 1) * (clearY + random(`sg-cl-${i}`) * 0.12);\n }\n nx = Math.max(-0.92, Math.min(0.92, nx));\n ny = Math.max(-0.9, Math.min(0.9, ny));\n const z = isCell ? 0.6 + random(`sg-z-${i}`) * 0.3 : random(`sg-z-${i}`);\n const sizeR = random(`sg-s-${i}`);\n const base =\n (portrait ? W : W * 0.62) *\n (isCell ? 0.12 + 0.03 * sizeR : 0.05 + 0.13 * sizeR ** 2) *\n (0.7 + z * 0.45);\n const asp = ASPECTS[(i * 5 + 3) % ASPECTS.length] as number;\n const r = random(`sg-k-${i}`);\n const kind: Kind = isCell\n ? i === 3\n ? \"accent\"\n : \"image\"\n : r < 0.5\n ? \"image\"\n : r < 0.68\n ? \"type\"\n : r < 0.86\n ? \"wave\"\n : \"swatch\";\n const dist = Math.hypot(nx, ny);\n return {\n i,\n isCell,\n kind,\n ci,\n nx,\n ny,\n z,\n w: base * Math.sqrt(asp),\n h: base / Math.sqrt(asp),\n rx: (random(`sg-rx-${i}`) - 0.5) * 30,\n ry: (random(`sg-ry-${i}`) - 0.5) * 36,\n rz: (random(`sg-rz-${i}`) - 0.5) * 14,\n delay: ci * 3 + Math.round(random(`sg-d-${i}`) * 8) - 16,\n conv: isCell\n ? beat(\"converge\") + i * 2\n : beat(\"converge\") - 2 + Math.round((1.2 - dist) * 6),\n seed: random(`sg-b-${i}`) * Math.PI * 2,\n };\n });\n }, [portrait, W]);\n\n const swirlP = (f: number) =>\n interpolate(f, [0, beat(\"drift\")], [0, 1], { ...CLAMP, easing: MOVE });\n\n const shardAt = (s: (typeof shards)[number], f: number) => {\n const e = spring({ frame: f - s.delay, fps, config: CARD });\n const sw = swirlP(f);\n const theta = (0.42 + 0.3 * s.z) * sw;\n const tight = 1 - 0.16 * sw;\n const cl = (portrait ? TALL_CLUSTERS : LAND_CLUSTERS)[s.ci] as {\n x: number;\n y: number;\n };\n const ccx = cl.x * 0.86;\n const ccy = cl.y * 0.86;\n const local = (s.seed > Math.PI ? 1 : -1) * 1.25 * sw;\n const lx = s.nx - ccx;\n const ly = s.ny - ccy;\n const ox = ccx + lx * Math.cos(local) - ly * Math.sin(local) * (H / W);\n const oy = ccy + ly * Math.cos(local) + lx * Math.sin(local) * (W / H);\n const bx = ox * (W / 2) * tight;\n const by = oy * (H / 2) * tight;\n const rxp = bx * Math.cos(theta) - by * Math.sin(theta) * (W / H) * 0.5;\n const ryp = by * Math.cos(theta) + bx * Math.sin(theta) * (H / W) * 0.9;\n const bob = Math.sin(f * 0.06 + s.seed) * 5 * unit * (0.4 + s.z);\n const dirx = s.nx / (Math.hypot(s.nx, s.ny) || 1);\n const diry = s.ny / (Math.hypot(s.nx, s.ny) || 1);\n const fly = (1 - e) * W * (0.4 + s.z * 0.3);\n const sx = cx + rxp + dirx * fly;\n const sy = cy + ryp + diry * fly + bob;\n const q = spring({\n frame: f - s.conv,\n fps,\n config: s.isCell ? CARD : HEAVY,\n });\n const target: Rect = s.isCell\n ? (cells[s.i] as Rect)\n : { x: cx - s.w * 0.1, y: cy - s.h * 0.1, w: s.w * 0.2, h: s.h * 0.2 };\n const tx = target.x + target.w / 2;\n const ty = target.y + target.h / 2;\n return {\n x: sx + (tx - sx) * q,\n y: sy + (ty - sy) * q,\n w: s.w + (target.w - s.w) * q,\n h: s.h + (target.h - s.h) * q,\n rx: s.rx * (1 - q) * (1 - 0.3 * sw),\n ry: (s.ry + (1 - e) * 40 * (dirx > 0 ? -1 : 1)) * (1 - q),\n rz: (s.rz + (1 - e) * 24 * (diry > 0 ? 1 : -1)) * (1 - q),\n e,\n q,\n };\n };\n\n const morph = sp(beat(\"morph\"), MORPH);\n const pillH = portrait ? H * 0.046 : H * 0.096;\n const pillW = portrait ? W * 0.76 : W * 0.34;\n const pillFont = pillH * 0.38;\n const winRect: Rect = {\n x: cx - pillW / 2 + (win.x - (cx - pillW / 2)) * morph,\n y: cy - pillH / 2 + (win.y - (cy - pillH / 2)) * morph,\n w: pillW + (win.w - pillW) * morph,\n h: pillH + (win.h - pillH) * morph,\n };\n const winRadius = pillH / 2 + (cellRadius * 1.7 - pillH / 2) * morph;\n const pillIn = sp(-8, CARD);\n const pct = Math.round(\n interpolate(frame, [0, beat(\"morph\")], [12, 100], {\n ...CLAMP,\n easing: Easing.bezier(0.33, 0, 0.2, 1),\n }),\n );\n const pillText = interpolate(\n frame,\n [beat(\"morph\"), beat(\"morph\") + 5],\n [1, 0],\n { ...CLAMP, easing: Easing.bezier(0.55, 0, 1, 0.45) },\n );\n const chrome = interpolate(\n frame,\n [beat(\"morph\") + 10, beat(\"morph\") + 22],\n [0, 1],\n { ...CLAMP, easing: TYPE_IN },\n );\n const fill = interpolate(morph, [0, 0.25], [0, 1], CLAMP);\n const winBg = light\n ? `rgba(${t.window},${0.78 + 0.22 * fill})`\n : `rgba(${t.window},${0.66 + 0.34 * fill})`;\n const snapPunch = interpolate(\n frame,\n [beat(\"snap\"), beat(\"snap\") + 2, beat(\"snap\") + 10],\n [0, 1, 0],\n { ...CLAMP, easing: MOVE },\n );\n const push = interpolate(frame, [0, beat(\"end\")], [1.02, 1.05]);\n\n const label = Math.max(16 * unit, portrait ? W * 0.026 : W * 0.0135);\n const heroCell = cells[0] as Rect;\n const heroFont = portrait ? heroCell.w * 0.088 : heroCell.w * 0.088;\n const contentIn = (k: number) => sp(beat(\"content\") + k * 3, CARD);\n const headlineIn = (k: number) =>\n interpolate(\n frame,\n [beat(\"content\") + k * 2, beat(\"content\") + k * 2 + 13],\n [0, 1],\n { ...CLAMP, easing: TYPE_IN },\n );\n const custom =\n background || (blooms && blooms.length > 0)\n ? {\n ...(background ? { background } : {}),\n ...(blooms && blooms.length > 0 ? { colors: blooms } : {}),\n }\n : undefined;\n const preset = ground ?? (groundParams ? undefined : t.preset);\n const gParams = groundParams ?? custom;\n\n const order = [...shards].sort((a, b) =>\n a.isCell === b.isCell ? a.z - b.z : a.isCell ? 1 : -1,\n );\n\n const renderShard = (s: (typeof shards)[number]) => {\n const p = shardAt(s, frame);\n const prev = shardAt(s, frame - 1);\n const vel = Math.hypot(p.x - prev.x, p.y - prev.y);\n const motion = Math.min(8, vel * 0.09);\n const depthBlur = s.isCell\n ? 0\n : s.z < 0.3\n ? (0.3 - s.z) * 12\n : s.z > 0.92\n ? 2\n : 0;\n const fade = s.isCell\n ? 1\n : interpolate(frame, [s.conv + 6, s.conv + 14], [1, 0], CLAMP);\n if (fade <= 0) return null;\n const radius = Math.min(p.w, p.h) * 0.07 * (1 - p.q) + cellRadius * p.q;\n const src = srcs[(s.i + (s.isCell ? 0 : 3)) % srcs.length] as string;\n const bg = s.kind === \"accent\" ? accent : t.surface;\n return (\n <div\n key={`sh-${s.i}`}\n style={{\n position: \"absolute\",\n left: p.x - p.w / 2,\n top: p.y - p.h / 2,\n width: p.w,\n height: p.h,\n borderRadius: radius,\n overflow: \"hidden\",\n backgroundColor: bg,\n opacity:\n Math.min(1, p.e * 2) *\n fade *\n (s.isCell ? 1 : 0.55 + 0.45 * Math.min(1, s.z * 2)),\n transform: `perspective(${W * 1.2}px) rotateX(${p.rx}deg) rotateY(${p.ry}deg) rotateZ(${p.rz}deg)`,\n filter:\n motion + depthBlur * (1 - p.q) > 0.3\n ? `blur(${motion + depthBlur * (1 - p.q)}px)`\n : undefined,\n boxShadow: `0 ${2 * unit}px ${6 * unit}px ${shadow(0.5)}, 0 ${24 * unit}px ${60 * unit}px ${shadow(0.5)}`,\n }}\n >\n {s.kind === \"image\" ? (\n <Img\n src={src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n display: \"block\",\n }}\n />\n ) : null}\n {s.kind === \"type\" || s.kind === \"wave\" || s.kind === \"swatch\" ? (\n <Fragment\n kind={s.kind}\n w={p.w}\n h={p.h}\n surface={t.surface}\n ink={t.ink}\n accent={accent}\n seed={s.seed}\n />\n ) : null}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: \"inherit\",\n boxShadow: `inset 0 0 0 1px ${light ? \"rgba(0,0,0,0.1)\" : \"rgba(255,255,255,0.1)\"}`,\n }}\n />\n </div>\n );\n };\n\n return (\n <AbsoluteFill style={{ overflow: \"hidden\" }}>\n <GshGround\n preset={preset}\n params={gParams}\n timeOffset={t.groundOffset}\n timeScale={0.5}\n />\n <AbsoluteFill\n style={{ transform: `scale(${push * (1 + snapPunch * 0.012)})` }}\n >\n {order\n .filter((s) => !s.isCell || frame < beat(\"morph\"))\n .map(renderShard)}\n <div\n style={{\n position: \"absolute\",\n left: winRect.x,\n top: winRect.y,\n width: winRect.w,\n height: winRect.h,\n borderRadius: winRadius,\n backgroundColor: fill > 0.01 ? winBg : t.pill,\n opacity: pillIn,\n transform: `translateY(${(1 - pillIn) * H * 0.04}px)`,\n boxShadow: `inset 0 1px 0 rgba(255,255,255,${light ? 0.9 : 0.07}), 0 0 0 1px ${t.pillEdge}, 0 ${(2 + 4 * morph) * unit}px ${(6 + 10 * morph) * unit}px ${shadow(0.5)}, 0 ${(16 + 40 * morph) * unit}px ${(40 + 100 * morph) * unit}px ${shadow(0.6)}`,\n backdropFilter: fill < 1 ? \"blur(14px)\" : undefined,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: pillFont * 0.7,\n fontFamily: geist.fontFamily,\n fontSize: pillFont,\n fontWeight: 400,\n color: t.pillInk,\n letterSpacing: \"-0.01em\",\n opacity: pillText,\n whiteSpace: \"nowrap\",\n }}\n >\n <span\n style={{\n width: pillFont * 0.42,\n height: pillFont * 0.42,\n borderRadius: \"50%\",\n backgroundColor: accent,\n }}\n />\n <span>{title}</span>\n <span style={{ opacity: 0.5, fontWeight: 300 }}>{status}</span>\n <span\n style={{\n fontFamily: mono.fontFamily,\n opacity: 0.6,\n fontSize: pillFont * 0.9,\n minWidth: \"3.4ch\",\n textAlign: \"right\",\n }}\n >\n {pct}%\n </span>\n </div>\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 0,\n height: bar,\n display: \"flex\",\n alignItems: \"center\",\n padding: `0 ${pad * 1.2}px`,\n opacity: chrome,\n fontFamily: geist.fontFamily,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: label * 0.6,\n fontSize: label,\n color: `rgb(${t.ink})`,\n whiteSpace: \"nowrap\",\n }}\n >\n <RemocnR height={label * 0.95} color={`rgb(${t.ink})`} />\n <span>{title}</span>\n <span\n style={{\n fontFamily: mono.fontFamily,\n fontSize: label * 0.86,\n color: `rgba(${t.ink},0.55)`,\n backgroundColor: t.chip,\n padding: `${label * 0.16}px ${label * 0.45}px`,\n borderRadius: label * 0.3,\n }}\n >\n main\n </span>\n </div>\n <div\n style={{\n marginLeft: \"auto\",\n display: \"flex\",\n alignItems: \"center\",\n gap: label * 0.9,\n }}\n >\n <PlayOutline size={label * 1.15} color={`rgba(${t.ink},0.6)`} />\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n height: bar * 0.56,\n padding: `0 ${label * 0.75}px`,\n borderRadius: label * 0.38,\n backgroundColor: accent,\n boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.22)\",\n fontSize: label * 0.94,\n color: \"#ffffff\",\n transform: `scale(${0.9 + 0.1 * sp(beat(\"snap\") + 6, CHIP)})`,\n }}\n >\n Publish\n </div>\n </div>\n </div>\n </div>\n {frame >= beat(\"morph\")\n ? order.filter((s) => s.isCell).map(renderShard)\n : null}\n {cells.map((c, k) => {\n const p = contentIn(k);\n const text = labels[k] ?? \"\";\n if (k === 0) {\n const words = headline.split(\" \");\n return (\n <div\n key=\"hero\"\n style={{\n position: \"absolute\",\n left: c.x,\n top: c.y,\n width: c.w,\n height: c.h,\n borderRadius: cellRadius,\n overflow: \"hidden\",\n backgroundImage:\n \"linear-gradient(180deg, rgba(8,9,14,0) 38%, rgba(8,9,14,0.82) 100%)\",\n opacity: Math.min(1, p * 1.5),\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flex-end\",\n padding: c.w * 0.065,\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n fontFamily: mono.fontFamily,\n fontSize: label * 0.9,\n color: \"rgba(255,255,255,0.66)\",\n letterSpacing: \"0.06em\",\n textTransform: \"uppercase\",\n marginBottom: label * 0.7,\n transform: `translateY(${(1 - p) * label}px)`,\n }}\n >\n <span style={{ opacity: 0.55 }}>01</span>\n <span style={{ marginLeft: \"0.9em\" }}>{text}</span>\n </div>\n <div\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n columnGap: \"0.24em\",\n fontFamily: geist.fontFamily,\n fontWeight: 400,\n fontSize: heroFont,\n lineHeight: 1.04,\n letterSpacing: \"-0.04em\",\n color: \"#ffffff\",\n maxWidth: \"8.4em\",\n }}\n >\n {words.map((w, wi) => (\n <span\n key={`${w}-${wi}`}\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n padding: \"0 0.02em 0.14em\",\n margin: \"0 -0.02em -0.14em\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n transform: `translateY(${(1 - headlineIn(wi + 1)) * 105}%)`,\n }}\n >\n {w}\n </span>\n </span>\n ))}\n </div>\n </div>\n );\n }\n if (k === 3) {\n return (\n <div\n key=\"accent\"\n style={{\n position: \"absolute\",\n left: c.x,\n top: c.y,\n width: c.w,\n height: c.h,\n padding: Math.min(c.w, c.h) * 0.12,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n fontFamily: geist.fontFamily,\n color: \"#ffffff\",\n }}\n >\n <div\n style={{\n transform: `scale(${sp(beat(\"content\") + 9, CHIP)})`,\n transformOrigin: \"0% 0%\",\n }}\n >\n <PlayIcon size={label * 2} color=\"#ffffff\" />\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"baseline\",\n fontSize: label * 1.08,\n fontWeight: 400,\n letterSpacing: \"-0.01em\",\n opacity: p,\n transform: `translateY(${(1 - p) * label}px)`,\n }}\n >\n <span>{text}</span>\n <span\n style={{\n fontFamily: mono.fontFamily,\n fontSize: label * 0.9,\n opacity: 0.7,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n 0:42\n </span>\n </div>\n </div>\n );\n }\n const cp = interpolate(\n frame,\n [beat(\"content\") + 4 + k * 3, beat(\"content\") + 16 + k * 3],\n [0, 1],\n { ...CLAMP, easing: TYPE_IN },\n );\n return (\n <div\n key={`cap-${k}`}\n style={{\n position: \"absolute\",\n left: c.x,\n top: c.y + c.h * 0.55,\n width: c.w,\n height: c.h * 0.45,\n borderRadius: `0 0 ${cellRadius}px ${cellRadius}px`,\n backgroundImage:\n \"linear-gradient(180deg, rgba(8,9,14,0) 0%, rgba(8,9,14,0.28) 45%, rgba(8,9,14,0.62) 100%)\",\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: label * 0.6,\n padding: label * 0.8,\n boxSizing: \"border-box\",\n fontFamily: geist.fontFamily,\n fontSize: label,\n color: \"#ffffff\",\n opacity: cp,\n whiteSpace: \"nowrap\",\n }}\n >\n <span\n style={{\n fontFamily: mono.fontFamily,\n fontSize: label * 0.86,\n opacity: 0.6,\n transform: `translateY(${(1 - cp) * label * 0.8}px)`,\n }}\n >\n 0{k + 1}\n </span>\n <span style={{ transform: `translateY(${(1 - cp) * label}px)` }}>\n {text}\n </span>\n </div>\n );\n })}\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n\nexport default ShardsToGrid;\n",
"type": "registry:component",
"target": "components/remocn/shards-to-grid.tsx"
}
],
"type": "registry:component"
}