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": "world-signups",
"title": "World Signups",
"description": "A dotted world map pings signup locations next to a rolling signup counter and live feed.",
"dependencies": ["remotion", "@remotion/google-fonts"],
"registryDependencies": ["@remocn/gsh"],
"files": [
{
"path": "registry/remocn/world-signups/index.tsx",
"content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/HankenGrotesk\";\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 { fontFamily } = loadFont(\"normal\", {\n weights: [\"300\", \"400\"],\n subsets: [\"latin\"],\n});\n\nexport interface Signup {\n name: string;\n city: string;\n country: string;\n lon: number;\n lat: number;\n plan?: \"Free\" | \"Pro\" | \"Team\";\n at: number;\n}\n\nexport interface CountryStat {\n name: string;\n code: string;\n count: number;\n}\n\nexport interface WorldSignupsProps {\n signups?: Signup[];\n startCount?: number;\n countries?: CountryStat[];\n title?: string;\n counterLabel?: string;\n delta?: string;\n theme?: \"light\" | \"dark\";\n accent?: string;\n speed?: number;\n ground?: GshPresetId;\n groundParams?: Partial<GradientParams>;\n}\n\nconst DEFAULT_SIGNUPS: Signup[] = [\n {\n name: \"Maya Chen\",\n city: \"Lisbon\",\n country: \"PT\",\n lon: -9.14,\n lat: 38.72,\n plan: \"Pro\",\n at: 26,\n },\n {\n name: \"Kenji Sato\",\n city: \"Tokyo\",\n country: \"JP\",\n lon: 139.69,\n lat: 35.69,\n plan: \"Free\",\n at: 38,\n },\n {\n name: \"Ana Souza\",\n city: \"São Paulo\",\n country: \"BR\",\n lon: -46.63,\n lat: -23.55,\n plan: \"Pro\",\n at: 49,\n },\n {\n name: \"Leo Park\",\n city: \"Seoul\",\n country: \"KR\",\n lon: 126.98,\n lat: 37.57,\n plan: \"Team\",\n at: 59,\n },\n {\n name: \"Priya Raman\",\n city: \"Bengaluru\",\n country: \"IN\",\n lon: 77.59,\n lat: 12.97,\n plan: \"Free\",\n at: 68,\n },\n {\n name: \"Jonas Weber\",\n city: \"Berlin\",\n country: \"DE\",\n lon: 13.4,\n lat: 52.52,\n plan: \"Pro\",\n at: 77,\n },\n {\n name: \"Sam Ortiz\",\n city: \"Austin\",\n country: \"US\",\n lon: -97.74,\n lat: 30.27,\n plan: \"Free\",\n at: 85,\n },\n {\n name: \"Amara Okafor\",\n city: \"Lagos\",\n country: \"NG\",\n lon: 3.38,\n lat: 6.52,\n plan: \"Free\",\n at: 93,\n },\n {\n name: \"Chloé Martin\",\n city: \"Paris\",\n country: \"FR\",\n lon: 2.35,\n lat: 48.86,\n plan: \"Pro\",\n at: 101,\n },\n {\n name: \"Noah Williams\",\n city: \"Sydney\",\n country: \"AU\",\n lon: 151.21,\n lat: -33.87,\n plan: \"Team\",\n at: 108,\n },\n {\n name: \"Olivia Brown\",\n city: \"Toronto\",\n country: \"CA\",\n lon: -79.38,\n lat: 43.65,\n plan: \"Free\",\n at: 115,\n },\n {\n name: \"Elena Rossi\",\n city: \"Milan\",\n country: \"IT\",\n lon: 9.19,\n lat: 45.46,\n plan: \"Pro\",\n at: 122,\n },\n {\n name: \"Diego Ramírez\",\n city: \"Mexico City\",\n country: \"MX\",\n lon: -99.13,\n lat: 19.43,\n plan: \"Free\",\n at: 129,\n },\n {\n name: \"Aiko Tanaka\",\n city: \"Osaka\",\n country: \"JP\",\n lon: 135.5,\n lat: 34.69,\n plan: \"Pro\",\n at: 137,\n },\n {\n name: \"Tom Becker\",\n city: \"Seattle\",\n country: \"US\",\n lon: -122.33,\n lat: 47.61,\n plan: \"Team\",\n at: 145,\n },\n];\n\nconst DEFAULT_COUNTRIES: CountryStat[] = [\n { name: \"United States\", code: \"US\", count: 2184 },\n { name: \"Germany\", code: \"DE\", count: 1032 },\n { name: \"Brazil\", code: \"BR\", count: 902 },\n { name: \"India\", code: \"IN\", count: 871 },\n { name: \"Japan\", code: \"JP\", count: 655 },\n];\n\nconst LAND: string[] = [\n \"............................#######..#################...........#..............##.........######.......................\",\n \"......................#######..###......#############.........................###.....################..................\",\n \"......####################.##########....############.............####........#...##.#################################..\",\n \"....###################################...########..............##########.#############################################\",\n \".....###########################....###...#####.....###........#########################################################\",\n \".....#########################....###......###...............#####.###################################################..\",\n \"......####....###############.....#####...................#...####.############################################.##......\",\n \"......##........################..######.................###..###..########################################.....##......\",\n \".................########################................#.#################################################....#.......\",\n \"..................#######################.................##################################################............\",\n \"..................######################...................###############################################..............\",\n \"..................####################...................#############...###.############################..#............\",\n \"..................##################.....................####....###########.##########################.................\",\n \"...................################......................###.##....#.################################.#...#.............\",\n \"....................###############......................#######........############################..####..............\",\n \".....................#############.......................############################################..#................\",\n \"......................######....#.......................####################.########################...................\",\n \".......................#####...........................######################.######################....................\",\n \"........................####.....#....................##################.#######...################.....................\",\n \".........................###.##...###.................#########################.....#####..#####........................\",\n \"...........................####.......................###################.####......####....####....#...................\",\n \"..............................##......................######################.........##......####...#...................\",\n \"...............................##.#####................######################........##.....#.##........................\",\n \".................................########...............#####################.........#......#.......#..................\",\n \"..................................#########..............###..##############................###...##....................\",\n \".................................###########...................############..................##.####....................\",\n \".................................############..................###########...................##.###.#...###.............\",\n \".................................###############................#########.....................##...##....####...........\",\n \".................................################...............#########.......................##........####..........\",\n \"..................................##############................##########..............................................\",\n \"..................................##############................##########..#.........................####.#............\",\n \"...................................############.................#########..##........................########...........\",\n \"....................................###########.................########..##.......................###########..........\",\n \"....................................##########...................#######..##......................#############.........\",\n \"....................................#########....................######...........................#############.........\",\n \"....................................########.....................######...........................#############.........\",\n \"....................................#######.......................####............................#############.........\",\n \"....................................######........................###.............................##......#####.........\",\n \"...................................######.................................................................####........#.\",\n \"...................................####...............................................................................#.\",\n \"...................................####.............................................................................##..\",\n \"...................................###..............................................................................#...\",\n \"...................................###..................................................................................\",\n \"...................................##...................................................................................\",\n];\nconst CELL = 3;\nconst LAT_TOP = 78;\n\nconst CL = { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" } as const;\nconst enterEase = Easing.bezier(0.32, 0.72, 0, 1);\nconst moveEase = Easing.bezier(0.65, 0, 0.35, 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 clamp = (v: number, lo: number, hi: number) =>\n Math.min(hi, Math.max(lo, v));\nconst fmt = (n: number) =>\n String(Math.round(n)).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\nconst hash = (n: number) => {\n const s = Math.sin(n * 127.1 + 311.7) * 43758.5453;\n return s - Math.floor(s);\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\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\ninterface Pal {\n win: string;\n chip: string;\n line: string;\n text: string;\n muted: string;\n faint: string;\n dot: string;\n green: string;\n scrim: string;\n winShadow: string;\n chipShadow: string;\n stageText: string;\n stageMuted: string;\n dark: boolean;\n}\n\nfunction palette(theme: \"light\" | \"dark\"): Pal {\n return theme === \"dark\"\n ? {\n win: \"#0D0E11\",\n chip: \"#1A1B1F\",\n line: \"rgba(255,255,255,0.07)\",\n text: \"#EEEEF0\",\n muted: \"rgba(238,238,240,0.58)\",\n faint: \"rgba(238,238,240,0.38)\",\n dot: \"rgba(255,255,255,0.3)\",\n green: \"#62D893\",\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 chipShadow:\n \"0 0 0 1px rgba(255,255,255,0.12), 0 10px 24px -6px rgba(0,0,0,0.6)\",\n stageText: \"#F2F2F4\",\n stageMuted: \"rgba(242,242,244,0.62)\",\n dark: true,\n }\n : {\n win: \"#FCFCFB\",\n chip: \"#FFFFFF\",\n line: \"rgba(22,23,26,0.08)\",\n text: \"#16171A\",\n muted: \"rgba(22,23,26,0.58)\",\n faint: \"rgba(22,23,26,0.4)\",\n dot: \"rgba(22,23,26,0.2)\",\n green: \"#18794E\",\n scrim: \"rgba(238,236,232,0.12)\",\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 chipShadow:\n \"0 0 0 1px rgba(17,19,24,0.08), 0 10px 24px -8px rgba(28,38,92,0.3)\",\n stageText: \"#14151A\",\n stageMuted: \"rgba(20,21,26,0.6)\",\n dark: false,\n };\n}\n\nconst LIGHT_GROUND: Partial<GradientParams> = {\n colors: [\"#6e8dff\", \"#aebdff\", \"#dfe4fb\", \"#f5f3ef\"],\n};\n\nfunction lighten(color: string, t: 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 const ch = (v: number) =>\n Math.round(v + (255 - v) * t)\n .toString(16)\n .padStart(2, \"0\");\n return `#${ch((n >> 16) & 255)}${ch((n >> 8) & 255)}${ch(n & 255)}`;\n}\n\nconst AVATAR_TONES = [\"#B9806C\", \"#6F8DB8\", \"#8E7DB3\", \"#6E9C84\", \"#B59866\"];\nfunction Avatar({ name, size }: { name: string; size: number }) {\n const idx =\n [...name].reduce((s, ch) => s + ch.charCodeAt(0), 0) % AVATAR_TONES.length;\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: 999,\n background: AVATAR_TONES[idx],\n color: \"rgba(255,255,255,0.95)\",\n fontSize: size * 0.4,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n letterSpacing: \"0.02em\",\n }}\n >\n {name\n .split(\" \")\n .map((s) => s[0])\n .join(\"\")\n .slice(0, 2)}\n </div>\n );\n}\n\nfunction SnapCounter({\n value,\n changedAt,\n frame,\n}: {\n value: string;\n changedAt: number[];\n frame: number;\n}) {\n let d = 0;\n const digits = value.replace(/\\D/g, \"\").length;\n return (\n <span\n style={{\n display: \"inline-flex\",\n fontVariantNumeric: \"tabular-nums\",\n overflow: \"hidden\",\n }}\n >\n {value.split(\"\").map((ch, i) => {\n if (!/\\d/.test(ch)) {\n return <span key={i}>{ch}</span>;\n }\n const slot = digits - 1 - d++;\n const t = changedAt[slot] ?? -999;\n const p = tween(frame, t, t + 8);\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n transform: `translateY(${(1 - p) * 60}%)`,\n opacity: 0.2 + 0.8 * p,\n }}\n >\n {ch}\n </span>\n );\n })}\n </span>\n );\n}\n\nexport function WorldSignups({\n signups = DEFAULT_SIGNUPS,\n startCount = 12847,\n countries = DEFAULT_COUNTRIES,\n title = \"Signups around the world\",\n counterLabel = \"Signups today\",\n delta = \"+18.2% vs. yesterday\",\n theme = \"light\",\n accent = \"#3B5BFD\",\n speed = 1,\n ground,\n groundParams,\n}: WorldSignupsProps) {\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 WIN = tall\n ? { x: 40, y: 340, w: 720, h: 1010 }\n : { x: 140, y: 60, w: 1000, h: 600 };\n const PAD = 28;\n const HEAD_H = 68;\n const MAP_W = tall ? WIN.w - PAD * 2 : 640;\n const PITCH = MAP_W / LAND[0].length;\n const PITCH_Y = PITCH * 1.18;\n const mapH = LAND.length * PITCH_Y;\n const COUNTRY_H = 70;\n const countryY = tall ? HEAD_H + 28 + mapH + 30 : WIN.h - PAD - COUNTRY_H;\n const mapTop = tall\n ? HEAD_H + 28\n : HEAD_H + (countryY - HEAD_H - mapH) / 2 - 6;\n const mapLeft = PAD;\n const SIDE = tall\n ? { x: PAD, y: countryY + COUNTRY_H + 30, w: WIN.w - PAD * 2 }\n : {\n x: PAD + MAP_W + 32,\n y: HEAD_H + 24,\n w: WIN.w - (PAD + MAP_W + 32) - PAD,\n };\n const feedTop = tall ? SIDE.y + 40 : SIDE.y + 180;\n const ROW = tall ? 66 : 62;\n\n const project = (lon: number, lat: number) => {\n const c = clamp(Math.floor((lon + 180) / CELL), 0, LAND[0].length - 1);\n const r = clamp(Math.floor((LAT_TOP - lat) / CELL), 0, LAND.length - 1);\n return { x: (c + 0.5) * PITCH, y: (r + 0.5) * PITCH_Y };\n };\n\n const events = [...signups].sort((a, b) => a.at - b.at);\n const landed = events.filter((e) => e.at <= frame);\n const inc = (k: number) => 1 + Math.floor(hash(k) * 3);\n\n let count = startCount;\n const changedAt: number[] = [];\n events.forEach((e, k) => {\n if (e.at > frame) return;\n const next = count + inc(k);\n const a = String(count);\n const b = String(next);\n for (let i = 0; i < b.length; i++) {\n if (a[a.length - 1 - i] !== b[b.length - 1 - i]) changedAt[i] = e.at;\n }\n count = next;\n });\n\n const win = sp(0, HEAVY);\n const winA = tween(frame, 0, 10);\n const lastAt = events.length ? events[events.length - 1].at : 120;\n const cam = tween(frame, 10, lastAt + 30, camEase);\n const blink = 0.4 + 0.6 * (0.5 + 0.5 * Math.cos((frame / 30) * Math.PI * 2));\n\n const heatSrc = landed.map((e) => ({\n ...project(e.lon, e.lat),\n w: tween(frame, e.at, e.at + 18),\n }));\n const hot = pal.dark ? lighten(accent, 0.28) : accent;\n const dots: React.ReactNode[] = [];\n LAND.forEach((row, r) => {\n for (let c = 0; c < row.length; c++) {\n if (row[c] !== \"#\") continue;\n const reveal = tween(frame, 4 + c * 0.12, 14 + c * 0.12);\n const cx = (c + 0.5) * PITCH;\n const cy = (r + 0.5) * PITCH_Y;\n let heat = 0;\n for (const h of heatSrc) {\n const d2 = (cx - h.x) ** 2 + (cy - h.y) ** 2;\n if (d2 < 900) heat += h.w * Math.exp(-d2 / 140);\n }\n heat = Math.min(1, heat);\n dots.push(\n <circle\n key={`${r}-${c}`}\n cx={cx}\n cy={cy}\n r={PITCH * (pal.dark ? 0.33 : 0.3)}\n fill={heat > 0.04 ? withAlpha(hot, 0.3 + 0.7 * heat) : pal.dot}\n opacity={reveal}\n />,\n );\n }\n });\n\n const countryTotals = countries.map(\n (c) =>\n c.count +\n events.reduce(\n (sum, e, k) =>\n sum + (e.country === c.code && e.at <= frame ? inc(k) : 0),\n 0,\n ),\n );\n const maxCountry = Math.max(...countryTotals);\n\n const counter = (size: number, labelSize: number, onStage: boolean) => (\n <div>\n <div\n style={{\n fontSize: labelSize,\n color: onStage ? pal.stageMuted : pal.muted,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n }}\n >\n <span\n style={{\n width: labelSize * 0.45,\n height: labelSize * 0.45,\n borderRadius: 99,\n background: pal.green,\n opacity: blink,\n }}\n />\n {counterLabel}\n </div>\n <div\n style={{\n fontSize: size,\n fontWeight: 300,\n letterSpacing: \"-0.045em\",\n color: onStage ? pal.stageText : pal.text,\n lineHeight: 1.08,\n marginTop: 6,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n transform: `translateY(${(1 - tween(frame, 4, 18)) * 100}%)`,\n }}\n >\n <SnapCounter value={fmt(count)} changedAt={changedAt} frame={frame} />\n </div>\n </div>\n <div\n style={{\n fontSize: labelSize,\n color: pal.green,\n marginTop: 6,\n fontVariantNumeric: \"tabular-nums\",\n opacity: tween(frame, 12, 22),\n }}\n >\n {delta}\n </div>\n </div>\n );\n\n return (\n <AbsoluteFill\n style={{\n fontFamily,\n fontWeight: 400,\n overflow: \"hidden\",\n WebkitFontSmoothing: \"antialiased\",\n background: pal.dark ? \"#03050C\" : \"#EEECE8\",\n }}\n >\n <GshGround\n preset={ground ?? (pal.dark ? \"europa\" : \"paper-crease\")}\n params={groundParams ?? (pal.dark ? undefined : LIGHT_GROUND)}\n timeOffset={pal.dark ? 5 : 2}\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: `${WIN.x + mapLeft + MAP_W / 2}px ${WIN.y + mapTop + mapH / 2}px`,\n transform: `scale(${1 + 0.03 * cam})`,\n }}\n >\n {tall ? (\n <div style={{ position: \"absolute\", left: 48, top: 88 }}>\n {counter(132, 26, true)}\n </div>\n ) : null}\n <div\n style={{\n position: \"absolute\",\n left: WIN.x,\n top: WIN.y,\n width: WIN.w,\n height: WIN.h,\n opacity: winA,\n transform: `translateY(${(1 - win) * 48}px) scale(${0.97 + 0.03 * win})`,\n transformOrigin: \"50% 100%\",\n borderRadius: 16,\n background: pal.win,\n boxShadow: pal.winShadow,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n height: HEAD_H,\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n padding: `0 ${PAD}px`,\n borderBottom: `1px solid ${pal.line}`,\n }}\n >\n <span\n style={{\n fontSize: 20,\n color: pal.text,\n letterSpacing: \"-0.01em\",\n }}\n >\n {title}\n </span>\n <div style={{ flex: 1 }} />\n <span style={{ fontSize: 16, color: pal.muted }}>Today</span>\n </div>\n\n <svg\n width={MAP_W}\n height={mapH}\n style={{\n position: \"absolute\",\n left: mapLeft,\n top: mapTop,\n overflow: \"visible\",\n }}\n >\n {dots}\n {events.map((e, k) => {\n if (k === 0) return null;\n const a = project(events[k - 1].lon, events[k - 1].lat);\n const b = project(e.lon, e.lat);\n const head = tween(frame, e.at - 12, e.at, moveEase);\n const tail = tween(frame, e.at - 3, e.at + 12, moveEase);\n if (head <= 0 || tail >= 1) return null;\n const mx = (a.x + b.x) / 2;\n const my = (a.y + b.y) / 2;\n const dist = Math.hypot(b.x - a.x, b.y - a.y);\n return (\n <path\n key={`arc-${e.name}`}\n d={`M${a.x} ${a.y} Q${mx} ${my - dist * 0.32} ${b.x} ${b.y}`}\n fill=\"none\"\n stroke={hot}\n strokeWidth={1.75}\n strokeLinecap=\"round\"\n pathLength={1}\n strokeDasharray={`${Math.max(0.0001, head - tail)} 2`}\n strokeDashoffset={-tail}\n />\n );\n })}\n {events.map((e) => {\n if (frame < e.at) return null;\n const p = project(e.lon, e.lat);\n const land = sp(e.at, CHIP);\n const ring = tween(frame, e.at, e.at + 24);\n return (\n <g key={`city-${e.name}`}>\n <circle\n cx={p.x}\n cy={p.y}\n r={4 + 18 * ring}\n fill=\"none\"\n stroke={hot}\n strokeWidth={1.5}\n opacity={0.6 * (1 - ring)}\n />\n <circle\n cx={p.x}\n cy={p.y}\n r={Math.max(0, 4 * land)}\n fill={hot}\n stroke={pal.win}\n strokeWidth={1.5}\n />\n </g>\n );\n })}\n </svg>\n {events.map((e, k) => {\n const nextAt = events[k + 1]?.at ?? e.at + 40;\n const hold = Math.max(14, Math.min(26, nextAt - e.at + 8));\n const a = sp(e.at + 1, CHIP);\n const out = tween(frame, e.at + hold, e.at + hold + 6, exitEase);\n if (frame < e.at + 1 || out >= 1) return null;\n const p = project(e.lon, e.lat);\n return (\n <div\n key={`label-${e.name}`}\n style={{\n position: \"absolute\",\n left: mapLeft + p.x,\n top: mapTop + p.y - 14,\n transform: `translate(-50%, -100%) translateY(${(1 - a) * 8 - out * 6}px) scale(${0.8 + 0.2 * a})`,\n transformOrigin: \"50% 100%\",\n opacity: clamp(a * 2, 0, 1) * (1 - out),\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n height: 34,\n padding: \"0 12px 0 5px\",\n borderRadius: 99,\n background: pal.chip,\n boxShadow: pal.chipShadow,\n fontSize: 16,\n color: pal.text,\n whiteSpace: \"nowrap\",\n zIndex: 3,\n }}\n >\n <Avatar name={e.name} size={24} />\n {e.name.split(\" \")[0]}\n <span style={{ color: pal.muted }}>{e.city}</span>\n </div>\n );\n })}\n\n <div\n style={{\n position: \"absolute\",\n left: mapLeft,\n top: countryY,\n width: MAP_W,\n height: COUNTRY_H,\n display: \"flex\",\n gap: 20,\n }}\n >\n {countries.map((c, i) => {\n const a = tween(frame, 10 + i * 3, 22 + i * 3);\n const bumpAt = events\n .filter((e) => e.country === c.code && e.at <= frame)\n .map((e) => e.at)\n .pop();\n const bump =\n bumpAt === undefined\n ? 0\n : 1 - tween(frame, bumpAt, bumpAt + 24);\n const fill = sp(10 + i * 3, CARD);\n return (\n <div\n key={c.code}\n style={{\n flex: 1,\n minWidth: 0,\n opacity: a,\n transform: `translateY(${(1 - a) * 8}px)`,\n }}\n >\n <div\n style={{\n fontSize: 16,\n color: pal.muted,\n whiteSpace: \"nowrap\",\n }}\n >\n {c.name}\n </div>\n <div\n style={{\n fontSize: 22,\n fontWeight: 300,\n color: bump > 0.35 ? accent : pal.text,\n marginTop: 2,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.01em\",\n }}\n >\n {fmt(countryTotals[i])}\n </div>\n <div\n style={{\n height: 3,\n borderRadius: 2,\n background: pal.line,\n marginTop: 8,\n }}\n >\n <div\n style={{\n width: `${(countryTotals[i] / maxCountry) * 100 * clamp(fill, 0, 1.03)}%`,\n height: \"100%\",\n borderRadius: 2,\n background: accent,\n }}\n />\n </div>\n </div>\n );\n })}\n </div>\n\n {tall ? (\n <div\n style={{\n position: \"absolute\",\n left: PAD,\n right: PAD,\n top: SIDE.y - 14,\n height: 1,\n background: pal.line,\n }}\n />\n ) : (\n <div\n style={{\n position: \"absolute\",\n left: SIDE.x - 16,\n top: HEAD_H,\n bottom: 0,\n width: 1,\n background: pal.line,\n }}\n />\n )}\n {!tall ? (\n <div\n style={{\n position: \"absolute\",\n left: SIDE.x,\n top: SIDE.y,\n width: SIDE.w,\n }}\n >\n {counter(60, 16, false)}\n </div>\n ) : null}\n <div\n style={{\n position: \"absolute\",\n left: SIDE.x,\n top: feedTop - 36,\n fontSize: 16,\n color: pal.muted,\n }}\n >\n Latest signups\n </div>\n <div\n style={{\n position: \"absolute\",\n left: SIDE.x,\n top: feedTop,\n width: SIDE.w,\n bottom: 0,\n overflow: \"hidden\",\n maskImage: \"linear-gradient(to bottom, black 70%, transparent)\",\n }}\n >\n {events.map((e, k) => {\n if (e.at > frame) return null;\n let y = 0;\n for (let j = k + 1; j < events.length; j++) {\n if (events[j].at <= frame) y += ROW * sp(events[j].at, CARD);\n }\n if (y > ROW * 8) return null;\n const a = tween(frame, e.at + 1, e.at + 10);\n const hl = 1 - tween(frame, e.at + 6, e.at + 30, moveEase);\n return (\n <div\n key={`row-${e.name}`}\n style={{\n position: \"absolute\",\n left: -10,\n right: -10,\n top: y,\n height: ROW - 6,\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n padding: \"0 10px\",\n borderRadius: 10,\n background: withAlpha(\n accent,\n (pal.dark ? 0.1 : 0.07) * hl,\n ),\n }}\n >\n <div\n style={{\n flex: 1,\n minWidth: 0,\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n opacity: a,\n transform: `translateY(${(1 - a) * -8}px)`,\n }}\n >\n <Avatar name={e.name} size={34} />\n <div style={{ flex: 1, minWidth: 0 }}>\n <div\n style={{\n fontSize: 17,\n color: pal.text,\n whiteSpace: \"nowrap\",\n }}\n >\n {e.name}\n </div>\n <div\n style={{\n fontSize: 16,\n color: pal.muted,\n marginTop: 1,\n whiteSpace: \"nowrap\",\n }}\n >\n {e.city}, {e.country}\n </div>\n </div>\n <span\n style={{\n fontSize: 16,\n color:\n e.plan && e.plan !== \"Free\" ? accent : pal.faint,\n }}\n >\n {e.plan ?? \"Free\"}\n </span>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/world-signups.tsx"
}
],
"type": "registry:component"
}