Pill Morph
A logo pill opens into a product card, splits into feature pills and becomes an app tile.
Source
components/kuchi/pill-morph.tsx
1"use client";23import { loadFont } from "@remotion/google-fonts/Figtree";4import { loadFont as loadManrope } from "@remotion/google-fonts/Manrope";5import type React from "react";6import { useEffect, useId, useMemo, useRef, useState } from "react";7import {8 AbsoluteFill,9 continueRender,10 delayRender,11 Easing,12 Img,13 interpolate,14 spring,15 useCurrentFrame,16 useVideoConfig,17} from "remotion";18import type { GradientParams } from "@/lib/kuchi/gsh/gradient-engine";19import { GshGround } from "@/lib/kuchi/gsh/gsh-ground";20import type { GshPresetId } from "@/lib/kuchi/gsh/presets";2122const figtree = loadFont("normal", {23 weights: ["300", "400"],24 subsets: ["latin"],25});26const manrope = loadManrope("normal", {27 weights: ["600"],28 subsets: ["latin"],29});30const sans = figtree.fontFamily;313233function KuchiLogo({ fontSize, color }: { fontSize: number; color: string }) {34 return (35 <div36 style={{37 display: "flex",38 alignItems: "baseline",39 color,40 fontFamily: manrope.fontFamily,41 fontWeight: 600,42 fontSize,43 letterSpacing: "-0.025em",44 lineHeight: 1,45 }}46 >47 <span>Acme</span>48 </div>49 );50}5152let measureCtx: CanvasRenderingContext2D | null = null;53function textWidth(s: string, size: number, family: string, weight: number) {54 if (!measureCtx && typeof document !== "undefined") {55 measureCtx = document.createElement("canvas").getContext("2d");56 }57 if (!measureCtx) return s.length * size * 0.52;58 measureCtx.font = `${weight} ${size}px "${family}"`;59 return measureCtx.measureText(s).width;60}6162function measure(63 version: number,64 name: string,65 features: string[],66 labelSize: number,67 featSize: number,68 fontFamily: string,69) {70 return {71 version,72 logo:73 textWidth("Acme", labelSize, manrope.fontFamily, 600) -74 labelSize * 0.025 * 4,75 name: textWidth(name, labelSize, fontFamily, 400),76 feats: features.map((f) => textWidth(f, featSize, fontFamily, 400)),77 };78}7980function useFontVersion(fontFamily: string) {81 const [handle] = useState(() => delayRender("pill-morph: fonts"));82 const [version, setVersion] = useState(0);83 const released = useRef(false);84 useEffect(() => {85 const bump = () => setVersion((v) => v + 1);86 Promise.all([87 figtree.waitUntilDone(),88 manrope.waitUntilDone(),89 document.fonts.load(`400 100px "${fontFamily}"`).catch(() => undefined),90 ]).then(() => {91 bump();92 if (!released.current) {93 released.current = true;94 continueRender(handle);95 }96 });97 if (typeof document === "undefined") return;98 document.fonts.addEventListener("loadingdone", bump);99 return () => document.fonts.removeEventListener("loadingdone", bump);100 }, [handle, fontFamily]);101 return version;102}103104export interface PillMorphProps {105 features?: [string, string, string];106 logo?: React.ReactNode;107 name?: string;108 src?: string;109 children?: React.ReactNode;110 accent?: string;111 /** Caption over the preview in the built-in editor mock. */112 caption?: string;113 /** Corner radius of the open card, in px at 720p. */114 radius?: number;115 /** Text color of the name and features; overrides the theme ink. */116 ink?: string;117 /** Solid fill in place of the gradient ground; "transparent" drops it. */118 background?: string;119 /** Typeface for the copy. Load it yourself; Figtree by default. */120 fontFamily?: string;121 /** Size of the pill and card, around the frame's center. */122 scale?: number;123 /** Frames to hold the first frame before anything moves. */124 delay?: number;125 speed?: number;126 theme?: "dark" | "light";127 ground?: GshPresetId;128 groundParams?: Partial<GradientParams>;129}130131const EASE_OUT = Easing.bezier(0.22, 1, 0.36, 1);132const CARD = { mass: 0.8, damping: 18, stiffness: 160 };133const CHIP = { mass: 0.5, damping: 12, stiffness: 200 };134const MORPH = { damping: 200 };135const CLAMP = {136 extrapolateLeft: "clamp",137 extrapolateRight: "clamp",138} as const;139140const THEMES = {141 dark: {142 base: "#04050A",143 scrim: "4,5,10",144 surface: "#17181C",145 fg: "#F3F2EF",146 muted: "rgba(243,242,239,0.55)",147 block: "rgba(255,255,255,0.06)",148 blockHi: "rgba(255,255,255,0.11)",149 hair: "rgba(255,255,255,0.08)",150 imgLine: "rgba(255,255,255,0.1)",151 ring: "rgba(255,255,255,0.1)",152 rim: "rgba(255,255,255,0.16)",153 shadow: "rgba(0,0,0,0.6)",154 },155 light: {156 base: "#EEF0F6",157 scrim: "244,244,247",158 surface: "#FFFFFF",159 fg: "#121214",160 muted: "rgba(18,18,20,0.55)",161 block: "rgba(18,18,20,0.05)",162 blockHi: "rgba(18,18,20,0.09)",163 hair: "rgba(18,18,20,0.08)",164 imgLine: "rgba(0,0,0,0.1)",165 ring: "rgba(18,18,20,0.09)",166 rim: "rgba(255,255,255,1)",167 shadow: "rgba(40,44,70,0.22)",168 },169} as const;170171type Palette = (typeof THEMES)[keyof typeof THEMES];172173const lerp = (a: number, b: number, k: number) => a + (b - a) * k;174175const FEATURE_ICONS = [176 "M2.5 5.5h7v7h-7zM6.5 5.5V3.5h7v7h-4",177 "M2 3.5h12v9H2zM4.5 8h4.5M11 8h.5M4.5 10.5h7",178 "M2 3.5h12v9H2zM2 10.5c3.5-3.5 7-3.5 12-1.5M10.5 6.5h.01",179];180181const SCENES = [182 { name: "Intro", len: "0:02" },183 { name: "Product", len: "0:03" },184 { name: "Captions", len: "0:02" },185 { name: "Pricing", len: "0:02" },186 { name: "Changelog", len: "0:02" },187 { name: "Outro", len: "0:01" },188];189190const CLIPS = [191 [0, 0.17, 0],192 [0.18, 0.5, 1],193 [0.51, 0.74, 0],194 [0.75, 1, 0],195] as const;196197function Editor({198 w,199 h,200 u,201 p,202 accent,203 t,204 caption,205 fontFamily,206}: {207 w: number;208 h: number;209 u: number;210 p: Palette;211 accent: string;212 t: number;213 caption: string;214 fontFamily: string;215}) {216 const side = w * 0.27;217 const fs = 16 * u;218 const row = (i: number) =>219 interpolate(t, [34 + i * 3, 50 + i * 3], [0, 1], {220 ...CLAMP,221 easing: EASE_OUT,222 });223 const play = interpolate(t, [40, 110], [0.24, 0.47], CLAMP);224 const secs = play * 12;225 const tc = `0:${String(Math.floor(secs)).padStart(2, "0")}.${String(Math.floor((secs % 1) * 30)).padStart(2, "0")}`;226 const right = side + 16 * u;227 const rw = w - right;228 const prevH = h * 0.62;229 const barY = prevH + 12 * u;230 const trackY = barY + 34 * u;231 const trackH = h - trackY;232 return (233 <div style={{ position: "absolute", inset: 0, fontFamily }}>234 {SCENES.map((sc, i) => (235 <div236 key={sc.name}237 style={{238 position: "absolute",239 left: 0,240 top: i * 42 * u,241 width: side - 12 * u,242 height: 34 * u,243 borderRadius: 8 * u,244 background: i === 1 ? p.block : "transparent",245 display: "flex",246 alignItems: "center",247 gap: 9 * u,248 padding: `0 ${10 * u}px`,249 boxSizing: "border-box",250 fontSize: fs,251 color: i === 1 ? p.fg : p.muted,252 opacity: row(i),253 transform: `translateX(${(1 - row(i)) * -10 * u}px)`,254 }}255 >256 <div257 style={{258 width: 7 * u,259 height: 7 * u,260 borderRadius: "50%",261 background: i === 1 ? accent : p.blockHi,262 flexShrink: 0,263 }}264 />265 <span style={{ flex: 1 }}>{sc.name}</span>266 <span style={{ fontVariantNumeric: "tabular-nums", opacity: 0.8 }}>267 {sc.len}268 </span>269 </div>270 ))}271 <div272 style={{273 position: "absolute",274 left: side,275 top: 0,276 bottom: 0,277 width: 1,278 background: p.hair,279 }}280 />281 <div282 style={{283 position: "absolute",284 left: right,285 top: 0,286 width: rw,287 height: prevH,288 borderRadius: 10 * u,289 overflow: "hidden",290 opacity: row(1),291 transform: `translateY(${(1 - row(1)) * 12 * u}px)`,292 }}293 >294 <Img295 src={"https://kuchi-media.kalarislabs.com/components/art/art-08.svg"}296 style={{297 width: "100%",298 height: "100%",299 objectFit: "cover",300 transform: `scale(${1.04 + play * 0.1})`,301 }}302 />303 <div304 style={{305 position: "absolute",306 inset: 0,307 borderRadius: 10 * u,308 boxShadow: `inset 0 0 0 1px ${p.imgLine}`,309 background:310 "linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.42) 100%)",311 }}312 />313 <div314 style={{315 position: "absolute",316 left: 16 * u,317 bottom: 14 * u,318 fontSize: 22 * u,319 letterSpacing: "-0.02em",320 color: "#FFFFFF",321 opacity: row(3),322 }}323 >324 {caption}325 </div>326 </div>327 <div328 style={{329 position: "absolute",330 left: right,331 top: barY,332 width: rw,333 height: 24 * u,334 display: "flex",335 alignItems: "center",336 gap: 10 * u,337 fontSize: fs,338 color: p.muted,339 fontVariantNumeric: "tabular-nums",340 opacity: row(2),341 }}342 >343 <svg344 width={14 * u}345 height={14 * u}346 viewBox="0 0 16 16"347 fill="none"348 aria-hidden349 >350 <path351 d="M4.5 3.2v9.6l8-4.8z"352 stroke={p.fg}353 strokeWidth={1.5}354 strokeLinejoin="round"355 />356 </svg>357 <span style={{ color: p.fg }}>{tc}</span>358 <span>/ 0:12.00</span>359 </div>360 <div361 style={{362 position: "absolute",363 left: right,364 top: trackY,365 width: rw,366 height: trackH,367 opacity: row(3),368 transform: `translateY(${(1 - row(3)) * 10 * u}px)`,369 }}370 >371 {CLIPS.map(([a, b, on]) => (372 <div373 key={a}374 style={{375 position: "absolute",376 left: `${a * 100}%`,377 width: `calc(${(b - a) * 100}% - ${3 * u}px)`,378 top: 0,379 height: trackH * 0.52,380 borderRadius: 6 * u,381 background: on ? accent : p.blockHi,382 boxShadow: on383 ? "inset 0 1px 0 rgba(255,255,255,0.22)"384 : `inset 0 0 0 1px ${p.hair}`,385 }}386 />387 ))}388 <div389 style={{390 position: "absolute",391 left: "30%",392 width: "36%",393 bottom: 0,394 height: trackH * 0.3,395 borderRadius: 5 * u,396 background: p.block,397 boxShadow: `inset 0 0 0 1px ${p.hair}`,398 }}399 />400 <div401 style={{402 position: "absolute",403 left: `${play * 100}%`,404 top: -6 * u,405 bottom: -2 * u,406 width: 1.5 * u,407 background: p.fg,408 borderRadius: u,409 }}410 />411 </div>412 </div>413 );414}415416/** The foreground at `scale`, around the frame's center; nothing extra at 1. */417function ScaleLayer({418 scale,419 children,420}: {421 scale: number;422 children: React.ReactNode;423}) {424 if (scale === 1) return children;425 return (426 <AbsoluteFill style={{ transform: `scale(${scale})` }}>427 {children}428 </AbsoluteFill>429 );430}431432interface Shape {433 x: number;434 y: number;435 w: number;436 h: number;437 r: [number, number, number, number];438}439440export function PillMorph({441 name = "",442 features = ["Transitions", "Captions", "Backgrounds"],443 logo,444 src,445 children,446 accent = "#3B5BFD",447 caption = "Launch day, in one take",448 radius = 28,449 ink,450 background,451 fontFamily = sans,452 scale = 1,453 delay = 0,454 speed = 1,455 theme = "dark",456 ground,457 groundParams,458}: PillMorphProps) {459 const t = Math.max(0, useCurrentFrame() - delay) * speed;460 const { fps, width, height } = useVideoConfig();461 const tall = height > width;462 const u = tall ? width / 760 : Math.min(width / 1280, height / 720);463 const p = THEMES[theme];464 const fg = ink ?? p.fg;465 const dark = theme === "dark";466 const resolvedGround: GshPresetId | undefined =467 ground ?? (groundParams ? undefined : dark ? "velvet-hour" : "glasswork");468 const gid = `goo${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;469 const fontVersion = useFontVersion(fontFamily);470 const cx = width / 2;471 const cy = height / 2;472473 const sp = (474 start: number,475 config: { mass?: number; damping?: number; stiffness?: number },476 ) =>477 spring({478 frame: t - start,479 fps,480 config,481 });482 const fade = (a: number, b: number) =>483 interpolate(t, [a, b], [0, 1], { ...CLAMP, easing: EASE_OUT });484485 const labelSize = 23 * u;486 const featSize = (tall ? 26 : 23) * u;487 const markSize = 24 * u;488 const pad = 20 * u;489 const widths = useMemo(490 () => measure(fontVersion, name, features, labelSize, featSize, fontFamily),491 [fontVersion, name, features, labelSize, featSize, fontFamily],492 );493 const labelW = logo ? markSize + 9 * u + widths.name : widths.logo;494 const w0 = labelW + pad * 2;495 const h0 = 52 * u;496 const cw = tall ? width * 0.86 : Math.min(width * 0.6, 760 * u);497 const ch = tall ? cw * 0.86 : Math.min(height * 0.64, 450 * u);498 const cr = radius * u;499 const barH = 66 * u;500 const pws = widths.feats.map((fw) => Math.max(170 * u, fw + 92 * u));501 const total = pws[0] + pws[1] + pws[2];502 const gap = (tall ? 18 : 30) * u;503 const tile = (tall ? 220 : 164) * u;504 const tileR = (tall ? 58 : 44) * u;505 const tileCy = cy - 22 * u;506507 const appear = sp(-4, CARD);508 const wP = sp(18, MORPH);509 const hP = sp(24, MORPH);510 const collapse = sp(102, MORPH);511 const split = sp(116, CARD);512 const merge = sp(168, MORPH);513 const settle = sp(182, CHIP);514515 let w = lerp(w0, cw, wP);516 let h = lerp(h0, ch, hP);517 w = lerp(w, total, collapse);518 h = lerp(h, barH, collapse);519 const rCard = Math.min(h / 2, lerp(h0 / 2, cr, hP));520 const r = Math.min(h / 2, lerp(rCard, h / 2, collapse));521 const lift = (1 - appear) * 14 * u;522 const scale0 = 0.94 + 0.06 * appear;523524 const shapes: Shape[] = [];525 if (t < 116) {526 shapes.push({527 x: cx - (w * scale0) / 2,528 y: cy - (h * scale0) / 2 + lift,529 w: w * scale0,530 h: h * scale0,531 r: [r, r, r, r],532 });533 } else {534 const spread = Math.max(0, split) * (1 - merge);535 const g = gap * spread;536 const k = w / total;537 let left = cx - (w + g * 2) / 2;538 pws.forEach((pw0, i) => {539 const pw = pw0 * k;540 const ph = h;541 const inner = r * Math.min(1, Math.max(0, split));542 const segCx = left + pw / 2;543 left += pw + g;544 const mx = lerp(segCx, cx, merge);545 const mw =546 lerp(pw, tile, merge) * (1 + 0.06 * Math.max(0, settle - merge));547 const mh = lerp(ph, tile, merge);548 const mr = lerp(r, tileR, merge);549 const rr: [number, number, number, number] =550 i === 0551 ? [r, inner, inner, r]552 : i === 2553 ? [inner, r, r, inner]554 : [inner, inner, inner, inner];555 const rm = rr.map((v) => lerp(v, mr, merge)) as Shape["r"];556 shapes.push({557 x: mx - mw / 2,558 y: lerp(cy, tileCy, merge) - mh / 2,559 w: mw,560 h: mh,561 r: rm,562 });563 });564 }565566 const labelOut = 1 - fade(103, 112);567 const content = fade(34, 52) * (1 - fade(96, 106));568 const featIn = (i: number) =>569 fade(122 + i * 3, 136 + i * 3) * (1 - fade(164 + i * 2, 172 + i * 2));570 const tileFill = fade(176, 194);571 const markIn = fade(186, 202);572 const nameIn = fade(196, 216);573574 const s0 = shapes[0];575 const labelX = t < 116 ? s0.x + pad * scale0 : 0;576 const labelY =577 t < 116 ? s0.y + Math.min(s0.h / 2, 30 * u) - (labelSize * scale0) / 2 : 0;578579 const drift = interpolate(t, [0, 240], [1, 1.035]);580 const tileGlow = fade(178, 200);581 const blur = 12 * u;582583 return (584 <AbsoluteFill585 style={{586 background:587 background === undefined588 ? p.base589 : background === "transparent"590 ? undefined591 : background,592 overflow: "hidden",593 }}594 >595 {background === undefined ? (596 <>597 <GshGround598 preset={resolvedGround}599 params={groundParams}600 timeOffset={dark ? 4 : 5}601 timeScale={0.45}602 />603 <AbsoluteFill604 style={{605 background: `radial-gradient(60% 60% at 50% 48%, rgba(${p.scrim},${dark ? 0.5 : 0.36}) 0%, rgba(${p.scrim},${dark ? 0.18 : 0.1}) 100%)`,606 }}607 />608 </>609 ) : null}610 <svg width={0} height={0} style={{ position: "absolute" }} aria-hidden>611 <defs>612 <filter613 id={gid}614 x="-10%"615 y="-10%"616 width="120%"617 height="120%"618 colorInterpolationFilters="sRGB"619 >620 <feGaussianBlur621 in="SourceGraphic"622 stdDeviation={blur}623 result="blur"624 />625 <feColorMatrix626 in="blur"627 type="matrix"628 values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 26 -12"629 result="goo"630 />631 <feMorphology632 in="goo"633 operator="erode"634 radius={Math.max(1, u)}635 result="inner"636 />637 <feComposite in="goo" in2="inner" operator="out" result="ring" />638 <feFlood floodColor={p.ring} result="ringColor" />639 <feComposite640 in="ringColor"641 in2="ring"642 operator="in"643 result="hair"644 />645 <feOffset in="goo" dy={1.5 * u} result="low" />646 <feComposite in="goo" in2="low" operator="out" result="top" />647 <feFlood floodColor={p.rim} result="rimColor" />648 <feComposite in="rimColor" in2="top" operator="in" result="rim" />649 <feMerge>650 <feMergeNode in="goo" />651 <feMergeNode in="hair" />652 <feMergeNode in="rim" />653 </feMerge>654 </filter>655 </defs>656 </svg>657658 <ScaleLayer scale={scale}>659 <AbsoluteFill660 style={{661 transform: `scale(${drift})`,662 opacity: interpolate(appear, [0, 0.4], [0, 1], CLAMP),663 }}664 >665 <AbsoluteFill666 style={{667 filter: `drop-shadow(0 ${16 * u}px ${28 * u}px ${p.shadow})`,668 }}669 >670 <AbsoluteFill style={{ filter: `url(#${gid})` }}>671 {shapes.map((s, i) => (672 <div673 key={i}674 style={{675 position: "absolute",676 left: s.x,677 top: s.y,678 width: s.w,679 height: s.h,680 borderRadius: `${s.r[0]}px ${s.r[1]}px ${s.r[2]}px ${s.r[3]}px`,681 background: p.surface,682 }}683 />684 ))}685 </AbsoluteFill>686 </AbsoluteFill>687688 {t < 116 ? (689 <div690 style={{691 position: "absolute",692 left: labelX,693 top: labelY,694 display: "flex",695 alignItems: "center",696 gap: 9 * u * scale0,697 opacity: labelOut * fade(-2, 9),698 transform: `scale(${scale0})`,699 transformOrigin: "0 0",700 }}701 >702 {logo ? (703 <>704 {logo}705 <span706 style={{707 fontFamily,708 fontWeight: 400,709 fontSize: labelSize,710 letterSpacing: "-0.02em",711 color: fg,712 lineHeight: `${markSize}px`,713 }}714 >715 {name}716 </span>717 </>718 ) : (719 <div720 style={{721 height: labelSize,722 display: "flex",723 alignItems: "center",724 }}725 >726 <KuchiLogo fontSize={labelSize} color={fg} />727 </div>728 )}729 </div>730 ) : null}731732 {t < 116 && content > 0 ? (733 <div734 style={{735 position: "absolute",736 left: s0.x + 22 * u,737 top: s0.y + 64 * u,738 width: cw - 44 * u,739 height: ch - 86 * u,740 opacity: content,741 overflow: "hidden",742 borderRadius: 12 * u,743 clipPath: `inset(0 0 ${Math.max(0, ch - 86 * u - (s0.h - 86 * u))}px 0)`,744 }}745 >746 {children ??747 (src ? (748 <Img749 src={src}750 style={{751 width: "100%",752 height: "100%",753 objectFit: "cover",754 }}755 />756 ) : (757 <Editor758 w={cw - 44 * u}759 h={ch - 86 * u}760 u={u}761 p={p}762 accent={accent}763 t={t}764 caption={caption}765 fontFamily={fontFamily}766 />767 ))}768 </div>769 ) : null}770771 {t >= 116772 ? shapes.map((s, i) => {773 const k = featIn(i);774 if (k <= 0) return null;775 return (776 <div777 key={features[i]}778 style={{779 position: "absolute",780 left: s.x,781 top: s.y,782 width: s.w,783 height: s.h,784 display: "flex",785 alignItems: "center",786 justifyContent: "center",787 gap: 10 * u,788 fontFamily,789 fontWeight: 400,790 fontSize: featSize,791 letterSpacing: "-0.01em",792 color: fg,793 whiteSpace: "nowrap",794 opacity: k,795 transform: `translateY(${(1 - k) * 6 * u}px)`,796 }}797 >798 <svg799 width={featSize * 0.95}800 height={featSize * 0.95}801 viewBox="0 0 16 16"802 fill="none"803 aria-hidden804 >805 <path806 d={FEATURE_ICONS[i % FEATURE_ICONS.length]}807 stroke={p.muted}808 strokeWidth={1.5}809 strokeLinecap="round"810 strokeLinejoin="round"811 />812 </svg>813 {features[i]}814 </div>815 );816 })817 : null}818819 {tileFill > 0 && t >= 116 ? (820 <div821 style={{822 position: "absolute",823 left: shapes[1].x,824 top: shapes[1].y,825 width: shapes[1].w,826 height: shapes[1].h,827 borderRadius: `${shapes[1].r[0]}px`,828 background: `linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 48%, rgba(0,0,0,0.14) 100%), ${accent}`,829 opacity: tileFill,830 boxShadow: `inset 0 ${1.5 * u}px 0 rgba(255,255,255,0.3), 0 ${18 * u}px ${48 * u}px -${10 * u}px ${accent}${Math.round(831 tileGlow * 140,832 )833 .toString(16)834 .padStart(2, "0")}`,835 }}836 />837 ) : null}838839 {markIn > 0 ? (840 <div841 style={{842 position: "absolute",843 left: cx - tile / 2,844 top: tileCy - tile / 2,845 width: tile,846 height: tile,847 display: "flex",848 alignItems: "center",849 justifyContent: "center",850 opacity: markIn,851 transform: `translateY(${(1 - markIn) * 6 * u}px) scale(${0.92 + 0.08 * markIn})`,852 }}853 >854 {logo ?? (855 <svg856 viewBox="0 0 124.06 134.26"857 height={tile * 0.46}858 width={(tile * 0.46 * 124.06) / 134.26}859 style={{ marginLeft: tile * 0.03 }}860 aria-hidden861 >862 <circle cx="62.03" cy="67.13" r="56" fill="#FFFFFF" />863 </svg>864 )}865 </div>866 ) : null}867 {nameIn > 0 ? (868 <div869 style={{870 position: "absolute",871 left: 0,872 right: 0,873 top: tileCy + tile / 2 + 30 * u,874 display: "flex",875 justifyContent: "center",876 opacity: nameIn,877 transform: `translateY(${(1 - nameIn) * 10 * u}px)`,878 }}879 >880 {logo ? (881 <span882 style={{883 fontFamily,884 fontWeight: 400,885 fontSize: 28 * u,886 letterSpacing: "-0.02em",887 color: fg,888 }}889 >890 {name}891 </span>892 ) : (893 <KuchiLogo fontSize={34 * u} color={fg} />894 )}895 </div>896 ) : null}897 </AbsoluteFill>898 </ScaleLayer>899 </AbsoluteFill>900 );901}







