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": "invoice-paid",
"title": "Invoice Paid",
"description": "An invoice gets stamped PAID while a payout notification arrives.",
"dependencies": ["remotion", "@remotion/google-fonts"],
"registryDependencies": ["@remocn/gsh"],
"files": [
{
"path": "registry/remocn/invoice-paid/index.tsx",
"content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Geist\";\nimport type React from \"react\";\nimport { useId } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n interpolateColors,\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 InvoiceLine {\n description: string;\n qty: number;\n unit: number;\n}\n\nexport interface InvoiceEvent {\n title: string;\n detail: string;\n time: string;\n}\n\nexport interface InvoicePaidProps {\n sender?: string;\n customer?: string;\n customerEmail?: string;\n customerAddress?: string;\n number?: string;\n issued?: string;\n due?: string;\n lines?: InvoiceLine[];\n /** Created, Sent, Viewed, Paid, in that order. */\n events?: InvoiceEvent[];\n payoutAccount?: string;\n payoutArrival?: string;\n payoutFee?: number;\n currency?: string;\n theme?: \"light\" | \"dark\";\n accent?: string;\n speed?: number;\n ground?: GshPresetId;\n groundParams?: Partial<GradientParams>;\n}\n\nconst DEFAULT_LINES: InvoiceLine[] = [\n { description: \"Brand identity system\", qty: 1, unit: 6400 },\n { description: \"Launch film, 60s cut\", qty: 1, unit: 4200 },\n { description: \"Motion toolkit license\", qty: 2, unit: 940 },\n];\n\nconst DEFAULT_EVENTS: InvoiceEvent[] = [\n { title: \"Invoice created\", detail: \"by Maya Chen\", time: \"Oct 24, 9:38 AM\" },\n {\n title: \"Sent to customer\",\n detail: \"Emailed [email protected]\",\n time: \"Oct 24, 9:41 AM\",\n },\n { title: \"Viewed\", detail: \"Opened by Leo Park\", time: \"Oct 25, 10:02 AM\" },\n {\n title: \"Payment received\",\n detail: \"ACH transfer · ••4821\",\n time: \"Oct 27, 2:17 PM\",\n },\n];\n\nconst DOC = { w: 500, h: 616 };\nconst PANEL_W = 544;\nconst PANEL_H = 540;\nconst PAD = 32;\nconst TL_Y = 268;\nconst STEP = 62;\n\nconst T = {\n send: 40,\n viewed: 66,\n paid: 92,\n stamp: 100,\n payout: 128,\n};\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 };\n\nconst ENTER = Easing.bezier(0.32, 0.72, 0, 1);\nconst ENTER2 = Easing.bezier(0.22, 1, 0.36, 1);\nconst MOVE = Easing.bezier(0.65, 0, 0.35, 1);\nconst EXIT = Easing.bezier(0.55, 0, 1, 0.45);\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n} as const;\nconst tween = (f: number, a: number, b: number, easing = ENTER) =>\n interpolate(f, [a, b], [0, 1], { ...clampOpts, easing });\nconst lerp = (a: number, b: number, t: number) => a + (b - a) * t;\n\nfunction withAlpha(hex: string, alpha: number) {\n const h = hex.replace(\"#\", \"\");\n const full = h.length === 3 ? h.replace(/./g, (c) => c + c) : h.slice(0, 6);\n const n = Number.parseInt(full, 16);\n return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${alpha})`;\n}\nconst fmt = (n: number, cur: string) =>\n `${cur}${n.toLocaleString(\"en-US\", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;\n\ninterface Pal {\n dark: boolean;\n scrim: string;\n panel: string;\n panelShadow: string;\n docShadow: string;\n text: string;\n muted: string;\n faint: string;\n line: string;\n btn2: string;\n node: string;\n green: string;\n amber: string;\n notif: string;\n}\n\nfunction palette(theme: \"light\" | \"dark\"): Pal {\n return theme === \"dark\"\n ? {\n dark: true,\n scrim: \"rgba(2,6,8,0.36)\",\n panel: \"#0F1113\",\n panelShadow:\n \"0 0 0 1px rgba(255,255,255,0.08), inset 0 1px 0 rgba(255,255,255,0.06), 0 24px 60px -20px rgba(0,0,0,0.75)\",\n docShadow:\n \"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.25), 0 30px 70px -24px rgba(0,0,0,0.75)\",\n text: \"#EEEFF1\",\n muted: \"#9EA1A8\",\n faint: \"#696C73\",\n line: \"rgba(255,255,255,0.08)\",\n btn2: \"#1A1C1F\",\n node: \"#1E2023\",\n green: \"#46CB91\",\n amber: \"#F0B44C\",\n notif: \"#17191C\",\n }\n : {\n dark: false,\n scrim: \"rgba(245,244,240,0.28)\",\n panel: \"#FFFFFF\",\n panelShadow:\n \"0 0 0 1px rgba(20,20,24,0.06), 0 1px 3px rgba(20,20,24,0.05), 0 14px 32px -14px rgba(20,20,24,0.16), 0 40px 80px -40px rgba(20,20,24,0.22)\",\n docShadow:\n \"0 0 0 1px rgba(20,20,24,0.05), 0 2px 4px rgba(20,20,24,0.04), 0 24px 56px -24px rgba(20,20,24,0.28)\",\n text: \"#17181B\",\n muted: \"#5F6169\",\n faint: \"#9A9CA3\",\n line: \"rgba(20,20,24,0.08)\",\n btn2: \"#FFFFFF\",\n node: \"#F2F2F3\",\n green: \"#0D7F4F\",\n amber: \"#A86500\",\n notif: \"#FFFFFF\",\n };\n}\n\nconst ICONS = {\n send: \"M13.5 2.5 7 9M13.5 2.5 9.4 13.5 7 9 2.5 6.6z\",\n file: \"M4.25 2.5h5L12 5.25v8.25H4.25zM9 2.5v3h3M6.25 8.5h3.5M6.25 11h2.5\",\n eye: \"M1.75 8S4 3.75 8 3.75 14.25 8 14.25 8 12 12.25 8 12.25 1.75 8 1.75 8zM8 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4z\",\n check: \"M3.75 8.5l2.75 2.75 5.75-6.25\",\n bank: \"M2.5 6 8 2.75 13.5 6M3.75 6v5.5M6.5 6v5.5M9.5 6v5.5M12.25 6v5.5M2.5 13.25h11\",\n bell: \"M4.25 10.75V7.5a3.75 3.75 0 0 1 7.5 0v3.25l1 1.25H3.25zM6.75 13.5h2.5\",\n download: \"M8 2.75v7.5M4.75 7.25 8 10.5l3.25-3.25M3 13.25h10\",\n} as const;\n\nfunction Icon({\n name,\n color,\n size = 16,\n}: {\n name: keyof typeof ICONS;\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={{ display: \"block\", flexShrink: 0 }}\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\ninterface Pt {\n x: number;\n y: number;\n}\ninterface Key extends Pt {\n t: number;\n}\nfunction pathAt(keys: Key[], f: number): Pt {\n if (f <= keys[0].t) return keys[0];\n for (let i = 1; i < keys.length; i++) {\n const a = keys[i - 1];\n const b = keys[i];\n if (f <= b.t) {\n const p = MOVE(Math.min(1, Math.max(0, (f - a.t) / (b.t - a.t || 1))));\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n const d = Math.hypot(dx, dy) || 1;\n const arc = Math.sin(p * Math.PI) * Math.min(30, d * 0.14);\n return {\n x: lerp(a.x, b.x, p) + (-dy / d) * arc,\n y: lerp(a.y, b.y, p) + (dx / d) * arc,\n };\n }\n }\n return keys[keys.length - 1];\n}\n\nfunction Cursor({ x, y, press }: Pt & { press: 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(${1 - 0.1 * press})`,\n filter: \"drop-shadow(0 3px 5px 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\nfunction StatusGlyph({ step, color }: { step: number; color: string }) {\n if (step >= 3) {\n return (\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 14 14\"\n style={{ display: \"block\" }}\n >\n <circle cx={7} cy={7} r={6} fill={color} />\n <path\n d=\"M4.3 7.2 6.1 9l3.6-3.8\"\n fill=\"none\"\n stroke=\"#fff\"\n strokeWidth={1.4}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n }\n const frac = [0, 0.4, 0.75][step];\n const r = 3;\n const a = frac * Math.PI * 2;\n return (\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 14 14\"\n style={{ display: \"block\" }}\n >\n <circle\n cx={7}\n cy={7}\n r={5.5}\n fill=\"none\"\n stroke={color}\n strokeWidth={1.4}\n strokeDasharray={step === 0 ? \"2 2\" : undefined}\n />\n {frac > 0 ? (\n <path\n d={`M7 7 L7 ${7 - r} A${r} ${r} 0 ${frac > 0.5 ? 1 : 0} 1 ${7 + r * Math.sin(a)} ${7 - r * Math.cos(a)} Z`}\n fill={color}\n />\n ) : null}\n </svg>\n );\n}\n\nconst PILLS = [\"Draft\", \"Sent\", \"Viewed\", \"Paid\"];\n\nfunction StatusPill({\n frame,\n fps,\n pal,\n accent,\n}: {\n frame: number;\n fps: number;\n pal: Pal;\n accent: string;\n}) {\n const at = [0, T.send + 2, T.viewed, T.paid];\n const step = at.filter((t) => frame >= t).length - 1;\n const colors = [pal.faint, accent, pal.amber, pal.green];\n const range = [at[step], at[step] + 4];\n const prev = Math.max(0, step - 1);\n const c = interpolateColors(frame, range, [colors[prev], colors[step]]);\n const bg = interpolateColors(frame, range, [\n withAlpha(colors[prev], pal.dark ? 0.14 : 0.1),\n withAlpha(colors[step], pal.dark ? 0.14 : 0.1),\n ]);\n const pop =\n step > 0\n ? spring({ frame: frame - at[step], fps, config: CHIP }) -\n spring({ frame: frame - at[step] - 3, fps, config: CHIP })\n : 0;\n return (\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 7,\n height: 30,\n padding: \"0 12px 0 9px\",\n borderRadius: 99,\n background: bg,\n color: c,\n fontSize: 16,\n transform: `scale(${1 + 0.07 * pop})`,\n }}\n >\n <StatusGlyph step={step} color={c} />\n {PILLS[step]}\n </div>\n );\n}\n\nfunction Stamp({ p, date }: { p: number; date: string }) {\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const ink = \"#12814E\";\n return (\n <svg\n width={198}\n height={96}\n viewBox=\"0 0 232 112\"\n style={{ display: \"block\", overflow: \"visible\" }}\n >\n <defs>\n <filter id={`${id}g`} x=\"-5%\" y=\"-5%\" width=\"110%\" height=\"110%\">\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency=\"0.55\"\n numOctaves={3}\n seed={11}\n result=\"n\"\n />\n <feColorMatrix\n in=\"n\"\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -6.5 0 0 0 4.75\"\n result=\"m\"\n />\n <feComposite in=\"SourceGraphic\" in2=\"m\" operator=\"in\" />\n </filter>\n </defs>\n <g filter={`url(#${id}g)`} opacity={0.62 + 0.26 * p}>\n <rect\n x={4}\n y={4}\n width={224}\n height={104}\n rx={14}\n fill=\"none\"\n stroke={ink}\n strokeWidth={5}\n />\n <rect\n x={13}\n y={13}\n width={206}\n height={86}\n rx={8}\n fill=\"none\"\n stroke={ink}\n strokeWidth={1.6}\n />\n <text\n x={116}\n y={70}\n textAnchor=\"middle\"\n fontSize={54}\n fontWeight={400}\n letterSpacing=\"0.16em\"\n fill={ink}\n style={{ fontFamily }}\n >\n PAID\n </text>\n <text\n x={116}\n y={90}\n textAnchor=\"middle\"\n fontSize={12}\n fontWeight={400}\n letterSpacing=\"0.26em\"\n fill={ink}\n style={{ fontFamily }}\n >\n {date}\n </text>\n </g>\n </svg>\n );\n}\n\nfunction InvoiceDoc({\n frame,\n fps,\n sender,\n customer,\n customerAddress,\n number,\n issued,\n due,\n lines,\n currency,\n stampDate,\n}: {\n frame: number;\n fps: number;\n sender: string;\n customer: string;\n customerAddress: string;\n number: string;\n issued: string;\n due: string;\n lines: InvoiceLine[];\n currency: string;\n stampDate: string;\n}) {\n const total = lines.reduce((s, l) => s + l.qty * l.unit, 0);\n const ink = \"#17181B\";\n const muted = \"#62646B\";\n const faint = \"#9C9EA4\";\n const line = \"rgba(20,20,24,0.08)\";\n const r = (k: number): React.CSSProperties => {\n const p = tween(frame, 8 + k * 3, 20 + k * 3, ENTER2);\n return { opacity: p, transform: `translateY(${(1 - p) * 10}px)` };\n };\n const land = spring({ frame: frame - T.stamp, fps, config: CHIP });\n const impact =\n spring({ frame: frame - T.stamp - 3, fps, config: CHIP }) -\n spring({ frame: frame - T.stamp - 6, fps, config: CHIP });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"#FFFFFF\",\n borderRadius: 6,\n padding: \"40px 40px\",\n boxSizing: \"border-box\",\n color: ink,\n transform: `translateY(${impact * 2}px) scale(${1 - 0.006 * impact})`,\n }}\n >\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"flex-start\",\n ...r(0),\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 10 }}>\n <svg width={24} height={24} viewBox=\"0 0 24 24\">\n <circle cx={12} cy={12} r={11} fill={ink} />\n <path\n d=\"M7.5 15.5c2.2-4.6 6.8-4.6 9 0\"\n stroke=\"#fff\"\n strokeWidth={1.8}\n fill=\"none\"\n strokeLinecap=\"round\"\n />\n </svg>\n <span style={{ fontSize: 16 }}>{sender}</span>\n </div>\n <div style={{ textAlign: \"right\" }}>\n <div\n style={{ fontSize: 28, fontWeight: 300, letterSpacing: \"-0.03em\" }}\n >\n Invoice\n </div>\n <div\n style={{\n fontSize: 15,\n color: muted,\n marginTop: 2,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n {number}\n </div>\n </div>\n </div>\n\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1.5fr 1fr 1fr\",\n gap: 14,\n marginTop: 34,\n fontSize: 15,\n ...r(1),\n }}\n >\n {[\n { k: \"Billed to\", v: customer, s: customerAddress },\n { k: \"Issued\", v: issued },\n { k: \"Due\", v: due },\n ].map((m) => (\n <div key={m.k}>\n <div style={{ color: faint, marginBottom: 4 }}>{m.k}</div>\n <div>{m.v}</div>\n {m.s ? (\n <div\n style={{\n color: muted,\n marginTop: 2,\n lineHeight: 1.4,\n fontSize: 14,\n }}\n >\n {m.s}\n </div>\n ) : null}\n </div>\n ))}\n </div>\n\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr 40px 110px\",\n marginTop: 30,\n fontSize: 14,\n color: faint,\n paddingBottom: 10,\n borderBottom: `1px solid ${line}`,\n ...r(2),\n }}\n >\n <span>Description</span>\n <span style={{ textAlign: \"right\" }}>Qty</span>\n <span style={{ textAlign: \"right\" }}>Amount</span>\n </div>\n {lines.map((l, i) => (\n <div\n key={l.description}\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr 40px 110px\",\n fontSize: 16,\n padding: \"13px 0\",\n borderBottom: `1px solid ${line}`,\n fontVariantNumeric: \"tabular-nums\",\n ...r(3 + i),\n }}\n >\n <span>{l.description}</span>\n <span style={{ textAlign: \"right\", color: muted }}>{l.qty}</span>\n <span style={{ textAlign: \"right\" }}>\n {fmt(l.qty * l.unit, currency)}\n </span>\n </div>\n ))}\n\n <div\n style={{\n marginLeft: \"auto\",\n width: 196,\n marginTop: 20,\n fontSize: 15,\n ...r(3 + lines.length),\n }}\n >\n {[\n { k: \"Subtotal\", v: fmt(total, currency) },\n { k: \"Tax\", v: fmt(0, currency) },\n ].map((x) => (\n <div\n key={x.k}\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n padding: \"4px 0\",\n color: muted,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n <span>{x.k}</span>\n <span style={{ color: ink }}>{x.v}</span>\n </div>\n ))}\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"baseline\",\n marginTop: 8,\n paddingTop: 10,\n borderTop: `1px solid ${line}`,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n <span>Total</span>\n <span style={{ fontSize: 20, letterSpacing: \"-0.02em\" }}>\n {fmt(total, currency)}\n </span>\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 40,\n right: 40,\n bottom: 34,\n display: \"flex\",\n justifyContent: \"space-between\",\n fontSize: 14,\n color: muted,\n paddingTop: 14,\n borderTop: `1px solid ${line}`,\n ...r(4 + lines.length),\n }}\n >\n <span>Net 14 · ACH or card</span>\n <span>Page 1 of 1</span>\n </div>\n\n {frame >= T.stamp ? (\n <div\n style={{\n position: \"absolute\",\n left: 22,\n top: 446,\n transformOrigin: \"50% 50%\",\n transform: `rotate(${lerp(-20, -9, land)}deg) scale(${lerp(1.6, 1, land)})`,\n opacity: tween(frame, T.stamp, T.stamp + 3, ENTER2),\n filter: `drop-shadow(0 ${Math.max(0, 1 - land) * 18}px ${Math.max(0, 1 - land) * 14}px rgba(0,0,0,${0.18 * Math.max(0, 1 - land)}))`,\n }}\n >\n <Stamp p={Math.min(1, land)} date={stampDate} />\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function InvoicePaid({\n sender = \"Halcyon Studio\",\n customer = \"Kitebase, Inc.\",\n customerEmail = \"[email protected]\",\n customerAddress = \"2100 Market St, SF\",\n number = \"INV-2041\",\n issued = \"Oct 24, 2026\",\n due = \"Nov 7, 2026\",\n lines = DEFAULT_LINES,\n events = DEFAULT_EVENTS,\n payoutAccount = \"Business Checking ••4821\",\n payoutArrival = \"Oct 29\",\n payoutFee = 5,\n currency = \"$\",\n theme = \"light\",\n accent = \"#3B5BFD\",\n speed = 1,\n ground,\n groundParams,\n}: InvoicePaidProps) {\n const frame = useCurrentFrame() * speed;\n const { width, height, fps } = useVideoConfig();\n const tall = height > width;\n const DW = tall ? 720 : 1280;\n const DH = tall ? 1280 : 720;\n const u = Math.min(width / DW, height / DH);\n const pal = palette(theme);\n const total = lines.reduce((s, l) => s + l.qty * l.unit, 0);\n const paidDay = events[3]?.time.split(\",\")[0] ?? \"\";\n\n const docScale = tall ? 0.88 : 1;\n const doc = tall\n ? { x: (DW - DOC.w * docScale) / 2, y: 132 }\n : { x: 92, y: (DH - DOC.h) / 2 };\n const panelW = tall ? 600 : PANEL_W;\n const panel = tall\n ? { x: 60, y: 132 + DOC.h * docScale + 36 }\n : { x: DW - PANEL_W - 92, y: 136 };\n const notif = tall\n ? { x: 60, y: 36, w: 600 }\n : { x: DW - 92 - 420, y: 40, w: 420 };\n\n const docIn = spring({ frame, fps, config: HEAVY });\n const panelIn = spring({ frame: frame - 6, fps, config: CARD });\n const rowIn = (k: number): React.CSSProperties => {\n const p = tween(frame, 12 + k * 3, 24 + k * 3, ENTER2);\n return { opacity: p, transform: `translateY(${(1 - p) * 10}px)` };\n };\n\n const sendPt = {\n x: panel.x + panelW - PAD - 70,\n y: panel.y + 28 + 22,\n };\n const cur = pathAt(\n [\n {\n t: 14,\n x: tall ? DW - 80 : DW - 60,\n y: tall ? panel.y + 420 : DH - 60,\n },\n { t: T.send - 2, ...sendPt },\n { t: T.send + 8, ...sendPt },\n {\n t: T.send + 30,\n x: sendPt.x + 40,\n y: sendPt.y + 140,\n },\n ],\n frame,\n );\n const press = Math.max(\n 0,\n spring({ frame: frame - T.send, fps, config: CHIP }) -\n spring({ frame: frame - T.send - 4, fps, config: CHIP }),\n );\n const cursorOp =\n tween(frame, 14, 20, ENTER2) *\n (1 - tween(frame, T.send + 20, T.send + 28, EXIT));\n const sentSwap = tween(frame, T.send + 2, T.send + 10, MOVE);\n\n const reachAt = [0, T.send + 4, T.viewed, T.paid];\n const paidP = tween(frame, T.paid, T.paid + 8, MOVE);\n const notifIn = spring({ frame: frame - T.payout, fps, config: CARD });\n\n return (\n <AbsoluteFill\n style={{\n fontFamily,\n fontWeight: 400,\n overflow: \"hidden\",\n WebkitFontSmoothing: \"antialiased\",\n }}\n >\n <GshGround\n preset={ground ?? (pal.dark ? \"riptide\" : \"paper-crease\")}\n params={groundParams}\n timeOffset={pal.dark ? 2 : 6}\n timeScale={0.3}\n />\n <AbsoluteFill style={{ background: pal.scrim }} />\n <div\n style={{\n position: \"absolute\",\n left: (width - DW * u) / 2,\n top: (height - DH * u) / 2,\n width: DW,\n height: DH,\n transformOrigin: \"0 0\",\n transform: `scale(${u})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: doc.x,\n top: doc.y,\n width: DOC.w,\n height: DOC.h,\n transformOrigin: \"0 0\",\n borderRadius: 6,\n boxShadow: pal.docShadow,\n opacity: tween(frame, 0, 10, ENTER2),\n transform: `translateY(${(1 - docIn) * 60}px) scale(${docScale * (0.97 + 0.03 * docIn)}) rotate(${(1 - docIn) * -2}deg)`,\n }}\n >\n <InvoiceDoc\n frame={frame}\n fps={fps}\n sender={sender}\n customer={customer}\n customerAddress={customerAddress}\n number={number}\n issued={issued}\n due={due}\n lines={lines}\n currency={currency}\n stampDate={paidDay.toUpperCase() || \"PAID\"}\n />\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: panel.x,\n top: panel.y,\n width: panelW,\n height: PANEL_H,\n borderRadius: 18,\n background: pal.panel,\n color: pal.text,\n boxShadow: pal.panelShadow,\n opacity: Math.min(1, panelIn * 1.4),\n transform: `translateY(${(1 - panelIn) * 40}px)`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: PAD,\n right: PAD,\n top: 28,\n height: 44,\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n ...rowIn(0),\n }}\n >\n <span style={{ fontSize: 18, fontVariantNumeric: \"tabular-nums\" }}>\n {number}\n </span>\n <StatusPill frame={frame} fps={fps} pal={pal} accent={accent} />\n <div style={{ flex: 1 }} />\n <div\n style={{\n width: 156,\n height: 44,\n borderRadius: 10,\n position: \"relative\",\n transform: `scale(${1 - 0.04 * press})`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 16,\n background: interpolateColors(\n sentSwap,\n [0, 1],\n [accent, pal.btn2],\n ),\n color: sentSwap > 0.5 ? pal.text : \"#FFFFFF\",\n boxShadow:\n sentSwap > 0.5\n ? `inset 0 0 0 1px ${pal.line}`\n : `0 1px 2px ${withAlpha(accent, 0.3)}, inset 0 1px 0 rgba(255,255,255,0.16)`,\n }}\n >\n <span\n style={{\n position: \"absolute\",\n display: \"flex\",\n gap: 8,\n alignItems: \"center\",\n opacity: 1 - sentSwap,\n }}\n >\n <Icon name=\"send\" color=\"#FFFFFF\" size={16} />\n Send invoice\n </span>\n <span\n style={{\n position: \"absolute\",\n display: \"flex\",\n gap: 8,\n alignItems: \"center\",\n opacity: sentSwap * (1 - paidP),\n }}\n >\n <Icon name=\"bell\" color={pal.muted} size={16} />\n Remind\n </span>\n <span\n style={{\n position: \"absolute\",\n display: \"flex\",\n gap: 8,\n alignItems: \"center\",\n opacity: paidP,\n }}\n >\n <Icon name=\"download\" color={pal.muted} size={16} />\n Receipt\n </span>\n </div>\n </div>\n\n <div\n style={{ position: \"absolute\", left: PAD, top: 98, ...rowIn(1) }}\n >\n <div\n style={{\n fontSize: 16,\n display: \"inline-grid\",\n color: pal.muted,\n }}\n >\n <span style={{ gridArea: \"1/1\", opacity: 1 - paidP }}>\n Amount due · {customer}\n </span>\n <span\n style={{ gridArea: \"1/1\", opacity: paidP, color: pal.green }}\n >\n Paid by {customer}\n </span>\n </div>\n <div\n style={{\n fontSize: 54,\n fontWeight: 300,\n letterSpacing: \"-0.04em\",\n lineHeight: 1,\n marginTop: 10,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n {fmt(total, currency)}\n </div>\n <div\n style={{\n fontSize: 16,\n color: pal.muted,\n marginTop: 12,\n display: \"inline-grid\",\n }}\n >\n <span style={{ gridArea: \"1/1\", opacity: 1 - paidP }}>\n Due {due.split(\",\")[0]} · {customerEmail}\n </span>\n <span style={{ gridArea: \"1/1\", opacity: paidP }}>\n Paid {paidDay} · 11 days early\n </span>\n </div>\n </div>\n <div\n style={{\n position: \"absolute\",\n left: PAD,\n right: PAD,\n top: TL_Y - 34,\n height: 1,\n background: pal.line,\n ...rowIn(2),\n }}\n />\n\n {events.slice(0, 4).map((ev, i) => {\n const at = reachAt[i];\n const on = tween(frame, at, at + 8, ENTER2);\n const isPaid = i === 3;\n const pop = isPaid\n ? spring({ frame: frame - at, fps, config: CHIP })\n : 1;\n const nodeBg = isPaid\n ? interpolateColors(on, [0, 1], [pal.panel, pal.green])\n : on > 0.5\n ? pal.node\n : pal.panel;\n const icon = ([\"file\", \"send\", \"eye\", \"check\"] as const)[i];\n const y = TL_Y + i * STEP;\n return (\n <div key={ev.title} style={rowIn(3 + i)}>\n {i < 3 ? (\n <div\n style={{\n position: \"absolute\",\n left: PAD + 15,\n top: y + 34,\n width: 1.5,\n height: STEP - 36,\n background: pal.line,\n }}\n >\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n background: i === 2 ? pal.green : pal.faint,\n transformOrigin: \"50% 0\",\n transform: `scaleY(${tween(frame, reachAt[i + 1] - 8, reachAt[i + 1], MOVE)})`,\n opacity: 0.7,\n }}\n />\n </div>\n ) : null}\n <div\n style={{\n position: \"absolute\",\n left: PAD,\n top: y,\n width: 32,\n height: 32,\n borderRadius: 16,\n background: nodeBg,\n boxShadow:\n isPaid && on > 0.5\n ? \"none\"\n : `inset 0 0 0 1px ${pal.line}`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `scale(${isPaid ? 0.85 + 0.15 * pop : 1})`,\n }}\n >\n <div style={{ opacity: 0.3 + 0.7 * on }}>\n <Icon\n name={icon}\n color={isPaid && on > 0.5 ? \"#FFFFFF\" : pal.text}\n size={16}\n />\n </div>\n </div>\n <div\n style={{\n position: \"absolute\",\n left: PAD + 48,\n right: PAD,\n top: y - 2,\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"flex-start\",\n }}\n >\n <div>\n <div\n style={{\n fontSize: 17,\n color:\n on > 0.5\n ? isPaid\n ? pal.green\n : pal.text\n : pal.faint,\n }}\n >\n {ev.title}\n </div>\n <div\n style={{\n fontSize: 16,\n color: pal.muted,\n marginTop: 2,\n opacity: on,\n transform: `translateY(${(1 - on) * 4}px)`,\n }}\n >\n {ev.detail}\n </div>\n </div>\n <span\n style={{\n fontSize: 16,\n color: pal.faint,\n fontVariantNumeric: \"tabular-nums\",\n opacity: on,\n marginTop: 1,\n }}\n >\n {ev.time}\n </span>\n </div>\n </div>\n );\n })}\n </div>\n\n <div style={{ opacity: cursorOp }}>\n <Cursor x={cur.x} y={cur.y} press={press} />\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: notif.x,\n top: notif.y,\n width: notif.w,\n borderRadius: 16,\n padding: \"14px 16px\",\n boxSizing: \"border-box\",\n background: pal.notif,\n color: pal.text,\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n opacity: Math.min(1, Math.max(0, notifIn) * 1.5),\n transform: `translateY(${(1 - notifIn) * -70}px) scale(${0.96 + 0.04 * notifIn})`,\n boxShadow: pal.panelShadow,\n }}\n >\n <div\n style={{\n width: 40,\n height: 40,\n borderRadius: 10,\n background: withAlpha(pal.green, pal.dark ? 0.18 : 0.12),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n }}\n >\n <Icon name=\"bank\" color={pal.green} size={20} />\n </div>\n <div style={{ flex: 1, minWidth: 0 }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"baseline\",\n fontSize: 17,\n }}\n >\n <span>Payout on the way</span>\n <span style={{ fontSize: 15, color: pal.faint }}>now</span>\n </div>\n <div\n style={{\n fontSize: 16,\n color: pal.muted,\n marginTop: 2,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n <span\n style={{ color: pal.text, fontVariantNumeric: \"tabular-nums\" }}\n >\n {fmt(total - payoutFee, currency)}\n </span>{\" \"}\n to ••{payoutAccount.slice(-4)} · arrives {payoutArrival}\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/invoice-paid.tsx"
}
],
"type": "registry:component"
}