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": "stock-scrub",
"title": "Stock Scrub",
"description": "A phone stock page scrubs its price chart then opens a buy sheet.",
"dependencies": ["remotion", "@remotion/google-fonts"],
"registryDependencies": ["@remocn/gsh"],
"files": [
{
"path": "registry/remocn/stock-scrub/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 StockScrubProps {\n ticker?: string;\n name?: string;\n /** Intraday prices, open → now. The first value is the open (the dashed baseline). */\n series?: number[];\n /** Prices for the 1Y range; rescaled so it ends on the same price as `series`. */\n yearSeries?: number[];\n accent?: string;\n speed?: number;\n theme?: \"light\" | \"dark\";\n /** Four lines beside the phone: live, scrub, range, buy. */\n lines?: [string, string, string, string];\n ground?: GshPresetId;\n groundParams?: Partial<GradientParams>;\n}\n\nconst REMOCN_R_PATH =\n \"M 0.01 0.81 C 0.01 1.73, 0.36 2.79, 1.09 4.13 C 4.91 11.04, 13.45 17.16, 21.7 18.9 C 22.94 19.16, 23.18 19.16, 51.39 19.27 C 76.07 19.36, 80.02 19.4, 81.32 19.57 C 89.89 20.69, 96.2 24.68, 99.38 31.01 C 103.19 38.56, 102.53 50.1, 97.91 57.07 C 94.66 61.96, 89.68 64.99, 83.26 66 C 82.81 66.07, 70.18 66.83, 55.2 67.69 C 24.82 69.43, 27.03 69.23, 24.18 70.4 C 19.9 72.15, 14.84 75.7, 10.65 79.89 C 4.86 85.68, 1.3 91.91, 0.25 98.13 C 0.12 98.85, 0.08 103.13, 0.04 116.66 L 0 134.26 9.5 134.26 L 19 134.26 19.05 119.41 C 19.1 103.27, 19.08 103.82, 19.82 101.04 C 21.79 93.65, 27.86 88.75, 36.45 87.63 C 37.23 87.53, 39.41 87.5, 43.57 87.53 C 50.12 87.59, 50.75 87.65, 53.22 88.45 C 56.61 89.56, 59.67 91.86, 62.02 95.07 C 62.52 95.76, 69.35 103.85, 77.2 113.07 C 85.04 122.28, 91.63 130.04, 91.85 130.32 C 92.07 130.59, 92.5 131.34, 92.82 131.97 C 93.52 133.35, 94.11 133.93, 95.06 134.13 C 95.5 134.23, 98.97 134.26, 106.36 134.23 L 117.01 134.19 100.82 113.07 C 91.91 101.45, 84.52 91.78, 84.39 91.57 C 83.36 89.89, 83.66 87.53, 85.09 86 C 85.79 85.25, 86.36 84.94, 88.07 84.38 C 96.18 81.72, 104.15 76.62, 109.97 70.36 C 120.59 58.93, 124.06 44.32, 119.44 30.43 C 114.59 15.81, 101.93 4.02, 87.64 0.83 C 83.93 0.01, 88.09 0.08, 41.85 0.04 L 0.01 0 0.01 0.81 Z\";\n\nconst SW = 390;\nconst SH = 844;\nconst BEZEL = 12;\nconst BW = SW + BEZEL * 2;\nconst BH = SH + BEZEL * 2;\n\nconst CH_Y = 250;\nconst CH_W = SW - 18;\nconst CH_H = 236;\nconst TABS_Y = 502;\nconst N = 96;\nconst TABS = [\"LIVE\", \"1D\", \"1W\", \"1M\", \"1Y\", \"ALL\"];\nconst TAB_W = (SW - 24) / TABS.length;\nconst DRAW = 8;\nconst PRESS = 72;\nconst LEFT = 112;\nconst RIGHT = 146;\nconst RELEASE = 154;\nconst TAB_TAP = 174;\nconst BUY_TAP = 214;\n\nconst clamp = { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" } as const;\nconst MOVE = Easing.bezier(0.65, 0, 0.35, 1);\nconst ENTER = Easing.bezier(0.32, 0.72, 0, 1);\nconst EXIT = Easing.bezier(0.55, 0, 1, 0.45);\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 DARK = {\n copy: \"#f4f4f6\",\n copyMuted: \"rgba(244,244,246,0.52)\",\n scrim: \"rgba(2,3,8,0.34)\",\n frame:\n \"linear-gradient(155deg,#55565c 0%,#2a2b2f 30%,#3d3e43 62%,#1f2023 100%)\",\n phoneShadow:\n \"0 50px 100px -20px rgba(0,0,0,0.7), 0 18px 36px -12px rgba(0,0,0,0.5)\",\n screen: \"#000000\",\n text: \"#ffffff\",\n muted: \"#8d8d93\",\n chip: \"#1c1c1e\",\n hair: \"rgba(255,255,255,0.08)\",\n up: \"#30c462\",\n down: \"#ff5b5b\",\n tabOn: \"#ffffff\",\n tabOnText: \"#000000\",\n sheet: \"#1c1c1e\",\n field: \"#2c2c2e\",\n touch: \"rgba(255,255,255,0.18)\",\n};\nconst LIGHT: typeof DARK = {\n copy: \"#141518\",\n copyMuted: \"rgba(20,21,24,0.5)\",\n scrim: \"rgba(243,241,237,0.3)\",\n frame:\n \"linear-gradient(155deg,#f1f1f3 0%,#c4c4ca 30%,#e2e2e6 62%,#b3b3ba 100%)\",\n phoneShadow:\n \"0 50px 90px -24px rgba(30,32,44,0.32), 0 14px 30px -10px rgba(30,32,44,0.18)\",\n screen: \"#ffffff\",\n text: \"#111317\",\n muted: \"#71747c\",\n chip: \"#f2f2f4\",\n hair: \"#ebebee\",\n up: \"#33a64a\",\n down: \"#e5484d\",\n tabOn: \"#efeff2\",\n tabOnText: \"#111317\",\n sheet: \"#ffffff\",\n field: \"#f2f2f4\",\n touch: \"rgba(17,19,23,0.16)\",\n};\ntype Palette = typeof DARK;\n\nfunction hash(n: number) {\n const x = Math.sin(n * 127.1 + 311.7) * 43758.5453;\n return x - Math.floor(x);\n}\n\nfunction makeSeries(anchors: [number, number][], vol: number, seed: number) {\n const out: number[] = [];\n let w = 0;\n for (let i = 0; i < N; i++) {\n const t = i / (N - 1);\n const base = interpolate(\n t,\n anchors.map((a) => a[0]),\n anchors.map((a) => a[1]),\n { easing: Easing.bezier(0.45, 0, 0.55, 1) },\n );\n w = w * 0.72 + (hash(i + seed) - 0.5) * vol;\n const edge = i === 0 || i === N - 1 ? 0 : 1;\n out.push(base + w * edge);\n }\n return out;\n}\n\nconst DAY = makeSeries(\n [\n [0, 180.2],\n [0.1, 181.3],\n [0.36, 176.6],\n [0.52, 178.1],\n [0.68, 181.9],\n [0.82, 180.9],\n [1, 184.32],\n ],\n 1.1,\n 3,\n);\nconst YEAR = makeSeries(\n [\n [0, 121.6],\n [0.18, 132.4],\n [0.32, 125.8],\n [0.5, 147.2],\n [0.62, 140.1],\n [0.8, 165.3],\n [0.9, 171.8],\n [1, 184.32],\n ],\n 6,\n 41,\n);\n\nfunction resample(src: number[]) {\n if (src.length === N) return src;\n return Array.from({ length: N }, (_, i) => {\n const p = (i / (N - 1)) * (src.length - 1);\n const a = Math.floor(p);\n const b = Math.min(src.length - 1, a + 1);\n return src[a] + (src[b] - src[a]) * (p - a);\n });\n}\n\nconst money = (v: number) => {\n const [int, dec] = Math.abs(v).toFixed(2).split(\".\");\n return `${int.replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")}.${dec}`;\n};\n\nconst ICON = {\n back: \"M15 5l-7 7 7 7\",\n heart: \"M12 20s-7-4.4-7-10a4 4 0 017-2.6A4 4 0 0119 10c0 5.6-7 10-7 10z\",\n more: \"M6 12h.01M12 12h.01M18 12h.01\",\n chev: \"M7 10l5 5 5-5\",\n};\n\nfunction Glyph({\n d,\n size = 20,\n color,\n sw = 2,\n}: {\n d: string;\n size?: number;\n color: string;\n sw?: number;\n}) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d={d}\n stroke={color}\n strokeWidth={sw}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction StatusBar({ color }: { color: string }) {\n return (\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n height: 54,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"4px 30px 0 52px\",\n zIndex: 30,\n }}\n >\n <span\n style={{ fontSize: 17, fontWeight: 400, color, letterSpacing: -0.3 }}\n >\n 9:41\n </span>\n <div style={{ display: \"flex\", gap: 6, alignItems: \"center\" }}>\n <svg width=\"18\" height=\"12\" viewBox=\"0 0 18 12\">\n {[0, 1, 2, 3].map((i) => (\n <rect\n key={i}\n x={i * 4.6}\n y={9 - i * 3}\n width={3.2}\n height={3 + i * 3}\n rx={0.8}\n fill={color}\n />\n ))}\n </svg>\n <svg width=\"17\" height=\"12\" viewBox=\"0 0 17 12\">\n <path\n d=\"M8.5 11.5l2.4-2.9a3.6 3.6 0 00-4.8 0zM3.7 6.2a7 7 0 019.6 0l1.6-1.9a9.6 9.6 0 00-12.8 0zM.5 2.9a12 12 0 0116 0\"\n fill={color}\n stroke={color}\n strokeWidth={0.6}\n />\n </svg>\n <div\n style={{\n width: 26,\n height: 12.5,\n borderRadius: 4,\n border: `1px solid ${color}`,\n padding: 1.5,\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n width: \"80%\",\n height: \"100%\",\n borderRadius: 2,\n background: color,\n }}\n />\n </div>\n </div>\n </div>\n );\n}\n\nfunction Phone({ children, c }: { children: React.ReactNode; c: Palette }) {\n const screen = c.screen;\n const home = c.text;\n const side = (s: \"left\" | \"right\", top: number, h: number) => (\n <div\n style={{\n position: \"absolute\",\n [s]: -2.5,\n top,\n width: 4,\n height: h,\n borderRadius: 2,\n background: c.frame,\n }}\n />\n );\n return (\n <div style={{ position: \"relative\", width: BW, height: BH }}>\n {side(\"left\", 168, 30)}\n {side(\"left\", 226, 60)}\n {side(\"left\", 298, 60)}\n {side(\"right\", 258, 96)}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: 67,\n background: c.frame,\n boxShadow: `${c.phoneShadow}, inset 0 0 0 1px rgba(255,255,255,0.22)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 3,\n borderRadius: 64,\n background: \"#050506\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: BEZEL,\n top: BEZEL,\n width: SW,\n height: SH,\n borderRadius: 55,\n overflow: \"hidden\",\n background: screen,\n }}\n >\n {children}\n <div\n style={{\n position: \"absolute\",\n top: 11,\n left: (SW - 124) / 2,\n width: 124,\n height: 36,\n borderRadius: 18,\n background: \"#000\",\n zIndex: 40,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n bottom: 8,\n left: (SW - 136) / 2,\n width: 136,\n height: 5,\n borderRadius: 3,\n background: home,\n zIndex: 40,\n }}\n />\n </div>\n </div>\n );\n}\n\nexport function StockScrub({\n ticker = \"RMCN\",\n name = \"remocn Inc.\",\n series = DAY,\n yearSeries = YEAR,\n accent = \"#3B5BFD\",\n speed = 1,\n theme = \"dark\",\n lines = [\n \"Every tick, live.\",\n \"Drag through the day.\",\n \"Zoom out to the year.\",\n \"Buy in two taps.\",\n ],\n ground,\n groundParams,\n}: StockScrubProps) {\n const frame = useCurrentFrame();\n const { fps, width, height } = useVideoConfig();\n const f = frame * speed;\n const dark = theme !== \"light\";\n const c: Palette = dark ? DARK : LIGHT;\n const uid = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n\n const tall = height > width;\n const W = tall ? 720 : 1280;\n const H = tall ? 1280 : 720;\n const u = Math.min(width / W, height / H);\n const k = tall ? (H * 0.72) / BH : (H * 0.94) / BH;\n const phoneCx = tall ? W / 2 : W * 0.68;\n const phoneCy = tall ? H - 30 - (BH * k) / 2 : H / 2;\n const sp = (at: number, config: Partial<typeof CARD> = CARD) =>\n spring({ frame: f - at, fps, config });\n const press = (at: number) =>\n Math.max(0, Math.min(1, sp(at - 1, CHIP) - sp(at + 5, CHIP)));\n\n const day = resample(series);\n const last = day[N - 1];\n const yr0 = resample(yearSeries);\n const year = yr0.map((v) => (v * last) / yr0[N - 1]);\n const open = day[0];\n\n const yOf = (arr: number[]) => {\n const lo = Math.min(...arr);\n const hi = Math.max(...arr);\n const pad = (hi - lo) * 0.12;\n return (v: number) => CH_H - ((v - lo + pad) / (hi - lo + pad * 2)) * CH_H;\n };\n const yDay = yOf(day);\n const yYear = yOf(year);\n const morph = interpolate(f, [TAB_TAP + 3, TAB_TAP + 25], [0, 1], {\n ...clamp,\n easing: Easing.bezier(0.65, 0, 0.35, 1),\n });\n const pts = day.map((v, i) => ({\n x: (i / (N - 1)) * CH_W,\n y: yDay(v) + (yYear(year[i]) - yDay(v)) * morph,\n }));\n const line = pts\n .map((p, i) => `${i ? \"L\" : \"M\"}${p.x.toFixed(1)} ${p.y.toFixed(1)}`)\n .join(\" \");\n const area = `${line} L${CH_W} ${CH_H} L0 ${CH_H} Z`;\n const baseY = yDay(open) + (yYear(year[0]) - yDay(open)) * morph;\n const fingerY = CH_Y + CH_H;\n const path = [\n { t: 52, x: 330, y: 700 },\n { t: PRESS, x: SW * 0.78, y: fingerY },\n { t: PRESS + 4, x: SW * 0.78, y: fingerY },\n { t: LEFT, x: SW * 0.38, y: fingerY + 6 },\n { t: LEFT + 8, x: SW * 0.38, y: fingerY + 6 },\n { t: RIGHT, x: SW * 0.9, y: fingerY - 4 },\n { t: RELEASE - 3, x: SW * 0.95, y: fingerY - 4 },\n { t: TAB_TAP, x: 12 + TAB_W * 4.5, y: TABS_Y + 16 },\n { t: TAB_TAP + 4, x: 12 + TAB_W * 4.5, y: TABS_Y + 16 },\n { t: BUY_TAP, x: SW - 82, y: SH - 64 },\n ];\n let touch = path[0];\n for (let i = 0; i < path.length - 1; i++) {\n const a = path[i];\n const b = path[i + 1];\n if (f >= a.t) {\n const e = MOVE(Math.min(1, (f - a.t) / (b.t - a.t)));\n const arc =\n Math.sin(Math.PI * e) *\n Math.min(40, Math.hypot(b.x - a.x, b.y - a.y) * 0.12);\n touch = {\n t: f,\n x: a.x + (b.x - a.x) * e,\n y: a.y + (b.y - a.y) * e - arc,\n };\n }\n }\n const touchOpacity = interpolate(\n f,\n [path[0].t, path[0].t + 8, BUY_TAP + 4, BUY_TAP + 10],\n [0, 1, 1, 0],\n clamp,\n );\n const held = interpolate(\n f,\n [PRESS - 2, PRESS + 2, RELEASE - 2, RELEASE + 2],\n [0, 1, 1, 0],\n clamp,\n );\n const touchScale = 1 - 0.16 * Math.max(held, press(TAB_TAP), press(BUY_TAP));\n const scrubAt = (ff: number) => {\n const on = ff >= PRESS && ff < RELEASE;\n const x = interpolate(\n ff,\n [PRESS, PRESS + 4, LEFT, LEFT + 8, RIGHT, RELEASE - 3, RELEASE + 6],\n [0.78, 0.78, 0.38, 0.38, 0.9, 0.95, 1],\n { ...clamp, easing: MOVE },\n );\n const idx = Math.round(x * (N - 1));\n return { on, x: idx / (N - 1), price: day[idx] };\n };\n const priceAt = (ff: number) =>\n ff < PRESS || ff >= RELEASE + 6 ? last : scrubAt(ff).price;\n const scrub = scrubAt(f);\n const cross = interpolate(\n f,\n [PRESS - 1, PRESS + 4, RELEASE, RELEASE + 6],\n [0, 1, 1, 0],\n clamp,\n );\n const price = priceAt(f);\n const downness =\n (price < open ? 0.6 : 0) +\n (priceAt(Math.max(0, f - 1)) < open ? 0.25 : 0) +\n (priceAt(Math.max(0, f - 2)) < open ? 0.15 : 0);\n const lineColor = interpolateColors(downness, [0, 1], [c.up, c.down]);\n\n const base = morph > 0.5 ? year[0] : open;\n const delta = price - base;\n const pct = (delta / base) * 100;\n const scrubMin = 9.5 * 60 + scrub.x * 390;\n const hh = Math.floor(scrubMin / 60);\n const mm = Math.floor(scrubMin % 60);\n const timeLabel = `${hh > 12 ? hh - 12 : hh}:${String(mm).padStart(2, \"0\")} ${hh >= 12 ? \"PM\" : \"AM\"}`;\n const changeLabel =\n cross > 0.5 ? timeLabel : morph > 0.5 ? \"Past year\" : \"Today\";\n const crossX = scrub.x * CH_W;\n const rise = sp(0, HEAVY);\n const draw = interpolate(f, [DRAW, DRAW + 40], [0, 1], {\n ...clamp,\n easing: Easing.bezier(0.65, 0, 0.35, 1),\n });\n const headIn = [0, 1, 2, 3].map((i) => sp(6 + i * 3, CARD));\n const tabX = 12 + TAB_W * (1 + 3 * sp(TAB_TAP + 1, CHIP));\n const sheet = sp(BUY_TAP + 4, HEAVY);\n const sheetRows = [0, 1, 2, 3].map((i) => sp(BUY_TAP + 10 + i * 3, CARD));\n const pulse = ((f - DRAW - 40) % 36) / 36;\n const camS = interpolate(f, [0, 270], [1, 1.03], clamp);\n\n const enter = (v: number, dy = 12): React.CSSProperties => ({\n opacity: Math.min(1, v * 1.4),\n transform: `translateY(${(1 - v) * dy}px)`,\n });\n const circleBtn: React.CSSProperties = {\n width: 36,\n height: 36,\n borderRadius: 18,\n background: c.chip,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n const stats: [string, string][] = [\n [\"Open\", money(open)],\n [\"High\", money(Math.max(...day))],\n [\"Low\", money(Math.min(...day))],\n [\"Volume\", \"12.4M\"],\n [\"Mkt cap\", \"8.21B\"],\n [\"P/E ratio\", \"41.3\"],\n ];\n const lineEnd = pts[N - 1];\n\n const beats = [0, PRESS - 6, TAB_TAP - 4, BUY_TAP];\n const copyLine = (i: number) => {\n const inAt = beats[i] + (i === 0 ? 8 : 0);\n const outAt = beats[i + 1];\n const pin = interpolate(f, [inAt, inAt + 14], [0, 1], {\n ...clamp,\n easing: ENTER,\n });\n const pout =\n outAt === undefined\n ? 0\n : interpolate(f, [outAt - 2, outAt + 6], [0, 1], {\n ...clamp,\n easing: EXIT,\n });\n if (pin <= 0 || pout >= 1) return null;\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 0,\n transform: `translateY(${(1 - pin) * 70 - pout * 50}%)`,\n opacity: pin * (1 - pout),\n }}\n >\n {lines[i]}\n </div>\n );\n };\n const readIn = sp(18, CARD);\n\n return (\n <AbsoluteFill style={{ fontFamily, overflow: \"hidden\" }}>\n <GshGround\n preset={ground ?? (dark ? \"velvet-hour\" : \"glasswork\")}\n params={groundParams}\n timeOffset={dark ? 6 : 4}\n timeScale={0.35}\n />\n <AbsoluteFill style={{ background: c.scrim }} />\n <div\n style={{\n position: \"absolute\",\n left: (width - W * u) / 2,\n top: (height - H * u) / 2,\n width: W,\n height: H,\n transformOrigin: \"0 0\",\n transform: `scale(${u})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: tall ? 56 : 88,\n top: tall ? 84 : H / 2 - 112,\n width: tall ? W - 112 : 480,\n height: tall ? 140 : 160,\n fontSize: tall ? 62 : 70,\n fontWeight: 300,\n lineHeight: 1.04,\n letterSpacing: \"-0.035em\",\n color: c.copy,\n overflow: \"hidden\",\n textWrap: \"balance\",\n }}\n >\n {[0, 1, 2, 3].map((i) => copyLine(i))}\n </div>\n <div\n style={{\n position: \"absolute\",\n left: tall ? 56 : 88,\n top: tall ? 236 : H / 2 + 72,\n display: \"flex\",\n alignItems: \"baseline\",\n gap: 14,\n fontSize: tall ? 26 : 22,\n fontWeight: 400,\n color: c.copyMuted,\n fontVariantNumeric: \"tabular-nums\",\n opacity: Math.min(1, readIn * 1.4),\n transform: `translateY(${(1 - readIn) * 16}px)`,\n }}\n >\n <span>{ticker}</span>\n <span style={{ color: c.copy }}>${money(price)}</span>\n <span style={{ color: lineColor }}>\n {delta >= 0 ? \"+\" : \"−\"}\n {Math.abs(pct).toFixed(2)}%\n </span>\n </div>\n <div\n style={{\n position: \"absolute\",\n left: phoneCx - BW / 2,\n top: phoneCy - BH / 2,\n width: BW,\n height: BH,\n transform: `translateY(${(1 - rise) * H * 0.9}px) scale(${k * camS})`,\n }}\n >\n <Phone c={c}>\n <StatusBar color={c.text} />\n <div\n style={{\n position: \"absolute\",\n top: 56,\n left: 14,\n right: 16,\n height: 44,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n ...enter(headIn[0]),\n }}\n >\n <Glyph d={ICON.back} size={22} color={c.text} sw={2.2} />\n <div\n style={{\n width: 32,\n height: 32,\n borderRadius: 16,\n background: accent,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <svg viewBox=\"0 0 124.06 134.26\" height={14} aria-hidden>\n <path fill=\"#fff\" d={REMOCN_R_PATH} />\n </svg>\n </div>\n <span style={{ fontSize: 16, fontWeight: 400, color: c.text }}>\n {ticker}\n </span>\n <div style={{ flex: 1 }} />\n <div style={circleBtn}>\n <Glyph d={ICON.heart} size={18} color={c.text} sw={1.9} />\n </div>\n <div style={circleBtn}>\n <Glyph d={ICON.more} size={20} color={c.text} sw={3} />\n </div>\n </div>\n <div\n style={{\n position: \"absolute\",\n top: 110,\n left: 18,\n right: 18,\n color: c.text,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontSize: 26,\n fontWeight: 400,\n letterSpacing: \"-0.02em\",\n ...enter(headIn[1]),\n }}\n >\n {name}\n <Glyph d={ICON.chev} size={18} color={c.muted} sw={2.4} />\n </div>\n <div\n style={{\n marginTop: 4,\n fontSize: 34,\n fontWeight: 400,\n letterSpacing: \"-0.03em\",\n fontVariantNumeric: \"tabular-nums\",\n ...enter(headIn[2]),\n }}\n >\n ${money(price)}\n </div>\n <div\n style={{\n marginTop: 4,\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontSize: 15,\n fontWeight: 400,\n color: lineColor,\n fontVariantNumeric: \"tabular-nums\",\n ...enter(headIn[3]),\n }}\n >\n <svg width={10} height={10} viewBox=\"0 0 10 10\">\n <path\n d={delta >= 0 ? \"M5 1l4.5 7h-9z\" : \"M5 9L.5 2h9z\"}\n fill={lineColor}\n />\n </svg>\n <span>\n {delta >= 0 ? \"+\" : \"−\"}${money(delta)} (\n {delta >= 0 ? \"+\" : \"−\"}\n {Math.abs(pct).toFixed(2)}%)\n </span>\n <span style={{ color: c.muted, fontWeight: 400 }}>\n {changeLabel}\n </span>\n </div>\n </div>\n <svg\n width={SW}\n height={CH_H + 30}\n viewBox={`0 -30 ${SW} ${CH_H + 30}`}\n style={{ position: \"absolute\", left: 0, top: CH_Y - 30 }}\n >\n <defs>\n <linearGradient id={`${uid}a`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop\n offset=\"0\"\n stopColor={lineColor}\n stopOpacity={dark ? 0.2 : 0.28}\n />\n <stop offset=\"1\" stopColor={lineColor} stopOpacity={0} />\n </linearGradient>\n <clipPath id={`${uid}l`}>\n <rect\n x={-4}\n y={-30}\n width={4 + (cross > 0 ? crossX : SW + 8)}\n height={CH_H + 40}\n />\n </clipPath>\n <clipPath id={`${uid}r`}>\n <rect\n x={cross > 0 ? crossX : SW + 8}\n y={-30}\n width={SW}\n height={CH_H + 40}\n />\n </clipPath>\n </defs>\n <line\n x1={0}\n x2={SW}\n y1={baseY}\n y2={baseY}\n stroke={c.muted}\n strokeWidth={1.2}\n strokeDasharray=\"2 5\"\n strokeLinecap=\"round\"\n opacity={0.35 + cross * 0.45}\n />\n <path\n d={area}\n fill={`url(#${uid}a)`}\n opacity={draw}\n clipPath={`url(#${uid}l)`}\n />\n {([\"l\", \"r\"] as const).map((side) => (\n <path\n key={side}\n d={line}\n fill=\"none\"\n stroke={side === \"l\" ? lineColor : c.muted}\n strokeWidth={2.4}\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n pathLength={1}\n strokeDasharray={1}\n strokeDashoffset={1 - draw}\n opacity={side === \"l\" ? 1 : 0.55}\n clipPath={`url(#${uid}${side})`}\n />\n ))}\n {draw >= 1 && cross < 0.5 ? (\n <g>\n <circle\n cx={lineEnd.x}\n cy={lineEnd.y}\n r={4 + pulse * 12}\n fill={lineColor}\n opacity={(1 - pulse) * 0.35}\n />\n <circle\n cx={lineEnd.x}\n cy={lineEnd.y}\n r={4}\n fill={lineColor}\n />\n </g>\n ) : null}\n {cross > 0 ? (\n <g opacity={cross}>\n <line\n x1={crossX}\n x2={crossX}\n y1={-8}\n y2={CH_H}\n stroke={c.muted}\n strokeWidth={1.2}\n />\n <circle\n cx={crossX}\n cy={yDay(scrub.price)}\n r={6.5}\n fill={c.screen}\n stroke={lineColor}\n strokeWidth={3}\n />\n <text\n x={Math.min(SW - 36, Math.max(36, crossX))}\n y={-14}\n textAnchor=\"middle\"\n fontSize={13}\n fontWeight={400}\n fill={c.muted}\n fontFamily={fontFamily}\n style={{ fontVariantNumeric: \"tabular-nums\" }}\n >\n {timeLabel}\n </text>\n </g>\n ) : null}\n </svg>\n <div\n style={{\n position: \"absolute\",\n left: tabX + 4,\n top: TABS_Y,\n width: TAB_W - 8,\n height: 32,\n borderRadius: 16,\n background: c.tabOn,\n ...enter(headIn[3]),\n }}\n />\n {TABS.map((t, i) => {\n const on = Math.abs(tabX - (12 + TAB_W * i)) < TAB_W / 2;\n return (\n <div\n key={t}\n style={{\n position: \"absolute\",\n left: 12 + TAB_W * i,\n top: TABS_Y,\n width: TAB_W,\n height: 32,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 5,\n fontSize: 14,\n fontWeight: 400,\n color: on ? c.tabOnText : c.muted,\n ...enter(headIn[3]),\n }}\n >\n {i === 0 ? (\n <span\n style={{\n width: 6,\n height: 6,\n borderRadius: 3,\n background: c.up,\n }}\n />\n ) : null}\n {t}\n </div>\n );\n })}\n <div\n style={{\n position: \"absolute\",\n top: TABS_Y + 60,\n left: 18,\n right: 18,\n color: c.text,\n ...enter(sp(24, CARD), 20),\n }}\n >\n <div style={{ fontSize: 20, fontWeight: 400, marginBottom: 6 }}>\n Stats\n </div>\n <div style={{ display: \"flex\", flexWrap: \"wrap\", columnGap: 24 }}>\n {stats.map(([kk, v]) => (\n <div\n key={kk}\n style={{\n width: \"calc(50% - 12px)\",\n height: 42,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n borderBottom: `1px solid ${c.hair}`,\n fontSize: 15,\n }}\n >\n <span style={{ color: c.muted }}>{kk}</span>\n <span\n style={{\n fontWeight: 400,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n {v}\n </span>\n </div>\n ))}\n </div>\n </div>\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: 112,\n padding: \"14px 18px 0\",\n boxSizing: \"border-box\",\n background: `linear-gradient(${c.screen}00, ${c.screen} 24%)`,\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"space-between\",\n }}\n >\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 2 }}>\n <span style={{ fontSize: 13, color: c.muted }}>\n Your position\n </span>\n <span\n style={{\n fontSize: 17,\n fontWeight: 400,\n color: c.text,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n $1,842.60\n </span>\n </div>\n <div\n style={{\n width: 150,\n height: 50,\n borderRadius: 25,\n background: accent,\n color: \"#fff\",\n fontSize: 17,\n fontWeight: 400,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `scale(${1 - press(BUY_TAP) * 0.04})`,\n }}\n >\n Buy\n </div>\n </div>\n {sheet > 0.001 ? (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"rgba(0,0,0,0.5)\",\n opacity: Math.min(1, sheet),\n zIndex: 20,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: 452,\n borderRadius: \"30px 30px 0 0\",\n background: c.sheet,\n transform: `translateY(${(1 - sheet) * 470}px)`,\n padding: \"10px 20px 0\",\n boxSizing: \"border-box\",\n color: c.text,\n zIndex: 21,\n }}\n >\n <div\n style={{\n width: 40,\n height: 5,\n borderRadius: 3,\n background: c.muted,\n opacity: 0.4,\n margin: \"0 auto 18px\",\n }}\n />\n <div style={{ fontSize: 20, fontWeight: 400 }}>\n Buy {ticker}\n </div>\n <div style={{ fontSize: 14, color: c.muted, marginTop: 4 }}>\n Market order · ${money(last)} per share\n </div>\n <div\n style={{\n textAlign: \"center\",\n fontSize: 52,\n fontWeight: 400,\n letterSpacing: \"-0.03em\",\n marginTop: 26,\n ...enter(sheetRows[0]),\n }}\n >\n $500\n </div>\n <div\n style={{\n textAlign: \"center\",\n fontSize: 14,\n color: c.muted,\n marginTop: 2,\n ...enter(sheetRows[0]),\n }}\n >\n ≈ {(500 / last).toFixed(4)} shares\n </div>\n <div\n style={{\n display: \"flex\",\n gap: 8,\n marginTop: 22,\n ...enter(sheetRows[1]),\n }}\n >\n {[\"$100\", \"$250\", \"$500\", \"$1,000\"].map((v) => (\n <div\n key={v}\n style={{\n flex: 1,\n height: 38,\n borderRadius: 19,\n background: v === \"$500\" ? `${accent}26` : c.field,\n color: v === \"$500\" ? accent : c.text,\n boxShadow:\n v === \"$500\"\n ? `inset 0 0 0 1.5px ${accent}`\n : \"none\",\n fontSize: 15,\n fontWeight: 400,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {v}\n </div>\n ))}\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n fontSize: 15,\n marginTop: 22,\n paddingTop: 14,\n borderTop: `1px solid ${c.hair}`,\n ...enter(sheetRows[2]),\n }}\n >\n <span style={{ color: c.muted }}>Buying power</span>\n <span style={{ fontWeight: 400 }}>$2,140.18</span>\n </div>\n <div\n style={{\n marginTop: 22,\n height: 54,\n borderRadius: 27,\n background: accent,\n color: \"#fff\",\n fontSize: 17,\n fontWeight: 400,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...enter(sheetRows[3]),\n }}\n >\n Review order\n </div>\n </div>\n </>\n ) : null}\n <div\n style={{\n position: \"absolute\",\n left: touch.x - 23,\n top: touch.y - 23,\n width: 46,\n height: 46,\n borderRadius: 23,\n background: c.touch,\n boxShadow: dark\n ? \"inset 0 0 0 1.5px rgba(255,255,255,0.7)\"\n : \"inset 0 0 0 1.5px rgba(255,255,255,0.9), 0 4px 14px rgba(0,0,0,0.18)\",\n opacity: touchOpacity,\n transform: `scale(${touchScale})`,\n zIndex: 35,\n }}\n />\n </Phone>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/stock-scrub.tsx"
}
],
"type": "registry:component"
}