Logo Construct
A blueprint grid draws the logo construction lines and the wordmark inks in.
Source
components/kuchi/logo-construct.tsx
1"use client";23import { loadFont as loadMono } from "@remotion/google-fonts/IBMPlexMono";4import { loadFont as loadManrope } from "@remotion/google-fonts/Manrope";5import type React from "react";6import { useId } from "react";7import {8 AbsoluteFill,9 Easing,10 interpolate,11 useCurrentFrame,12 useVideoConfig,13} from "remotion";1415const { fontFamily: mono } = loadMono("normal", {16 weights: ["400", "500"],17 subsets: ["latin"],18});19const manrope = loadManrope("normal", {20 weights: ["500", "600"],21 subsets: ["latin"],22});2324export interface LogoConstructProps {25 /** Replaces the constructed R. The construction still draws, then your logo settles in its place. */26 logo?: React.ReactNode;27 /** Letters set after the R, on its baseline, in Manrope 600. The real logo reads R + "Acme". */28 name?: string;29 accent?: string;30 /** Color of the name and the R's outline; overrides the theme ink. */31 ink?: string;32 /** Paper fill; "transparent" drops it with the vignette and grain. */33 background?: string;34 /** Typeface for the name. Load it yourself; Manrope by default. */35 fontFamily?: string;36 /** Frames between letters of the name as they rise. */37 stagger?: number;38 /** The paper grid behind the construction. */39 grid?: boolean;40 /** Size of the drawing around the frame's center; hairlines stay 1px. */41 scale?: number;42 /** Frames to hold the first frame before anything moves. */43 delay?: number;44 /** Film grain over the scene. */45 grain?: boolean;46 /** Playback multiplier. */47 speed?: number;48 /** Light = blueprint paper (default); dark = drafting film on black. */49 theme?: "light" | "dark";50}5152const EASE_IO = Easing.bezier(0.65, 0, 0.35, 1);53const EASE_OUT = Easing.bezier(0.22, 1, 0.36, 1);54const EASE_DRAW = Easing.bezier(0.45, 0, 0.2, 1);55const CLAMP = {56 extrapolateLeft: "clamp",57 extrapolateRight: "clamp",58} as const;5960// gradients.sh "mesh" palette: bg #0a0d24, [#ecdcf2, #8796ee, #2e45b7, #0e1645].61// It fills the constructed R: a mesh of soft blobs inside the letter.62const THEMES = {63 light: {64 bg: "#F5F4F0",65 ink: "#121214",66 guideMix: 0,67 gridAlpha: 0.075,68 majorAlpha: 0.13,69 guideAlpha: 0.62,70 label: 0.9,71 vignette: "rgba(120,110,90,0.10)",72 grain: 0.05,73 meshBase: "#0a0d24",74 // [colour, x, y, radius, opacity] per blob, in the R's bounding box75 mesh: [76 ["#ecdcf2", 0.58, 0.1, 0.42, 0.55],77 ["#8796ee", 0.95, 0.32, 0.7, 1],78 ["#2e45b7", 0.74, 0.92, 0.7, 1],79 ["#0e1645", 0.12, 0.72, 0.7, 1],80 ],81 },82 dark: {83 bg: "#0A0A0B",84 ink: "#F3F2EF",85 guideMix: 0.45,86 gridAlpha: 0.07,87 majorAlpha: 0.12,88 guideAlpha: 0.7,89 label: 0.95,90 vignette: "rgba(0,0,0,0.55)",91 grain: 0.06,92 meshBase: "#2e45b7",93 mesh: [94 ["#ecdcf2", 0.6, 0.12, 0.5, 0.9],95 ["#8796ee", 0.12, 0.22, 0.7, 1],96 ["#2e45b7", 0.74, 0.9, 0.7, 1],97 ["#8796ee", 0.2, 0.86, 0.5, 0.8],98 ],99 },100} as const;101102103// Construction geometry, measured off the R path (R units, y down, 134.26 tall).104const R_W = 121.44;105const H = 134.26;106/** One stroke module: the bar, stem, mid bar and bowl are all ~1/7 of the height. */107const M = H / 7;108/** Bowl: concentric arcs around one centre. */109const BOWL = { x: 79.6, y: 42.6, ro: 41.9, ri: 23.1 };110const BAR_IN = 19.3;111const MID_TOP = 67.7;112const MID_BOT = 87.6;113const STEM_R = 19;114/** Leg: the outer edge runs from (84.4, 91.6) to the foot at (117, 134.2). */115const LEG = { x0: 84.4, y0: 91.6, x1: 117, y1: 134.2 };116const LEG_DEG = (Math.atan2(LEG.y1 - LEG.y0, LEG.x1 - LEG.x0) * 180) / Math.PI;117/** Bezier anchors + handles of the two transitions that give the R its voice. */118const HANDLES = [119 // the top-left swash120 { a: [21.7, 18.9], h: [13.45, 17.16] },121 { a: [1.09, 4.13], h: [4.91, 11.04] },122 // the mid bar turning down into the stem123 { a: [10.65, 79.89], h: [14.84, 75.7] },124 { a: [10.65, 79.89], h: [4.86, 85.68] },125 { a: [19.82, 101.04], h: [21.79, 93.65] },126 { a: [36.45, 87.63], h: [27.86, 88.75] },127] as const;128129// The wordmark, set like the site header: R is 0.76em tall, "Acme" Manrope 600 at -0.025em.130const FONT = H / 0.76;131const X_HEIGHT = 0.54;132const WORD_XLINE = H - FONT * X_HEIGHT;133const TRACK = -0.025;134/** Manrope 600 advances, per em. */135const ADV: Record<string, number> = {136 a: 0.57,137 c: 0.568,138 e: 0.596,139 i: 0.264,140 l: 0.264,141 m: 0.882,142 n: 0.615,143 o: 0.61,144 r: 0.386,145 s: 0.536,146 t: 0.422,147 " ": 0.26,148};149const WORD_X = 124.06 + FONT * 0.04;150const RISE = FONT * 0.8;151152function hexRgb(hex: string) {153 const h = hex.replace("#", "");154 const n = Number.parseInt(155 h.length === 3156 ? h157 .split("")158 .map((c) => c + c)159 .join("")160 : h,161 16,162 );163 return [(n >> 16) & 255, (n >> 8) & 255, n & 255];164}165166function tint(hex: string, mixWhite: number, alpha: number) {167 const [r, g, b] = hexRgb(hex).map((c) =>168 Math.round(c + (255 - c) * mixWhite),169 );170 return `rgba(${r},${g},${b},${alpha})`;171}172173/** Polyline of a circular arc, angles in degrees, y down (270 = up). */174function arc(cx: number, cy: number, r: number, a0: number, sweep: number) {175 const steps = Math.max(2, Math.ceil(Math.abs(sweep) / 3));176 let d = "";177 for (let i = 0; i <= steps; i++) {178 const a = ((a0 + (sweep * i) / steps) * Math.PI) / 180;179 d += `${i ? "L" : "M"}${cx + Math.cos(a) * r} ${cy + Math.sin(a) * r}`;180 }181 return d;182}183184function Grain({ opacity }: { opacity: number }) {185 const id = `g${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;186 return (187 <svg188 width="100%"189 height="100%"190 style={{ position: "absolute", inset: 0, opacity }}191 aria-hidden192 >193 <filter id={id}>194 <feTurbulence195 type="fractalNoise"196 baseFrequency="0.85"197 numOctaves={2}198 seed={11}199 stitchTiles="stitch"200 />201 <feColorMatrix values="0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.9 0" />202 </filter>203 <rect width="100%" height="100%" filter={`url(#${id})`} />204 </svg>205 );206}207208export function LogoConstruct({209 logo,210 name = "Acme",211 accent = "#3B5BFD",212 ink,213 background,214 fontFamily = manrope.fontFamily,215 stagger = 3,216 grid = true,217 scale = 1,218 delay = 0,219 grain = true,220 speed = 1,221 theme = "light",222}: LogoConstructProps) {223 const t = Math.max(0, useCurrentFrame() - delay) * speed;224 const { width, height } = useVideoConfig();225 const u = height / 720;226 const pal = THEMES[theme];227 const fg = ink ?? pal.ink;228 const transparent = background === "transparent";229 const stage = transparent ? "transparent" : (background ?? pal.bg);230 const knock = transparent ? pal.bg : stage;231 const uid = useId().replace(/[^a-zA-Z0-9_-]/g, "");232233 const p = (a: number, b: number, easing = EASE_DRAW) =>234 interpolate(t, [a, b], [0, 1], { ...CLAMP, easing });235236 // ---- camera: tight on the R, then an eased pull back to the lockup ----237 const wordW =238 name.split("").reduce((w, ch) => w + (ADV[ch] ?? 0.6) + TRACK, 0) * FONT;239 const lockL = 0;240 const lockR = WORD_X + wordW;241 const dimRoom = 30;242 const s1 = 3.05 * u;243 const s2 = Math.min((width * 0.6) / (lockR + dimRoom - lockL), 1.25 * u);244 const pull = p(120, 168, EASE_IO);245 const drift = interpolate(t, [0, 120], [0, 1], CLAMP);246 const sCam = Math.exp(247 interpolate(248 pull,249 [0, 1],250 [Math.log(s1 * (0.965 + drift * 0.035)), Math.log(s2)],251 ),252 );253 const camX = interpolate(pull, [0, 1], [R_W / 2 + 4, (lockL + lockR) / 2]);254 const camY = interpolate(pull, [0, 1], [H / 2 - 2, H / 2 + 4]);255 const hold = interpolate(t, [160, 260], [1, 1.03], {256 ...CLAMP,257 easing: EASE_IO,258 });259 // scale goes through the camera so the grid still fills the frame and260 // hairlines stay 1px261 const s = sCam * hold * scale;262 const tx = width / 2 - camX * s;263 const ty = height / 2 - camY * s;264 const px = (n: number) => n / s; // screen px -> units at the current zoom265266 // visible range in units, for grid + infinite guides267 const vx0 = (0 - tx) / s;268 const vx1 = (width - tx) / s;269 const vy0 = (0 - ty) / s;270 const vy1 = (height - ty) / s;271272 // ---- colours ----273 const guide = tint(accent, pal.guideMix, 1);274 const guideA = (a: number) => tint(accent, pal.guideMix, a);275276 // guides settle to hairlines once the mark is solid277 const settle = p(112, 150, EASE_IO);278 const guideLevel = interpolate(settle, [0, 1], [pal.guideAlpha, 0.2]);279 const labelLevel = interpolate(p(110, 132, EASE_IO), [0, 1], [pal.label, 0]);280281 // ---- paper grid on the module (half-module minor, module major) ----282 const gridIn = 0.45 + 0.55 * p(0, 18, EASE_OUT);283 const minorStep = M / 2;284 const minorAlpha =285 pal.gridAlpha *286 gridIn *287 interpolate(minorStep * s, [10 * u, 26 * u], [0.25, 1], CLAMP);288 const gridLines: React.ReactNode[] = [];289 for (let i = Math.floor(vx0 / minorStep); i * minorStep <= vx1; i++) {290 const gx = i * minorStep;291 const major = i % 2 === 0;292 gridLines.push(293 <line294 key={`gx${i}`}295 x1={gx}296 x2={gx}297 y1={vy0}298 y2={vy1}299 stroke={guideA(major ? pal.majorAlpha * gridIn : minorAlpha)}300 strokeWidth={px(1)}301 />,302 );303 }304 for (let i = Math.floor(vy0 / minorStep); i * minorStep <= vy1; i++) {305 const gy = i * minorStep;306 const major = i % 2 === 0;307 gridLines.push(308 <line309 key={`gy${i}`}310 y1={gy}311 y2={gy}312 x1={vx0}313 x2={vx1}314 stroke={guideA(major ? pal.majorAlpha * gridIn : minorAlpha)}315 strokeWidth={px(1)}316 />,317 );318 }319320 // ---- infinite guides that grow out from the R ----321 const span = Math.max(vx1 - vx0, vy1 - vy0) * 1.2;322 const hGuides = [323 { y: 0, from: 60, at: 8 },324 { y: H, from: 60, at: 11 },325 { y: BOWL.y, from: BOWL.x, at: 16 },326 { y: BAR_IN, from: 50, at: 19 },327 { y: MID_TOP, from: 50, at: 22 },328 { y: MID_BOT, from: 50, at: 25 },329 ];330 const vGuides = [331 { x: 0, from: 67, at: 13 },332 { x: STEM_R, from: 67, at: 17 },333 { x: BOWL.x, from: BOWL.y, at: 21 },334 { x: R_W, from: BOWL.y, at: 24 },335 ];336 // the wordmark re-lights the baseline337 const relight = p(146, 166, EASE_OUT) * (1 - p(196, 230, EASE_IO) * 0.5);338 const lineAlpha = (y?: number) =>339 y === H ? guideLevel + relight * (pal.guideAlpha - 0.2) * 0.9 : guideLevel;340341 // ---- construction draw windows ----342 const crossIn = p(28, 40, EASE_OUT);343 const radius = p(32, 46);344 const outer = p(36, 66);345 const inner = p(48, 64);346 const dims = p(44, 60, EASE_OUT);347 const ruler = p(40, 64);348 const leg = p(54, 72);349 const legArc = p(60, 76);350 const handles = HANDLES.map((_, i) => p(58 + i * 3, 70 + i * 3, EASE_OUT));351 const outline = p(72, 106);352 const fill = p(96, 128, EASE_IO);353 const markDone = p(122, 134, EASE_OUT);354355 const hair = px(1 * u);356 const thin = px(1.25 * u);357 const dash = `${px(3 * u)} ${px(3.5 * u)}`;358 const fs = px(12 * u);359360 const Label = ({361 x,362 y,363 children,364 anchor = "start",365 o = 1,366 rotate,367 }: {368 x: number;369 y: number;370 children: React.ReactNode;371 anchor?: "start" | "middle" | "end";372 o?: number;373 rotate?: number;374 }) => (375 <text376 x={x}377 y={y}378 textAnchor={anchor}379 fontFamily={mono}380 fontSize={fs}381 fontWeight={500}382 letterSpacing={px(0.2 * u)}383 fill={guide}384 opacity={o * labelLevel}385 transform={rotate ? `rotate(${rotate} ${x} ${y})` : undefined}386 style={{ fontVariantNumeric: "tabular-nums" }}387 >388 {children}389 </text>390 );391392 const tick = (x: number, y: number, vertical: boolean, len = 3) =>393 vertical ? (394 <line x1={x} x2={x} y1={y - len} y2={y + len} />395 ) : (396 <line x1={x - len} x2={x + len} y1={y} y2={y} />397 );398399 // the fill sweeps round the bowl centre, like the compass did400 const wedge = (() => {401 const sweep = 360 * fill;402 if (sweep <= 0) return "M0 0z";403 if (sweep >= 359.9) return `M-400 -400H600V600H-400z`;404 return `M${BOWL.x} ${BOWL.y}${arc(BOWL.x, BOWL.y, 400, 180, sweep).replace("M", "L")}Z`;405 })();406407 // mesh blobs drift a few percent over the shot408 const blob = (bx: number, by: number, k: number) => ({409 cx: R_W * (bx + Math.sin(t / 47 + k * 1.7) * 0.04),410 cy: H * (by + Math.cos(t / 53 + k * 2.3) * 0.03),411 });412 const blobs = pal.mesh.map(([c, bx, by, r, o], k) => ({413 ...blob(bx, by, k),414 c,415 r: R_W * r,416 o,417 }));418419 // wordmark letters rise out of the baseline, 3 frames apart420 const letters = name.split("");421 const letterP = (i: number) =>422 p(144 + i * stagger, 164 + i * stagger, EASE_OUT);423 const wordGuides = p(140, 160, EASE_OUT);424 const xGrow = p(138, 166);425 const wordSettle = p(198, 232, EASE_IO);426 const dimX = lockR + 14;427428 // logo overlay geometry (screen)429 const markScreen = {430 left: tx,431 top: ty,432 size: H * s,433 };434 const logoIn = p(100, 126, EASE_OUT);435436 const legLen = Math.hypot(LEG.x1 - LEG.x0, LEG.y1 - LEG.y0);437 const legUx = (LEG.x1 - LEG.x0) / legLen;438 const legUy = (LEG.y1 - LEG.y0) / legLen;439440 return (441 <AbsoluteFill style={{ background: stage, overflow: "hidden" }}>442 <svg443 width={width}444 height={height}445 style={{ position: "absolute", inset: 0 }}446 aria-hidden447 >448 <defs>449 <clipPath id={`fill${uid}`} clipPathUnits="userSpaceOnUse">450 <path d={wedge} />451 </clipPath>452 {blobs.map((b, i) => (453 <radialGradient454 key={i}455 id={`mesh${uid}${i}`}456 gradientUnits="userSpaceOnUse"457 cx={b.cx}458 cy={b.cy}459 r={b.r}460 >461 <stop offset="0%" stopColor={b.c} stopOpacity={b.o} />462 <stop offset="68%" stopColor={b.c} stopOpacity={0} />463 </radialGradient>464 ))}465 <clipPath id={`word${uid}`} clipPathUnits="userSpaceOnUse">466 <rect467 x={WORD_X - 10}468 y={-200}469 width={wordW + 60}470 height={H + 200.5}471 />472 </clipPath>473 </defs>474 <g transform={`translate(${tx} ${ty}) scale(${s})`}>475 {grid ? gridLines : null}476477 {/* infinite construction guides */}478 <g stroke={guide} strokeWidth={hair} fill="none">479 {hGuides.map((g) => {480 const k = p(g.at, g.at + 26);481 return (482 <line483 key={`h${g.y}`}484 x1={g.from - span * k}485 x2={g.from + span * k}486 y1={g.y}487 y2={g.y}488 opacity={lineAlpha(g.y)}489 />490 );491 })}492 {vGuides.map((g) => {493 const k = p(g.at, g.at + 26);494 return (495 <line496 key={`v${g.x}`}497 y1={g.from - span * k}498 y2={g.from + span * k}499 x1={g.x}500 x2={g.x}501 opacity={guideLevel}502 />503 );504 })}505 </g>506507 {/* compass, ruler and handle work */}508 <g509 stroke={guide}510 fill="none"511 strokeWidth={thin}512 opacity={interpolate(settle, [0, 1], [1, 0.3])}513 >514 <g opacity={crossIn}>515 <line x1={BOWL.x - 5} x2={BOWL.x + 5} y1={BOWL.y} y2={BOWL.y} />516 <line y1={BOWL.y - 5} y2={BOWL.y + 5} x1={BOWL.x} x2={BOWL.x} />517 <circle cx={BOWL.x} cy={BOWL.y} r={1.4} />518 </g>519 {radius > 0 && (520 <line521 x1={BOWL.x}522 y1={BOWL.y}523 x2={BOWL.x + Math.cos(-Math.PI / 4) * BOWL.ro * radius}524 y2={BOWL.y + Math.sin(-Math.PI / 4) * BOWL.ro * radius}525 />526 )}527 {outer > 0 && (528 <path529 d={arc(BOWL.x, BOWL.y, BOWL.ro, 180, 360 * outer)}530 strokeDasharray={dash}531 />532 )}533 {inner > 0 && (534 <path535 d={arc(BOWL.x, BOWL.y, BOWL.ri, 180, 360 * inner)}536 strokeDasharray={dash}537 />538 )}539 {/* 90° quadrant marker */}540 <path541 d={arc(BOWL.x, BOWL.y, 9, 270, 90 * p(46, 60))}542 opacity={0.8}543 />544545 {/* leg: its axis, extended, and the angle off the baseline */}546 {leg > 0 && (547 <line548 x1={LEG.x0 - legUx * 26}549 y1={LEG.y0 - legUy * 26}550 x2={LEG.x0 - legUx * 26 + legUx * (legLen + 46) * leg}551 y2={LEG.y0 - legUy * 26 + legUy * (legLen + 46) * leg}552 strokeDasharray={dash}553 />554 )}555 {legArc > 0 && (556 <path557 d={arc(LEG.x1, LEG.y1, 16, 180, LEG_DEG * legArc)}558 transform={`translate(0 0)`}559 />560 )}561562 {/* bezier handles of the swash and the stem join */}563 {HANDLES.map((hd, i) =>564 handles[i] > 0 ? (565 <g key={`hd${i}`} opacity={handles[i]}>566 <line567 x1={hd.a[0]}568 y1={hd.a[1]}569 x2={hd.a[0] + (hd.h[0] - hd.a[0]) * handles[i]}570 y2={hd.a[1] + (hd.h[1] - hd.a[1]) * handles[i]}571 />572 <circle573 cx={hd.a[0] + (hd.h[0] - hd.a[0]) * handles[i]}574 cy={hd.a[1] + (hd.h[1] - hd.a[1]) * handles[i]}575 r={px(3 * u)}576 fill={knock}577 />578 <rect579 x={hd.a[0] - px(3.5 * u)}580 y={hd.a[1] - px(3.5 * u)}581 width={px(7 * u)}582 height={px(7 * u)}583 fill={knock}584 />585 </g>586 ) : null,587 )}588589 {/* module ruler: seven strokes tall */}590 <g opacity={dims}>591 <line x1={-14} x2={-14} y1={0} y2={H * ruler} />592 {Array.from({ length: 8 }, (_, i) =>593 i * M <= H * ruler + 0.01 ? (594 <g key={`m${i}`}>595 {tick(-14, i * M, false, i % 7 === 0 ? 4 : 2.4)}596 </g>597 ) : null,598 )}599 {/* width */}600 <line x1={0} x2={R_W * ruler} y1={-14} y2={-14} />601 {tick(0, -14, true, 4)}602 {ruler >= 1 && tick(R_W, -14, true, 4)}603 {/* bar thickness */}604 <line x1={56} x2={56} y1={0} y2={BAR_IN} />605 {tick(56, 0, false, 2.4)}606 {tick(56, BAR_IN, false, 2.4)}607 </g>608 </g>609610 {/* measurement labels */}611 <g opacity={dims}>612 <Label x={R_W / 2} y={-14 - px(8 * u)} anchor="middle">613 124614 </Label>615 <Label x={-14 - px(10 * u)} y={H / 2} anchor="middle" rotate={-90}>616 7m · 134617 </Label>618 <Label x={56 + px(8 * u)} y={BAR_IN / 2 + px(4 * u)}>619 m 19.2620 </Label>621 </g>622 <Label623 x={BOWL.x + Math.cos(-Math.PI / 4) * BOWL.ro + px(6 * u)}624 y={BOWL.y + Math.sin(-Math.PI / 4) * BOWL.ro - px(4 * u)}625 o={radius}626 >627 R42628 </Label>629 <Label630 x={BOWL.x - BOWL.ri - px(8 * u)}631 y={BOWL.y - px(8 * u)}632 anchor="end"633 o={inner}634 >635 R23636 </Label>637 <Label x={BOWL.x + px(8 * u)} y={BOWL.y + px(18 * u)} o={crossIn}>638 80,43639 </Label>640 <Label x={LEG.x1 - 20} y={LEG.y1 - 6} anchor="end" o={legArc}>641 {`${LEG_DEG.toFixed(0)}°`}642 </Label>643644 {/* the R: outline first, then the mesh fill sweeps round the bowl centre */}645 {!logo && (646 <g>647 {outline > 0 && (648 <circle cx="62.03" cy="67.13" r="56"649650 fill="none"651 stroke={fg}652 strokeWidth={px(1.4 * u)}653 strokeLinejoin="round"654 pathLength={1}655 strokeDasharray={`${outline} 2`}656 opacity={1 - markDone}657 />658 )}659 <g clipPath={`url(#fill${uid})`}>660 <circle cx="62.03" cy="67.13" r="56" fill={pal.meshBase} />661 {blobs.map((_, i) => (662 <circle cx="62.03" cy="67.13" r="56"663 key={i}664665 fill={`url(#mesh${uid}${i})`}666 />667 ))}668 </g>669 </g>670 )}671672 {/* wordmark guides: its x-height, the shared baseline, a side bearing */}673 <g stroke={guide} strokeWidth={hair} fill="none">674 <line675 x1={WORD_X - span * xGrow}676 x2={WORD_X + span * xGrow}677 y1={WORD_XLINE}678 y2={WORD_XLINE}679 opacity={pal.guideAlpha * 0.85 * (1 - wordSettle * 0.7)}680 />681 </g>682 <g683 opacity={wordGuides * (1 - wordSettle * 0.75)}684 stroke={guide}685 strokeWidth={thin}686 fill="none"687 >688 <line689 x1={WORD_X - 3}690 x2={WORD_X - 3}691 y1={WORD_XLINE - 10}692 y2={H + 10}693 strokeDasharray={dash}694 />695 </g>696 <g697 opacity={p(156, 174, EASE_OUT) * (1 - wordSettle * 0.75)}698 stroke={guide}699 strokeWidth={thin}700 >701 <line x1={dimX} x2={dimX} y1={WORD_XLINE} y2={H} />702 {tick(dimX, WORD_XLINE, false, 4)}703 {tick(dimX, H, false, 4)}704 </g>705 <g706 opacity={p(156, 174, EASE_OUT) * (1 - wordSettle * 0.75)}707 fontFamily={mono}708 fontSize={fs}709 fontWeight={500}710 fill={guide}711 style={{ fontVariantNumeric: "tabular-nums" }}712 >713 <text x={dimX + px(8 * u)} y={(WORD_XLINE + H) / 2 + px(4 * u)}>714 0.54em715 </text>716 <text x={WORD_X} y={WORD_XLINE - px(7 * u)}>717 x-height718 </text>719 <text x={WORD_X} y={H + px(17 * u)}>720 baseline721 </text>722 </g>723 <g clipPath={`url(#word${uid})`}>724 <text725 x={WORD_X}726 y={H}727 fontFamily={fontFamily}728 fontWeight={600}729 fontSize={FONT}730 letterSpacing={FONT * TRACK}731 fill={fg}732 >733 {letters.map((ch, i) => {734 const k = letterP(i);735 const prev = i === 0 ? 0 : (1 - letterP(i - 1)) * RISE;736 return (737 <tspan738 key={i}739 dy={(1 - k) * RISE - prev}740 fillOpacity={0.15 + k * 0.85}741 >742 {ch}743 </tspan>744 );745 })}746 </text>747 </g>748 </g>749 </svg>750751 {logo && (752 <div753 style={{754 position: "absolute",755 left: markScreen.left,756 top: markScreen.top,757 height: markScreen.size,758 display: "flex",759 alignItems: "center",760 opacity: logoIn,761 filter: `blur(${(1 - logoIn) * 6 * u}px)`,762 transform: `scale(${0.96 + logoIn * 0.04})`,763 transformOrigin: "left center",764 }}765 >766 {logo}767 </div>768 )}769770 {!transparent ? (771 <AbsoluteFill772 style={{773 background: `radial-gradient(ellipse 75% 70% at 50% 48%, transparent 55%, ${pal.vignette} 100%)`,774 }}775 />776 ) : null}777 {!transparent && grain ? <Grain opacity={pal.grain} /> : null}778 </AbsoluteFill>779 );780}






