Order Flow
An independent 18-second trading-interface demo with fictional market data, graphite and amber styling, an original stepped mark, and editable camera choreography.
Source
components/kuchi/templates/fomo-limit-orders/content.ts
1export interface FomoContent {2 intro: string;3 feature: string;4 audience: string;5 ticker: string;6 assetName: string;7 leverage: string;8 position: string;9 positionValue: string;10 positionProfit: string;11 positionSize: string;12 positionQuantity: string;13 positionReturn: string;14 entryPrice: string;15 liquidationPrice: string;16 marketPrice: string;17 change: string;18 openInterest: string;19 limitPrice: string;20 margin: string;21 orderSize: string;22 action: string;23 closing: string;24}2526export const fomoContent: FomoContent = {27 intro: "New in Order Flow",28 feature: "Plan your next exit",29 audience: "Before the market moves",30 ticker: "DEMO",31 assetName: "Demo Market",32 leverage: "5x",33 position: "2x Long",34 positionValue: "$12,640.00",35 positionProfit: "+$640.00",36 positionSize: "$12.64K",37 positionQuantity: "160 DEMO",38 positionReturn: "10.67%",39 entryPrice: "$75.00",40 liquidationPrice: "$37.50",41 marketPrice: "$79.00",42 change: "1.28%",43 openInterest: "$24M OI",44 limitPrice: "$82.00",45 margin: "$6,000.00",46 orderSize: "$12.64K",47 action: "Set an exit price",48 closing: "Your price. Your next move.",49};5051export interface FomoTheme {52 ink: string;53 panel: string;54 paper: string;55 accent: string;56 positive: string;57}58export const fomoTheme: FomoTheme = {59 ink: "#121310",60 panel: "#20221c",61 paper: "#f6f1e7",62 accent: "#e8b45a",63 positive: "#80bf97",64};65export interface FomoLimitOrdersProps {66 brandName?: string;67 accentColor?: string;68 content?: Partial<FomoContent>;69 theme?: Partial<FomoTheme>;70 /** Optional, user-owned soundtrack. The source reference audio is not redistributed. */71 audioSrc?: string;72 volume?: number;73}74export interface SceneProps {75 t: number;76 content: FomoContent;77 theme: FomoTheme;78 brandName: string;79}
components/kuchi/templates/fomo-limit-orders/index.tsx
1"use client";23import "@fontsource/manrope/latin-400.css";4import "@fontsource/manrope/latin-500.css";5import "@fontsource/manrope/latin-600.css";6import "@fontsource/manrope/latin-800.css";7import { AbsoluteFill, Audio, useCurrentFrame, useVideoConfig } from "remotion";8import {9 type FomoLimitOrdersProps,10 fomoContent,11 fomoTheme,12 type SceneProps,13} from "./content";14import {15 FOMO_FPS,16 FOMO_FRAMES,17 FOMO_HEIGHT,18 FOMO_WIDTH,19 tween,20} from "./motion";21import { Closing } from "./scenes/closing";22import { Confirmation } from "./scenes/confirmation";23import { Opening } from "./scenes/opening";24import { Phone } from "./scenes/phone";25import { Price } from "./scenes/price";26import { Slider } from "./scenes/slider";2728export type { FomoContent, FomoLimitOrdersProps, FomoTheme } from "./content";29export { fomoContent, fomoTheme } from "./content";30export {31 FOMO_FPS,32 FOMO_FRAMES,33 FOMO_HEIGHT,34 FOMO_WIDTH,35 fomoTimeline,36} from "./motion";3738export function FomoLimitOrders(props: FomoLimitOrdersProps) {39 const frame = useCurrentFrame();40 const { width, height, fps } = useVideoConfig();41 const t = frame / fps;42 const scale = Math.min(width / 480, height / 270);43 const theme = {44 ...fomoTheme,45 ...props.theme,46 ...(props.accentColor ? { accent: props.accentColor } : {}),47 };48 const scene: SceneProps = {49 t,50 theme,51 content: { ...fomoContent, ...props.content },52 brandName: props.brandName ?? "Order Flow",53 };54 const volume = Number.isFinite(props.volume)55 ? Math.min(1, Math.max(0, props.volume ?? 1))56 : 1;57 return (58 <AbsoluteFill59 style={{60 background: theme.ink,61 color: "#fff",62 overflow: "hidden",63 fontFamily: "Manrope, sans-serif",64 fontWeight: 400,65 WebkitFontSmoothing: "antialiased",66 }}67 >68 <div69 style={{70 position: "absolute",71 left: (width - 480 * scale) / 2,72 top: (height - 270 * scale) / 2,73 width: 480,74 height: 270,75 transform: `scale(${scale})`,76 transformOrigin: "0 0",77 }}78 >79 {t < 2.7 ? (80 <Opening {...scene} />81 ) : t < 8 ? (82 <Phone {...scene} />83 ) : t < 10.9 ? (84 <Slider {...scene} />85 ) : t < 12.6 ? (86 <div87 style={{88 position: "absolute",89 inset: 0,90 opacity: 1 - tween(t, 12.3, 12.6),91 }}92 >93 <Price {...scene} />94 </div>95 ) : t < 14.15 ? (96 <div97 style={{98 position: "absolute",99 inset: 0,100 opacity: tween(t, 12.6, 12.78),101 }}102 >103 <Confirmation {...scene} t={t + 1.85} />104 </div>105 ) : (106 <Closing {...scene} t={t + 1.85} />107 )}108 </div>109 {props.audioSrc?.trim() ? (110 <Audio src={props.audioSrc} volume={volume} />111 ) : null}112 </AbsoluteFill>113 );114}115116export const OrderFlow = FomoLimitOrders;117export type OrderFlowProps = FomoLimitOrdersProps;118119export const fomoLimitOrdersConfig = {120 componentName: "OrderFlow",121 importPath: "@/components/kuchi/templates/fomo-limit-orders",122 controls: {123 brandName: {124 type: "text-content" as const,125 default: "Order Flow",126 description: "Closing wordmark",127 },128 accentColor: {129 type: "color" as const,130 default: "#e8b45a",131 description: "Controls and progress color",132 },133 },134 durationInFrames: FOMO_FRAMES,135 fps: FOMO_FPS,136 compositionWidth: FOMO_WIDTH,137 compositionHeight: FOMO_HEIGHT,138};
components/kuchi/templates/fomo-limit-orders/motion.ts
1import { Easing, interpolate } from "remotion";23export const FOMO_FPS = 60;4export const FOMO_FRAMES = 1108;5export const FOMO_WIDTH = 1920;6export const FOMO_HEIGHT = 1080;7export const fomoTimeline = [8 { id: "opening", from: 0, to: 162 },9 { id: "phone", from: 162, to: 480 },10 { id: "slider", from: 480, to: 654 },11 { id: "price", from: 654, to: 756 },12 { id: "confirmation", from: 756, to: 849 },13 { id: "closing", from: 849, to: FOMO_FRAMES },14] as const;1516export const ease = Easing.bezier(0.22, 1, 0.36, 1);17export const travel = Easing.bezier(0.65, 0, 0.3, 1);18/** Fit to 25 source-frame measurements, 10.483–10.883 seconds. */19export const contraction = Easing.bezier(0.652, 0.343, 0.075, 0.909);20export const clamp = (n: number) => Math.min(1, Math.max(0, n));21export function ramp(t: number, start: number, end: number) {22 return clamp((t - start) / (end - start));23}24export function tween(25 t: number,26 start: number,27 end: number,28 a = 0,29 b = 1,30 easing = ease,31) {32 return a + (b - a) * easing(ramp(t, start, end));33}34export function key(t: number, times: number[], values: number[]) {35 return interpolate(t, times, values, {36 extrapolateLeft: "clamp",37 extrapolateRight: "clamp",38 });39}40export function money(n: number) {41 return `$${n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;42}4344/** Centerline of the phone border, in the same local coordinates as its camera. */45export function phoneBorderPoint(progress: number) {46 const inset = 0.85;47 const r = 59 - inset;48 const straight = 230 - 59;49 const arc = (Math.PI * r) / 2;50 const distance = clamp(progress) * (straight + arc + 66);51 if (distance <= straight) return { x: 230 - distance, y: 680 - inset };52 if (distance <= straight + arc) {53 const angle = Math.PI / 2 + (distance - straight) / r;54 return { x: 59 + r * Math.cos(angle), y: 621 + r * Math.sin(angle) };55 }56 return { x: inset, y: 621 - (distance - straight - arc) };57}
components/kuchi/templates/fomo-limit-orders/scenes/closing.tsx
1import type { SceneProps } from "../content";2import { ramp, tween } from "../motion";3import { AssetIcon, Layer } from "../ui";45export function Closing({ t, content, brandName, theme }: SceneProps) {6 const brand = tween(t, 18.15, 18.38);7 return (8 <>9 {t < 18.3 && (10 <Layer11 x={15}12 y={111}13 w={450}14 h={42}15 style={{16 display: "flex",17 alignItems: "center",18 justifyContent: "center",19 gap: 5,20 fontSize: 22.5,21 letterSpacing: -1,22 whiteSpace: "nowrap",23 opacity: 1 - ramp(t, 18.13, 18.24),24 }}25 >26 {content.closing.split(" ").map((word, i) => {27 const p = tween(t, 16 + i * 0.3, 16.18 + i * 0.3);28 return (29 <span30 key={i}31 style={{32 opacity: p,33 filter: `blur(${(1 - p) * 4}px)`,34 transform: `translateY(${(1 - p) * 7}px)`,35 }}36 >37 {word}38 </span>39 );40 })}41 </Layer>42 )}43 {t >= 18.15 && (44 <Layer45 x={15}46 y={98}47 w={450}48 h={64}49 style={{50 display: "grid",51 placeItems: "center",52 fontSize: brandName.length > 9 ? 31 : 42,53 fontWeight: 600,54 letterSpacing: -1.2,55 opacity: brand,56 transform: `scale(${0.95 + 0.05 * brand})`,57 filter: `blur(${(1 - brand) * 5}px)`,58 }}59 >60 <span style={{ display: "flex", alignItems: "center", gap: 12 }}>61 <AssetIcon size={42} color={theme.accent} />62 {brandName}63 </span>64 </Layer>65 )}66 </>67 );68}
components/kuchi/templates/fomo-limit-orders/scenes/confirmation.tsx
1import type { SceneProps } from "../content";2import { key, tween } from "../motion";3import { AssetIcon, Badge, Layer, muted, row } from "../ui";45export function Confirmation({ t, content: c, theme }: SceneProps) {6 const scale = key(7 t,8 [14.45, 14.65, 15.25, 15.6, 15.8, 16],9 [0.67, 0.73, 1, 1.16, 1.25, 1.3],10 );11 const exit = tween(t, 15.77, 16, 0, 210, (v) => v * v);12 const fill = Math.round(13 key(t, [14.45, 14.7, 15, 15.25, 15.45], [20, 50, 83, 97, 100]),14 );15 return (16 <Layer17 x={240}18 y={135 + exit}19 w={300}20 h={110}21 style={{22 transform: `translate(-50%, -50%) scale(${scale}) rotate(${key(t, [14.45, 15.4, 16], [-1.2, 0, 2])}deg)`,23 background: theme.panel,24 borderRadius: 12,25 boxShadow: "0 0 10px #18131e65",26 fontWeight: 500,27 letterSpacing: -0.4,28 }}29 >30 <Layer x={10} y={10}>31 <Badge theme={theme}>{c.position}</Badge>32 </Layer>33 <Layer34 x={235}35 y={12}36 w={55}37 style={{ fontSize: 14, textAlign: "right", color: "#d0ced9" }}38 >39 Cancel40 </Layer>41 <Layer x={10} y={41} style={{ ...row, gap: 5, fontSize: 16 }}>42 <AssetIcon size={18} color={theme.accent} />43 <span>{c.ticker}</span>44 <span style={{ color: muted, fontSize: 12 }}>⊙</span>45 <span>{c.limitPrice}</span>46 </Layer>47 <Layer48 x={214}49 y={45}50 style={{ ...row, gap: 8, fontSize: 12, color: muted }}51 >52 <svg width="14" height="14" viewBox="0 0 14 14" aria-hidden>53 <circle54 cx="7"55 cy="7"56 r="5"57 fill="none"58 stroke="#302946"59 strokeWidth="1.8"60 />61 <circle62 cx="7"63 cy="7"64 r="5"65 fill="none"66 stroke={theme.accent}67 strokeWidth="1.8"68 strokeDasharray={`${(31.416 * fill) / 100} 31.416`}69 transform="rotate(-90 7 7)"70 />71 </svg>72 <span>{fill}% filled</span>73 </Layer>74 <Layer75 x={10}76 y={86}77 w={280}78 style={{79 ...row,80 justifyContent: "space-between",81 fontSize: 12,82 color: "#bbb8c6",83 }}84 >85 <span>86 Margin{" "}87 <span style={{ color: "white", fontSize: 15, marginLeft: 4 }}>88 {c.margin}89 </span>90 </span>91 <span>92 Lev. size{" "}93 <span style={{ color: "white", fontSize: 15, marginLeft: 4 }}>94 {c.orderSize}95 </span>96 </span>97 </Layer>98 </Layer>99 );100}
components/kuchi/templates/fomo-limit-orders/scenes/opening.tsx
1import type { SceneProps } from "../content";2import { ramp, tween } from "../motion";3import { Layer } from "../ui";45export function Opening({ t, content }: SceneProps) {6 const text =7 t < 0.7 ? content.intro : t < 1.9 ? content.feature : content.audience;8 const start = t < 0.7 ? 0 : t < 1.9 ? 0.7 : 1.9;9 const words = text.split(" ");10 return (11 <>12 {Array.from({ length: 10 }, (_, i) => {13 const upper = i < 5;14 const column = i % 5;15 const height = [18, 48, 85, 61, 30][column];16 const drift = tween(t, 0.8 + column * 0.025, 1.25 + column * 0.025);17 return (18 <Layer19 key={i}20 x={upper ? 277 + column * 47 : -35 + column * 47}21 y={upper ? -14 : 270 - height + 12}22 w={47}23 h={height}24 style={{25 opacity: ramp(t, 0.8, 1.05) * (1 - ramp(t, 2.45, 2.7)),26 transform: `translateY(${(1 - drift) * (upper ? -75 : 75) + Math.sin(t * 2 + column) * 5}px)`,27 borderRadius: 2,28 background: `linear-gradient(${upper ? 150 : 30}deg, #c29b5452, #8770444a 40%, #4a412d30 76%, #12131000)`,29 boxShadow: "inset 0.5px 0 1px #efd19626",30 filter: "blur(0.7px)",31 }}32 />33 );34 })}35 <Layer36 x={19}37 y={110}38 w={450}39 h={42}40 style={{41 display: "flex",42 justifyContent: "center",43 alignItems: "center",44 gap: 6,45 fontSize: 24.5,46 letterSpacing: -1.1,47 whiteSpace: "nowrap",48 opacity: 1 - ramp(t, 2.55, 2.7),49 }}50 >51 {words.map((word, i) => {52 const enter = tween(t, start + i * 0.1, start + i * 0.1 + 0.2);53 return (54 <span55 key={`${start}-${i}`}56 style={{57 opacity: enter,58 filter: `blur(${(1 - enter) * 5}px)`,59 transform: `translateY(${(1 - enter) * 9}px)`,60 }}61 >62 {word}63 </span>64 );65 })}66 </Layer>67 </>68 );69}
components/kuchi/templates/fomo-limit-orders/scenes/phone.tsx
1import type { SceneProps } from "../content";2import { key, phoneBorderPoint, ramp, travel, tween } from "../motion";3import { AssetIcon, Badge, Layer, muted, row } from "../ui";45function PhoneUI({ t, content: c, theme }: SceneProps) {6 return (7 <>8 <Layer9 x={62}10 y={32}11 style={{ opacity: ramp(t, 3.85, 4.3), fontSize: 14, fontWeight: 600 }}12 >13 9:4114 </Layer>15 <Layer16 x={280}17 y={37}18 style={{ opacity: ramp(t, 3.85, 4.3), fontSize: 9, letterSpacing: 3 }}19 >20 ▮▮▮ ◔ ▰21 </Layer>22 <Layer x={54} y={73} style={{ ...row, gap: 14 }}>23 <span style={{ position: "relative", display: "flex" }}>24 <AssetIcon size={44} color={theme.accent} />25 <span26 style={{27 position: "absolute",28 inset: 0,29 borderRadius: "50%",30 background: "black",31 opacity: 1 - ramp(t, 3.5, 4.1),32 mixBlendMode: "darken",33 }}34 />35 <svg36 width="44"37 height="44"38 viewBox="0 0 40 40"39 style={{ position: "absolute", opacity: 1 - ramp(t, 3.5, 4.1) }}40 >41 <circle42 cx="20"43 cy="20"44 r="19.8"45 fill="none"46 stroke="#ffffff10"47 strokeWidth="0.4"48 />49 <path d="M9 25h5v6H9Zm8-8h5v14h-5Zm8-8h6v22h-6Z" fill="white" />50 </svg>51 </span>52 <div>53 <div style={{ ...row, gap: 8, fontSize: 16.5, letterSpacing: -0.5 }}>54 {c.ticker}55 <span56 style={{57 fontSize: 12,58 color: theme.accent,59 borderRadius: 3,60 padding: "1px 5px",61 background: `${theme.accent}25`,62 opacity: ramp(t, 3.35, 3.85),63 }}64 >65 {c.leverage}66 </span>67 </div>68 <div style={{ marginTop: 3, fontSize: 12, color: muted }}>69 {c.assetName.slice(70 0,71 Math.floor(tween(t, 3.28, 4.1, 0, c.assetName.length)),72 )}73 </div>74 </div>75 </Layer>76 <div style={{ opacity: ramp(t, 3.85, 4.3) }}>77 <Layer x={23} y={135} style={{ fontSize: 24, letterSpacing: -0.9 }}>78 {c.marketPrice}79 </Layer>80 <Layer x={24} y={169} style={{ fontSize: 12, color: theme.positive }}>81 ↑ $1.00 ({c.change})82 </Layer>83 <Layer x={22} y={215} w={355} h={110}>84 <svg width="355" height="110" viewBox="0 0 355 110" aria-hidden>85 {[20, 55, 90].map((y) => (86 <path87 key={y}88 d={`M0 ${y}H355`}89 stroke="#ffffff0a"90 strokeWidth="0.5"91 />92 ))}93 {Array.from({ length: 57 }, (_, i) => {94 const y =95 85 - i * 1.07 + Math.sin(i * 0.6) * 13 + Math.sin(i * 1.4) * 4;96 const positive = i % 5 !== 1 && i % 7 !== 2;97 return (98 <g99 key={i}100 stroke={positive ? theme.positive : "#cf495e"}101 fill={positive ? theme.positive : "#cf495e"}102 >103 <path d={`M${i * 6 + 2} ${y - 6}v20`} strokeWidth="0.6" />104 <rect105 x={i * 6}106 y={y}107 width="3.5"108 height={5 + (i % 6)}109 rx="0.3"110 />111 </g>112 );113 })}114 </svg>115 </Layer>116 <Layer117 x={9}118 y={334}119 w={365}120 style={{121 ...row,122 justifyContent: "space-between",123 color: "#b5b2be",124 fontSize: 12,125 fontWeight: 600,126 }}127 >128 <span>129 <span style={{ color: theme.positive }}>╂</span> 15m ⌃130 </span>131 {["1D", "1W", "3M", "6M", "1Y", "All"].map((s, i) => (132 <span133 key={s}134 style={{135 padding: 4,136 background: i === 0 ? "#2b2c26" : undefined,137 borderRadius: 4,138 color: i === 0 ? "white" : undefined,139 }}140 >141 {s}142 </span>143 ))}144 <span style={{ color: theme.positive, fontSize: 21 }}>ϟ</span>145 </Layer>146 <Layer147 x={17}148 y={379}149 w={366}150 h={138}151 style={{152 background: `linear-gradient(125deg, ${theme.ink}, ${theme.panel})`,153 borderRadius: 11,154 boxShadow: "inset 0 1px 8px #ffffff04",155 }}156 >157 <Layer x={11} y={9}>158 <Badge theme={theme}>{c.position}</Badge>159 </Layer>160 <Layer161 x={11}162 y={39}163 w={344}164 style={{165 ...row,166 justifyContent: "space-between",167 fontSize: 21,168 fontWeight: 500,169 letterSpacing: -1.1,170 }}171 >172 <span>{c.positionValue}</span>173 <span style={{ color: theme.positive }}>{c.positionProfit}</span>174 </Layer>175 <Layer x={11} y={70} style={{ fontSize: 13, color: muted }}>176 Lev. size <span style={{ color: "#e7e6ed" }}>{c.positionSize}</span>{" "}177 ({c.positionQuantity})178 </Layer>179 <Layer x={265} y={70} style={{ fontSize: 13, color: "#bab7c4" }}>180 <span style={{ color: theme.positive }}>▴</span> {c.positionReturn}181 </Layer>182 <Layer183 x={16}184 y={97}185 w={334}186 h={0.6}187 style={{ background: "#ffffff0b" }}188 />189 <Layer190 x={11}191 y={108}192 w={344}193 style={{194 ...row,195 justifyContent: "space-between",196 fontSize: 13,197 color: muted,198 }}199 >200 <span>201 Avg. entry{" "}202 <span style={{ color: "white", marginLeft: 6 }}>203 {c.entryPrice}204 </span>205 </span>206 <span>207 Liq. price{" "}208 <span style={{ color: "white", marginLeft: 6 }}>209 {c.liquidationPrice}210 </span>211 </span>212 </Layer>213 </Layer>214 <Layer215 x={28}216 y={541}217 w={345}218 style={{219 ...row,220 justifyContent: "space-between",221 color: theme.accent,222 fontSize: 13,223 fontWeight: 600,224 }}225 >226 <span>227 <span style={{ color: muted, marginRight: 10 }}>+</span>Add a note228 </span>229 <span>Add SL/TP</span>230 </Layer>231 <Layer x={51} y={575} style={{ fontSize: 11, color: muted }}>232 Overview Activity Details233 </Layer>234 <Layer235 x={24}236 y={593}237 w={350}238 h={44}239 style={{ ...row, gap: 15, fontSize: 13, fontWeight: 600 }}240 >241 <div242 style={{243 width: 43,244 height: 42,245 display: "grid",246 placeItems: "center",247 borderRadius: 11,248 background: "#282c22",249 border: "1px solid #7e806c",250 }}251 >252 <svg width="19" height="19" viewBox="0 0 24 24">253 <path d="m4 16 11-11 5 5-11 11-6 1Z" fill="white" />254 <path d="m13 7 5 5" stroke="#282c22" />255 </svg>256 </div>257 <div258 style={{259 background: theme.accent,260 color: theme.ink,261 borderRadius: 9,262 padding: "11px 14px",263 whiteSpace: "nowrap",264 boxShadow: "inset 0 1px 1px #ffffff99",265 }}266 >267 Close position268 </div>269 <div270 style={{271 background: theme.panel,272 color: theme.positive,273 borderRadius: 9,274 padding: "11px 32px",275 }}276 >277 Long278 </div>279 </Layer>280 </div>281 </>282 );283}284285export function Phone(props: SceneProps) {286 const { t } = props;287 const push = tween(t, 4.63, 5.18, 0, 1, travel);288 const pull = tween(t, 6.04, 6.92, 0, 1, travel);289 const orbit = tween(t, 6.92, 7.7, 0, 1, travel);290 const openingScale = tween(t, 3.4, 4.3, 1.45, 1);291 const s = openingScale + 0.18 * push - 0.28 * pull + 0.55 * orbit;292 const x = tween(t, 3.4, 4.3, 62, 75) - 67 * push + 134 * pull + 95 * orbit;293 const y = tween(t, 3.4, 4.3, 9, 45) - 435 * push - 13 * pull - 309 * orbit;294 const dotTimes = [295 6.55, 6.75, 7, 7.25, 7.5, 7.65, 7.75, 7.8, 7.85, 7.9, 7.95, 8,296 ];297 const point = phoneBorderPoint(tween(t, 6.55, 7.75, 0, 1, travel));298 const dotX = tween(t, 7.85, 8, x + point.x * s, 240);299 const dotY = tween(t, 7.85, 8, y + point.y * s, 135);300 const radius = key(301 t,302 dotTimes,303 [4, 6, 6, 6.5, 7.5, 9.5, 12, 16, 24, 57, 160, 390],304 );305 return (306 <>307 <Layer308 w={480}309 h={270}310 style={{ background: "black", opacity: ramp(t, 2.7, 2.9) }}311 />312 <Layer313 x={x}314 y={y}315 w={400}316 h={680}317 style={{318 transform: `scale(${s})`,319 transformOrigin: "0 0",320 opacity: ramp(t, 2.7, 3),321 filter: `blur(${Math.sin(push * Math.PI) * 1.1}px)`,322 }}323 >324 <Layer325 w={400}326 h={680}327 style={{328 border: "1.7px solid #55584a",329 boxSizing: "border-box",330 borderRadius: 59,331 opacity: ramp(t, 3.65, 4.35) * (1 - 0.8 * push * (1 - pull)),332 boxShadow: "0 0 2px #ad926155, inset 0 0 4px #ad926122",333 background: "#000",334 }}335 />336 <Layer337 w={400}338 h={680}339 style={{340 borderLeft: "1.2px solid #e8b45a",341 boxSizing: "border-box",342 borderBottom: "1.2px solid #e8b45a",343 borderRadius: 59,344 opacity: ramp(t, 6.55, 7.2),345 maskImage: "linear-gradient(0deg, black, transparent 34%)",346 boxShadow: "-1px 1px 3px #d59b4044",347 }}348 />349 <div style={{ opacity: 1 - ramp(t, 7.78, 7.96), fontWeight: 500 }}>350 <PhoneUI {...props} />351 </div>352 </Layer>353 <Layer354 w={480}355 h={270}356 style={{357 opacity: Math.sin(push * Math.PI) * 0.24,358 background:359 "linear-gradient(120deg, transparent 10%, #ebc47b 53%, transparent 75%)",360 mixBlendMode: "screen",361 }}362 />363 <Layer364 w={480}365 h={270}366 style={{367 opacity: ramp(t, 6.1, 7),368 background:369 "linear-gradient(100deg, #000 0%, transparent 43%, #0004 66%, #000 96%)",370 }}371 />372 {t >= 6.55 && (373 <>374 <Layer375 x={dotX - radius * 2}376 y={dotY - radius * 2}377 w={radius * 4}378 h={radius * 4}379 style={{380 background: "#eed7a6",381 borderRadius: "50%",382 filter: `blur(${Math.min(10, radius)}px)`,383 opacity: t < 7.88 ? 0.2 : 0,384 }}385 />386 <Layer387 x={dotX - radius}388 y={dotY - radius}389 w={radius * 2}390 h={radius * 2}391 style={{392 background: "#fff",393 borderRadius: "50%",394 boxShadow: "0 0 4px #f6e3bf",395 }}396 />397 </>398 )}399 </>400 );401}
components/kuchi/templates/fomo-limit-orders/scenes/price.tsx
1import type { SceneProps } from "../content";2import { ramp, travel, tween } from "../motion";3import { AssetIcon, Layer, lightMuted as muted } from "../ui";45export function Price({ t, content: c, theme }: SceneProps) {6 const zoom = tween(t, 11.65, 12.25, 1, 2.7, travel);7 const targetX = tween(t, 11.65, 12.25, 240, 277, travel);8 const typed =9 t < 11.8410 ? "$"11 : c.limitPrice.slice(12 0,13 Math.floor(tween(t, 11.84, 12.12, 1, c.limitPrice.length, (v) => v)),14 );1516 const alpha = ramp(t, 10.9, 11.18);1718 return (19 <>20 <Layer21 w={480}22 h={270}23 style={{24 background: `linear-gradient(145deg, ${theme.paper}, #ebe1ce 65%, #f7f0e3)`,25 }}26 />27 <Layer28 x={240 - targetX * zoom}29 y={135 - 135 * zoom}30 w={480}31 h={270}32 style={{33 transform: `scale(${zoom})`,34 transformOrigin: "0 0",35 color: "#28281f",36 }}37 >38 <div style={{ opacity: alpha, fontWeight: 500 }}>39 <Layer x={100} y={61}>40 <AssetIcon size={30} color={theme.accent} />41 </Layer>42 <Layer x={140} y={63} style={{ fontSize: 12 }}>43 {c.ticker}44 <div style={{ marginTop: 2, color: muted, fontSize: 9 }}>45 {c.openInterest}46 </div>47 </Layer>48 <Layer49 x={300}50 y={65}51 w={79}52 style={{ textAlign: "right", fontSize: 12 }}53 >54 {c.marketPrice}55 <div style={{ marginTop: 3, color: "#326846", fontSize: 9 }}>56 {c.change}57 </div>58 </Layer>59 <Layer60 x={100}61 y={110}62 w={279}63 h={0.6}64 style={{ background: "#c5bba466" }}65 />66 <Layer67 x={100}68 y={158}69 w={279}70 h={0.6}71 style={{ background: "#c5bba444" }}72 />73 <Layer x={117} y={120} style={{ fontSize: 11 }}>74 Limit price75 <div style={{ marginTop: 4, fontSize: 8, color: muted }}>76 +3.80% above market77 </div>78 </Layer>79 <Layer x={100} y={181} w={279} style={{ display: "flex", gap: 6 }}>80 {["+1%", "+5%", "+10%", "+20%"].map((s) => (81 <div82 key={s}83 style={{84 width: 66,85 height: 21,86 borderRadius: 5,87 border: "0.5px solid #cbbda282",88 background: "#ffffff24",89 display: "grid",90 placeItems: "center",91 fontSize: 9,92 }}93 >94 {s}95 </div>96 ))}97 </Layer>98 </div>99 <Layer100 x={225}101 y={122}102 w={96}103 h={28}104 style={{105 display: "flex",106 alignItems: "center",107 justifyContent: "flex-end",108 transform: `translateX(${tween(t, 10.9, 11.18, -39, 0)}px)`,109 gap: 5,110 fontSize: 12,111 fontWeight: 600,112 letterSpacing: -0.35,113 }}114 >115 <span style={{ opacity: alpha }}>{typed}</span>116 <span117 style={{118 width: 1.5,119 height: 19,120 background: theme.accent,121 opacity: 1,122 }}123 />124 <span style={{ color: "#865616", marginLeft: -1, opacity: alpha }}>125 Mid126 </span>127 </Layer>128 </Layer>129 </>130 );131}
components/kuchi/templates/fomo-limit-orders/scenes/slider.tsx
1import type { SceneProps } from "../content";2import { contraction, key, money, ramp, tween } from "../motion";3import { Chevron, Layer, lightMuted as muted } from "../ui";45export function Slider({ t, theme, content }: SceneProps) {6 const label = t < 8.65;7 const barW =8 t < 10.48339 ? key(10 t,11 [8.65, 8.8, 9, 9.2, 9.3, 9.55, 9.8, 10.05, 10.3, 10.4833],12 [3500, 2600, 1800, 820, 464, 322, 292, 276, 255, 220],13 )14 : tween(t, 10.4833, 10.8833, 220, 2, contraction);15 const barH = key(16 t,17 [8.65, 8.8, 9, 9.2, 9.3, 9.55, 9.8, 10.3, 10.5],18 [650, 400, 154, 66, 35, 24, 22, 20, 19],19 );20 const centerX = tween(t, 10.45, 10.8833, 240, 250, contraction);21 const price = key(t, [9.3, 9.55, 9.8, 10.05, 10.3], [79, 79.5, 80, 81, 82]);22 const quantity = key(23 t,24 [9.3, 9.55, 9.8, 10.05, 10.3],25 [40, 72, 112, 144, 160],26 );27 const percent = Math.round((quantity / 160) * 100);28 const detailAlpha = ramp(t, 9.15, 9.4) * (1 - ramp(t, 10.3, 10.56));29 const uiScale = key(t, [9.3, 9.55, 9.8, 10.3], [1.6, 1.1, 1, 0.93]);30 const roll = tween(t, 8.18, 8.55, 0, 1, (v) => v);31 const knobSize = barH * 0.77;32 return (33 <>34 <Layer35 w={480}36 h={270}37 style={{38 background: label39 ? "white"40 : `linear-gradient(145deg, ${theme.paper}, #ebe1ce 65%, #f7f0e3)`,41 }}42 />43 {label ? (44 <Layer45 x={130}46 y={116}47 w={220}48 h={38}49 style={{50 display: "flex",51 alignItems: "center",52 justifyContent: "center",53 gap: 9,54 color: "#865616",55 fontSize: 23,56 letterSpacing: -0.6,57 opacity: ramp(t, 8.01, 8.1),58 }}59 >60 <span style={{ transform: "rotate(90deg)", display: "flex" }}>61 <Chevron color={theme.accent} size={16} />62 </span>63 <div64 style={{65 width: 78,66 height: 35,67 position: "relative",68 overflow: "visible",69 }}70 >71 <Layer y={-roll * 35} style={{ opacity: 1 - roll }}>72 Market73 </Layer>74 <Layer y={(1 - roll) * 35} style={{ opacity: roll }}>75 Limit76 </Layer>77 </div>78 </Layer>79 ) : (80 <>81 <Layer82 x={centerX - barW / 2}83 y={135 - barH / 2}84 w={barW}85 h={barH}86 style={{87 background: `linear-gradient(100deg, #c78a30, ${theme.accent})`,88 borderRadius: Math.min(9, barH / 3),89 boxShadow:90 t < 10.791 ? "inset 0 0.5px 1px #f3d8a3, 0 1px 2px #8d6a301f"92 : undefined,93 }}94 >95 <Layer96 x={97 barW *98 key(t, [8.65, 9.2, 9.3, 10.3], [0.5, 0.57, 0.58, 0.955]) -99 knobSize / 2100 }101 y={(barH - knobSize) / 2}102 w={knobSize}103 h={knobSize}104 style={{105 background: "#fff",106 borderRadius: "50%",107 boxShadow: "0 1px 3px #4d3b2126",108 opacity: 1 - ramp(t, 10.4, 10.65),109 }}110 />111 </Layer>112 <Layer113 x={240}114 y={135}115 style={{116 transform: `scale(${uiScale})`,117 opacity: detailAlpha,118 color: "#28281f",119 fontSize: 9,120 whiteSpace: "nowrap",121 }}122 >123 <Layer124 x={-146}125 y={-65}126 w={292}127 style={{128 display: "flex",129 justifyContent: "center",130 gap: 7,131 fontSize: 11,132 }}133 >134 <span>Limit price</span>135 <span>136 {money(price)}{" "}137 <span style={{ color: muted }}>138 (+{(((price - 79) / 79) * 100).toFixed(2)}%)139 </span>140 </span>141 </Layer>142 <Layer x={-142} y={-31} style={{ fontSize: 13, color: "#5b5548" }}>143 {quantity.toFixed(2)} {content.ticker}144 </Layer>145 <Layer146 x={113}147 y={-31}148 w={30}149 style={{150 textAlign: "right",151 fontSize: 13,152 color: "#865616",153 fontWeight: 600,154 }}155 >156 {percent}%157 </Layer>158 <Layer159 x={-146}160 y={25}161 w={292}162 style={{163 display: "flex",164 justifyContent: "space-between",165 fontSize: 13,166 }}167 >168 <span style={{ color: muted }}>Est. profit</span>169 <span style={{ color: "#326846" }}>170 {money(quantity * (price - 75))}171 </span>172 </Layer>173 <Layer174 x={-128}175 y={53}176 w={274}177 style={{178 display: "flex",179 justifyContent: "space-between",180 fontSize: 12,181 }}182 >183 <span style={{ color: muted }}>Details</span>184 <span><0.01% fee ﹀</span>185 </Layer>186 </Layer>187 </>188 )}189 </>190 );191}
components/kuchi/templates/fomo-limit-orders/ui.tsx
1import type { CSSProperties, ReactNode } from "react";2import type { FomoTheme } from "./content";34export function Layer({5 x = 0,6 y = 0,7 w,8 h,9 style,10 children,11}: {12 x?: number;13 y?: number;14 w?: number | string;15 h?: number | string;16 style?: CSSProperties;17 children?: ReactNode;18}) {19 return (20 <div21 style={{22 position: "absolute",23 left: x,24 top: y,25 width: w,26 height: h,27 ...style,28 }}29 >30 {children}31 </div>32 );33}34export function AssetIcon({35 size = 40,36 color = "#e8b45a",37}: {38 size?: number;39 color?: string;40}) {41 return (42 <svg width={size} height={size} viewBox="0 0 40 40" aria-hidden>43 <circle44 cx="20"45 cy="20"46 r="20"47 fill="#242720"48 stroke="#ffffff0b"49 strokeWidth="0.5"50 />51 <path d="M9 25h5v6H9Zm8-8h5v14h-5Zm8-8h6v22h-6Z" fill={color} />52 </svg>53 );54}55export function Chevron({56 color = "white",57 size = 16,58 up = false,59}: {60 color?: string;61 size?: number;62 up?: boolean;63}) {64 return (65 <svg66 width={size}67 height={size}68 viewBox="0 0 24 24"69 style={{ transform: up ? "rotate(-90deg)" : undefined }}70 aria-hidden71 >72 <path73 d="m5 5 7 7-7 7m8-14 7 7-7 7"74 fill="none"75 stroke={color}76 strokeWidth="2.6"77 strokeLinecap="round"78 strokeLinejoin="round"79 />80 </svg>81 );82}83export function Badge({84 children,85 theme,86}: {87 children: ReactNode;88 theme: FomoTheme;89}) {90 return (91 <span92 style={{93 color: theme.positive,94 background: `${theme.positive}20`,95 padding: "2px 5px",96 borderRadius: 3,97 fontSize: 12,98 fontWeight: 600,99 }}100 >101 {children}102 </span>103 );104}105export const row: CSSProperties = { display: "flex", alignItems: "center" };106export const muted = "#aaa79d";107export const lightMuted = "#6a6357";





