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": "social-scheduler",
"title": "Social Scheduler",
"description": "A weekly post queue where a post is scheduled and a toast confirms.",
"dependencies": ["remotion", "@remotion/google-fonts"],
"registryDependencies": ["@remocn/gsh"],
"files": [
{
"path": "registry/remocn/social-scheduler/index.tsx",
"content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Onest\";\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n spring,\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 { fontFamily } = loadFont(\"normal\", {\n weights: [\"300\", \"400\"],\n subsets: [\"latin\"],\n});\n\nexport interface SchedulerSlot {\n label: string;\n hint?: string;\n}\n\nexport interface QueuePost {\n day: string;\n time: string;\n text: string;\n media?: boolean;\n}\n\nexport interface SocialSchedulerProps {\n text?: string;\n brand?: string;\n handle?: string;\n followers?: string;\n mediaSrc?: string;\n networks?: [string, string];\n slots?: SchedulerSlot[];\n pick?: number;\n queue?: QueuePost[];\n weekLabel?: string;\n days?: string[];\n theme?: \"light\" | \"dark\";\n accent?: string;\n speed?: number;\n ground?: GshPresetId;\n groundParams?: Partial<GradientParams>;\n}\n\nconst DEFAULT_TEXT =\n \"remocn 2.0 is live: 120 Remotion components you copy, paste and own. Your next launch video takes an afternoon, not a sprint.\";\n\nconst DEFAULT_SLOTS: SchedulerSlot[] = [\n { label: \"Mon 17:30\" },\n { label: \"Tue 9:00\", hint: \"Best time\" },\n { label: \"Wed 12:15\", hint: \"High reach\" },\n { label: \"Thu 8:45\" },\n];\n\nconst DEFAULT_QUEUE: QueuePost[] = [\n {\n day: \"Mon\",\n time: \"9:00\",\n text: \"How we tuned spring physics for UI motion\",\n },\n {\n day: \"Mon\",\n time: \"14:30\",\n text: \"Poll: which transition should we ship next?\",\n },\n {\n day: \"Tue\",\n time: \"8:30\",\n text: \"Thread: five launch video mistakes we made\",\n },\n {\n day: \"Tue\",\n time: \"12:00\",\n text: \"Customer story: how Kitebase cut a demo in a day\",\n },\n {\n day: \"Tue\",\n time: \"16:30\",\n text: \"Weekly changelog: captions and a new cursor\",\n },\n {\n day: \"Wed\",\n time: \"10:00\",\n text: \"Live: building a launch video with Fernway\",\n },\n {\n day: \"Wed\",\n time: \"15:00\",\n text: \"Tip: own your code, don’t fight a black box\",\n },\n {\n day: \"Thu\",\n time: \"9:15\",\n text: \"Behind the scenes of the remocn registry\",\n },\n {\n day: \"Thu\",\n time: \"13:45\",\n text: \"Five templates for your next product launch\",\n },\n {\n day: \"Fri\",\n time: \"11:00\",\n text: \"Community showcase: Halcyon’s launch reel\",\n },\n];\n\nconst DEFAULT_DAYS = [\"Mon 26\", \"Tue 27\", \"Wed 28\", \"Thu 29\", \"Fri 30\"];\n\nconst CL = { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" } as const;\nconst enterEase = Easing.bezier(0.32, 0.72, 0, 1);\nconst exitEase = Easing.bezier(0.55, 0, 1, 0.45);\nconst camEase = Easing.bezier(0.87, 0, 0.13, 1);\nconst tween = (f: number, a: number, b: number, easing = enterEase) =>\n interpolate(f, [a, b], [0, 1], { ...CL, easing });\nconst lerp = (a: number, b: number, t: number) => a + (b - a) * t;\nconst clamp = (v: number, lo: number, hi: number) =>\n Math.min(hi, Math.max(lo, v));\n\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\nfunction withAlpha(color: string, alpha: number) {\n const hex = color.replace(\"#\", \"\");\n const full = hex.length === 3 ? hex.replace(/(.)/g, \"$1$1\") : hex;\n if (!/^[0-9a-fA-F]{6}$/.test(full)) return color;\n const n = Number.parseInt(full, 16);\n return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${alpha})`;\n}\n\nconst hash = (i: number) => {\n const s = Math.sin(i * 127.1 + 311.7) * 43758.5453;\n return s - Math.floor(s);\n};\n\nfunction typedCount(text: string, frame: number, start: number) {\n let t = start;\n for (let i = 0; i < text.length; i++) {\n t += 0.38 + hash(i) * 0.22 + (/[.:,]/.test(text[i - 1] ?? \"\") ? 2 : 0);\n if (t > frame) return i;\n }\n return text.length;\n}\n\ninterface Pt {\n x: number;\n y: number;\n}\n\nfunction arcTo(a: Pt, b: Pt, p: number, bend = 0.16): Pt {\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n const d = Math.hypot(dx, dy) || 1;\n const bow = Math.sin(clamp(p, 0, 1) * Math.PI) * Math.min(56, d * bend);\n return {\n x: lerp(a.x, b.x, p) + (dy / d) * bow,\n y: lerp(a.y, b.y, p) - (dx / d) * bow,\n };\n}\n\nfunction Cursor({ x, y, scale }: { x: number; y: number; scale: number }) {\n return (\n <svg\n width={24}\n height={28}\n viewBox=\"0 0 20 24\"\n style={{\n position: \"absolute\",\n left: x - 2,\n top: y - 2,\n transformOrigin: \"2px 2px\",\n transform: `scale(${scale})`,\n filter: \"drop-shadow(0 3px 6px rgba(0,0,0,0.3))\",\n overflow: \"visible\",\n }}\n >\n <path\n d=\"M2 2 L2 19.5 L6.6 15.4 L9.8 22.4 L12.9 21 L9.8 14.2 L16 14.2 Z\"\n fill=\"#FFFFFF\"\n stroke=\"#16171A\"\n strokeWidth={1.1}\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\ninterface Pal {\n board: string;\n col: string;\n card: string;\n comp: string;\n panel: string;\n pop: string;\n line: string;\n ring: string;\n text: string;\n muted: string;\n faint: string;\n green: string;\n dim: string;\n scrim: string;\n winShadow: string;\n cardShadow: string;\n popShadow: string;\n stageText: string;\n stageMuted: string;\n dark: boolean;\n}\n\nfunction palette(theme: \"light\" | \"dark\"): Pal {\n return theme === \"dark\"\n ? {\n board: \"#0E0F12\",\n col: \"rgba(255,255,255,0.025)\",\n card: \"#17181C\",\n comp: \"#111215\",\n panel: \"#0C0D10\",\n pop: \"#1A1B1F\",\n line: \"rgba(255,255,255,0.07)\",\n ring: \"rgba(255,255,255,0.09)\",\n text: \"#EEEEF0\",\n muted: \"rgba(238,238,240,0.6)\",\n faint: \"rgba(238,238,240,0.38)\",\n green: \"#62D893\",\n dim: \"rgba(3,4,8,0.45)\",\n scrim: \"rgba(3,4,10,0.25)\",\n winShadow:\n \"0 0 0 1px rgba(255,255,255,0.09), inset 0 1px 0 rgba(255,255,255,0.05), 0 40px 90px -24px rgba(0,0,0,0.75), 0 10px 28px rgba(0,0,0,0.35)\",\n cardShadow: \"0 0 0 1px rgba(255,255,255,0.07)\",\n popShadow:\n \"0 0 0 1px rgba(255,255,255,0.11), inset 0 1px 0 rgba(255,255,255,0.06), 0 24px 48px -12px rgba(0,0,0,0.7)\",\n stageText: \"#F2F2F4\",\n stageMuted: \"rgba(242,242,244,0.62)\",\n dark: true,\n }\n : {\n board: \"#FAFAF9\",\n col: \"rgba(22,23,26,0.025)\",\n card: \"#FFFFFF\",\n comp: \"#FFFFFF\",\n panel: \"#F6F6F4\",\n pop: \"#FFFFFF\",\n line: \"rgba(22,23,26,0.08)\",\n ring: \"rgba(22,23,26,0.1)\",\n text: \"#16171A\",\n muted: \"rgba(22,23,26,0.6)\",\n faint: \"rgba(22,23,26,0.4)\",\n green: \"#18794E\",\n dim: \"rgba(236,238,244,0.5)\",\n scrim: \"rgba(238,240,246,0.15)\",\n winShadow:\n \"0 0 0 1px rgba(17,19,24,0.07), 0 1px 2px rgba(17,19,24,0.05), 0 30px 70px -20px rgba(28,38,92,0.28)\",\n cardShadow:\n \"0 0 0 1px rgba(17,19,24,0.06), 0 1px 2px rgba(17,19,24,0.04)\",\n popShadow:\n \"0 0 0 1px rgba(17,19,24,0.08), 0 2px 4px rgba(17,19,24,0.05), 0 22px 44px -14px rgba(28,38,92,0.3)\",\n stageText: \"#14151A\",\n stageMuted: \"rgba(20,21,26,0.6)\",\n dark: false,\n };\n}\n\nconst ICONS = {\n image:\n \"M3.5 2.75h9a.75.75 0 0 1 .75.75v9a.75.75 0 0 1-.75.75h-9a.75.75 0 0 1-.75-.75v-9a.75.75 0 0 1 .75-.75zM2.75 10.5l3-3 2.5 2.5 1.5-1.5 3.5 3.5M10.25 5.75h.01\",\n cal: \"M3.5 3.5h9a.75.75 0 0 1 .75.75v8.5a.75.75 0 0 1-.75.75h-9a.75.75 0 0 1-.75-.75v-8.5a.75.75 0 0 1 .75-.75zM2.75 6.5h10.5M5.5 2v2.5M10.5 2v2.5\",\n chev: \"M4.75 6.5 8 9.75l3.25-3.25\",\n x: \"M4.75 4.75l6.5 6.5M11.25 4.75l-6.5 6.5\",\n check: \"M3.5 8.5l3 3 6-6.5\",\n clock: \"M8 13.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zM8 5v3.25l2 1.25\",\n reply: \"M3 7.5a4.5 4.5 0 0 1 4.5-4.5h1a4.5 4.5 0 0 1 0 9H6l-3 2v-6.5z\",\n repost:\n \"M4 6.5V5.25a1.5 1.5 0 0 1 1.5-1.5H12M10.5 2.25 12 3.75l-1.5 1.5M12 9.5v1.25a1.5 1.5 0 0 1-1.5 1.5H4M5.5 13.75 4 12.25l1.5-1.5\",\n heart:\n \"M8 13S2.75 9.9 2.75 6.25A2.75 2.75 0 0 1 8 5a2.75 2.75 0 0 1 5.25 1.25C13.25 9.9 8 13 8 13z\",\n chart: \"M3 13V8.5M6.5 13V4.5M10 13V7M13.5 13V3\",\n} as const;\ntype IconName = keyof typeof ICONS;\n\nfunction Icon({\n name,\n color,\n size = 16,\n}: {\n name: IconName;\n color: string;\n size?: number;\n}) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 16 16\"\n style={{ flexShrink: 0, display: \"block\" }}\n >\n <path\n d={ICONS[name]}\n fill=\"none\"\n stroke={color}\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction NetworkMark({\n kind,\n size,\n pal,\n}: {\n kind: 0 | 1;\n size: number;\n pal: Pal;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: size * 0.3,\n background: kind === 0 ? (pal.dark ? \"#EDEDEF\" : \"#16171A\") : \"#2F6F64\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n }}\n >\n <svg width={size * 0.62} height={size * 0.62} viewBox=\"0 0 16 16\">\n <path\n d={\n kind === 0\n ? \"M10.5 10.5 13 13M7.25 11.5a4.25 4.25 0 1 0 0-8.5 4.25 4.25 0 0 0 0 8.5z\"\n : \"M3.5 9.5 8 5l4.5 4.5M3.5 13 8 8.5l4.5 4.5\"\n }\n fill=\"none\"\n stroke={kind === 0 && pal.dark ? \"#16171A\" : \"#fff\"}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n );\n}\n\nfunction Media({\n w,\n h,\n accent,\n src,\n radius,\n}: {\n w: number;\n h: number;\n accent: string;\n src?: string;\n radius: number;\n}) {\n if (src) {\n return (\n <Img\n src={src}\n style={{\n width: w,\n height: h,\n objectFit: \"cover\",\n borderRadius: radius,\n display: \"block\",\n }}\n />\n );\n }\n const k = h / 100;\n const wide = w / h > 1.3;\n return (\n <div\n style={{\n width: w,\n height: h,\n borderRadius: radius,\n overflow: \"hidden\",\n position: \"relative\",\n background: \"#0E0F12\",\n outline: \"1px solid rgba(255,255,255,0.1)\",\n outlineOffset: -1,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: \"9%\",\n top: wide ? \"16%\" : \"14%\",\n color: \"#fff\",\n fontSize: (wide ? 20 : 30) * k,\n fontWeight: 300,\n letterSpacing: \"-0.04em\",\n lineHeight: 1,\n }}\n >\n {wide ? \"remocn 2.0\" : \"2.0\"}\n </div>\n {[0, 1, 2].map((i) => (\n <div\n key={i}\n style={{\n position: \"absolute\",\n right: `${(wide ? 7 : 12) + i * (wide ? 13 : 24)}%`,\n bottom: \"12%\",\n width: wide ? \"11%\" : \"18%\",\n height: `${26 + i * 12}%`,\n borderRadius: 4 * k,\n background:\n i === 0 ? accent : `rgba(255,255,255,${0.16 - i * 0.04})`,\n }}\n />\n ))}\n </div>\n );\n}\n\nconst T = {\n comp: 0,\n type: 10,\n cursorIn: 62,\n media: 90,\n time: 110,\n slot: 128,\n sched: 144,\n land: 160,\n toast: 184,\n end: 228,\n};\n\nexport function SocialScheduler({\n text = DEFAULT_TEXT,\n brand = \"remocn\",\n handle = \"remocn\",\n mediaSrc,\n networks = [\"Quill\", \"Guild\"],\n slots = DEFAULT_SLOTS,\n pick = 1,\n queue = DEFAULT_QUEUE,\n weekLabel = \"Oct 26 – 30, 2026\",\n days = DEFAULT_DAYS,\n theme = \"light\",\n accent = \"#3B5BFD\",\n speed = 1,\n ground,\n groundParams,\n}: SocialSchedulerProps) {\n const frame = useCurrentFrame() * speed;\n const { width: W, height: H, fps } = useVideoConfig();\n const pal = palette(theme);\n const tall = H > W * 1.2;\n const D = tall ? { w: 800, h: 1422 } : { w: 1280, h: 720 };\n const s = Math.min(W / D.w, H / D.h);\n const sp = (at: number, config: object) =>\n spring({ frame: frame - at, fps, config });\n\n const slot = slots[clamp(pick, 0, slots.length - 1)] ?? DEFAULT_SLOTS[1];\n const [slotDay, slotTime = \"\"] = slot.label.split(\" \");\n const toMin = (t: string) => {\n const [h, m] = t.split(\":\").map(Number);\n return (h || 0) * 60 + (m || 0);\n };\n const allDays = days.map((d) => d.split(\" \")[0]);\n const pickedCol = Math.max(0, allDays.indexOf(slotDay));\n const visible = tall\n ? days.slice(\n clamp(pickedCol - 1, 0, Math.max(0, days.length - 3)),\n clamp(pickedCol - 1, 0, Math.max(0, days.length - 3)) + 3,\n )\n : days;\n const dayNames = visible.map((d) => d.split(\" \")[0]);\n const col = Math.max(0, dayNames.indexOf(slotDay));\n\n const BOARD = tall\n ? { x: 40, y: 330, w: 720, h: 1000 }\n : { x: 150, y: 62, w: 980, h: 596 };\n const COMP = tall\n ? { x: 40, y: 250, w: 720, h: 1100 }\n : { x: 176, y: 78, w: 928, h: 564 };\n const BPAD = 24;\n const GAP = 12;\n const COL_W =\n (BOARD.w - BPAD * 2 - GAP * (dayNames.length - 1)) / dayNames.length;\n const COL_Y = 64 + 52;\n const CARD_H = 100;\n const CARD_GAP = 10;\n const colX = (i: number) => BPAD + i * (COL_W + GAP);\n\n const PAD = 28;\n const HEAD_H = 60;\n const FOOT_H = 76;\n const FOOT_Y = COMP.h - FOOT_H;\n const ED = { x: PAD, y: HEAD_H, w: tall ? COMP.w - PAD * 2 : 440 };\n const PV = tall\n ? { x: 0, y: 470, w: COMP.w, h: FOOT_Y - 470 }\n : {\n x: PAD + 440 + PAD,\n y: HEAD_H,\n w: COMP.w - (PAD + 440 + PAD),\n h: FOOT_Y - HEAD_H,\n };\n const TEXT_Y = ED.y + 80;\n const TEXT_H = tall ? 170 : 150;\n const MEDIA_Y = TEXT_Y + TEXT_H + 14;\n const TILE = 104;\n const SCHED = { x: COMP.w - PAD - 132, w: 132 };\n const TIME = { x: SCHED.x - 12 - 196, w: 196 };\n const BTN_Y = FOOT_Y + 18;\n const ROW_H = 44;\n const POP_H = 44 + slots.length * ROW_H + 8;\n const POP_Y = BTN_Y - 10 - POP_H;\n const PV_CARD = {\n x: PV.x + PAD,\n y: PV.y + 56,\n w: PV.w - PAD * 2,\n };\n\n const typed = typedCount(text, frame, T.type);\n const typing = typed < text.length;\n const caretOn = typing || Math.floor(frame / 15) % 2 === 0;\n const body = text.slice(0, typed);\n\n const compIn = sp(T.comp, HEAVY);\n const compInA = tween(frame, 0, 10);\n const compOut = tween(frame, T.sched + 4, T.sched + 16, exitEase);\n const boardFocus = sp(T.sched + 11, HEAVY);\n const mediaIn = sp(T.media + 2, CARD);\n const mediaGrow = sp(T.media + 2, MORPH);\n const popIn = sp(T.time + 2, CARD);\n const popA =\n tween(frame, T.time + 1, T.time + 7) *\n (1 - tween(frame, T.slot + 3, T.slot + 9, exitEase));\n const picked = frame >= T.slot + 2;\n const pickLabel = sp(T.slot + 2, CHIP);\n const fly = sp(T.land - 4, HEAVY);\n const shift = sp(T.land, CARD);\n const landed = frame >= T.land + 18;\n const ringA =\n tween(frame, T.land + 14, T.land + 22) *\n (1 - 0.6 * tween(frame, T.land + 50, T.land + 70));\n const toast = sp(T.toast, CARD);\n const toastA = tween(frame, T.toast, T.toast + 8);\n const cam = tween(frame, T.sched, T.end, camEase);\n\n const columns = dayNames.map((d) =>\n queue\n .filter((q) => q.day === d)\n .sort((a, b) => toMin(a.time) - toMin(b.time)),\n );\n const insertAt =\n columns[col]?.filter((q) => toMin(q.time) < toMin(slotTime)).length ?? 0;\n const target = {\n x: BOARD.x + colX(col),\n y: BOARD.y + COL_Y + insertAt * (CARD_H + CARD_GAP),\n };\n const flyFrom = {\n x: COMP.x + COMP.w / 2 - COL_W / 2,\n y: COMP.y + COMP.h * 0.42,\n };\n const flyPos = arcTo(flyFrom, target, fly, 0.2);\n\n const at = (x: number, y: number) => ({ x: COMP.x + x, y: COMP.y + y });\n const tilePt = at(ED.x + TILE / 2, MEDIA_Y + TILE / 2 + 6);\n const timePt = at(TIME.x + 64, BTN_Y + 24);\n const slotPt = at(TIME.x + 110, POP_Y + 44 + pick * ROW_H + 24);\n const schedPt = at(SCHED.x + 70, BTN_Y + 24);\n const restPt = {\n x: target.x + COL_W * 0.7,\n y: target.y + CARD_H + 60,\n };\n const startPt = { x: D.w * 0.82, y: D.h + 40 };\n const legs: [number, Pt, Pt][] = [\n [T.cursorIn, startPt, tilePt],\n [T.media + 6, tilePt, timePt],\n [T.time + 4, timePt, slotPt],\n [T.slot + 4, slotPt, schedPt],\n [T.sched + 8, schedPt, restPt],\n ];\n let cur: Pt = startPt;\n for (const [t0, a, b] of legs) {\n if (frame >= t0) cur = arcTo(a, b, sp(t0, CARD));\n }\n const clicks = [T.media, T.time, T.slot, T.sched];\n const pressOf = (c: number) =>\n clamp(sp(c - 3, CHIP) - sp(c + 2, CHIP), 0, 1.2);\n const press = Math.max(...clicks.map(pressOf));\n const cursorA =\n tween(frame, T.cursorIn, T.cursorIn + 6) *\n (1 - tween(frame, T.toast + 20, T.toast + 28, exitEase));\n\n const qCard = (post: QueuePost, hl = 0, isNew = false) => (\n <div\n style={{\n width: COL_W,\n height: CARD_H,\n boxSizing: \"border-box\",\n borderRadius: 12,\n background: pal.card,\n padding: \"12px 14px\",\n boxShadow: isNew\n ? `0 0 0 ${1 + hl}px ${withAlpha(accent, 0.3 + 0.6 * hl)}, 0 12px 28px -10px ${withAlpha(accent, 0.35 * hl)}`\n : pal.cardShadow,\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 6 }}>\n <span\n style={{\n fontSize: 16,\n color: pal.text,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n {post.time}\n </span>\n <div style={{ flex: 1 }} />\n <NetworkMark kind={0} size={16} pal={pal} />\n <NetworkMark kind={1} size={16} pal={pal} />\n </div>\n <div\n style={{\n marginTop: 6,\n fontSize: 16,\n lineHeight: 1.35,\n color: pal.muted,\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n overflow: \"hidden\",\n }}\n >\n {post.text}\n </div>\n </div>\n );\n\n const btn = (\n x: number,\n w: number,\n content: React.ReactNode,\n primary: boolean,\n c: number,\n enabled = true,\n ) => (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: BTN_Y,\n width: w,\n height: 44,\n boxSizing: \"border-box\",\n borderRadius: 10,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: primary ? \"center\" : \"flex-start\",\n gap: 10,\n padding: primary ? 0 : \"0 14px\",\n fontSize: 16,\n whiteSpace: \"nowrap\",\n color: primary ? \"#fff\" : pal.text,\n background: primary ? accent : \"transparent\",\n boxShadow: primary\n ? \"inset 0 1px 0 rgba(255,255,255,0.18), 0 1px 2px rgba(17,19,24,0.2)\"\n : `inset 0 0 0 1px ${pal.ring}`,\n opacity: enabled ? 1 : 0.45,\n transform: `scale(${1 - 0.04 * pressOf(c)})`,\n }}\n >\n {content}\n </div>\n );\n\n const thumbW = PV_CARD.w;\n const thumbH = Math.round(Math.min(thumbW * 0.5, tall ? 240 : 136));\n\n return (\n <AbsoluteFill\n style={{\n fontFamily,\n fontWeight: 400,\n overflow: \"hidden\",\n WebkitFontSmoothing: \"antialiased\",\n background: pal.dark ? \"#04050C\" : \"#EEF0F6\",\n }}\n >\n <GshGround\n preset={ground ?? (pal.dark ? \"velvet-hour\" : \"glasswork\")}\n params={groundParams}\n timeOffset={pal.dark ? 6 : 9}\n timeScale={0.3}\n />\n <AbsoluteFill style={{ background: pal.scrim }} />\n <div\n style={{\n position: \"absolute\",\n left: (W - D.w * s) / 2,\n top: (H - D.h * s) / 2,\n width: D.w,\n height: D.h,\n transformOrigin: \"0 0\",\n transform: `scale(${s})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n transformOrigin: `${target.x + COL_W / 2}px ${target.y + CARD_H / 2}px`,\n transform: `scale(${1 + 0.035 * cam})`,\n }}\n >\n {tall ? (\n <div style={{ position: \"absolute\", left: 48, top: 64 }}>\n <div style={{ fontSize: 26, color: pal.stageMuted }}>\n {picked ? \"Scheduled for\" : \"New post\"}\n </div>\n <div\n style={{\n marginTop: 6,\n fontSize: 104,\n fontWeight: 300,\n letterSpacing: \"-0.045em\",\n lineHeight: 1.05,\n color: pal.stageText,\n height: 112,\n overflow: \"hidden\",\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n <div\n style={{\n transform: `translateY(${(picked ? 1 - pickLabel : 1 - tween(frame, 4, 18)) * 100}%)`,\n }}\n >\n {picked ? slot.label : \"Draft\"}\n </div>\n </div>\n </div>\n ) : null}\n\n <div\n style={{\n position: \"absolute\",\n left: BOARD.x,\n top: BOARD.y,\n width: BOARD.w,\n height: BOARD.h,\n borderRadius: 16,\n background: pal.board,\n boxShadow: pal.winShadow,\n overflow: \"hidden\",\n opacity: tween(frame, 0, 8),\n transform: `scale(${0.95 + 0.05 * boardFocus})`,\n filter: `blur(${(1 - clamp(boardFocus, 0, 1)) * 5}px)`,\n }}\n >\n <div\n style={{\n height: 64,\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n padding: `0 ${BPAD + 4}px`,\n borderBottom: `1px solid ${pal.line}`,\n }}\n >\n <span style={{ fontSize: 20, color: pal.text }}>Queue</span>\n <span style={{ fontSize: 16, color: pal.muted }}>\n {weekLabel}\n </span>\n </div>\n {visible.map((d, i) => {\n const posts = columns[i];\n const count = posts.length + (i === col && landed ? 1 : 0);\n return (\n <div key={d}>\n <div\n style={{\n position: \"absolute\",\n left: colX(i),\n top: 72,\n width: COL_W,\n height: BOARD.h - 72 - BPAD,\n borderRadius: 12,\n background: pal.col,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: colX(i) + 4,\n top: 64 + 18,\n fontSize: 16,\n color: pal.text,\n display: \"flex\",\n gap: 8,\n }}\n >\n {d}\n <span\n style={{\n color: pal.faint,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n {count}\n </span>\n </div>\n {posts.map((p, k) => {\n const down = i === col && k >= insertAt ? shift : 0;\n return (\n <div\n key={`${p.day}-${p.time}`}\n style={{\n position: \"absolute\",\n left: colX(i),\n top: COL_Y + (k + down) * (CARD_H + CARD_GAP),\n }}\n >\n {qCard(p)}\n </div>\n );\n })}\n </div>\n );\n })}\n <AbsoluteFill\n style={{\n background: pal.dim,\n opacity: 1 - clamp(boardFocus, 0, 1),\n }}\n />\n </div>\n\n {frame >= T.land - 4 ? (\n <div\n style={{\n position: \"absolute\",\n left: flyPos.x,\n top: flyPos.y,\n transform: `scale(${1 + 0.18 * (1 - clamp(fly, 0, 1))})`,\n transformOrigin: \"0 0\",\n opacity: tween(frame, T.land - 4, T.land + 2),\n zIndex: 3,\n }}\n >\n {qCard(\n { day: slotDay, time: slotTime, text, media: true },\n ringA,\n true,\n )}\n </div>\n ) : null}\n\n {compOut < 1 ? (\n <div\n style={{\n position: \"absolute\",\n left: COMP.x,\n top: COMP.y,\n width: COMP.w,\n height: COMP.h,\n opacity: compInA * (1 - compOut),\n transform: `translateY(${(1 - compIn) * 56 + compOut * 28}px) scale(${(0.96 + 0.04 * compIn) * (1 - 0.08 * compOut)})`,\n transformOrigin: \"50% 60%\",\n zIndex: 4,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: 18,\n background: pal.comp,\n boxShadow: pal.winShadow,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: PV.x,\n top: PV.y,\n width: PV.w,\n height: PV.h,\n background: pal.panel,\n borderLeft: tall ? \"none\" : `1px solid ${pal.line}`,\n borderTop: tall ? `1px solid ${pal.line}` : \"none\",\n }}\n />\n <div\n style={{\n height: HEAD_H,\n display: \"flex\",\n alignItems: \"center\",\n padding: `0 ${PAD}px`,\n borderBottom: `1px solid ${pal.line}`,\n fontSize: 18,\n color: pal.text,\n }}\n >\n New post\n <div style={{ flex: 1 }} />\n <Icon name=\"x\" color={pal.faint} size={18} />\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: ED.x,\n top: ED.y + 22,\n display: \"flex\",\n gap: 10,\n }}\n >\n {networks.map((nw, i) => (\n <div\n key={nw}\n style={{\n height: 36,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"0 14px 0 8px\",\n borderRadius: 18,\n boxShadow: `inset 0 0 0 1px ${pal.ring}`,\n fontSize: 16,\n color: pal.text,\n opacity: tween(frame, 6 + i * 3, 16 + i * 3),\n }}\n >\n <NetworkMark kind={i as 0 | 1} size={22} pal={pal} />\n {nw}\n </div>\n ))}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: ED.x,\n top: TEXT_Y,\n width: ED.w,\n height: TEXT_H,\n fontSize: tall ? 24 : 21,\n fontWeight: 300,\n lineHeight: 1.45,\n letterSpacing: \"-0.01em\",\n color: pal.text,\n textWrap: \"pretty\",\n }}\n >\n {body}\n {caretOn ? (\n <span\n style={{\n display: \"inline-block\",\n width: 2,\n height: \"1.05em\",\n background: accent,\n marginLeft: 2,\n verticalAlign: \"-0.15em\",\n }}\n />\n ) : null}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: ED.x,\n top: MEDIA_Y,\n display: \"flex\",\n gap: 12,\n }}\n >\n {frame >= T.media + 2 ? (\n <div\n style={{\n width: TILE * clamp(mediaGrow, 0, 1),\n height: TILE,\n transform: `scale(${0.7 + 0.3 * mediaIn})`,\n transformOrigin: \"0 50%\",\n opacity: clamp(mediaIn * 2, 0, 1),\n }}\n >\n <Media\n w={TILE}\n h={TILE}\n accent={accent}\n src={mediaSrc}\n radius={12}\n />\n </div>\n ) : null}\n <div\n style={{\n width: TILE,\n height: TILE,\n boxSizing: \"border-box\",\n borderRadius: 12,\n border: `1.5px dashed ${pal.ring}`,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 8,\n fontSize: 16,\n color: pal.muted,\n transform: `scale(${1 - 0.04 * pressOf(T.media)})`,\n }}\n >\n <Icon name=\"image\" color={pal.muted} size={20} />\n Media\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: PV.x + PAD,\n top: PV.y + 24,\n fontSize: 16,\n color: pal.muted,\n }}\n >\n Preview\n </div>\n <div\n style={{\n position: \"absolute\",\n left: PV_CARD.x,\n top: PV_CARD.y,\n width: PV_CARD.w,\n boxSizing: \"border-box\",\n borderRadius: 14,\n background: pal.card,\n boxShadow: pal.cardShadow,\n padding: 16,\n }}\n >\n <div style={{ display: \"flex\", gap: 12 }}>\n <div\n style={{\n width: 40,\n height: 40,\n borderRadius: 12,\n background: accent,\n color: \"#fff\",\n fontSize: 19,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n }}\n >\n {brand.slice(0, 1)}\n </div>\n <div style={{ minWidth: 0 }}>\n <div style={{ fontSize: 16, color: pal.text }}>\n {brand}\n </div>\n <div style={{ fontSize: 16, color: pal.faint }}>\n @{handle} · {picked ? slot.label : \"now\"}\n </div>\n </div>\n </div>\n <div\n style={{\n marginTop: 12,\n fontSize: 16,\n lineHeight: 1.45,\n color: pal.text,\n minHeight: 23,\n textWrap: \"pretty\",\n }}\n >\n {body}\n </div>\n <div\n style={{\n height: (thumbH + 14) * clamp(mediaGrow, 0, 1),\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n paddingTop: 14,\n opacity: clamp(mediaIn, 0, 1),\n }}\n >\n <Media\n w={thumbW - 32}\n h={thumbH}\n accent={accent}\n src={mediaSrc}\n radius={10}\n />\n </div>\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n marginTop: 14,\n padding: \"0 4px\",\n }}\n >\n {([\"reply\", \"repost\", \"heart\", \"chart\"] as IconName[]).map(\n (ic) => (\n <Icon key={ic} name={ic} color={pal.faint} size={18} />\n ),\n )}\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: FOOT_Y,\n height: 1,\n background: pal.line,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: PAD,\n top: BTN_Y + 12,\n fontSize: 16,\n color: pal.faint,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n {typed} / 280\n </div>\n {btn(\n TIME.x,\n TIME.w,\n <>\n <Icon\n name={picked ? \"check\" : \"cal\"}\n color={picked ? accent : pal.muted}\n />\n <span\n style={{\n display: \"inline-block\",\n transform: picked\n ? `translateY(${(1 - pickLabel) * 8}px)`\n : undefined,\n }}\n >\n {picked ? slot.label : \"Pick a time\"}\n </span>\n <div style={{ flex: 1 }} />\n <Icon name=\"chev\" color={pal.faint} />\n </>,\n false,\n T.time,\n )}\n {btn(SCHED.x, SCHED.w, \"Schedule\", true, T.sched, picked)}\n </div>\n\n {popA > 0 ? (\n <div\n style={{\n position: \"absolute\",\n left: TIME.x,\n top: POP_Y,\n width: 290,\n height: POP_H,\n boxSizing: \"border-box\",\n borderRadius: 14,\n background: pal.pop,\n boxShadow: pal.popShadow,\n padding: \"12px 6px 6px\",\n opacity: popA,\n transform: `translateY(${(1 - popIn) * 10}px) scale(${0.94 + 0.06 * popIn})`,\n transformOrigin: \"20% 100%\",\n }}\n >\n <div\n style={{\n fontSize: 16,\n color: pal.faint,\n padding: \"2px 12px 10px\",\n }}\n >\n Suggested times\n </div>\n {slots.map((sl, i) => {\n const hot = i === pick && frame >= T.slot - 8;\n return (\n <div\n key={sl.label}\n style={{\n height: ROW_H,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n padding: \"0 12px\",\n borderRadius: 9,\n background: hot\n ? withAlpha(accent, pal.dark ? 0.16 : 0.08)\n : \"transparent\",\n fontSize: 16,\n color: pal.text,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n <Icon name=\"clock\" color={hot ? accent : pal.faint} />\n {sl.label}\n <div style={{ flex: 1 }} />\n {sl.hint ? (\n <span\n style={{\n color: i === pick ? accent : pal.faint,\n }}\n >\n {sl.hint}\n </span>\n ) : null}\n </div>\n );\n })}\n </div>\n ) : null}\n </div>\n ) : null}\n\n {frame >= T.toast ? (\n <div\n style={{\n position: \"absolute\",\n left: BOARD.x + BOARD.w / 2,\n top: BOARD.y + BOARD.h - 26,\n transform: `translateX(-50%) translateY(${(1 - toast) * 24}px)`,\n opacity: toastA,\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n height: 52,\n padding: \"0 10px 0 18px\",\n borderRadius: 14,\n background: pal.dark ? \"#1E1F24\" : \"#16171A\",\n boxShadow:\n \"0 0 0 1px rgba(255,255,255,0.08), 0 18px 40px -12px rgba(0,0,0,0.55)\",\n color: \"#F2F2F4\",\n fontSize: 16,\n whiteSpace: \"nowrap\",\n zIndex: 5,\n }}\n >\n <Icon name=\"check\" color={pal.dark ? pal.green : \"#7EE2A8\"} />\n Scheduled for {slot.label}\n <span\n style={{\n marginLeft: 6,\n padding: \"6px 12px\",\n borderRadius: 9,\n background: \"rgba(255,255,255,0.08)\",\n color: \"rgba(242,242,244,0.75)\",\n }}\n >\n Undo\n </span>\n </div>\n ) : null}\n\n <div\n style={{\n opacity: cursorA,\n zIndex: 6,\n position: \"absolute\",\n inset: 0,\n }}\n >\n <Cursor x={cur.x} y={cur.y} scale={1 - 0.04 * press} />\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/social-scheduler.tsx"
}
],
"type": "registry:component"
}