Grok Bot Promo
A 12-second app promo: the mascot is born, then the App Store page, ask bar, home screen, pill words and logo lockup.
Install using CLI
npx shadcn@latest add https://www.sycamore.to/r/grok-bot-promo.jsonDownload assets (fonts and images)
node sycamore-assets.mjs grok-bot-promoUsage
import { GrokBotPromo } from "./sycamore/grok-bot-promo/GrokBotPromo";
<Composition
id="GrokBotPromo"
component={GrokBotPromo}
durationInFrames={365}
fps={30}
width={2048}
height={1152}
/>Install manually
Copy the source code into src/sycamore/grok-bot-promo/
// Grok Bot promo: a 12-second motion graphic rebuilt section by section from a
// reference, at the reference's own size and frame rate so frames compare 1:1.
import React from "react";
import { AbsoluteFill, Sequence } from "remotion";
import { AppStorePage, APP_STORE_FRAMES } from "./AppStorePage";
import { AskBar, ASK_BAR_FRAMES } from "./AskBar";
import { HomeScreen, HOME_FRAMES } from "./HomeScreen";
import { LogoLockup, LOGO_FRAMES } from "./LogoLockup";
import { SphereBirth, SPHERE_BIRTH_FRAMES } from "./SphereBirth";
import { WriteCreateSolve, WRITE_FRAMES } from "./WriteCreateSolve";
export const GROK_FPS = 30;
export const GROK_WIDTH = 2048;
export const GROK_HEIGHT = 1152;
const SECTIONS: Array<{ name: string; frames: number; component: React.FC }> = [
{ name: "1 Sphere birth", frames: SPHERE_BIRTH_FRAMES, component: SphereBirth },
{ name: "2 App Store page", frames: APP_STORE_FRAMES, component: AppStorePage },
{ name: "3 Ask anything bar", frames: ASK_BAR_FRAMES, component: AskBar },
{ name: "4 Home screen", frames: HOME_FRAMES, component: HomeScreen },
{ name: "5 Write Create Solve", frames: WRITE_FRAMES, component: WriteCreateSolve },
{ name: "6 Logo lockup", frames: LOGO_FRAMES, component: LogoLockup },
];
export const GROK_FRAMES = SECTIONS.reduce((sum, s) => sum + s.frames, 0);
export const GrokBotPromo: React.FC = () => {
let from = 0;
return (
<AbsoluteFill style={{ backgroundColor: "#000" }}>
{SECTIONS.map(({ name, frames, component: Section }) => {
const start = from;
from += frames;
return (
<Sequence key={name} name={name} from={start} durationInFrames={frames}>
<Section />
</Sequence>
);
})}
</AbsoluteFill>
);
};Plus 12 files it imports. Copy them with the same folder layout:
›engine/src/grok-bot/AppStorePage.tsx
engine/src/grok-bot/AppStorePage.tsx // Section 2 (reference frames 43-112): the icon's App Store page builds around it, letter // by letter, while the camera eases out. A hard zoom-in at frame 85, then the mascot's face // shrinks and rolls away, the share arrow flies a loop, and the Open button swells into the // white pill that Section 3's "Ask anything" bar is made from. // // The page is laid out in the coordinates of reference frame 72; `camera` maps them to the // screen. Everything that moves on its own is tracked per frame in screen space. import React from "react"; import { AbsoluteFill } from "remotion"; import { CHEVRON_LEFT, SHARE_ARROW, STAR, WIFI } from "./icons"; import { INTER, textWidth, useInter } from "./fonts"; import { MotionBlur } from "./MotionBlur"; import { INK, iconW, iconX, iconY, Marks, SphereScene } from "./SphereBirth"; import { cutTrack, gray, track } from "./track"; export const APP_STORE_FROM = 43; export const APP_STORE_FRAMES = 70; // 43-112; the page's fade-out belongs to Section 3 const CUT = 84; // the hard zoom-in lands on frame 85 const PAGE_TAKEOVER = 51.5; // before this the Section 1 scene is still underneath const BLUE = "#1A91F9"; const LINK = "#3A7DE0"; const DIM = "#8B8B8B"; const LABEL = "#7C7C7C"; const VALUE = "#8E8E8E"; const RULE = gray(42); // Camera: where page x=641 and y=621 land, and the width the 907px-wide page spans. const cameraLeft = cutTrack( 52, [ 690.6, 684.6, 678.7, 673.3, 671, 667, 664, 661.5, 659, 656, 654, 652, 650, 648.5, 648, 646, 645, 644, 642, 642, 641, 640, 640, 640, 639, 638, 635, 632, 624.5, 614, 600, 583.5, 560.5, 689.5, 656, 629.5, 608, 584, 569, 555, 541.5, 528, 517, 507, 497, 487, 477, 467, 457, 447, 437.5, 428.5, 420, 412, 405, 398, 393, 388.5, 385.5, 383, 381, 380, ], [CUT], ); const cameraRight = cutTrack( 52, [ 1707.3, 1701.4, 1689.6, 1671, 1658, 1650, 1638, 1627, 1616, 1607.5, 1600, 1592, 1584, 1578, 1571.5, 1567.5, 1562.5, 1558.5, 1554, 1551, 1548, 1545, 1542.5, 1540, 1537, 1534, 1532, 1528, 1518, 1504.5, 1487, 1465.5, 1436, 1861.5, 1883, 1895, 1902, 1907, 1907, 1904, 1900, 1896, 1891, 1886, 1881, 1876, 1871, 1866, 1861, 1856, 1851, 1846, 1842.5, 1839.5, 1834, 1830, 1826, 1824, 1819, 1816, 1813, 1809, ], [CUT], ); const cameraTop = cutTrack( 52, [ 694.2, 688, 681.9, 676, 671, 666, 661, 656, 651, 647, 644, 640, 637, 634.5, 632, 629, 627.5, 626, 624, 622.5, 621, 620, 618.5, 617.5, 616.5, 615.5, 615, 614.5, 613.5, 612.5, 611.5, 610, 608.5, 759, 759, 758, 757, 755.5, 753.5, 751.5, 749, 747, 744.5, 743, 741, 739.5, 738, 736.5, 735, 733.5, 733, 734, 735, 735.5, 735, 734, 732, 730, 728, 726, 725, 723.5, ], [CUT], ); // The icon's place on the page (frame 72). const ICON_LEFT = 644; const ICON_TOP = 264; const ICON_SIZE = 314; const camera = (frame: number) => { if (frame < PAGE_TAKEOVER) { // Until the page takes over, Section 1's icon track is what the page hangs from. const w = iconW(frame); const s = w / ICON_SIZE; return { s, left: iconX(frame) - w / 2 - (ICON_LEFT - 641) * s, top: iconY(frame) - w / 2 + (621 - ICON_TOP) * s }; } const left = cameraLeft(frame); return { s: (cameraRight(frame) - left) / 907, left, top: cameraTop(frame) }; }; const faceX = cutTrack( 52, [ 843, 835.2, 829.2, 823.1, 817.7, 812.8, 808.2, 804.4, 800.7, 797.4, 795, 792.7, 789.9, 787.2, 785.8, 783.2, 782.3, 780.3, 778.1, 777.3, 775.1, 773, 770.8, 769.7, 767.5, 765.4, 763.2, 762.1, 759.9, 748.8, 733.7, 716.1, 691.7, 848.5, 822.4, 800.1, 782.1, 766.5, 752, 745.7, 740.7, 739.4, 735.3, 729.1, 719.9, 709.8, 701.4, 692.3, 683.3, 677.7, 669, ], [CUT], ); const faceY = cutTrack( 52, [ 557.2, 548.7, 543.9, 539.1, 534.7, 530.4, 525.3, 521.4, 518.4, 515.1, 512.4, 510.6, 507.3, 506.1, 503.3, 501.1, 500.2, 499, 496.5, 495.8, 495.4, 495, 493.6, 493.2, 492.9, 491.5, 491.1, 490.7, 489.3, 488.9, 489.2, 489.4, 490.1, 603, 595, 588.7, 582.6, 578.4, 573.7, 549.9, 502.7, 447.4, 395.1, 361.2, 355.8, 361.8, 379.4, 408.3, 467.1, 545, 550, ], [CUT], ); const faceR = cutTrack( 52, [ 203, 199.5, 198.4, 197.3, 195.2, 194.2, 191.5, 189.6, 188.4, 187.1, 185.2, 184.9, 183.5, 182.7, 181.6, 181, 180.4, 179.2, 178.7, 178.1, 177.8, 177.5, 177.2, 176.9, 176.6, 176.3, 176, 175.7, 175.4, 175, 174.8, 174.5, 174.3, 232.7, 243.1, 251.6, 256.8, 260.7, 262.1, 250.1, 223.1, 185.7, 147.6, 125.4, 116.1, 108.1, 103.8, 100.6, 95.4, 88, 82, ], [CUT], ); const faceAngle = track(52, [ -397.3, -397.4, -398.2, -398.6, -398.9, -399.3, -399.5, -399.7, -400, -400.3, -400.6, -401.1, -401.1, -401.4, -401.5, -401.5, -401.9, -401.8, -401.9, -402, -402.1, -402.2, -402.3, -402.4, -402.5, -402.6, -402.8, -402.9, -403.1, -403.2, -403.3, -403.4, -403.5, -403.1, -403.2, -403.3, -403.3, -403.5, -403.4, -403.3, -403.2, -401.4, -394.8, -383.3, -368.7, -346.4, -318.8, -297, -272.8, -260, -250, ]); const faceOpacity = track(99, [1, 0.92, 0.45, 0.08, 0]); const iconFill = track(99, [INK, 46, 38, 24, 12, 0]); const BUTTON_CUTS = [CUT, 103]; // it also jumps as it starts to swell at 104 // The Open button's outline, unrotated. 53-103 is its bounding box; from 104 it is the // pill's own length and height, which then tilts by `pillAngle`. const buttonL = cutTrack( 53, [ 1170, 1139, 1108, 1078, 1049, 1032, 1020, 1010, 1005, 1002, 1004, 1006, 1007, 1008, 1008, 1009, 1006, 1004, 1001, 998, 994, 991, 988, 986, 985, 980, 978, 971, 959, 946, 928, 902, 1150, 1137, 1123, 1109, 1095, 1085, 1075, 1065, 1056, 1049, 1040, 1032, 1026, 1018, 1011, 1000, 992, 988, 981, 925.1, 880.6, 828.7, 779.6, 729.1, 678.9, 627.8, 578.6, 535.9, ], BUTTON_CUTS, ); const buttonR = cutTrack( 53, [ 1200, 1213, 1226, 1239, 1252, 1257, 1256, 1252, 1246, 1238, 1226, 1215, 1207, 1198, 1192, 1186, 1183, 1182, 1180, 1180, 1179, 1180, 1179, 1179, 1176, 1173, 1169, 1161, 1146, 1130, 1110, 1080, 1390, 1389, 1388, 1385, 1381, 1377, 1369, 1358, 1354, 1343, 1336, 1326, 1319, 1311, 1304, 1297, 1290, 1284, 1278, 1324.1, 1359.6, 1400.7, 1435.6, 1479.1, 1520.9, 1561.8, 1602.6, 1646.9, ], BUTTON_CUTS, ); const buttonT = cutTrack( 53, [ 571, 554, 542, 528, 520, 511, 508, 504, 502, 501, 501, 501, 500, 500, 498, 497, 495, 494, 493, 490, 489, 486, 485, 484, 484, 484, 485, 485, 484, 483, 481, 482, 592, 582, 575, 570, 562, 559, 556, 552, 549, 546, 543, 540, 537, 534, 532, 530, 529, 528, 529, 547.2, 569.9, 605.5, 602.6, 578.3, 547.7, 510, 455.6, 447.2, ], BUTTON_CUTS, ); const buttonB = cutTrack( 53, [ 605, 609, 611, 615, 615, 613, 609, 605, 601, 595, 590, 585, 581, 577, 575, 573, 571, 570, 569, 569, 568, 569, 567, 567, 566, 566, 564, 563, 562, 561, 560, 558, 692, 691, 689, 686, 686, 680, 677, 675, 672, 669, 667, 665, 662, 660, 658, 656, 656, 656, 656, 694.2, 733.9, 781.5, 791.6, 780.3, 753.7, 709, 649.6, 632.2, ], BUTTON_CUTS, ); const pillAngle = track(103, [0, 1.9, 3.5, 5.5, 7.3, 9.5, 10.8, 10.7, 7.6, 4.5]); // The last keys overshoot white so the blur samples around 108 still average to pure white. const pillR = track(103, [26, 27, 94, 174, 232, 262]); const pillG = track(103, [145, 146, 178, 217, 245, 262]); const pillB = track(103, [249, 248, 251, 252, 254, 262]); const openOpacity = track(104, [1, 0.6, 0.2, 0]); // The share arrow's flight, 93-107, screen space (heading: 0 = right, -90 = up). const ARROW_FLIGHT_FROM = 93; const arrowX = track(93, [ 1858, 1828, 1793.3, 1764.1, 1729.2, 1686.6, 1633.8, 1571.8, 1493.7, 1383.4, 1325.2, 1288.6, 1298.1, 1296.6, 1291.7, ]); const arrowY = track(93, [ 572, 545, 509.9, 488.8, 463.5, 436.7, 405.7, 376.4, 364.2, 379.6, 408.8, 445.4, 431.4, 413.9, 407.7, ]); const arrowHeading = track(93, [ -93, -105, -118.9, -125.9, -131, -136.9, -140, -146.6, -167.9, -192.2, -223.9, -283.1, -329.2, -352.6, -360.5, ]); const arrowGrow = track(93, [1, 1.05, 1.12, 1.25, 1.3, 1.43, 1.5, 1.6, 1.62, 1.68, 1.7, 1.62, 1.6, 1.6, 1.62]); const arrowOpacity = track(106, [1, 0.47, 0]); // Where the share icon's 56-unit glyph sits on the page, and its scale. const SHARE_X = 1491.2; const SHARE_Y = 486.4; const SHARE_SCALE = 1.226; const fadeIn = (frame: number, from: number, frames: number) => Math.min(1, Math.max(0, (frame - from) / frames)); // One letter's arrival, by its age in frames: it drops in from lower right, small and // tilted, and straightens up. const letterY = track(0, [42, 32, 22, 13, 6, 2, 0]); const letterX = track(0, [18, 14, 9, 5, 2, 0]); const letterTilt = track(0, [42, 32, 20, 10, 4, 1, 0]); const letterScale = track(0, [0.65, 0.78, 0.88, 0.96, 1]); const letterOpacity = track(0, [0.5, 0.8, 1]); export const Letters: React.FC<{ frame: number; text: string; x: number; baseline: number; width: number; size: number; weight: number; start: number; stagger: number; color: (age: number) => string; drop?: number; // how far the letters fall in, 1 being the title's }> = ({ frame, text, x, baseline, width, size, weight, start, stagger, color, drop = 1 }) => { const fit = width / textWidth(text, size, weight); return ( <> {text.split("").map((letter, i) => { const age = frame - (start + i * stagger); if (age < 0 || letter === " ") return null; const letterX0 = x + textWidth(text.slice(0, i), size, weight) * fit; const half = (textWidth(letter, size, weight) * fit) / 2; return ( <text key={i} fontSize={size} fontWeight={weight} fill={color(age)} opacity={letterOpacity(age)} transform={`translate(${letterX0 + half + letterX(age) * drop} ${baseline + letterY(age) * drop}) rotate(${letterTilt(age)}) scale(${letterScale(age)}) translate(${-half} 0)`} > {letter} </text> ); })} </> ); }; const Label: React.FC<{ text: string; x: number; baseline: number; size: number; weight?: number; width: number; fill: string; anchor?: "start" | "middle"; opacity?: number; }> = ({ text, x, baseline, size, weight = 400, width, fill, anchor = "start", opacity = 1 }) => ( <text x={x} y={baseline} fontSize={size} fontWeight={weight} fill={fill} textAnchor={anchor} textLength={width} lengthAdjust="spacing" opacity={opacity} > {text} </text> ); // "Grok Bot" lands blue and flashes to white a few frames later. const titleColor = (age: number) => { const t = Math.min(1, Math.max(0, (age - 6.2) / 2.3)); const mix = (a: number) => Math.round(a + (255 - a) * t); return `rgb(${mix(58)},${mix(151)},${mix(232)})`; }; const flat = (color: string) => () => color; // `hideButton`: Section 3 draws this page fading out, with the pill now its own. export const AppStoreScene: React.FC<{ frame: number; sample: number; hideButton?: boolean }> = ({ frame, sample, hideButton = false, }) => { const { s, left, top } = camera(frame); const showPage = frame >= PAGE_TAKEOVER; const flying = frame >= ARROW_FLIGHT_FROM - 0.25; const clipId = `grok-page-icon-${sample}`; // After the cut the icon sits a little left of where the page's zoom alone puts it. const iconLeft = left + (ICON_LEFT - 641) * s - (Math.round(frame) > CUT ? 16 : 0); const iconTop = top + (ICON_TOP - 621) * s; const iconSize = ICON_SIZE * s; const iconRadius = iconSize * 0.225; // Frame 104 is the first of the swell and stays sharp: no shutter on the button there. const buttonFrame = Math.round(frame) === 104 ? 104 : frame; const buttonLeft = buttonL(buttonFrame); const buttonRight = buttonR(buttonFrame); const buttonTop = buttonT(buttonFrame); const buttonBottom = buttonB(buttonFrame); const buttonHeight = buttonBottom - buttonTop; const buttonCx = (buttonLeft + buttonRight) / 2; const buttonCy = (buttonTop + buttonBottom) / 2; const faceVisible = faceOpacity(frame); const r = faceR(frame); return ( <AbsoluteFill> {showPage ? null : <SphereScene frame={frame} clipId={`grok-sphere-under-${sample}`} />} <svg width="100%" height="100%" viewBox="0 0 2048 1152" style={{ position: "absolute", inset: 0, fontFamily: INTER }} > <defs> <clipPath id={clipId}> <rect x={iconLeft} y={iconTop} width={iconSize} height={iconSize} rx={iconRadius} /> </clipPath> </defs> {showPage ? <rect width={2048} height={1152} fill="#000" /> : null} <g transform={`translate(${left - 641 * s} ${top - 621 * s}) scale(${s})`}> <g opacity={fadeIn(frame, 51.5, 2)}> <Label text="15:20" x={672} baseline={102} size={44} weight={600} width={105} fill="#fff" /> </g> <g opacity={fadeIn(frame, 52.5, 3.5)}> {[ [1378, 11, 1], [1388, 17, 1], [1398, 24, 1], [1408, 30, 0.35], ].map(([x, h, op]) => ( <rect key={x} x={x} y={107 - h} width={7} height={h} rx={2} fill="#fff" opacity={op} /> ))} <path d={WIFI} fill="#fff" transform="translate(1420.8 65.3) scale(1.04)" /> <rect x={1491} y={76} width={62} height={30} rx={11} fill="#fff" /> <rect x={1555} y={84} width={3.5} height={14} rx={1.75} fill="#888" /> <text x={1522} y={99.5} fontSize={23} fontWeight={700} textAnchor="middle" fill="#000"> 62 </text> </g> <g opacity={fadeIn(frame, 52.5, 3.5)}> <path d={CHEVRON_LEFT} fill={LINK} stroke={LINK} strokeWidth={1.5} transform="translate(602.7 177) scale(1.05)" /> <Label text="Search" x={652} baseline={222} size={47} width={148} fill={LINK} /> </g> <Letters frame={frame} text="Grok Bot" x={994} baseline={320} width={238} size={56.5} weight={700} start={42.4} stagger={1.87} color={titleColor} drop={0.75} /> <Letters frame={frame} text="X Corp." x={994} baseline={379} width={134} size={41} weight={400} start={55.8} stagger={0.55} color={flat(DIM)} drop={0.35} /> <g opacity={fadeIn(frame, 54.5, 2.5)}> <rect x={641} y={620} width={907} height={2} fill={RULE} /> <rect x={641} y={866} width={907} height={2} fill={RULE} /> <rect x={915} y={663} width={2} height={172} fill={RULE} /> <rect x={1185} y={663} width={2} height={172} fill={RULE} /> </g> <Label text="15K RATINGS" x={754.5} baseline={691} size={30} weight={600} width={185} fill={LABEL} anchor="middle" opacity={fadeIn(frame, 54.5, 3.5)} /> <Label text="AGE" x={1051} baseline={691} size={28.5} weight={600} width={55} fill={LABEL} anchor="middle" opacity={fadeIn(frame, 56.5, 3.5)} /> <Label text="CHART" x={1325} baseline={691} size={30} weight={600} width={99} fill={LABEL} anchor="middle" opacity={fadeIn(frame, 57.5, 3.5)} /> <Letters frame={frame} text="4.9" x={725} baseline={769} width={85} size={60} weight={600} start={60} stagger={2} color={flat(VALUE)} drop={0.4} /> <Letters frame={frame} text="18+" x={1005} baseline={769} width={89} size={57} weight={600} start={62} stagger={1.7} color={flat(VALUE)} drop={0.4} /> <Letters frame={frame} text="No." x={1280} baseline={769} width={57} size={38} weight={600} start={65} stagger={1.2} color={flat(VALUE)} drop={0.4} /> <Letters frame={frame} text="7" x={1337} baseline={769} width={34} size={58} weight={600} start={69} stagger={0} color={flat(VALUE)} drop={0.4} /> <g opacity={fadeIn(frame, 57.5, 3.5)} fill="#8A8A8A"> {[697, 733, 769, 805, 841].map((x) => ( <path key={x} d={STAR} transform={`translate(${x - 17} ${818 - 17}) scale(${34 / 56})`} /> ))} </g> <Label text="Years Old" x={1048} baseline={825} size={34.5} width={141} fill={LABEL} anchor="middle" opacity={fadeIn(frame, 58.5, 3.5)} /> <Label text="Productivity" x={1325} baseline={826} size={34.5} width={183} fill={LABEL} anchor="middle" opacity={fadeIn(frame, 59.5, 3.5)} /> <g opacity={fadeIn(frame, 55.5, 4.5)}> <Label text="What’s New" x={640} baseline={947} size={56} weight={800} width={317} fill="#fff" /> <path d={CHEVRON_LEFT} fill="#6E6E6E" transform="translate(1014.85 906) scale(-0.9 0.9)" /> </g> <Label text="Version 1.18.0" x={644} baseline={1030} size={39} width={231} fill={DIM} opacity={fadeIn(frame, 57.5, 4.5)} /> <Label text="2d ago" x={1433} baseline={1032} size={39} width={119} fill={DIM} opacity={fadeIn(frame, 58.5, 4.5)} /> <Label text="Bug fixes and improvements" x={644} baseline={1106} size={39} width={495} fill="#CFCFCF" opacity={fadeIn(frame, 62.5, 4.5)} /> <g opacity={fadeIn(frame, 54.5, 3)} fill={BLUE}> {/* square-cornered and shallower than the icon set's box */} <path d="M1515 511H1502.2V549.8H1548.8V511H1537" fill="none" stroke={BLUE} strokeWidth={4.4} strokeLinejoin="round" /> {flying ? null : <path d={SHARE_ARROW} transform={`translate(${SHARE_X} ${SHARE_Y}) scale(${SHARE_SCALE})`} />} </g> </g> {showPage && iconFill(frame) > 0 ? ( <g clipPath={`url(#${clipId})`}> <rect x={iconLeft} y={iconTop} width={iconSize} height={iconSize} fill={gray(iconFill(frame))} /> {faceVisible > 0 ? ( <g opacity={faceVisible}> <circle cx={faceX(frame)} cy={faceY(frame)} r={r} fill="#fff" /> <Marks cx={faceX(frame)} cy={faceY(frame)} r={r} theta={faceAngle(frame)} fill={gray(INK)} /> </g> ) : null} </g> ) : null} {frame >= 52.5 && !hideButton ? ( <g transform={`rotate(${pillAngle(frame)} ${buttonCx} ${buttonCy})`}> <rect x={buttonLeft} y={buttonTop} width={buttonRight - buttonLeft} height={buttonHeight} rx={buttonHeight / 2} fill={`rgb(${Math.min(255, Math.round(pillR(frame)))},${Math.min(255, Math.round(pillG(frame)))},${Math.min(255, Math.round(pillB(frame)))})`} /> {openOpacity(frame) > 0 ? ( <text x={buttonCx} y={buttonCy + 13.5 * s} fontSize={39 * s} fontWeight={600} fill="#fff" textAnchor="middle" opacity={openOpacity(frame) * fadeIn(frame, 55.5, 2.5)} > Open </text> ) : null} </g> ) : null} {flying && frame < 107.75 ? ( <path d={SHARE_ARROW} fill={BLUE} stroke={BLUE} strokeWidth={0.9} opacity={arrowOpacity(frame)} transform={`translate(${arrowX(frame)} ${arrowY(frame)}) rotate(${arrowHeading(frame) + 90}) scale(${SHARE_SCALE * 1.52 * arrowGrow(frame)}) translate(-28 -17)`} /> ) : null} </svg> </AbsoluteFill> ); }; export const AppStorePage: React.FC = () => { const ready = useInter(); if (!ready) return null; // Three samples: the reference's blur here has two distinct ghost levels. return <MotionBlur samples={3} render={(frame, sample) => <AppStoreScene frame={frame + APP_STORE_FROM} sample={sample} />} />; };›engine/src/grok-bot/icons.ts
engine/src/grok-bot/icons.ts // Apple-style glyphs from Framework7 Icons (MIT), viewBox 0 0 56 56. SHARE_ARROW is the // arrow subpath of its square-arrow-up icon, on its own because the arrow flies off. export const CHEVRON_LEFT = "M35.805 47.723c.398.398.914.633 1.523.633c1.219 0 2.133-.915 2.133-2.133c0-.586-.234-1.125-.61-1.524L21.79 28.012l17.063-16.688c.375-.398.609-.96.609-1.523c0-1.219-.914-2.157-2.133-2.157c-.61 0-1.125.235-1.523.633L17.242 26.441c-.445.375-.703.961-.703 1.57c0 .587.258 1.126.703 1.571Z"; export const SHARE_ARROW = "M28.012 36.098c1.008 0 1.851-.844 1.851-1.829V10.2l-.14-3.492l1.593 1.664l3.54 3.773c.328.375.82.563 1.265.563c.984 0 1.711-.703 1.711-1.64c0-.516-.187-.891-.539-1.243l-7.922-7.64c-.469-.47-.89-.633-1.36-.633c-.491 0-.89.164-1.359.633l-7.922 7.64c-.351.352-.562.727-.562 1.242c0 .938.703 1.64 1.688 1.64c.468 0 .96-.187 1.288-.562l3.563-3.773l1.594-1.687l-.164 3.515v24.07c0 .985.867 1.828 1.875 1.828Z"; export const STAR = "M11.969 52.293c.96.727 2.18.469 3.633-.586L28 42.613l12.422 9.094c1.453 1.055 2.648 1.313 3.633.586c.96-.727 1.172-1.922.586-3.633l-4.899-14.578l12.516-9c1.453-1.031 2.039-2.11 1.664-3.281c-.375-1.125-1.477-1.688-3.281-1.664l-15.352.093l-4.664-14.648C30.063 3.848 29.22 2.981 28 2.981c-1.195 0-2.039.867-2.602 2.601L20.734 20.23l-15.351-.093c-1.805-.024-2.906.539-3.281 1.664c-.399 1.172.21 2.25 1.664 3.281l12.515 9l-4.898 14.578c-.586 1.711-.375 2.906.586 3.633"; export const WIFI = "M5.465 25.035c.445.445 1.101.422 1.523-.023c5.532-5.883 12.844-8.977 21.024-8.977c8.226 0 15.562 3.117 21.07 9c.398.399 1.032.399 1.453-.047l3.118-3.117c.374-.398.374-.914.07-1.289c-5.297-6.516-15.258-11.32-25.711-11.32S7.598 14.066 2.3 20.582c-.328.375-.305.89.07 1.29Zm9.375 9.399c.469.492 1.078.445 1.523-.07c2.719-3.024 7.125-5.204 11.649-5.157c4.57-.047 8.953 2.203 11.695 5.227c.445.468 1.031.468 1.477-.024l3.492-3.445c.375-.375.422-.867.07-1.266c-3.398-4.195-9.703-7.289-16.734-7.289s-13.336 3.117-16.735 7.29c-.351.398-.304.866.07 1.265Zm13.172 12.304c.492 0 .937-.258 1.804-1.101l5.485-5.274c.351-.328.422-.843.117-1.242c-1.477-1.898-4.242-3.539-7.406-3.539c-3.235 0-6.047 1.711-7.5 3.68c-.211.328-.14.773.21 1.101l5.485 5.274c.867.843 1.313 1.101 1.805 1.101"; export const PLUS = "M27.988 47.734c1.149 0 2.11-.914 2.11-2.039V30.11h15.14c1.125 0 2.11-.96 2.11-2.109c0-1.148-.985-2.086-2.11-2.086h-15.14v-15.61c0-1.124-.961-2.038-2.11-2.038c-1.148 0-2.086.914-2.086 2.039v15.61h-15.14c-1.125 0-2.11.937-2.11 2.085s.985 2.11 2.11 2.11h15.14v15.585c0 1.125.938 2.04 2.086 2.04"; export const PLACEMARK = "M28 4c9.389 0 17 7 17 19c0 9.13-9.841 22.313-14.548 28.096c-1.354 1.604-3.627 1.54-4.903 0C20.843 45.316 11 32.132 11 23c0-12 7.611-19 17-19m0 11a6 6 0 1 0 0 12a6 6 0 0 0 0-12"; // Grok and X marks from svgl.app. export const GROK_DARK = [ "M395.479 633.828L735.91 381.105C752.599 368.715 776.454 373.548 784.406 392.792C826.26 494.285 807.561 616.253 724.288 699.996C641.016 783.739 525.151 802.104 419.247 760.277L303.556 814.143C469.49 928.202 670.987 899.995 796.901 773.282C896.776 672.843 927.708 535.937 898.785 412.476L899.047 412.739C857.105 231.37 909.358 158.874 1016.4 10.6326C1018.93 7.11771 1021.47 3.60279 1024 0L883.144 141.651V141.212L395.392 633.916", "M325.226 695.251C206.128 580.84 226.662 403.776 328.285 301.668C403.431 226.097 526.549 195.254 634.026 240.596L749.454 186.994C728.657 171.88 702.007 155.623 671.424 144.2C533.19 86.9942 367.693 115.465 255.323 228.382C147.234 337.081 113.244 504.215 171.613 646.833C215.216 753.423 143.739 828.818 71.7385 904.916C46.2237 931.893 20.6216 958.87 0 987.429L325.139 695.339", ]; export const X_LOGO = "M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z";›engine/src/grok-bot/fonts.ts
engine/src/grok-bot/fonts.ts import { useEffect, useState } from "react"; import { cancelRender, continueRender, delayRender, staticFile } from "remotion"; // Inter stands in for the reference's SF Pro (variable: weight + optical size). export const INTER = "GrokInter"; let loading: Promise<void> | null = null; const load = () => { loading ??= new FontFace(INTER, `url(${staticFile("product-tour/fonts/inter-latin-opsz-normal.woff2")}) format("woff2")`, { weight: "100 900", }) .load() .then((font) => void document.fonts.add(font)); return loading; }; // False until Inter is in, so per-letter layout never measures a fallback font. export const useInter = () => { const [ready, setReady] = useState(false); const [handle] = useState(() => delayRender("Inter")); useEffect(() => { load() .then(() => { setReady(true); continueRender(handle); }) .catch((err) => cancelRender(err)); }, [handle]); return ready; }; let context: CanvasRenderingContext2D | null = null; const widths = new Map<string, number>(); export const textWidth = (text: string, size: number, weight: number) => { const key = `${weight}|${size}|${text}`; const known = widths.get(key); if (known !== undefined) return known; context ??= document.createElement("canvas").getContext("2d"); context!.font = `${weight} ${size}px ${INTER}`; const width = context!.measureText(text).width; widths.set(key, width); return width; };›engine/src/grok-bot/MotionBlur.tsx
engine/src/grok-bot/MotionBlur.tsx import React from "react"; import { AbsoluteFill, useCurrentFrame } from "remotion"; // Camera-style motion blur: draws the scene at several sub-frame times and averages // them (layer i at 1/(i+1) opacity is an exact mean). Each sample must paint an opaque // background. Defaults match the reference: 180 degree shutter, centred on the frame, // and few enough samples to keep its stepped edges. export const MotionBlur: React.FC<{ render: (frame: number, sample: number) => React.ReactNode; samples?: number; shutter?: number; }> = ({ render, samples = 6, shutter = 0.5 }) => { const frame = useCurrentFrame(); return ( <AbsoluteFill> {Array.from({ length: samples }, (_, i) => ( <AbsoluteFill key={i} style={{ opacity: 1 / (i + 1) }}> {render(frame + (i / (samples - 1) - 0.5) * shutter, i)} </AbsoluteFill> ))} </AbsoluteFill> ); };›engine/src/grok-bot/SphereBirth.tsx
engine/src/grok-bot/SphereBirth.tsx // Section 1 (reference frames 0-51): a black ball rises inside a pale bubble while both // spin, the bubble collapses onto the ball, the ball inverts into the mascot's white face // (its two highlights become the eyes) inside a growing dark app icon, which then drifts // up-left as the white background fades to black. // // Ball, bubble and face are one model: a sphere carrying a rigid pair of marks. Every // track below is measured from the reference, one value per frame, in its 2048x1152 space. import React from "react"; import { MotionBlur } from "./MotionBlur"; import { gray, track } from "./track"; // The section runs to frame 42; from 43 the App Store text starts on top of it, so // AppStorePage draws this scene underneath itself until the page takes over at 52. export const SPHERE_BIRTH_FRAMES = 43; export const INK = 49; // the icon's dark and the eyes // Marks, in sphere radii. `angle` is the outer mark's polar angle; the inner one trails it. const OUTER_RHO = 0.787; const INNER_RHO = 0.355; const INNER_LAG = 29; const MARK_LENGTH = 0.56; const OUTER_WIDTH = 0.145; const INNER_WIDTH = 0.27; const OUTER_AXIS = 100; const INNER_AXIS = 136; // relative to the inner mark's own polar angle // The outer mark is foreshortened near the limb: narrow at one end, bulging rimward. const OUTER_PATH = "M-1,0C-1,-.72-.6,-.9-.15,-.96C.35,-1.03.95,-1 .98,-.25C1,.55.75,.95.35,.92C-.1,.88-.55,.78-.82,.68C-.97,.6-1,.25-1,0Z"; const angle = track(0, [ 28, 1, -25.6, -51.9, -80.7, -107.9, -132.5, -156.3, -176.1, -193.6, -210.6, -224.9, -239, -249.7, -261, -272.4, -282, -290, -299.3, -307, -315.2, -321.6, -327, -333, -338.5, -345.3, -350.7, -355.1, -358.7, -361.8, -364.9, -367.9, -370.5, -373, -375.4, -377.6, -379.7, -381.3, -383.4, -384.9, -386.2, -387.7, -388.7, -389.7, -391.1, -392.1, -393, -393.7, -394.5, -395.3, -396, -396.5, ]); const sphereX = track(23, [ 1027, 1024, 1024, 1013, 1003, 996, 992, 989.5, 990, 991, 994, 998, 999, 1001, 1001, 1000, 998, 994, 988, 980, 969, 953.4, 934.7, 916.6, 901.6, 885.6, 870.9, 860.5, 849.1, ]); const sphereY = track(0, [ 1201, 1121.5, 1060, 1006, 957, 913, 873, 839.5, 808, 780, 755.5, 734.5, 713.5, 695.5, 680, 665.5, 653, 643, 633, 624.5, 616.5, 609, 603, 598, 598, 610, 635, 661, 684, 699, 706, 704, 698, 689, 681, 673.5, 668, 664, 661.6, 659.4, 658, 658, 655, 647, 639.9, 626.9, 616.8, 606, 594.2, 583.7, 573.5, 565, ]); const sphereR = track(23, [ 67.5, 120, 160, 194, 226, 250, 264, 265, 257, 245, 230, 216, 204.5, 197, 193, 193, 194.6, 197.4, 203, 206, 208, 210, 212, 214, 213, 212, 210, 207, 206, ]); // Keys sit a little past the measured grays (30, 226): the blur averages across this fast flip. const sphereFill = track(22, [10, 22, 242, 255]); const markFill = track(22, [255, 225, 75, INK]); const bubbleR = track(0, [ 440, 470, 468, 465.5, 460, 452.5, 445, 436.5, 428, 417, 404, 392, 379, 362.5, 345.5, 324, 300, 275.5, 236, 188, 140, 91.5, 60, ]); const bubbleOpacity = track(0, [0, 0.44, 0.8, 1]); const bubbleVisible = track(21, [1, 0]); export const iconW = track(22, [ 140, 198, 262, 340, 400, 436, 454, 452, 438, 420, 396, 376, 360, 348, 340, 338, 342, 346, 352, 358, 362, 364, 366, 368, 368, 366, 364, 361, 357, 355, ]); export const iconX = track(22, [ 1027, 1028, 1028, 1028, 1028, 1028, 1028, 1027.5, 1028, 1027.5, 1027.5, 1027.5, 1027.5, 1027.5, 1027.5, 1026.5, 1024.5, 1022.5, 1019.5, 1014.5, 1006.5, 995.5, 980.5, 963.5, 950, 937, 920, 904.5, 890.5, 879.5, ]); export const iconY = track(22, [ 603, 597, 595, 591, 588, 586, 585, 584, 583, 584, 582, 582, 584, 584, 582, 581, 581, 579, 576, 573, 569, 560, 549, 538, 526, 513, 502, 493.5, 485.5, 476.5, ]); const iconOpacity = track(22, [0, 0.46, 1]); const background = track(41, [254, 239, 212, 186, 160, 132, 106, 79, 54, 26, 2, 0]); const polar = (cx: number, cy: number, r: number, degrees: number) => { const a = (degrees * Math.PI) / 180; return { x: cx + r * Math.cos(a), y: cy + r * Math.sin(a) }; }; export const Marks: React.FC<{ cx: number; cy: number; r: number; theta: number; fill: string }> = ({ cx, cy, r, theta, fill, }) => { const outer = polar(cx, cy, r * OUTER_RHO, theta); const inner = polar(cx, cy, r * INNER_RHO, theta - INNER_LAG); const length = r * MARK_LENGTH; const innerWidth = r * INNER_WIDTH; return ( <g fill={fill}> <rect x={-length / 2} y={-innerWidth / 2} width={length} height={innerWidth} rx={innerWidth / 2} transform={`translate(${inner.x} ${inner.y}) rotate(${theta - INNER_LAG + INNER_AXIS})`} /> <path d={OUTER_PATH} transform={`translate(${outer.x} ${outer.y}) rotate(${theta + OUTER_AXIS}) scale(${length / 2} ${(r * OUTER_WIDTH) / 2})`} /> </g> ); }; export const SphereScene: React.FC<{ frame: number; clipId: string }> = ({ frame, clipId }) => { const theta = angle(frame); const cx = frame < 23 ? 1027 : sphereX(frame); const cy = sphereY(frame); const r = sphereR(frame); const hasBubble = frame < 22; const bubble = bubbleR(frame); const showIcon = frame >= 22.5; // frame 22 itself shows no icon at all, even in its blur samples const w = iconW(frame); const left = iconX(frame) - w / 2; const top = iconY(frame) - w / 2; const corner = w * 0.225; const sphere = ( <g> <circle cx={cx} cy={cy} r={r} fill={gray(sphereFill(frame))} /> <Marks cx={cx} cy={cy} r={r} theta={theta} fill={gray(markFill(frame))} /> </g> ); return ( <svg width="100%" height="100%" viewBox="0 0 2048 1152" style={{ position: "absolute", inset: 0 }}> <defs> <clipPath id={clipId}> <rect x={left} y={top} width={w} height={w} rx={corner} /> </clipPath> </defs> {/* a solid fade has nothing to blur: every sample takes the frame's own value */} <rect width={2048} height={1152} fill={gray(background(Math.round(frame)))} /> {hasBubble ? ( <g opacity={bubbleOpacity(frame) * bubbleVisible(frame)}> <circle cx={1027.5} cy={cy} r={bubble} fill={gray(245)} style={{ filter: "blur(3px)" }} /> <g style={{ filter: "blur(7px)" }}> <Marks cx={1027.5} cy={cy} r={bubble} theta={theta} fill={gray(255)} /> </g> </g> ) : null} {/* dark and face share one clip, so no dark fringe shows around the white face */} {showIcon ? ( <g clipPath={`url(#${clipId})`}> <rect x={left} y={top} width={w} height={w} fill={gray(INK)} opacity={iconOpacity(frame)} /> {sphere} </g> ) : ( sphere )} </svg> ); }; export const SphereBirth: React.FC = () => { const id = React.useId().replace(/:/g, ""); return <MotionBlur render={(frame, sample) => <SphereScene frame={frame} clipId={`${id}-icon-${sample}`} />} />; };›engine/src/grok-bot/track.ts
engine/src/grok-bot/track.ts // A value per reference frame, starting at `first`, read back at any (fractional) // frame so sub-frame motion-blur samples land between the measured keys. Holds the // first and last values outside the measured range, or continues their slope with // `extrapolate`. export const track = (first: number, values: readonly number[], extrapolate = false) => (frame: number): number => { const raw = frame - first; const at = extrapolate ? raw : Math.min(Math.max(raw, 0), values.length - 1); const i = Math.max(0, Math.min(Math.floor(at), values.length - 2)); return values[i] + (values[i + 1] - values[i]) * (at - i); }; // A track with hard cuts after the given frames. Motion-blur samples stay on their own // side of a cut, carrying the slope instead of smearing across the jump. export const cutTrack = (first: number, values: readonly number[], cuts: readonly number[]) => { const edges = [first - 1, ...cuts, first + values.length - 1]; const segments = edges.slice(1).map((end, i) => { const start = edges[i] + 1; return { end, read: track(start, values.slice(start - first, end - first + 1), true), start }; }); const lastKnown = first + values.length - 1; return (frame: number): number => { const whole = Math.round(frame); const segment = segments.find((s) => whole <= s.end) ?? segments[segments.length - 1]; return segment.read(Math.min(Math.max(frame, first), lastKnown)); }; }; export const gray = (v: number) => { const c = Math.round(v); return `rgb(${c},${c},${c})`; };›engine/src/grok-bot/AskBar.tsx
engine/src/grok-bot/AskBar.tsx // Section 3 (reference frames 113-178): the white pill wipes off from the left to reveal // the dark "Ask anything" bar, leaving only the send button. The bar wobbles like a spring, // a "+" button pulses in, and at the end the "+" swells and rolls toward centre as the white // tile that becomes the app icon, while the send button lifts away to become its badge. // // Tracks are measured per frame in the reference's 2048x1152 space; bar children are laid // out relative to the bar's centre so they tilt with it. import React from "react"; import { AbsoluteFill } from "remotion"; import { AppStoreScene, Letters } from "./AppStorePage"; import { INTER, useInter } from "./fonts"; import { PLUS } from "./icons"; import { MotionBlur } from "./MotionBlur"; import { gray, track } from "./track"; export const ASK_BAR_FROM = 113; export const ASK_BAR_FRAMES = 66; // 113-178; the wallpaper starts at 179 const barX = track(113, [ 1086, 1090.6, 1090.6, 1088, 1089.4, 1089.7, 1085, 1084.7, 1084.5, 1083.5, // 113-122 1083.5, 1083.5, 1081.5, 1080.9, 1079.5, 1077.5, 1077.5, 1077.5, 1077.5, 1075.5, 1075.5, 1073.5, 1073.5, 1071.9, 1071.5, 1069.5, 1069.6, 1067.6, 1067.6, 1067.6, 1065.6, 1065.5, 1063.5, 1063.5, 1061.5, 1061.4, 1061.6, 1059.5, 1059.2, 1057.4, 1057.5, 1055.5, 1055.4, 1055.6, 1053.8, 1053.5, 1052.3, 1052, 1051.6, 1049.6, 1049.4, 1049.4, 1047.9, 1047.5, 1046.1, 1045.9, 1045.5, 1043.5, 1043.5, 1043.5, 1043.5, 1044, 1044, 1044, 1044, 1044, // 173-178 ]); const barY = track(113, [ 535.4, 535.3, 539.4, 548.4, 559.3, 569.2, 577.2, 582.4, 587.5, 587.5, // 113-122 585.6, 582.7, 579.5, 574.7, 571.5, 569.5, 567.5, 568.6, 567.5, 567.5, 569.6, 570.9, 572.3, 573.5, 575.5, 575.5, 575.5, 575.5, 575.5, 574, 573.5, 573.5, 573.5, 571.5, 571.5, 570.2, 569.5, 569.5, 569.5, 569.5, 569.5, 569.5, 569.5, 571.5, 571.6, 571.5, 571.5, 572.9, 573.5, 573.5, 573.5, 573, 571.6, 571.5, 571.5, 571.5, 571.5, 571.5, 571.9, 571.6, 571.5, 574, 576, 580, 592, 608, // 173-178 ]); const barAngle = track(113, [ -0.15, -2.47, -3.59, -3.79, -3.57, -2.95, -1.91, -0.59, -0.14, 0.66, // 113-122 1.16, 1.38, 1.36, 1.16, 0.86, 0.49, 0.17, -0.02, -0.28, -0.49, -0.5, 0.07, 1.45, 3.14, 4.69, 6.02, 6.63, 6.8, 6.72, 6.33, 5.74, 5.11, 4.48, 3.41, 0.77, -3.43, -7.54, -11.55, -12.45, -12.38, -11.63, -10.03, -7.94, -5.44, -2.66, 0.01, 2.61, 5.04, 5.46, 5.72, 5.8, 5.64, 5.1, 4.4, 3.49, 2.6, 1.8, 0.99, 0.21, -0.29, -0.5, -0.3, 0, 0, 0, 0, // 173-178 ]); const barLength = track(113, [ 1207, 1238, 1259, 1260, 1257, 1236, 1202, 1178, 1162, 1144, // 113-122 1133, 1132, 1132, 1135, 1144, 1152, 1160, 1168, 1172, 1176, 1176, 1176, 1173, 1171, 1168, 1164, 1164, 1164, 1164, 1164, 1166, ]); const barHeight = track(113, [172, 163, 160, 159, 160, 163, 164, 163, 164, 165, 167, 168, 168, 167, 165, 164]); // The pill's blue lingers in the bar's first frames. const barR = track(113, [33, 33, 34, 34]); const barG = track(113, [54, 47, 38, 34]); const barB = track(113, [78, 60, 41, 34]); const barOpacity = track(173, [1, 0.9, 0.85, 0.75, 0.55, 0.3]); // The white that is wiped away, as a capsule along the bar (frames 113-120), its left // edge feathered. wipeLeft is the middle of that feather. const WIPE_ENDS = 120.5; const wipeFeather = track(113, [60, 60, 60, 60, 60, 60, 40, 10]); // gone as it closes to a circle const wipeLeft = track(113, [-473, -250.5, -25, 129, 230, 304, 359, 395]); const wipeRight = track(113, [600, 614, 625, 626, 624, 606, 584, 557]); const wipeHeight = track(113, [165, 160, 155, 152, 150, 150, 151, 150]); const sendX = track(121, [ 1567, 1564.8, 1563.5, 1565.5, 1563.2, 1561.6, 1560.8, 1559.8, 1559.3, 1561.1, // 121-130 1562.9, 1560.9, 1560.9, 1559.6, 1557.4, 1554.1, 1551.5, 1547.5, 1545.4, 1543.3, 1542.9, 1542.8, 1542.9, 1542.9, 1542.9, 1542.7, 1542.5, 1540.5, 1537.5, 1531.5, 1528.9, 1528.9, 1528.8, 1529.5, 1530.7, 1532.7, 1532.7, 1532.7, 1531.6, 1530.7, 1528.9, 1528.8, 1528.9, 1526.9, 1526.9, 1526.9, 1525.7, 1524.8, 1524.9, 1523.4, 1522.8, 1524.8, 1513.5, 1508.2, 1522.6, 1540.4, 1566.3, 1604.4, // 171-178 ]); const sendY = track(121, [ 586.7, 590.8, 593.5, 592.5, 588.8, 583.6, 576.5, 571.5, 567, 564.6, // 121-130 563, 561.5, 563.5, 570.1, 583.4, 598.5, 612.4, 623.7, 628.8, 629.4, 628.9, 625.4, 619.4, 613.5, 608.5, 597.5, 575.5, 539.5, 504.6, 471.1, 463.7, 463.7, 470.6, 483.7, 502.4, 523.5, 547.5, 569.5, 592.3, 612.9, 616.4, 618.4, 619.4, 618.4, 612.8, 607.4, 599.5, 591.5, 584.5, 577.6, 570.5, 566.3, 567.1, 562.8, 556.4, 547.2, 532.4, 508.5, // 171-178 ]); const sendGrowIn = track(121, [61.5, 57, 58]); const sendGrowOut = track(172, [58, 56, 59, 60, 61, 63, 65]); // Four bars that sprout one after another. x is from the button's centre. const WAVE = [ { x: -18, height: track(125, [0, 6, 12, 15, 16, 17, 17.5, 18]) }, { x: -5.5, height: track(126, [0, 16, 24, 33, 37, 39, 40]) }, { x: 8, height: track(127, [0, 12, 17, 22, 26, 28]) }, { x: 20.5, height: track(128, [0, 24, 34, 42, 47]) }, ]; const waveOpacity = track(172, [1, 0.7, 0.3, 0]); const micScale = track(127, [0.7, 0.75, 0.85, 0.95, 1.04, 1.1, 1.1, 1.06, 1.03, 1]); const micOpacity = track(127, [0, 0.3, 0.75, 0.95, 1]); // The "+" button, 141-178: a pulse of gray, then the tile that flies off. const PLUS_FROM = 140.5; const plusX = track(141, [ 369.6, 364.4, 359.4, 353.5, 350.4, 349.5, 350.4, 356.5, 363.5, 370.7, // 141-150 368.6, 363.6, 357.5, 351.6, 347.4, 344.6, 343.5, 343.5, 343.5, 343.5, 343.5, 341.5, 341.5, 339.5, 337.5, 337.5, 335.8, 334.5, 333.5, 333, 313, 341.7, 423.4, 500, 580, 675.6, 830, 1002, // 171-178 ]); const plusY = track(141, [ 427.5, 457.6, 493.6, 537.5, 574.5, 606.5, 646.5, 688.5, 721.5, 747.7, // 141-150 739.4, 720.8, 697.6, 669.7, 640.6, 609.6, 581.9, 555.1, 531.5, 508.1, 510.5, 511.5, 511.9, 515.6, 521.6, 528.2, 536.2, 544.6, 553.6, 562.4, 544.5, 493.5, 438.1, 416, 414, 442, 490, 532, // 171-178 ]); const plusGray = track(141, [ 27, 88, 132, 171, 178, 167, 157, 146, 136, 127, // 141-150 116, 105, 95, 86, 75, 66, 56, 47, 36, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 33, 54, 120, 165, 190, 225, 255, // 171-178 ]); const tileSize = track(170, [160, 158, 158, 162, 185, 200, 196, 225, 250]); const tileRound = track(175, [0.5, 0.42, 0.32, 0.26]); // corner radius, as a share of its size const tileAngle = track(175, [0, 10, 34, 33]); const tileBlur = track(170, [0, 3, 6, 7, 6, 5, 3, 1.5, 1]); // The "+" glyph spins in as an "x", and spins away again before the tile flies. const glyphAngle = track(155, [45, 45, 45, 40, 15, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 45, 60, 75]); const glyphIn = track(155, [0, 0.15, 0.35, 0.7, 0.85, 1]); const glyphOut = track(170, [1, 0.7, 0.3, 0.12, 0]); // The App Store page, still fading under the bar's first frames. const pageOpacity = track(112, [1, 0.88, 0.55, 0.25, 0.07, 0]); const PAGE_GONE = 116.5; // Letters land white and fade down to the placeholder's gray a few frames later. const SETTLED = 148; const letterColor = (age: number) => { const t = Math.min(1, Math.max(0, (age - 6.5) / 3)); return gray(255 + (SETTLED - 255) * t); }; const Mic: React.FC<{ scale: number }> = ({ scale }) => ( <g transform={`scale(${scale})`} fill="none" stroke="#C8C8C8" strokeWidth={5} strokeLinecap="round"> <rect x={-13} y={-29.5} width={26} height={41} rx={13} /> <path d="M-19.5 -3V1A19.5 19.5 0 0 0 19.5 1V-3M0 20.5V30" /> </g> ); const Scene: React.FC<{ frame: number; sample: number }> = ({ frame, sample }) => { const cx = barX(frame); const cy = barY(frame); const angle = barAngle(frame); const length = barLength(frame); const height = barHeight(frame); const wiping = frame < WIPE_ENDS; const feather = wipeFeather(frame); const wipeStart = wipeLeft(frame) - feather / 2; const whole = Math.round(frame); const sendRadius = frame < 172 ? sendGrowIn(frame) : sendGrowOut(frame); const showPlus = frame >= PLUS_FROM; const size = tileSize(frame); const blur = tileBlur(frame); const glyph = glyphIn(frame) * glyphOut(frame); return ( <AbsoluteFill> <AbsoluteFill style={{ backgroundColor: "#000" }} /> {frame < PAGE_GONE ? ( <AbsoluteFill style={{ opacity: pageOpacity(whole) }}> <AppStoreScene frame={frame} sample={sample} hideButton /> </AbsoluteFill> ) : null} <svg width="100%" height="100%" viewBox="0 0 2048 1152" style={{ position: "absolute", inset: 0, fontFamily: INTER }} > <g transform={`translate(${cx} ${cy}) rotate(${angle})`} opacity={barOpacity(frame)}> <rect x={-length / 2} y={-height / 2} width={length} height={height} rx={height / 2} fill={`rgb(${Math.round(barR(frame))},${Math.round(barG(frame))},${Math.round(barB(frame))})`} /> <Letters frame={frame} text="Ask anything" x={-517.5} baseline={27.4} width={354} size={58} weight={400} start={113.4} stagger={1} color={letterColor} drop={0.55} /> {micOpacity(frame) > 0 ? ( <g transform="translate(322.5 -13.6)" opacity={micOpacity(frame)}> <Mic scale={micScale(frame)} /> </g> ) : null} {wiping ? ( <> <defs> <linearGradient id={`grok-wipe-${sample}`} gradientUnits="userSpaceOnUse" x1={wipeStart} x2={wipeStart + feather} y1={0} y2={0} > <stop offset={0} stopColor="#fff" stopOpacity={0} /> <stop offset={1} stopColor="#fff" stopOpacity={1} /> </linearGradient> </defs> <rect x={wipeStart} y={-wipeHeight(frame) / 2} width={wipeRight(frame) - wipeStart} height={wipeHeight(frame)} rx={wipeHeight(frame) / 2} fill={`url(#grok-wipe-${sample})`} /> </> ) : null} </g> {wiping ? null : ( <g transform={`translate(${sendX(frame)} ${sendY(frame)}) rotate(${angle})`}> <circle r={sendRadius} fill="#fff" /> <g fill="#111" opacity={waveOpacity(frame)}> {WAVE.map(({ x, height: bar }) => ( <rect key={x} x={x - 3.5} y={-bar(frame) / 2} width={7} height={bar(frame)} rx={3.5} /> ))} </g> </g> )} {showPlus ? ( <g style={blur > 0 ? { filter: `blur(${blur}px)` } : undefined}> <g transform={`translate(${plusX(frame)} ${plusY(frame)}) rotate(${tileAngle(frame)})`}> <rect x={-size / 2} y={-size / 2} width={size} height={size} rx={size * tileRound(frame)} fill={gray(plusGray(frame))} /> {glyph > 0 ? ( <path d={PLUS} fill="#fff" opacity={glyph} transform={`rotate(${glyphAngle(frame)}) scale(1.06) translate(-28 -28)`} /> ) : null} </g> </g> ) : null} </svg> </AbsoluteFill> ); }; export const AskBar: React.FC = () => { const ready = useInter(); if (!ready) return null; return <MotionBlur render={(frame, sample) => <Scene frame={frame + ASK_BAR_FROM} sample={sample} />} />; };›engine/src/grok-bot/HomeScreen.tsx
engine/src/grok-bot/HomeScreen.tsx // Section 4 (reference frames 179-229): the white tile lands as the mascot's app icon on an // iOS home screen, its neighbours focus in and the send circle arrives as the "3" badge. // The camera eases out, punches in, the face shrinks away, the tile goes frosted, and the // badge stretches into the white pill that carries the next section. // // Icons are laid out in the coordinates of reference frame 200; `camera` maps them to the // screen. wallpaper.png is a low-resolution colour field sampled from the reference: frame // 184 shows the wallpaper with only the tile in front of it, and later frames extend it // past the edges so it can move and scale without showing one. import React from "react"; import { AbsoluteFill, Img, staticFile } from "remotion"; import { Background } from "./Background"; import { INTER, useInter } from "./fonts"; import { GROK_DARK, PLACEMARK, X_LOGO } from "./icons"; import { MotionBlur } from "./MotionBlur"; import { INK, Marks } from "./SphereBirth"; import { gray, track } from "./track"; export const HOME_FROM = 179; export const HOME_FRAMES = 51; // 179-229; the wash to the next section's background carries on there // The camera, 186-225: scale and where the layout's centre (1023, 578) lands. const cameraS = track( 186, [ 1.215, 1.1876, 1.1511, 1.1199, 1.0931, 1.0746, 1.0604, 1.0497, 1.0414, 1.0327, 1.0249, 1.0175, 1.0112, 1.0054, 1, 0.9961, 0.9917, 0.9888, 0.9844, 0.9805, 0.9766, 0.9751, 0.9742, 0.9712, 0.9693, 0.9727, 0.9917, 1.0273, 1.0716, 1.1204, 1.1681, 1.2135, 1.2529, 1.2836, 1.3095, 1.3328, 1.3509, 1.364, 1.3728, 1.3791, ], ); const cameraX = track(186, [ 1027.2, 1023.8, 1026.5, 1027.5, 1027.2, 1026.8, 1026, 1025, 1023.8, 1023.2, 1023.2, 1023, 1022.8, 1022.8, 1022.5, 1022, 1021.2, 1021.2, 1021.5, 1021.5, 1022, 1022.2, 1022.2, 1023.2, 1023.8, 1024.5, 1024.8, 1023.5, 1022.2, 1021.2, 1022.8, 1024.5, 1026.2, 1031, 1035.2, 1038.2, 1040, 1041.8, 1043.8, 1045.5, ]); const cameraY = track(186, [ 540.5, 548.5, 556, 561, 566, 570.5, 574, 576.5, 578, 578.5, 579, 578.5, 578.5, 578.5, 578, 577.5, 577.5, 577.5, 577.5, 577.5, 578, 578, 578.5, 579, 579, 578.5, 578, 577, 576, 574.5, 572, 569, 566.5, 564, 562.5, 561, 560.5, 560.5, 561, 561, ]); // The wallpaper's own move (it drifts against the icons), 179-225, and its fade up from // black. The plate's centre lands at (wallX, wallY). const wallS = track(179, [ 1.2, 1.141, 1.0985, 1.0687, 1.035, 0.9998, 0.9768, 0.9436, 0.9118, 0.8845, 0.8608, 0.8405, 0.8254, 0.8149, 0.8065, 0.8004, 0.7933, 0.7877, 0.7818, 0.7779, 0.7732, 0.7693, 0.7659, 0.7629, 0.7597, 0.7571, 0.754, 0.7504, 0.7495, 0.7483, 0.7463, 0.746, 0.748, 0.7604, 0.7857, 0.8185, 0.8556, 0.8904, 0.923, 0.9522, 0.9747, 0.9947, 1.0076, 1.021, 1.026, 1.03, 1.034, ]); const wallX = track(179, [ 1022, 1022.9, 1021.6, 1022.7, 1023.4, 1024, 1028.1, 1022.3, 1022.9, 1022.9, 1023.5, 1021.9, 1021.9, 1020.6, 1019.6, 1020, 1019.8, 1019.5, 1019.5, 1015.9, 1016.2, 1016, 1016.5, 1015.2, 1015.8, 1015.6, 1016.6, 1017.6, 1017.9, 1018, 1018, 1018.4, 1018.7, 1020.7, 1023.1, 1019.9, 1020.7, 1021.3, 1022.8, 1024.5, 1028.1, 1032.9, 1036.5, 1039.2, 1040, 1040, 1040, ]); const wallY = track(179, [ 545, 549.6, 557.3, 562.5, 568.8, 576.2, 574, 579.4, 583.2, 588.5, 593.1, 598.1, 602.2, 605.5, 608, 608, 608.8, 608.4, 608, 609.1, 608.5, 608.4, 606.9, 607.3, 607.1, 606.8, 606.2, 606.9, 606.7, 606.9, 607.5, 607.2, 607.6, 608.8, 607.5, 610.1, 609.7, 610.3, 610.9, 609.5, 611.5, 608.3, 612.2, 614.6, 612, 612, 612, ]); const wallGain = track(179, [0.079, 0.276, 0.429, 0.577, 0.738, 0.881, 0.975, 0.965]); const WALL_WIDTH = 3848; const WALL_HEIGHT = 2192; // The neighbouring icons focus in. const iconsOpacity = track(185, [0.25, 0.6, 1]); const iconsBlur = track(185, [14, 10, 5, 2, 1, 0]); // The rows above and below the mascot's scale in on their own (187-225): each icon's scale // about its centre, and how far it sits from where the camera alone would put it. const topScale = track( 187, [ 0.6243, 0.7115, 0.7723, 0.8176, 0.853, 0.8861, 0.9089, 0.9299, 0.9489, 0.9617, 0.9743, 0.9832, 0.9946, 1, 1.0039, 1.0084, 1.0113, 1.0158, 1.017, 1.021, 1.0196, 1.0235, 1.0237, 1.0257, 1.031, 1.0316, 1.035, 1.0351, 1.0387, 1.0381, 1.0348, 1.0321, 1.032, 1.0314, 1.0306, 1.0295, 1.0281, 1.0257, 1.0147, ], true, ); const topShift = track( 187, [ 144.7, 93.2, 59.9, 39.2, 26, 17, 10.6, 8, 4.7, 2.8, 2.9, 2.6, 0, 0, 0.7, 0.7, 0.4, 0.4, 1.1, -0.2, 0.7, 0.3, 0.9, 0, -0.4, 0.2, 0.4, 0.5, -0.2, 0.4, 0.5, 0.5, 0.4, 0.2, 1.1, 0.9, 0.8, 1.2, 0.7, ], true, ); const bottomScale = track( 187, [ 0.6358, 0.7135, 0.772, 0.8173, 0.8528, 0.886, 0.9115, 0.9353, 0.9516, 0.9645, 0.9771, 0.9861, 0.9946, 1.0029, 1.0068, 1.0113, 1.0172, 1.0158, 1.0199, 1.024, 1.0255, 1.0235, 1.0267, 1.0287, 1.0281, 1.0287, 1.0323, 1.0327, 1.0314, 1.0288, 1.0307, 1.0305, 1.0305, 1.0299, 1.0314, 1.0304, 1.031, 1.0265, 1.026, ], true, ); const bottomShift = track( 187, [ -1.2, -8.6, -11.9, -9.3, -7.7, -4.1, -3.8, -2.6, 0.2, -0.8, 1.1, 1.4, 1.5, 2, 1.3, 3.3, 3.1, 3.1, 3.9, 4.2, 3.9, 3.3, 3.1, 4, 3.5, 3.8, 4.5, 4.3, 4, 3.7, 3.5, 3.1, 3.1, 3.3, 3.6, 3.7, 4.1, 4.8, 4.9, ], true, ); // The flat white tile that arrives from Section 3 and becomes the icon. const tileX = track(179, [1047.4, 1068, 1070, 1064.4, 1056.1, 1046.9, 1037, 1028]); const tileY = track(179, [567, 578.1, 579.9, 579.7, 575.7, 571.1, 563, 556]); const tileSide = track(179, [255, 308, 348, 372, 392, 407, 415, 420]); const tileAngle = track(179, [-21.7, -15.7, -10.9, -7.6, -4.7, -2.7, -1.5, -0.5]); const tileGray = track(179, [255, 255, 255, 255, 255, 255, 198, 186]); const mascotOpacity = track(185, [0, 0.34, 1]); // It goes from solid dark to frosted glass; the alpha lets the wallpaper through. const mascotFill = track(220, [INK, 84, 148, 178, 206, 236, 255]); const mascotAlpha = track(220, [1, 1, 0.85, 0.75, 0.6, 0.5, 0.45]); const faceX = track(186, [ 992, 988.9, 986.4, 985.2, 985.8, 987.5, 989.6, 992.6, 994.6, 995.8, 996, 995.7, 996.4, 996, 996.2, 995.3, 994.5, 994.4, 995.1, 996.2, 995.5, 997.1, 996.8, 997.8, 997.9, 998.6, 998.3, 996.8, 999.1, 1006.9, 1018.6, 1030.8, 1045.7, 1065.8, 1086.4, 1102.6, 1113, 1119.5, ]); const faceY = track(186, [ 628, 645.6, 661.6, 660.8, 661.6, 661.2, 660.8, 663.5, 665.2, 667.6, 666.1, 666.6, 665.4, 663.8, 663.2, 662.4, 661.6, 662.8, 661.8, 661.1, 662.6, 662, 661.9, 661.6, 663.3, 661.2, 663.1, 665.5, 664.2, 662.3, 656, 646.5, 634.2, 620.5, 606.3, 594.7, 587, 582.5, ]); const faceR = track(186, [ 168, 178.4, 188.1, 198.9, 207.9, 211.2, 212.7, 214.1, 211.9, 209.7, 208, 206.5, 205.3, 203.7, 203.1, 202.3, 201.5, 200.6, 199.8, 199, 198.5, 197.9, 197.8, 196.2, 197.2, 197.2, 201, 207.7, 210, 202.1, 182.7, 160.3, 142.3, 130.8, 125.6, 123.9, 124, 121.5, ]); const faceAngle = track(186, [-100, -76.7, -58, -50.1, -46.5, -45.1, -44.2, -44.1, -43.9, -43.7, -43.6]); const faceOpacity = track(221, [1, 0.8, 0.4, 0]); // The badge, 179-229: the send circle, the red "3", then a pink capsule whitening into the pill. const badgeX = track(179, [ 1656.9, 1691.4, 1674.4, 1607.8, 1521.8, 1400, 1260, 1228, 1210, 1198.5, 1190.5, 1187.5, 1187.5, 1189.5, 1191.5, 1191.5, 1193, 1193, 1191, 1188, 1185.5, 1183.5, 1181.5, 1179.5, 1177.5, 1178.5, 1178.5, 1178, 1179.5, 1180.5, 1180.5, 1182.5, 1183.5, 1188.5, 1195.5, 1205.5, 1216, 1225, 1235, 1243.5, 1250, 1261.5, 1295.5, 1332, 1357.6, 1358.5, 1351.3, 1338, 1320.9, 1281.7, 1220.7, ]); const badgeY = track(179, [ 472.3, 429.6, 387.7, 335.4, 267.8, 232, 300, 368, 391.5, 409.5, 419.5, 422, 419, 414, 409.5, 405.5, 402, 401.5, 402, 406.5, 411, 414.5, 418, 420, 422, 423.5, 423, 422.5, 421, 421.5, 418.5, 416, 412.5, 407.5, 399, 389.5, 378, 368.5, 359, 350.5, 343.5, 331, 295.5, 256, 243.8, 244.5, 248.6, 272, 302.2, 348, 422, ]); // Length along its axis and height; equal until it starts to stretch at 225. const badgeL = track(179, [ 130, 155, 152, 125, 96, 90, 105, 125, 140, 131, 129, 127, 123, 123, 124, 120, 119, 119, 115, 117, 116, 116, 116, 116, 116, 114, 114, 113, 110, 110, 110, 110, 112, 116, 118, 124, 131, 135, 139, 146, 149, 148, 150, 150, 150, 150, 190, 228, 268, 323, 418, ]); const badgeH = track(224, [147, 135, 125, 114, 116, 121]); const badgeAngle = track(224, [-23, -20.2, -18, -16.3, -10.1, -4.9]); const entryR = track(182, [255, 255, 245, 235, 228, 220]); const entryG = track(182, [255, 230, 150, 120, 90, 66]); const entryB = track(182, [255, 232, 160, 128, 95, 66]); const exitR = track(220, [220, 225, 232, 235, 235, 236, 240, 247, 246, 243]); const exitG = track(220, [66, 92, 130, 145, 158, 185, 220, 246, 247, 247]); const exitB = track(220, [66, 97, 140, 155, 168, 192, 225, 251, 251, 251]); const badgeColor = (frame: number) => { const read = frame < 200 ? [entryR, entryG, entryB] : [exitR, exitG, exitB]; return `rgb(${read.map((c) => Math.round(c(frame))).join(",")})`; }; const digitIn = track(184, [0, 0.5, 0.8, 1]); const digitOut = track(221, [1, 0.85, 1, 0.7, 0]); const digitSpin = track(184, [50, 30, 12, 0]); // The wash toward Section 5's background, and the focus falling off under it. const washOpacity = track(222, [0, 0.03, 0.1, 0.21, 0.27, 0.36, 0.43, 0.5, 0.62, 0.8, 0.95, 1]); // Under the wash the icons dissolve into the wallpaper, the frosted tile first. const iconsDissolve = track(225, [1, 0.92, 0.7, 0.5, 0.35, 0.25, 0.15, 0.05, 0]); const mascotDissolve = track(225, [1, 0.9, 0.5, 0.15, 0]); const washBlur = track(225, [0, 1.5, 3.5, 6, 8, 10, 12, 14]); const ICON_RADIUS = 0.225; const Squircle: React.FC<{ x: number; y: number; w: number; fill: string; children?: React.ReactNode; clip?: string }> = ({ x, y, w, fill, children, }) => ( <g style={{ filter: "drop-shadow(0 5px 14px rgba(0,0,0,0.16))" }}> <rect x={x} y={y} width={w} height={w} rx={w * ICON_RADIUS} fill={fill} /> {children} </g> ); const Gradients: React.FC = () => ( <defs> {( [ ["grok-g-weather", "#519CF1", "#2A62D7"], ["grok-g-sun", "#FCE77A", "#EFB63A"], ["grok-g-cloud", "#FFFFFF", "#DCE6F4"], ["grok-g-mail", "#79CDFF", "#1E78EE"], ["grok-g-letter", "#FFFFFF", "#E2ECF9"], ["grok-g-msg", "#96F893", "#39DA54"], ["grok-g-black", "#333338", "#000000"], ["grok-g-notes", "#FBDB72", "#F2C049"], ] as const ).map(([id, a, b]) => ( <linearGradient key={id} id={id} x1="0" x2="0" y1="0" y2="1"> <stop offset="0" stopColor={a} /> <stop offset="1" stopColor={b} /> </linearGradient> ))} <clipPath id="grok-clip-maps"> <rect x={336} y={857} width={348} height={348} rx={348 * ICON_RADIUS} /> </clipPath> <clipPath id="grok-clip-notes"> <rect x={1368} y={858} width={337} height={337} rx={337 * ICON_RADIUS} /> </clipPath> </defs> ); // Everything except the mascot, in frame-200 coordinates. const Neighbours: React.FC<{ frame: number }> = ({ frame }) => { const place = (x: number, y: number, scale: number, shift: number) => `translate(${x} ${y + shift}) scale(${Math.max(scale, 0.3)}) translate(${-x} ${-y})`; const top = (x: number) => place(x, 123, topScale(frame), topShift(frame)); const bottom = (x: number) => place(x, 1031, bottomScale(frame), bottomShift(frame)); return ( <> <g transform={top(510)}> <Squircle x={336} y={-51} w={348} fill="#fff"> <text x={510} y={56} fontSize={55} fontWeight={700} fill="#E8344A" textAnchor="middle"> SUN </text> <text x={512} y={228} fontSize={178} fontWeight={300} fill="#1C1C1E" textAnchor="middle"> 25 </text> </Squircle> </g> <g transform={top(1023.5)}> <Squircle x={850} y={-51} w={347} fill="url(#grok-g-weather)"> <circle cx={988} cy={90} r={63} fill="url(#grok-g-sun)" /> <path d={CLOUD} fill="url(#grok-g-cloud)" transform="translate(904.8 52) scale(4.24 3.43)" /> </Squircle> </g> <g transform={top(1536)}> <Squircle x={1362} y={-51} w={348} fill="url(#grok-g-black)"> <g transform="translate(1410 0) scale(0.249)" fill="#fff"> {GROK_DARK.map((d) => ( <path key={d} d={d} /> ))} </g> </Squircle> </g> <Squircle x={331} y={399} w={358} fill="url(#grok-g-mail)"> <rect x={395} y={503} width={230} height={157} rx={18} fill="url(#grok-g-letter)" /> <path d="M397 508L510 598L623 508" fill="none" stroke="#A8C8EE" strokeWidth={9} /> </Squircle> <Squircle x={1357} y={399} w={359} fill="url(#grok-g-msg)"> <ellipse cx={1536} cy={567} rx={122} ry={90} fill="#fff" /> <path d="M1458 632L1443 675C1460 672 1480 660 1492 652Z" fill="#fff" /> </Squircle> <g transform={bottom(510)} style={{ filter: "drop-shadow(0 5px 14px rgba(0,0,0,0.16))" }}> <g clipPath="url(#grok-clip-maps)"> <rect x={336} y={857} width={348} height={348} fill="#E8F2E0" /> <circle cx={650} cy={868} r={102} fill="#AEDCF1" /> <path d="M451 840L482 1220" stroke="#fff" strokeWidth={36} /> <path d="M320 1105L700 985" stroke="#fff" strokeWidth={34} /> <path d="M320 1105L700 985" stroke="#F2CB4E" strokeWidth={17} /> </g> <circle cx={583} cy={947} r={17} fill="#fff" /> <path d={PLACEMARK} fill="#EE3B4A" transform="translate(508.85 891.4) scale(2.65)" /> </g> <g transform={bottom(1023.5)}> <Squircle x={850} y={857} w={347} fill="url(#grok-g-black)"> <path d={X_LOGO} fill="#fff" stroke="#fff" strokeWidth={14} transform="translate(934 950) scale(0.1467 0.132)" /> </Squircle> </g> <g transform={bottom(1536.5)} style={{ filter: "drop-shadow(0 5px 14px rgba(0,0,0,0.16))" }}> <g clipPath="url(#grok-clip-notes)"> <rect x={1368} y={858} width={337} height={337} fill="#fff" /> <rect x={1368} y={858} width={337} height={95} fill="url(#grok-g-notes)" /> {[1009, 1056, 1103, 1150].map((y) => ( <rect key={y} x={1402} y={y - 2} width={270} height={4} fill="#CFCFCF" /> ))} </g> </g> </> ); }; // Also drawn by Section 5 under its first frames, while the screen is still dissolving. export const HomeScene: React.FC<{ frame: number; sample: number }> = ({ frame, sample }) => { const s = cameraS(frame); const cx = cameraX(frame); const cy = cameraY(frame); const wall = wallS(frame); const wallLeft = wallX(frame) - (WALL_WIDTH / 2) * wall; const wallTop = wallY(frame) - (WALL_HEIGHT / 2) * wall; const showNeighbours = frame >= 184.5; const showMascot = frame >= 185.5; const showTile = frame < 186.5; const r = faceR(frame); const mascotClip = `grok-mascot-${sample}`; const mascotLeft = cx + s * (844 - 1023); const mascotTop = cy + s * (398 - 578); const mascotSize = 358 * s; const side = tileSide(frame); const blur = washBlur(frame); const entering = iconsBlur(frame); const length = badgeL(frame); const height = frame < 224 ? length : badgeH(frame); const angle = frame < 224 ? 0 : badgeAngle(frame); const digit = digitIn(frame) * digitOut(frame); return ( <AbsoluteFill style={{ backgroundColor: "#000", overflow: "hidden" }}> <AbsoluteFill style={blur > 0 ? { filter: `blur(${blur}px)` } : undefined}> <Img src={staticFile("grok-bot/wallpaper.png")} style={{ position: "absolute", left: wallLeft, top: wallTop, width: WALL_WIDTH * wall, height: WALL_HEIGHT * wall, opacity: wallGain(frame), maxWidth: "none", }} /> <svg width="100%" height="100%" viewBox="0 0 2048 1152" style={{ position: "absolute", inset: 0, fontFamily: INTER }} > <Gradients /> <clipPath id={mascotClip}> <rect x={mascotLeft} y={mascotTop} width={mascotSize} height={mascotSize} rx={mascotSize * ICON_RADIUS} /> </clipPath> {showNeighbours ? ( <g opacity={iconsOpacity(frame) * iconsDissolve(frame)} style={entering > 0 ? { filter: `blur(${entering}px)` } : undefined} > <g transform={`translate(${cx - 1023 * s} ${cy - 578 * s}) scale(${s})`}> <Neighbours frame={frame} /> </g> </g> ) : null} {showTile ? ( <rect x={-side / 2} y={-side / 2} width={side} height={side} rx={side * ICON_RADIUS} fill={gray(tileGray(frame))} transform={`translate(${tileX(frame)} ${tileY(frame)}) rotate(${tileAngle(frame)})`} /> ) : null} {showMascot ? ( <g opacity={mascotOpacity(frame) * mascotDissolve(frame)} clipPath={`url(#${mascotClip})`}> <rect x={mascotLeft} y={mascotTop} width={mascotSize} height={mascotSize} fill={gray(mascotFill(frame))} opacity={mascotAlpha(frame)} /> {faceOpacity(frame) > 0 ? ( <g opacity={faceOpacity(frame)}> <circle cx={faceX(frame)} cy={faceY(frame)} r={r} fill="#fff" /> <Marks cx={faceX(frame)} cy={faceY(frame)} r={r} theta={faceAngle(frame)} fill={gray(INK)} /> </g> ) : null} </g> ) : null} </svg> </AbsoluteFill> <AbsoluteFill style={{ opacity: washOpacity(frame) }}> <Background frame={frame} /> </AbsoluteFill> {frame >= 229.5 ? null : ( <svg width="100%" height="100%" viewBox="0 0 2048 1152" style={{ position: "absolute", inset: 0, fontFamily: INTER }} > <g transform={`translate(${badgeX(frame)} ${badgeY(frame)}) rotate(${angle})`}> <rect x={-length / 2} y={-height / 2} width={length} height={height} rx={height / 2} fill={badgeColor(frame)} /> {digit > 0 ? ( <text y={26.5 * (length / 116)} fontSize={73 * (length / 116)} fontWeight={600} fill="#fff" textAnchor="middle" opacity={digit} transform={`rotate(${digitSpin(frame)})`} > 3 </text> ) : null} </g> </svg> )} </AbsoluteFill> ); }; export const HomeScreen: React.FC = () => { const ready = useInter(); if (!ready) return null; return <MotionBlur render={(frame, sample) => <HomeScene frame={frame + HOME_FROM} sample={sample} />} />; }; const CLOUD = "M12.262 45.52h29.086c7.43 0 13.172-5.626 13.172-12.82c0-7.29-6-12.75-13.946-12.68c-3-6.047-8.507-9.54-15-9.54c-8.648 0-15.937 6.82-16.617 15.563c-4.547 1.242-7.477 5.063-7.477 9.68c0 5.812 4.36 9.797 10.782 9.797";›engine/src/grok-bot/Background.tsx
engine/src/grok-bot/Background.tsx import React from "react"; import { AbsoluteFill } from "remotion"; import { track } from "./track"; import { BG_PHASE } from "./writeSolveTracks"; // Section 5's sky: a two-lobed blue and white conic gradient that swings back and forth. // It is drawn on a square stretched to the frame, so its lobes follow the frame's corners, // and softened toward a flat tint at the centre. const phase = track(230, BG_PHASE); const BLUE = "rgb(187,220,254)"; const WHITE = "rgb(255,255,255)"; const TINT = "221,237,254"; const WIDTH = 2048; const HEIGHT = 1152; export const Background: React.FC<{ frame: number }> = ({ frame }) => ( <AbsoluteFill style={{ overflow: "hidden" }}> <div style={{ position: "absolute", left: (WIDTH - HEIGHT) / 2, top: 0, width: HEIGHT, height: HEIGHT, transform: `scaleX(${WIDTH / HEIGHT})`, background: `conic-gradient(from ${phase(frame) + 90}deg at 50% 50%, ${BLUE} 0deg, ${WHITE} 90deg, ${BLUE} 180deg, ${WHITE} 270deg, ${BLUE} 360deg)`, }} /> <AbsoluteFill style={{ background: `radial-gradient(ellipse farthest-corner at 50% 50%, rgba(${TINT},0.95) 0%, rgba(${TINT},0.45) 57%, rgba(${TINT},0) 92%)`, }} /> </AbsoluteFill> );›engine/src/grok-bot/writeSolveTracks.ts
engine/src/grok-bot/writeSolveTracks.ts // Generated from per-frame measurements of the reference; see WriteCreateSolve.tsx. export const BG_PHASE = [50, 50, 50, 50, 49, 48, 48, 48, 47, 47, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 47, 47, 47, 46, 44, 42, 40, 39, 35, 31, 25, 19, 12, 4, -4, -12, -19, -24, -30, -34, -36, -39, -41, -43, -44, -45, -46, -47, -47, -47, -47, -46, -45, -44, -41, -39, -35, -32, -26, -21, -14, -7, 1, 9, 16, 22, 27, 31, 35, 38, 40, 41, 43, 44, 45, 46, 46, 46, 48, 47, 47, 47]; // 230-313 export const PILL_WRITE = { first: 230, l: [728, 614, 569, 573, 576, 580, 581, 582, 580, 576, 573, 568, 565, 564, 560, 560, 558, 558, 556, 556, 556, 556, 556, 555, 554, 550, 553, 553], r: [1420, 1418, 1459, 1465, 1470, 1472, 1472, 1473, 1472, 1471, 1468, 1467, 1466, 1466, 1466, 1466, 1466, 1467, 1468, 1470, 1472, 1474, 1474, 1476, 1477, 1478, 1475, 1474], t: [436, 500, 500, 483, 474, 468, 466, 466, 467, 470, 474, 478, 480, 480, 480, 480, 480, 478, 478, 476, 474, 474, 472, 472, 472, 470, 470, 496], b: [644, 695, 699, 683, 675, 669, 666, 666, 668, 669, 675, 679, 684, 683, 685, 684, 684, 685, 683, 683, 681, 681, 681, 681, 681, 681, 681, 707] }; export const PILL_CREATE = { first: 256, l: [548, 548, 545, 546, 544, 544, 541, 541, 540, 539, 537, 536, 534, 532, 529, 527, 527, 525, 525, 525, 525, 524, 524, 524, 522, 522, 520, 520, 520, 520], r: [1480, 1485, 1491, 1489, 1490, 1492, 1492, 1494, 1494, 1495, 1496, 1497, 1500, 1503, 1505, 1509, 1511, 1513, 1515, 1515, 1514, 1516, 1516, 1518, 1518, 1520, 1520, 1519, 1519, 1519], t: [405, 436, 476, 482, 487, 490, 490, 488, 480, 470, 462, 456, 450, 447, 447, 448, 451, 454, 456, 459, 460, 463, 462, 462, 462, 461, 456, 456, 515, 540], b: [610, 639, 688, 695, 700, 705, 706, 702, 694, 685, 678, 672, 669, 665, 667, 670, 672, 677, 679, 682, 686, 686, 688, 688, 688, 686, 684, 683, 738, 765] }; export const PILL_SOLVE = { first: 283, l: [518, 516, 512, 511, 507, 507, 507, 505, 505, 505, 505, 506, 503, 503, 501, 501, 499, 499, 501, 501, 501, 501, 501, 501, 500, 499, 499, 504, 522, 592], r: [1520, 1520, 1524, 1528, 1527, 1526, 1526, 1527, 1526, 1527, 1528, 1528, 1528, 1531, 1529, 1529, 1529, 1531, 1531, 1531, 1531, 1531, 1531, 1531, 1531, 1531, 1531, 1526, 1505, 1440], t: [370, 390, 430, 478, 494, 496, 498, 499, 499, 498, 496, 491, 488, 484, 482, 480, 482, 483, 484, 484, 486, 488, 488, 488, 488, 488, 490, 492, 534, 641], b: [590, 611, 656, 698, 724, 726, 728, 730, 730, 730, 726, 723, 720, 716, 715, 714, 714, 716, 716, 718, 719, 720, 722, 722, 722, 722, 722, 724, 742, 808] }; export const ORB_TEAL = { first: 238, x: [1474.5, 1474.5, 1474.5, 1486, 1495, 1502.5, 1507, 1510.5, 1514.5, 1518.5, 1520, 1522.5, 1524, 1526.5, 1527, 1529.5, 1529.5, 1530, 1489.5, 1499], y: [385.5, 385.5, 385.5, 381.5, 379.5, 379.5, 379.5, 387, 397.5, 399.5, 399.5, 398, 397.5, 397, 395.5, 395.5, 395.5, 395.5, 511.5, 506], w: [92, 92, 92, 109, 119, 128, 131, 134, 134, 130, 129, 126, 125, 124, 121, 120, 120, 119, 12, 25], h: [90, 90, 90, 106, 118, 126, 130, 137, 134, 130, 128, 125, 124, 123, 120, 120, 120, 118, 16, 27], o: [0, 0, 0.48, 0.99, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.98, 0.57, 0.08, 0.02, 0.03] }; export const ORB_INDIGO = { first: 240, x: [471, 471, 460, 451.5, 445.5, 442, 436.5, 432.5, 428.5, 425, 420, 415.5, 409, 404, 400, 398, 544, 544.5], y: [741, 741, 748, 753, 754.5, 753.5, 754.5, 758.5, 761, 763, 765, 766.5, 770, 773.5, 775.5, 778, 669, 673.5], w: [91, 91, 111, 126, 136, 141, 142, 140, 138, 135, 133, 130, 129, 129, 129, 129, 31, 30], h: [91, 91, 109, 127, 136, 142, 144, 144, 143, 139, 137, 136, 133, 132, 132, 129, 59, 68], o: [0, 0.41, 0.96, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85, 0.36, 0.05, 0.06] }; export const ORB_BLUE = { first: 263, x: [1504, 1504, 1597, 1620.5, 1629.5, 1631.5, 1634, 1641.5, 1650.5, 1658.5, 1663, 1668, 1671.5, 1676, 1681.5, 1512.5, 1513], y: [695, 695, 767.5, 790.5, 803, 809, 811.5, 813.5, 813.5, 815.5, 818.5, 824, 827, 830, 832, 704, 704.5], w: [9, 9, 99, 116, 120, 126, 129, 132, 134, 128, 127, 123, 122, 121, 118, 26, 27], h: [11, 11, 92, 116, 121, 127, 130, 130, 130, 128, 126, 123, 121, 121, 119, 29, 30], o: [0.1, 0, 0.72, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.97, 0.54, 0.03, 0.03] }; export const ORB_VIOLET = { first: 266, x: [457, 457, 443.5, 431.5, 420, 410, 399, 392, 386, 380.5, 376, 373, 369.5, 363.5, 522, 524.5], y: [448, 448, 432, 421, 414, 403, 398, 393.5, 389, 386, 383.5, 379.5, 377.5, 371.5, 520.5, 517], w: [77, 77, 98, 110, 117, 121, 121, 119, 117, 116, 113, 113, 110, 88, 21, 26], h: [79, 79, 99, 107, 115, 117, 121, 118, 117, 113, 112, 110, 108, 92, 18, 25], o: [0, 0.59, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89, 0.4, 0.01, 0.01] }; export const ORB_VIOLET2 = { first: 291, x: [1576, 1576, 1576, 1567.5, 1567.5, 1571.5, 1575.5, 1577.5, 1579.5, 1581.5, 1583, 1583.5, 1585.5, 1585.5, 1587.5, 1587.5, 1587.5], y: [435, 435, 435, 421.5, 413.5, 408, 403.5, 401.5, 401.5, 399.5, 397.5, 395.5, 395, 393.5, 393.5, 393.5, 393.5], w: [91, 91, 91, 108, 118, 126, 130, 130, 130, 128, 125, 122, 120, 120, 118, 118, 118], h: [91, 91, 91, 106, 118, 125, 130, 130, 130, 128, 124, 122, 121, 120, 118, 118, 118], o: [0, 0, 0.74, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.98, 0.56, 0, 0] }; export const ORB_ORANGE = { first: 295, x: [401.5, 401.5, 385.5, 375.5, 369, 363, 358, 354, 351.5, 349.5, 348, 347.5, 347.5], y: [459.5, 459.5, 450.5, 445, 441, 436.5, 434, 431.5, 429.5, 428, 427.5, 428, 428], w: [84, 84, 104, 116, 125, 129, 131, 131, 128, 126, 125, 122, 122], h: [84, 84, 104, 117, 125, 130, 131, 130, 128, 127, 124, 121, 121], o: [0, 0.52, 0.99, 1, 1, 1, 1, 1, 1, 1, 0.99, 0.63, 0] };›engine/src/grok-bot/LogoLockup.tsx
engine/src/grok-bot/LogoLockup.tsx // Section 6 (reference frames 313-364): the black ball drops in on white, bounces, and rolls // left to make room as "Grok Bot" slides in. The letters arrive light gray, then a wave turns // them black while the vignette closes in. A white glint sweeps right to left over the // whole lockup and the ball's highlights give one last wobble. import React from "react"; import { AbsoluteFill } from "remotion"; import { INTER, textWidth, useInter } from "./fonts"; import { MotionBlur } from "./MotionBlur"; import { Marks } from "./SphereBirth"; import { gray, track } from "./track"; import { WriteScene } from "./WriteCreateSolve"; export const LOGO_FROM = 313; export const LOGO_FRAMES = 52; // 313-364, the end of the video const INK = "#0B0B0B"; const ballX = track(313, [ 1028, 1028, 1028, 1027.5, 1017, 1016.5, 1016, 1016.5, 1016.5, 1016.5, 1015, 997.5, 865.5, 750.5, 636, 513.5, 483.5, 469.5, 465.5, 465.5, 473.5, 487.5, 499.5, 510.5, 520, 527.5, 531, 534.5, 534, 533.5, 531.5, 531, 530.5, 532, 531.5, 533, 534, 537, 539, 539.5, 543.5, 545, 545, 547, 546.5, 548.5, 550.5, 550, 549.5, 549.5, 551, 551, ]); const ballY = track(313, [ -20, 140, 420, 578, 623, 649.5, 660, 652.5, 638.5, 616.5, 593, 575.5, 573.5, 573, 572, 573.5, 573.5, 573.5, 573.5, 573.5, 573.5, 573.5, 573.5, 574.5, 574, 573.5, 575, 574.5, 576, 575.5, 575.5, 577, 576.5, 576, 575.5, 577, 576.5, 577, 578, 577.5, 577.5, 577, 577, 577, 576.5, 576.5, 578.5, 578, 577.5, 577.5, 577, 577, ]); const ballD = track(313, [ 150, 160, 168, 180, 207, 230, 245, 246, 246, 246, 243, 240, 244, 242, 241, 240, 240, 240, 240, 240, 240, 240, 240, 238, 237, 236, 235, 234, 233, 232, 232, 231, 230, 229, 228, 227, 226, 225, 225, 224, 224, 223, 223, 223, 222, 222, 222, 221, 220, 220, 219, 219, ]); const ballAngle = track(313, [ 250, 225, 200, 175, 147, 120.9, 95.5, 70.2, 45.5, 20.6, 2.7, -7.5, -14.6, -21.2, -26.1, -31.5, -34.3, -36.8, -38.1, -39.2, -40.3, -40.8, -41.4, -41.8, -42.3, -42.7, -43.1, -43.5, -43.5, -43.4, -43.9, -43.8, -43.8, -43.8, -43.7, -43.6, -43.6, -43.6, -43.6, -43, -41.5, -39.7, -38.7, -38.2, -37.8, -38.4, -39.4, -40.6, -42.1, -43.7, -43.6, -43.7, ]); const ballOpacity = track(313, [0.45, 1]); // The wordmark's left edge, from when it enters. const textLeft = track(328, [ 933, 857, 789, 731, 697, 688, 684, 684, 689, 696, 706, 716, 722, 727, 731, 733, 733, 730, 728, 726, 725, 724, 723, 722, 723, 725, 728, 729, 731, 732, 733, 733, 733, 733, 733, 733, 733, ]); const WORD = "Grok Bot"; const WORD_SIZE = 224; const WORD_WEIGHT = 520; const WORD_WIDTH = 889; const BASELINE = 658; const SIDE_BEARING = 11; // G's left edge sits this far inside its advance // Each letter fades up to gray, then turns black in a wave that follows it. const GRAY_FROM = 327.3; const GRAY_STAGGER = 1.25; const BLACK_FROM = 332.6; const BLACK_STAGGER = 0.7; const letterOpacity = (frame: number, i: number) => Math.min(1, Math.max(0, (frame - (GRAY_FROM + GRAY_STAGGER * i)) / 2)); const letterGray = (frame: number, i: number) => { const t = Math.min(1, Math.max(0, (frame - (BLACK_FROM + BLACK_STAGGER * i)) / 3)); return 190 + (11 - 190) * t; }; // The glint: a pale band moving right to left, painted only on the lockup. const glintX = track(342, [1568, 1444, 1320, 1174, 1028, 910, 792, 670, 548, 424, 300]); const GLINT_FROM = 341.5; const GLINT_TO = 351.5; const GLINT_HALF = 86; // The vignette grows from nothing to full strength (keys every third frame from 316), in // true circles around the frame's centre. const vignetteKey = track(0, [0.028, 0.125, 0.264, 0.319, 0.403, 0.486, 0.569, 0.653, 0.75, 0.861, 0.931, 0.972, 1]); const vignette = (frame: number) => (frame < 316 ? 0 : vignetteKey((frame - 316) / 3)); const VIGNETTE_STOPS = [ [0, 0], [15, 0.008], [20, 0.016], [30, 0.035], [40, 0.063], [50, 0.102], [60, 0.142], [70, 0.189], [80, 0.236], [90, 0.283], [100, 0.331], ]; const Scene: React.FC<{ frame: number; sample: number }> = ({ frame, sample }) => { const whole = Math.round(frame); const stillBehind = frame < 313.5; // The original has no shutter on the sideways slides, so they read crisp. const sliding = whole >= 324 && whole <= 329; const cx = sliding ? ballX(whole) : ballX(frame); const cy = ballY(frame); const r = ballD(frame) / 2; const left = whole < 334 ? textLeft(whole) : textLeft(frame); const originX = left - SIDE_BEARING; const fit = WORD_WIDTH / textWidth(WORD, WORD_SIZE, WORD_WEIGHT); const glinting = frame >= GLINT_FROM && frame < GLINT_TO; const glintId = `grok-glint-${sample}`; const paint = (solid: string) => (glinting ? `url(#${glintId})` : solid); return ( <AbsoluteFill style={{ backgroundColor: "#FEFEFE", overflow: "hidden" }}> {stillBehind ? ( <> <WriteScene frame={frame} sample={sample} /> <AbsoluteFill style={{ backgroundColor: "rgba(255,255,255,0.6)" }} /> </> ) : null} <AbsoluteFill style={{ opacity: vignette(frame), background: `radial-gradient(circle farthest-corner at 50% 50%, ${VIGNETTE_STOPS.map( ([stop, a]) => `rgba(0,0,0,${a}) ${stop}%`, ).join(", ")})`, }} /> <svg width="100%" height="100%" viewBox="0 0 2048 1152" style={{ position: "absolute", inset: 0, fontFamily: INTER }} > {glinting ? ( <defs> <linearGradient id={glintId} gradientUnits="userSpaceOnUse" x1={glintX(frame) - GLINT_HALF} x2={glintX(frame) + GLINT_HALF} y1={0} y2={0} > <stop offset="0" stopColor={INK} /> <stop offset="0.5" stopColor="#E2E2E2" /> <stop offset="1" stopColor={INK} /> </linearGradient> </defs> ) : null} <g opacity={ballOpacity(frame)}> <circle cx={cx} cy={cy} r={r} fill={paint(INK)} /> <Marks cx={cx} cy={cy} r={r} theta={ballAngle(frame)} fill="#fff" /> </g> {frame >= GRAY_FROM ? WORD.split("").map((letter, i) => { const opacity = letterOpacity(frame, i); if (letter === " " || opacity <= 0) return null; return ( <text key={i} x={originX + textWidth(WORD.slice(0, i), WORD_SIZE, WORD_WEIGHT) * fit} y={BASELINE} fontSize={WORD_SIZE} fontWeight={WORD_WEIGHT} fill={paint(gray(letterGray(frame, i)))} opacity={opacity} > {letter} </text> ); }) : null} </svg> </AbsoluteFill> ); }; export const LogoLockup: React.FC = () => { const ready = useInter(); if (!ready) return null; return <MotionBlur render={(frame, sample) => <Scene frame={frame + LOGO_FROM} sample={sample} />} />; };›engine/src/grok-bot/WriteCreateSolve.tsx
engine/src/grok-bot/WriteCreateSolve.tsx // Section 5 (reference frames 230-312): the badge's pill spells "Write", then a new pill // slams down on top for "Create" and again for "Solve", each leaving a sliver of the last // one under it. Small glossy orbs pop in beside each word. At the end the stack fans out // downward and the pills fall away, blurring. // // Per-frame tracks are in writeSolveTracks.ts, generated from the reference. import React from "react"; import { AbsoluteFill } from "remotion"; import { Letters } from "./AppStorePage"; import { Background } from "./Background"; import { INTER, useInter } from "./fonts"; import { HomeScene } from "./HomeScreen"; import { MotionBlur } from "./MotionBlur"; import { track } from "./track"; import { ORB_BLUE, ORB_INDIGO, ORB_ORANGE, ORB_TEAL, ORB_VIOLET, ORB_VIOLET2, PILL_CREATE, PILL_SOLVE, PILL_WRITE, } from "./writeSolveTracks"; export const WRITE_FROM = 230; export const WRITE_FRAMES = 83; // 230-312; at 313 the white flash for the logo begins type Box = { first: number; l: readonly number[]; r: readonly number[]; t: readonly number[]; b: readonly number[] }; const boxTracks = (box: Box) => ({ l: track(box.first, box.l), r: track(box.first, box.r), t: track(box.first, box.t), b: track(box.first, box.b), }); const WRITE = { box: boxTracks(PILL_WRITE), word: "Write", start: 233, stagger: 1.6, width: 274, size: 116 }; const CREATE = { box: boxTracks(PILL_CREATE), word: "Create", start: 258, stagger: 1.6, width: 376, size: 120 }; const SOLVE = { box: boxTracks(PILL_SOLVE), word: "Solve", start: 285, stagger: 1.25, width: 320, size: 124 }; // While a pill is being covered its word is dimmed. const COVERED_TEXT = 0.55; const SETTLED = 1000; // a frame number by which every letter has long landed // Slivers of the earlier pills, as (offset below the top pill, tilt). const SLIVER_TWO = { drop: 25, angle: -0.78, top: "#CFD4E0", bottom: "#C2C9D8" }; const SLIVER_THREE = { drop: 47, angle: -1.6, top: "#B9C4D6", bottom: "#ABB8CE" }; // The stack fanning out, by the falling pill's centre y. const fanWrite = track(308, [705, 843, 1056, 1290]); const fanCreate = track(309, [625, 779, 933, 1061]); const pillsBlur = track(310, [0, 2, 4]); // Glossy orbs. type Orb = { x: (f: number) => number; y: (f: number) => number; w: (f: number) => number; h: (f: number) => number; o: (f: number) => number; from: number; to: number; fill: string; shape: "circle" | "pick" | "soft"; }; const orb = ( data: { first: number; x: number[]; y: number[]; w: number[]; h: number[]; o: number[] }, fill: string, shape: Orb["shape"], ): Orb => ({ x: track(data.first, data.x), y: track(data.first, data.y), w: track(data.first, data.w), h: track(data.first, data.h), o: track(data.first, data.o), from: data.first, to: data.first + data.x.length - 1, fill, shape, }); const ORBS = [ orb(ORB_TEAL, "#5CC5A6", "circle"), orb(ORB_INDIGO, "#655CE9", "pick"), orb(ORB_BLUE, "#4381F0", "circle"), orb(ORB_VIOLET, "#864EF1", "soft"), orb(ORB_VIOLET2, "#864EF1", "circle"), orb(ORB_ORANGE, "#E26932", "circle"), ]; // A rounded guitar-pick outline, in a unit box centred on the origin. const PICK = "M-.38-.46C-.2-.62.05-.42.42-.06C.58.1.42.22.2.34C-.05.48-.33.62-.47.42C-.52.34-.48 0-.46-.24C-.45-.35-.42-.42-.38-.46Z"; const OrbMark: React.FC<{ orb: Orb; frame: number }> = ({ orb: o, frame }) => { const w = o.w(frame); const h = o.h(frame); const r = w / 2; return ( <g transform={`translate(${o.x(frame)} ${o.y(frame)})`} opacity={o.o(frame)}> {o.shape === "circle" ? <circle r={r} fill={o.fill} /> : null} {o.shape === "soft" ? <rect x={-r} y={-h / 2} width={w} height={h} rx={r * 0.86} fill={o.fill} /> : null} {o.shape === "pick" ? <path d={PICK} fill={o.fill} transform={`scale(${w} ${h})`} /> : null} <g fill="rgba(255,255,255,0.82)"> <rect x={-r * 0.28} y={-r * 0.14} width={r * 0.56} height={r * 0.28} rx={r * 0.14} transform={`translate(${r * 0.11} ${-r * 0.34}) rotate(50)`} /> <rect x={-r * 0.24} y={-r * 0.07} width={r * 0.48} height={r * 0.14} rx={r * 0.07} transform={`translate(${r * 0.55} ${-r * 0.55}) rotate(50)`} /> </g> </g> ); }; // The words land blue and fall to black. const wordColor = (age: number) => { const t = Math.min(1, Math.max(0, (age - 7) / 3)); const mix = (a: number) => Math.round(a * (1 - t)); return `rgb(${mix(58)},${mix(151)},${mix(232)})`; }; const Pill: React.FC<{ frame: number; l: number; r: number; t: number; b: number; word: { word: string; start: number; stagger: number; width: number; size: number }; textOpacity?: number; settled?: boolean; }> = ({ frame, l, r, t, b, word, textOpacity = 1, settled = false }) => { const h = b - t; const cx = (l + r) / 2; const cy = (t + b) / 2; return ( <g> <rect x={l} y={t} width={r - l} height={h} rx={h / 2} fill="url(#grok-pill)" style={{ filter: "drop-shadow(0 22px 28px rgba(88,120,176,0.34))" }} /> <g opacity={textOpacity}> <Letters frame={settled ? SETTLED : frame} text={word.word} x={cx - word.width / 2} baseline={cy + h * 0.212} width={word.width} size={word.size} weight={600} start={word.start} stagger={word.stagger} color={wordColor} drop={1.4} /> </g> </g> ); }; const Sliver: React.FC<{ l: number; r: number; t: number; b: number; spec: typeof SLIVER_TWO; id: string; }> = ({ l, r, t, b, spec, id }) => { const h = b - t; const cx = (l + r) / 2; const cy = (t + b) / 2 + spec.drop; return ( <g transform={`rotate(${spec.angle} ${cx} ${cy})`} style={{ filter: "drop-shadow(0 18px 24px rgba(88,120,176,0.3))" }}> <defs> <linearGradient id={id} x1="0" x2="0" y1="0" y2="1"> <stop offset="0.6" stopColor={spec.top} /> <stop offset="1" stopColor={spec.bottom} /> </linearGradient> </defs> <rect x={l + 6} y={t + spec.drop} width={r - l - 12} height={h} rx={h / 2} fill={`url(#${id})`} /> </g> ); }; // Also drawn by Section 6 under its first frame. export const WriteScene: React.FC<{ frame: number; sample: number }> = ({ frame, sample }) => { const showHome = frame < 232.5; const write = { l: WRITE.box.l(frame), r: WRITE.box.r(frame), t: WRITE.box.t(frame), b: WRITE.box.b(frame) }; const create = { l: CREATE.box.l(frame), r: CREATE.box.r(frame), t: CREATE.box.t(frame), b: CREATE.box.b(frame) }; const solve = { l: SOLVE.box.l(frame), r: SOLVE.box.r(frame), t: SOLVE.box.t(frame), b: SOLVE.box.b(frame) }; const whole = Math.round(frame); const showWrite = frame < 257.5; const showCreate = frame >= 256 && frame < 285.5; const showSolve = frame >= 283; // The word being covered dims as the next pill arrives. const writeText = frame >= 256 ? COVERED_TEXT : 1; const createText = frame >= 283 ? COVERED_TEXT : 1; // Slivers follow whichever pill is on top. Each is hidden once the fan-out uses that pill. const top = frame >= 283 ? (frame >= 285.5 ? solve : create) : create; const oneSliver = whole >= 258 && frame < 309.5; const twoSlivers = frame >= 285.5 && frame < 307.5; const blur = pillsBlur(frame); const stackWidth = solve.r - solve.l; const stackCx = (solve.l + solve.r) / 2; const fanned = (cy: number, height: number) => ({ l: stackCx - stackWidth * 0.485, r: stackCx + stackWidth * 0.485, t: cy - height / 2, b: cy + height / 2, }); return ( <AbsoluteFill style={{ backgroundColor: "#000", overflow: "hidden" }}> {showHome ? <HomeScene frame={frame} sample={sample} /> : <Background frame={frame} />} <svg width="100%" height="100%" viewBox="0 0 2048 1152" style={{ position: "absolute", inset: 0, fontFamily: INTER }} > <defs> <linearGradient id="grok-pill" x1="0" x2="0" y1="0" y2="1"> <stop offset="0" stopColor="#FDFDFD" /> <stop offset="0.12" stopColor="#F7F7F7" /> <stop offset="0.55" stopColor="#EEEEEE" /> <stop offset="1" stopColor="#F9F9F9" /> </linearGradient> </defs> {ORBS.map((o, i) => frame >= o.from && frame <= o.to ? <OrbMark key={i} orb={o} frame={frame} /> : null, )} <g style={blur > 0 ? { filter: `blur(${blur}px)` } : undefined}> {frame >= 307.5 && frame < 311.5 ? ( <Pill frame={frame} {...fanned(fanWrite(frame), 212)} word={WRITE} settled /> ) : null} {frame >= 309.5 ? <Pill frame={frame} {...fanned(fanCreate(frame), 212)} word={CREATE} settled /> : null} {twoSlivers ? <Sliver {...top} spec={SLIVER_THREE} id={`grok-sl3-${sample}`} /> : null} {oneSliver ? <Sliver {...top} spec={SLIVER_TWO} id={`grok-sl2-${sample}`} /> : null} {showWrite ? <Pill frame={frame} {...write} word={WRITE} textOpacity={writeText} /> : null} {showCreate ? <Pill frame={frame} {...create} word={CREATE} textOpacity={createText} /> : null} {showSolve ? <Pill frame={frame} {...solve} word={SOLVE} /> : null} </g> </svg> </AbsoluteFill> ); }; export const WriteCreateSolve: React.FC = () => { const ready = useInter(); if (!ready) return null; return <MotionBlur render={(frame, sample) => <WriteScene frame={frame + WRITE_FROM} sample={sample} />} />; };
Download assets (fonts and images)
curl -O https://www.sycamore.to/sycamore-assets.mjsnode sycamore-assets.mjs grok-bot-promo
Sycamore