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": "calendar-booking",
"title": "Calendar Booking",
"description": "A cursor picks a time slot and a meeting-scheduled confirmation appears.",
"dependencies": ["remotion", "@remotion/google-fonts"],
"registryDependencies": ["@remocn/gsh"],
"files": [
{
"path": "registry/remocn/calendar-booking/index.tsx",
"content": "\"use client\";\n\nimport { loadFont as loadSans } from \"@remotion/google-fonts/InstrumentSans\";\nimport { loadFont as loadSerif } from \"@remotion/google-fonts/InstrumentSerif\";\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\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 sans = loadSans(\"normal\", { weights: [\"400\"], subsets: [\"latin\"] });\nconst serif = loadSerif(\"normal\", { weights: [\"400\"], subsets: [\"latin\"] });\n\nexport interface BookingHost {\n name: string;\n email?: string;\n /** Two-letter monogram for the avatar. */\n initials?: string;\n}\n\nexport interface BookingEvent {\n title: string;\n description?: string;\n durations?: string[];\n /** Index into `durations` that is booked. */\n duration?: number;\n location?: string;\n timezone?: string;\n /** Month shown on the calendar. */\n month?: string;\n year?: number;\n /** Weekday of the 1st, 0 = Sunday. */\n firstWeekday?: number;\n daysInMonth?: number;\n /** First bookable day; weekends are never bookable. */\n firstAvailable?: number;\n}\n\nexport interface CalendarBookingProps {\n host?: BookingHost;\n event?: BookingEvent;\n slots?: string[];\n /** Slot the cursor picks. Defaults to \"10:30am\" or the 4th slot. */\n pick?: string;\n /** Day of the month the cursor picks. */\n day?: number;\n accent?: string;\n speed?: number;\n theme?: \"light\" | \"dark\";\n ground?: GshPresetId;\n groundParams?: Partial<GradientParams>;\n}\n\nconst DEFAULT_HOST: BookingHost = {\n name: \"Maya Chen\",\n email: \"[email protected]\",\n initials: \"MC\",\n};\n\nconst DEFAULT_EVENT: BookingEvent = {\n title: \"Product walkthrough\",\n description:\n \"Thirty minutes on the registry, live previews and the render pipeline. Bring the product you want to launch.\",\n durations: [\"15m\", \"30m\", \"45m\"],\n duration: 1,\n location: \"Video call\",\n timezone: \"Europe/Lisbon\",\n month: \"June\",\n year: 2026,\n firstWeekday: 1,\n daysInMonth: 30,\n firstAvailable: 9,\n};\n\nconst DEFAULT_SLOTS = [\n \"9:00am\",\n \"9:30am\",\n \"10:00am\",\n \"10:30am\",\n \"11:00am\",\n \"1:30pm\",\n \"2:00pm\",\n \"3:30pm\",\n];\n\nconst WEEKDAYS = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\nconst WEEKDAY_LONG = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n];\n\nconst SPR = {\n heavy: { mass: 1, damping: 26, stiffness: 120 },\n card: { mass: 0.8, damping: 18, stiffness: 160 },\n chip: { mass: 0.5, damping: 12, stiffness: 200 },\n morph: { damping: 200 },\n};\nconst EASE = {\n enter: Easing.bezier(0.32, 0.72, 0, 1),\n soft: Easing.bezier(0.22, 1, 0.36, 1),\n move: Easing.bezier(0.65, 0, 0.35, 1),\n exit: Easing.bezier(0.55, 0, 1, 0.45),\n camera: Easing.bezier(0.87, 0, 0.13, 1),\n};\nconst CL = { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" } as const;\nconst clamp01 = (v: number) => Math.min(1, Math.max(0, v));\nconst tween = (\n f: number,\n from: number,\n len: number,\n easing: (t: number) => number,\n) => interpolate(f, [from, from + len], [0, 1], { ...CL, easing });\n\nconst BEAT = {\n card: 0,\n cursor: 8,\n day: 34,\n slot: 66,\n confirm: 88,\n};\n\nconst PALETTES = {\n light: {\n card: \"#FFFFFF\",\n text: \"#18181B\",\n muted: \"#71717A\",\n faint: \"#B4B4BB\",\n line: \"rgba(24,24,27,0.08)\",\n tint: \"rgba(24,24,27,0.045)\",\n ink: \"#18181B\",\n inkText: \"#FFFFFF\",\n shadow:\n \"0 0 0 1px rgba(24,24,27,0.06), 0 2px 4px rgba(24,24,27,0.04), 0 36px 80px -24px rgba(20,24,60,0.32)\",\n ghost: \"0 0 0 1px rgba(24,24,27,0.1), 0 1px 2px rgba(24,24,27,0.05)\",\n },\n dark: {\n card: \"#141518\",\n text: \"#EDEDEF\",\n muted: \"#8E9097\",\n faint: \"#4E5057\",\n line: \"rgba(255,255,255,0.07)\",\n tint: \"rgba(255,255,255,0.05)\",\n ink: \"#EDEDEF\",\n inkText: \"#141518\",\n shadow:\n \"0 0 0 1px rgba(255,255,255,0.09), inset 0 1px 0 rgba(255,255,255,0.06), 0 40px 90px -24px rgba(0,0,0,0.75)\",\n ghost: \"0 0 0 1px rgba(255,255,255,0.1)\",\n },\n};\ntype Palette = (typeof PALETTES)[\"light\"];\n\nconst LIGHT_GROUND: Partial<GradientParams> = {\n colors: [\"#a9bcff\", \"#3b5bfd\", \"#22349e\", \"#c9d6ff\"],\n background: \"#f1f1ef\",\n};\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\ntype IconName = \"clock\" | \"video\" | \"globe\" | \"left\" | \"right\" | \"check\";\n\nfunction Icon({\n name,\n color,\n size = 18,\n}: {\n name: IconName;\n color: string;\n size?: number;\n}) {\n const p = {\n fill: \"none\",\n stroke: color,\n strokeWidth: 1.5,\n strokeLinecap: \"round\" as const,\n strokeLinejoin: \"round\" as const,\n };\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n aria-hidden\n style={{ display: \"block\", flexShrink: 0 }}\n >\n {name === \"clock\" && (\n <>\n <circle cx={12} cy={12} r={8.5} {...p} />\n <path d=\"M12 7.5V12l3 2\" {...p} />\n </>\n )}\n {name === \"video\" && (\n <>\n <rect x={3} y={6.5} width={12.5} height={11} rx={2.5} {...p} />\n <path d=\"M15.5 10.5l5-3v9l-5-3\" {...p} />\n </>\n )}\n {name === \"globe\" && (\n <>\n <circle cx={12} cy={12} r={8.5} {...p} />\n <path\n d=\"M3.5 12h17M12 3.5c2.8 3 2.8 14 0 17M12 3.5c-2.8 3-2.8 14 0 17\"\n {...p}\n />\n </>\n )}\n {name === \"left\" && <path d=\"M14.5 6.5L9 12l5.5 5.5\" {...p} />}\n {name === \"right\" && <path d=\"M9.5 6.5L15 12l-5.5 5.5\" {...p} />}\n {name === \"check\" && <path d=\"M6 12.5l4 4 8-9\" {...p} />}\n </svg>\n );\n}\n\nfunction Cursor({\n x,\n y,\n press,\n opacity,\n}: {\n x: number;\n y: number;\n press: number;\n opacity: number;\n}) {\n return (\n <svg\n width={24}\n height={28}\n viewBox=\"0 0 20 24\"\n aria-hidden\n style={{\n position: \"absolute\",\n left: x - 2.2,\n top: y - 2.2,\n opacity,\n transformOrigin: \"2px 2px\",\n transform: `scale(${1 - 0.04 * press})`,\n filter: \"drop-shadow(0 2px 3px 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=\"#111114\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction geometry(tall: boolean, gridRows: number) {\n if (tall) {\n const cell = 64;\n const gap = 8;\n const hostH = 206;\n const calY = hostH + 24;\n const gridY = calY + 84;\n const gridBottom = gridY + gridRows * (cell + gap);\n const slotY = gridBottom + 18;\n return {\n cell,\n gap,\n host: { x: 0, y: 0, w: 560, h: hostH },\n calX: 28,\n calY,\n weekY: calY + 50,\n gridY,\n slotHeadY: slotY,\n slotX: 28,\n slotY: slotY + 44,\n slotCols: 2,\n slotW: 246,\n slotH: 46,\n slotStep: 54,\n narrow: { w: 560, h: slotY },\n wide: { w: 560, h: slotY + 44 + 4 * 54 + 16 },\n done: { w: 560, h: 440 },\n };\n }\n const cell = 56;\n const gap = 6;\n const hostW = 300;\n const calX = hostW + 32;\n const gridW = 7 * cell + 6 * gap;\n const narrowW = calX + gridW + 32;\n return {\n cell,\n gap,\n host: { x: 0, y: 0, w: hostW, h: 488 },\n calX,\n calY: 30,\n weekY: 86,\n gridY: 122,\n slotHeadY: 30,\n slotX: narrowW + 24,\n slotY: 86,\n slotCols: 1,\n slotW: 212,\n slotH: 42,\n slotStep: 50,\n narrow: { w: narrowW, h: 488 },\n wide: { w: narrowW + 260, h: 488 },\n done: { w: 620, h: 424 },\n };\n}\n\nexport function CalendarBooking({\n host = DEFAULT_HOST,\n event: eventProp,\n slots = DEFAULT_SLOTS,\n pick,\n day = 18,\n accent = \"#3B5BFD\",\n speed = 1,\n theme = \"light\",\n ground,\n groundParams,\n}: CalendarBookingProps) {\n const frame = useCurrentFrame() * speed;\n const { width, height, fps } = useVideoConfig();\n const tall = height > width;\n const SW = tall ? 600 : 1280;\n const SH = tall ? (600 * height) / width : 720;\n const k = width / SW;\n const dark = theme === \"dark\";\n const c = PALETTES[theme];\n const event = { ...DEFAULT_EVENT, ...eventProp };\n const first = event.firstWeekday ?? 1;\n const days = event.daysInMonth ?? 30;\n const gridRows = Math.ceil((first + days) / 7);\n const G = geometry(tall, gridRows);\n const sp = (at: number, config: Record<string, number>) =>\n spring({ frame: frame - at, fps, config });\n const isOpen = (d: number) => {\n const wd = (first + d - 1) % 7;\n return d >= (event.firstAvailable ?? 1) && wd !== 0 && wd !== 6;\n };\n const shown = slots.slice(0, tall ? 8 : 7);\n const wanted = shown.indexOf(pick ?? \"10:30am\");\n const pickIdx = wanted >= 0 ? wanted : Math.min(3, shown.length - 1);\n const pickLabel = shown[pickIdx] ?? \"\";\n\n const cardIn = sp(BEAT.card, SPR.heavy);\n const cardOp = tween(frame, BEAT.card, 10, EASE.enter);\n const dayFill = sp(BEAT.day, SPR.chip);\n const widen = sp(BEAT.day + 2, SPR.heavy);\n const split = sp(BEAT.slot + 1, SPR.card);\n const morph = sp(BEAT.confirm + 2, SPR.morph);\n const cam =\n 1 +\n 0.03 * tween(frame, 6, 80, EASE.camera) +\n 0.015 * tween(frame, BEAT.confirm + 10, 60, EASE.camera);\n\n const bookW = G.narrow.w + (G.wide.w - G.narrow.w) * widen;\n const bookH = G.narrow.h + (G.wide.h - G.narrow.h) * widen;\n const cardW = bookW + (G.done.w - bookW) * morph;\n const cardH = bookH + (G.done.h - bookH) * morph;\n const cardX = (SW - cardW) / 2;\n const cardY = (SH - cardH) / 2 + (1 - cardIn) * 36;\n\n const cellPos = (d: number) => {\n const idx = first + d - 1;\n return {\n x: G.calX + (idx % 7) * (G.cell + G.gap),\n y: G.gridY + Math.floor(idx / 7) * (G.cell + G.gap),\n };\n };\n const slotPos = (i: number) => ({\n x: G.slotX + (i % G.slotCols) * (G.slotW + 12),\n y: G.slotY + Math.floor(i / G.slotCols) * G.slotStep,\n });\n const narrowOrigin = { x: (SW - G.narrow.w) / 2, y: (SH - G.narrow.h) / 2 };\n const wideOrigin = { x: (SW - G.wide.w) / 2, y: (SH - G.wide.h) / 2 };\n const dc = cellPos(day);\n const dayPt = {\n x: narrowOrigin.x + dc.x + G.cell / 2 + 4,\n y: narrowOrigin.y + dc.y + G.cell / 2 + 4,\n };\n const ps = slotPos(pickIdx);\n const half = (G.slotW - 8) / 2;\n const slotPt = {\n x: wideOrigin.x + ps.x + G.slotW / 2 + 6,\n y: wideOrigin.y + ps.y + G.slotH / 2 + 4,\n };\n const confirmPt = {\n x: wideOrigin.x + ps.x + half + 8 + half / 2 + 4,\n y: slotPt.y,\n };\n const start = tall ? { x: 660, y: 1120 } : { x: 1360, y: 800 };\n const legs = [\n { at: BEAT.cursor, from: start, to: dayPt, arc: 1 },\n { at: BEAT.slot - 20, from: dayPt, to: slotPt, arc: -1 },\n { at: BEAT.confirm - 16, from: slotPt, to: confirmPt, arc: 1 },\n {\n at: BEAT.confirm + 10,\n from: confirmPt,\n to: { x: confirmPt.x + 60, y: confirmPt.y + 110 },\n arc: -1,\n },\n ];\n let curX = start.x;\n let curY = start.y;\n for (const leg of legs) {\n const p = sp(leg.at, SPR.heavy);\n const dx = leg.to.x - leg.from.x;\n const dy = leg.to.y - leg.from.y;\n const len = Math.hypot(dx, dy) || 1;\n const bend = Math.sin(clamp01(p) * Math.PI) * Math.min(60, len * 0.14);\n curX += dx * p + (-dy / len) * bend * leg.arc;\n curY += dy * p + (dx / len) * bend * leg.arc;\n }\n const pressOf = (at: number) =>\n clamp01(sp(at - 2, SPR.chip) - sp(at + 3, SPR.chip));\n const press = Math.max(\n pressOf(BEAT.day),\n pressOf(BEAT.slot),\n pressOf(BEAT.confirm),\n );\n const curOp =\n tween(frame, BEAT.cursor, 5, EASE.enter) *\n (1 - tween(frame, BEAT.confirm + 22, 10, EASE.exit));\n\n const bookOp = 1 - tween(frame, BEAT.confirm + 2, 7, EASE.exit);\n const doneOp = tween(frame, BEAT.confirm + 7, 9, EASE.enter);\n const slotHover = tween(frame, BEAT.slot - 6, 4, EASE.enter);\n const wd = (first + day - 1) % 7;\n const end = shown[pickIdx + 1] ?? \"\";\n\n return (\n <AbsoluteFill\n style={{\n overflow: \"hidden\",\n fontFamily: sans.fontFamily,\n WebkitFontSmoothing: \"antialiased\",\n }}\n >\n <GshGround\n preset={ground ?? (dark ? \"film-blue\" : \"glasswork\")}\n params={groundParams ?? (dark ? undefined : LIGHT_GROUND)}\n timeOffset={2}\n timeScale={0.45}\n />\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: SW,\n height: SH,\n transform: `scale(${k})`,\n transformOrigin: \"0 0\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n transform: `scale(${cam})`,\n transformOrigin: `${SW / 2}px ${SH / 2}px`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: cardX,\n top: cardY,\n width: cardW,\n height: cardH,\n borderRadius: 22,\n background: c.card,\n boxShadow: c.shadow,\n overflow: \"hidden\",\n opacity: cardOp,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: G.wide.w,\n height: G.wide.h,\n opacity: bookOp,\n transform: `scale(${1 - 0.03 * morph})`,\n transformOrigin: \"50% 40%\",\n }}\n >\n <HostPanel host={host} event={event} c={c} tall={tall} G={G} />\n <div\n style={{\n position: \"absolute\",\n left: G.calX,\n top: G.calY,\n width: 7 * G.cell + 6 * G.gap,\n height: 32,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n }}\n >\n <div style={{ fontSize: 19, color: c.text }}>\n {event.month}{\" \"}\n <span style={{ color: c.muted }}>{event.year}</span>\n </div>\n <div style={{ display: \"flex\", gap: 14 }}>\n <Icon name=\"left\" color={c.faint} size={20} />\n <Icon name=\"right\" color={c.text} size={20} />\n </div>\n </div>\n {WEEKDAYS.map((w, i) => (\n <div\n key={w}\n style={{\n position: \"absolute\",\n left: G.calX + i * (G.cell + G.gap),\n top: G.weekY,\n width: G.cell,\n textAlign: \"center\",\n fontSize: 16,\n color: c.muted,\n }}\n >\n {w}\n </div>\n ))}\n {Array.from({ length: days }, (_, i) => i + 1).map((d) => {\n const idx = first + d - 1;\n const open = isOpen(d);\n const sel = d === day;\n const pos = cellPos(d);\n const appear = tween(\n frame,\n 3 + (idx % 7) * 0.7 + Math.floor(idx / 7) * 1.6,\n 10,\n EASE.soft,\n );\n return (\n <div\n key={d}\n style={{\n position: \"absolute\",\n left: pos.x,\n top: pos.y,\n width: G.cell,\n height: G.cell,\n borderRadius: 12,\n background: open ? c.tint : \"transparent\",\n opacity: appear,\n transform: `translateY(${(1 - appear) * 8}px)`,\n }}\n >\n {sel ? (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: 12,\n background: c.ink,\n transform: `scale(${0.6 + 0.4 * dayFill})`,\n opacity: clamp01(dayFill * 3),\n }}\n />\n ) : null}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 17,\n fontVariantNumeric: \"tabular-nums\",\n color:\n sel && dayFill > 0.3\n ? c.inkText\n : open\n ? c.text\n : c.faint,\n }}\n >\n {d}\n </div>\n </div>\n );\n })}\n <div\n style={{\n position: \"absolute\",\n left: tall ? 0 : G.narrow.w,\n top: tall ? G.narrow.h - 1 : 0,\n width: tall ? G.wide.w : 1,\n height: tall ? 1 : G.wide.h,\n background: c.line,\n opacity: clamp01(widen * 2),\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: G.slotX,\n top: G.slotHeadY,\n height: 32,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 19,\n color: c.text,\n opacity: tween(frame, BEAT.day + 8, 10, EASE.enter),\n }}\n >\n {WEEKDAY_LONG[wd].slice(0, 3)} \n <span style={{ color: c.muted }}>{day}</span>\n </div>\n {shown.map((s, i) => {\n const inn = sp(BEAT.day + 10 + i * 2, SPR.card);\n const picked = i === pickIdx;\n const sv = picked ? split : 0;\n const pos = slotPos(i);\n const timeW = G.slotW - (G.slotW - half) * sv;\n const base: React.CSSProperties = {\n position: \"absolute\",\n top: pos.y,\n height: G.slotH,\n borderRadius: 10,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 8,\n fontSize: 17,\n boxSizing: \"border-box\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n fontVariantNumeric: \"tabular-nums\",\n };\n return (\n <div key={s}>\n <div\n style={{\n ...base,\n left: pos.x + (1 - inn) * 18,\n width: timeW,\n opacity: clamp01(inn * 1.5),\n color: c.text,\n background: picked && sv > 0.05 ? c.tint : c.card,\n boxShadow:\n picked && slotHover > 0 && sv < 0.5\n ? `0 0 0 1px ${c.text}`\n : c.ghost,\n }}\n >\n {s}\n </div>\n {picked && sv > 0.01 ? (\n <div\n style={{\n ...base,\n left: pos.x + timeW + 8,\n width: Math.max(0, G.slotW - timeW - 8),\n background: accent,\n color: \"#FFFFFF\",\n opacity: clamp01(sv * 2),\n boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.16)\",\n transform: `scale(${1 - 0.04 * pressOf(BEAT.confirm)})`,\n }}\n >\n Confirm\n </div>\n ) : null}\n </div>\n );\n })}\n </div>\n {morph > 0.01 ? (\n <SuccessView\n frame={frame - BEAT.confirm - 6}\n fps={fps}\n c={c}\n accent={accent}\n opacity={doneOp}\n left={(cardW - G.done.w) / 2}\n top={(cardH - G.done.h) / 2}\n w={G.done.w}\n h={G.done.h}\n host={host}\n event={event}\n when={`${WEEKDAY_LONG[wd]}, ${event.month} ${day}`}\n time={`${pickLabel}${end ? ` – ${end}` : \"\"}`}\n />\n ) : null}\n </div>\n <Cursor x={curX} y={curY} press={press} opacity={curOp} />\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n\nfunction HostPanel({\n host,\n event,\n c,\n tall,\n G,\n}: {\n host: BookingHost;\n event: BookingEvent;\n c: Palette;\n tall: boolean;\n G: ReturnType<typeof geometry>;\n}) {\n const meta: [IconName, string | undefined][] = [\n [\"clock\", event.durations?.[event.duration ?? 0]?.replace(\"m\", \" min\")],\n [\"video\", event.location],\n [\"globe\", event.timezone],\n ];\n return (\n <div\n style={{\n position: \"absolute\",\n left: G.host.x,\n top: G.host.y,\n width: G.host.w,\n height: G.host.h,\n boxSizing: \"border-box\",\n padding: tall ? \"28px 28px\" : \"32px 30px\",\n boxShadow: tall\n ? `inset 0 -1px 0 ${c.line}`\n : `inset -1px 0 0 ${c.line}`,\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 12 }}>\n <div\n style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n background: c.tint,\n boxShadow: `inset 0 0 0 1px ${c.line}`,\n color: c.text,\n fontSize: 14.5,\n letterSpacing: \"0.02em\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {host.initials ?? host.name.slice(0, 2).toUpperCase()}\n </div>\n <span style={{ fontSize: 17, color: c.muted }}>{host.name}</span>\n </div>\n <div\n style={{\n marginTop: tall ? 16 : 22,\n fontFamily: serif.fontFamily,\n fontSize: tall ? 38 : 40,\n lineHeight: 1.05,\n letterSpacing: \"-0.01em\",\n color: c.text,\n }}\n >\n {event.title}\n </div>\n {!tall && event.description ? (\n <div\n style={{\n marginTop: 14,\n fontSize: 16,\n lineHeight: 1.5,\n color: c.muted,\n }}\n >\n {event.description}\n </div>\n ) : null}\n <div\n style={{\n marginTop: tall ? 22 : 26,\n display: \"flex\",\n flexDirection: tall ? \"row\" : \"column\",\n gap: tall ? 20 : 14,\n }}\n >\n {meta.map(([icon, label]) =>\n label ? (\n <div\n key={icon}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 16,\n color: c.text,\n whiteSpace: \"nowrap\",\n }}\n >\n <Icon name={icon} color={c.muted} />\n {label}\n </div>\n ) : null,\n )}\n </div>\n </div>\n );\n}\n\nfunction SuccessView({\n frame,\n fps,\n c,\n accent,\n opacity,\n left,\n top,\n w,\n h,\n host,\n event,\n when,\n time,\n}: {\n frame: number;\n fps: number;\n c: Palette;\n accent: string;\n opacity: number;\n left: number;\n top: number;\n w: number;\n h: number;\n host: BookingHost;\n event: BookingEvent;\n when: string;\n time: string;\n}) {\n const disc = spring({ frame: frame - 2, fps, config: SPR.chip });\n const tick = tween(frame, 6, 10, EASE.enter);\n const item = (i: number): React.CSSProperties => {\n const p = tween(frame, 4 + i * 3, 12, EASE.soft);\n return { opacity: p, transform: `translateY(${(1 - p) * 10}px)` };\n };\n const rows: [string, React.ReactNode][] = [\n [\n \"When\",\n <>\n {when}\n <div style={{ color: c.muted, marginTop: 2 }}>\n {time} · {event.timezone}\n </div>\n </>,\n ],\n [\n \"With\",\n <>\n {host.name}\n <div style={{ color: c.muted, marginTop: 2 }}>{host.email}</div>\n </>,\n ],\n [\"Where\", event.location],\n ];\n return (\n <div\n style={{\n position: \"absolute\",\n left,\n top,\n width: w,\n height: h,\n boxSizing: \"border-box\",\n padding: \"40px 40px\",\n opacity,\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 14 }}>\n <div\n style={{\n width: 44,\n height: 44,\n borderRadius: 22,\n background: withAlpha(accent, 0.12),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `scale(${0.5 + 0.5 * disc})`,\n opacity: clamp01(disc * 2),\n }}\n >\n <svg width={24} height={24} viewBox=\"0 0 24 24\" aria-hidden>\n <path\n d=\"M6 12.5l4 4 8-9\"\n fill=\"none\"\n stroke={accent}\n strokeWidth={1.75}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeDasharray={20}\n strokeDashoffset={20 * (1 - tick)}\n />\n </svg>\n </div>\n <div style={{ fontSize: 17, color: c.muted, ...item(0) }}>\n Invite sent to your inbox\n </div>\n </div>\n <div\n style={{\n ...item(1),\n marginTop: 26,\n fontFamily: serif.fontFamily,\n fontSize: 46,\n lineHeight: 1.05,\n letterSpacing: \"-0.01em\",\n color: c.text,\n }}\n >\n You’re booked with {host.name.split(\" \")[0]}\n </div>\n <div\n style={{\n marginTop: 28,\n display: \"flex\",\n flexDirection: \"column\",\n }}\n >\n {rows.map(([label, value], i) => (\n <div\n key={label}\n style={{\n display: \"flex\",\n padding: \"14px 0\",\n boxShadow: `inset 0 1px 0 ${c.line}`,\n fontSize: 17,\n lineHeight: 1.35,\n color: c.text,\n ...item(2 + i),\n }}\n >\n <div style={{ width: 92, flexShrink: 0, color: c.muted }}>\n {label}\n </div>\n <div>{value}</div>\n </div>\n ))}\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/calendar-booking.tsx"
}
],
"type": "registry:component"
}