{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"text-swell","type":"registry:component","title":"Text Swell","description":"Kinetic typography title with a bouncing letter wave. A title reveal where the lead word floats toward the viewer and hangs there while the sentence assembles around it — each trailing word pushes in and its letters bounce up off the baseline in a wave — before the whole line falls back to size.","dependencies":["remotion"],"docs":"Needs a Remotion project. If a frame renders black, the component is drawing on a transparent layer: put a background behind it, e.g. <AbsoluteFill style={{ background: \"#faf9f6\" }}><Component /></AbsoluteFill>. Pass mode=\"dark\" for dark frames.","registryDependencies":["https://kuchi.kalarislabs.com/r/kuchi-ui.json"],"files":[{"path":"components/kuchi/text-swell.tsx","type":"registry:component","target":"components/kuchi/text-swell.tsx","content":"/*! Portions Copyright (c) 2026 Sri Nath (snap-cn). MIT License. See THIRD_PARTY_LICENSES. */\n\"use client\";\r\n\r\nimport { Fragment, useEffect, useRef, useState } from \"react\";\r\nimport {\r\n  AbsoluteFill,\r\n  continueRender,\r\n  delayRender,\r\n  Easing,\r\n  getRemotionEnvironment,\r\n  interpolate,\r\n  useCurrentFrame,\r\n  useVideoConfig,\r\n} from \"remotion\";\r\nimport {\r\n  resolveFont,\r\n  type KuchiTheme,\r\n  useKuchiTheme,\r\n} from \"@/lib/kuchi-ui\";\r\n\r\nexport interface TextSwellProps {\r\n  /** The sentence to assemble. Its first word leads, and everything else pushes it left. */\r\n  text?: string;\r\n  /** Final font size in px (the size the line settles at). */\r\n  fontSize?: number;\r\n  /** Overrides the design system's `foreground`. */\r\n  color?: string;\r\n  fontWeight?: number | string;\r\n  /** Design-system token overrides. */\r\n  theme?: Partial<KuchiTheme>;\r\n  mode?: \"light\" | \"dark\";\r\n  /**\r\n   * The face this scene paints its words in — a label from `fonts.ts`\r\n   * (\"Inter\", \"Space Grotesk\", \"Instrument Serif\") or a CSS family you have\r\n   * loaded yourself. Unset, the scene keeps the face it was designed around.\r\n   *\r\n   * Overrides `theme.fontFamily`, which is how a brand kit re-skins a whole\r\n   * timeline from one value.\r\n   */\r\n  fontFamily?: string;\r\n\r\n  /** Frames the lead word fades in over. */\r\n  introDuration?: number;\r\n  /** How far below its resting line the lead word starts, in em. */\r\n  riseDistance?: number;\r\n  /** Frames the lead word takes to rise into place. */\r\n  riseDuration?: number;\r\n\r\n  /** Size the lead word rises in at, relative to its final size. */\r\n  startScale?: number;\r\n  /**\r\n   * How far forward the line floats (2.1 = just over twice its final size).\r\n   * Capped so the line never leaves the frame — see `frontScale` in the docs.\r\n   */\r\n  frontScale?: number;\r\n  /** Frames after the start before the line begins floating forward. */\r\n  approachDelay?: number;\r\n  /** Frames the line takes to float forward. */\r\n  approachDuration?: number;\r\n\r\n  /**\r\n   * Frames before the second word arrives. The lead word is alone until then, so\r\n   * this is the beat between it landing and the sentence starting to build.\r\n   */\r\n  wordDelay?: number;\r\n  /** Frames between each trailing word arriving. */\r\n  wordStagger?: number;\r\n  /** How far right of its slot a trailing word starts, in em. */\r\n  wordPush?: number;\r\n  /**\r\n   * Frames a trailing word takes to push into its slot. The lead word is shoved\r\n   * left over the same window, so the push and the shove are one motion.\r\n   */\r\n  wordPushDuration?: number;\r\n\r\n  /**\r\n   * How many trailing words bounce their letters in. 1 (the default) bounces\r\n   * only the second word; the rest simply push in. The lead word never bounces.\r\n   */\r\n  bounceWords?: number;\r\n  /** How far each letter swells at the peak of its bounce (0.23 = 23% bigger). */\r\n  letterSwell?: number;\r\n  /** Frames between one letter starting its bounce and the next. */\r\n  letterStagger?: number;\r\n  /** Frames a letter takes to swell up. */\r\n  letterRise?: number;\r\n  /** Frames a letter stays swollen at the top of its bounce. */\r\n  letterHold?: number;\r\n  /** Frames a letter takes to settle back to its natural size. */\r\n  letterFall?: number;\r\n\r\n  /** Frames the line stays forward once everything has landed. */\r\n  holdDuration?: number;\r\n  /** Frames the whole line takes to fall back to its final size. */\r\n  recedeDuration?: number;\r\n\r\n  /** Resting letter-spacing (CSS value, em recommended). */\r\n  letterSpacing?: string;\r\n  speed?: number;\r\n  className?: string;\r\n}\r\n\r\n/**\r\n * The lead word rising into place: already moving, decelerating to a standstill.\r\n *\r\n * A *moderate* decelerate, deliberately — not the quint/expo-out that this kind\r\n * of entrance usually reaches for. Those asymptote: they cover 99% of the travel\r\n * in the first third and then crawl. Over a 50px rise at 30fps that leaves five\r\n * frames moving less than half a pixel each, which rasterise to identical frames\r\n * — the word visibly stops dead partway up and then the next beat starts. This\r\n * curve still arrives at a standstill, but it spends its frames on travel you can\r\n * see. The general rule for anything on a frame clock: a settle worth one frame\r\n * is a settle; a settle worth five frames is a freeze.\r\n */\r\nconst RISE_EASE = Easing.bezier(0.2, 0.6, 0.35, 1);\r\n\r\n/** The line floating forward: eases in, decelerates into a hang. */\r\nconst APPROACH_EASE = Easing.bezier(0.4, 0, 0.15, 1);\r\n\r\n/**\r\n * The fall back. Heavily eased in — barely 10% travelled a third of the way\r\n * through — so the line hangs a moment longer than you expect and then carries\r\n * to a dead stop. No bounce.\r\n */\r\nconst ZOOM_EASE = Easing.bezier(0.5, 0, 0.05, 1);\r\n\r\n/**\r\n * A word pushing into its slot, and the shove it gives the line. Quick off the\r\n * mark, long soft landing.\r\n */\r\nconst WORD_EASE = Easing.bezier(0.22, 0.8, 0.36, 1);\r\n\r\n/**\r\n * Both halves of a letter's bounce. It leaves and arrives at a standstill, so\r\n * the letter eases off its baseline, rounds over the top and eases back down\r\n * with no kink at either end and no jerk on the way up.\r\n */\r\nconst LETTER_EASE = Easing.bezier(0.4, 0, 0.2, 1);\r\n\r\n/** Fraction of the frame width the line may occupy. */\r\nconst FIT = 0.97;\r\n\r\n/**\r\n * A title reveal built around one idea: the lead word is pushed aside by the\r\n * words that follow it.\r\n *\r\n * 1. The lead word rises from below and settles, centred, at its natural size.\r\n * 2. The line floats forward — toward the viewer.\r\n * 3. The second word cuts in from the right, its letters bouncing up off the\r\n *    baseline one after another, and **shoves the lead word left** to make room.\r\n *    Later words follow, pushing in without a bounce, each shoving the lead word\r\n *    further left.\r\n * 4. Once everything has landed, the whole line falls back to its final size and\r\n *    settles into the sentence.\r\n *\r\n * The shove is the point, so it is not on a clock of its own. Each word owns a\r\n * share of the leftward travel — its share of the width it adds to the line —\r\n * and spends that share over exactly the frames it spends pushing into its slot.\r\n * The lead word therefore cannot move until a word arrives to move it, and it\r\n * lands where the finished sentence needs it to be.\r\n *\r\n * Only `scale`, `translate` and `opacity` animate — nothing reflows — so the\r\n * baseline is fixed and there is no layout shift.\r\n */\r\nexport function TextSwell({\r\n  text = \"No extra charge\",\r\n  fontSize = 72,\r\n  color,\r\n  fontWeight = 600,\r\n  theme,\r\n  mode,\r\n  fontFamily,\r\n  introDuration = 8,\r\n  riseDistance = 0.7,\r\n  riseDuration = 10,\r\n  startScale = 1,\r\n  frontScale = 2.1,\r\n  approachDelay = 14,\r\n  approachDuration = 20,\r\n  wordDelay = 27,\r\n  wordStagger = 14,\r\n  wordPush = 0.15,\r\n  wordPushDuration = 12,\r\n  bounceWords = 1,\r\n  letterSwell = 0.23,\r\n  letterStagger = 2,\r\n  letterRise = 3,\r\n  letterHold = 0,\r\n  letterFall = 6,\r\n  holdDuration = 6,\r\n  recedeDuration = 18,\r\n  letterSpacing = \"-0.03em\",\r\n  speed = 1,\r\n  className,\r\n}: TextSwellProps) {\r\n  const frame = useCurrentFrame() * speed;\r\n  const { width } = useVideoConfig();\r\n  const t = useKuchiTheme(theme, mode);\r\n  const face =\r\n    resolveFont(fontFamily ?? t.fontFamily) ??\r\n    \"-apple-system, BlinkMacSystemFont, sans-serif\";\r\n  const fill = color ?? t.foreground;\r\n\r\n  const words = text.split(\" \").filter(Boolean);\r\n\r\n  /**\r\n   * Why the scale is pivoted on the baseline, and not on the middle of the line.\r\n   *\r\n   * Browsers do not scale text the way they scale an image. They re-shape and\r\n   * re-rasterise the glyphs at every new size, and the rasteriser snaps each\r\n   * glyph's origin to the pixel grid: horizontally it gets quarter-pixel\r\n   * precision, vertically it gets **none at all** — the origin rounds to a whole\r\n   * device pixel. So a scale that moves the baseline makes the type climb the\r\n   * pixel grid in whole-pixel steps. During the slow ends of an eased curve the\r\n   * baseline drifts by a fraction of a pixel per frame, which rounds to *nothing*\r\n   * for several frames and then to a whole pixel all at once: the letters sit\r\n   * still, jump, sit still. That is the \"stuck\", and no amount of easing work\r\n   * fixes it, because it is the type being quantised, not the animation.\r\n   *\r\n   * Pivot on the baseline and the baseline's device Y simply never changes, so\r\n   * there is nothing to snap. The glyphs still re-rasterise at every size — which\r\n   * is what we want, it is why they stay crisp — they just stop moving vertically\r\n   * while doing it. Swept across a linear 1.6x → 1x ramp, the line's vertical\r\n   * judder falls from 0.284px (pivoting on the middle, 29 direction reversals in\r\n   * 40 frames) to 0.014px with zero reversals, and the minimum sits exactly on\r\n   * the baseline and nowhere else.\r\n   *\r\n   * The alternative — compositing the line so the GPU resamples a bitmap — also\r\n   * removes the snapping, but it stops the type being re-rasterised at all: what\r\n   * you get on screen is a rescaled texture, softer than real type at every size\r\n   * but one. Crisp and smooth beats smooth alone.\r\n   *\r\n   * The visible cost is that the line now grows *upward* off its baseline rather\r\n   * than outward from its middle, which shifts the ink about 10px at full size on\r\n   * a 720p frame. Type sitting on a line and growing off it is the more\r\n   * typographic read anyway.\r\n   */\r\n\r\n  // The lead word sits in the middle of the frame while it is alone, and every\r\n  // word after it shoves the line left by the width it adds. That needs the\r\n  // line's rendered width and where each word ends inside it — all constant\r\n  // across frames, so measure once and hold the render until they are known.\r\n  // offsetLeft / offsetWidth are layout px, untouched by the animated\r\n  // transforms, so they give the unscaled geometry.\r\n  const lineRef = useRef<HTMLSpanElement>(null);\r\n  const wordRefs = useRef<(HTMLSpanElement | null)[]>([]);\r\n  const [handle] = useState(() => delayRender(\"text-swell: measure line\"));\r\n  const baselineRef = useRef<HTMLSpanElement>(null);\r\n  const [metrics, setMetrics] = useState<{\r\n    lineWidth: number;\r\n    leadCenter: number;\r\n    /** Right edge of each word, in unscaled line-local px. */\r\n    ends: number[];\r\n    /** Distance from the top of the line box down to the text baseline. */\r\n    baseline: number;\r\n  } | null>(null);\r\n\r\n  useEffect(() => {\r\n    const line = lineRef.current;\r\n    const spans = wordRefs.current.slice(0, words.length);\r\n    if (!line || spans.length !== words.length || spans.some((s) => !s)) {\r\n      continueRender(handle);\r\n      return;\r\n    }\r\n    const lead = spans[0] as HTMLSpanElement;\r\n    // An empty, zero-sized inline-block sits with its bottom edge on the text\r\n    // baseline, so its offsetTop *is* the baseline — measured from the real font\r\n    // metrics rather than guessed from a line-height ratio.\r\n    const baseline = baselineRef.current?.offsetTop ?? line.offsetHeight * 0.8;\r\n    setMetrics({\r\n      lineWidth: line.offsetWidth,\r\n      leadCenter: lead.offsetLeft + lead.offsetWidth / 2,\r\n      ends: spans.map((s) => {\r\n        const el = s as HTMLSpanElement;\r\n        return el.offsetLeft + el.offsetWidth;\r\n      }),\r\n      baseline,\r\n    });\r\n  }, [handle, words.length]);\r\n\r\n  // Release the render only once the measurement has re-rendered, so the very\r\n  // first captured frame already carries the correct geometry (no blank frame).\r\n  useEffect(() => {\r\n    if (metrics) continueRender(handle);\r\n  }, [metrics, handle]);\r\n\r\n  const ready = metrics !== null;\r\n  const lineWidth = metrics?.lineWidth ?? width * 0.4;\r\n  const leadCenter = metrics?.leadCenter ?? lineWidth * 0.08;\r\n  const ends =\r\n    metrics?.ends ?? words.map((_, i) => ((i + 1) * lineWidth) / words.length);\r\n  // Distance from the top of the line box down to the text baseline — the one\r\n  // point the scale must not move. See the note above.\r\n  const baseline = metrics?.baseline ?? fontSize * 0.88;\r\n\r\n  // Where the line's left edge rests once everything has settled — flexbox\r\n  // centres the line, and the transform pivots on that same left edge.\r\n  const restLeft = (width - lineWidth) / 2;\r\n\r\n  // Each trailing word owns a share of the leftward shove, proportional to the\r\n  // width it adds to the line. `before[i]` is how much of the shove is already\r\n  // spent by the time word `i` arrives.\r\n  const added = words.map((_, i) => (i === 0 ? 0 : ends[i] - ends[i - 1]));\r\n  const totalAdded = added.reduce((a, b) => a + b, 0) || 1;\r\n  const share = added.map((a) => a / totalAdded);\r\n  const before: number[] = [];\r\n  for (let i = 0, run = 0; i < words.length; i++) {\r\n    before.push(run);\r\n    run += share[i];\r\n  }\r\n\r\n  const wordStart = (i: number) => wordDelay + (i - 1) * wordStagger;\r\n  const letterStart = (i: number, j: number) =>\r\n    wordStart(i) + j * letterStagger;\r\n\r\n  // Floating forward blows the line up about its left edge, and until the last\r\n  // word has finished shoving, that edge still sits right of where it will rest.\r\n  // A word arriving into that gap is the widest the line ever gets, so cap the\r\n  // float at whatever keeps even that moment inside the frame.\r\n  let front = Math.min(frontScale, (width * FIT - restLeft) / lineWidth);\r\n  for (let i = 1; i < words.length; i++) {\r\n    const unspent = 1 - before[i];\r\n    const room = width * FIT - restLeft - (lineWidth / 2) * unspent;\r\n    const reach = ends[i] + wordPush * fontSize - leadCenter * unspent;\r\n    if (reach > 0) front = Math.min(front, room / reach);\r\n  }\r\n  front = Math.max(1, front);\r\n\r\n  // Float forward, hang, then fall back. The two curves never overlap — the\r\n  // first clamps at `front` once the approach ends, the second is 0 until the\r\n  // recede starts — so they sum into one continuous scale: startScale → front → 1.\r\n  const lastEnd = Math.max(\r\n    approachDelay + approachDuration,\r\n    ...words.map((word, i) =>\r\n      i === 0\r\n        ? 0\r\n        : Math.max(\r\n            wordStart(i) + wordPushDuration,\r\n            i <= bounceWords\r\n              ? letterStart(i, word.length - 1) +\r\n                  letterRise +\r\n                  letterHold +\r\n                  letterFall\r\n              : 0,\r\n          ),\r\n    ),\r\n  );\r\n  const recedeStart = lastEnd + holdDuration;\r\n\r\n  const scale =\r\n    interpolate(\r\n      frame,\r\n      [approachDelay, approachDelay + approachDuration],\r\n      [startScale, front],\r\n      {\r\n        extrapolateLeft: \"clamp\",\r\n        extrapolateRight: \"clamp\",\r\n        easing: APPROACH_EASE,\r\n      },\r\n    ) +\r\n    interpolate(\r\n      frame,\r\n      [recedeStart, recedeStart + recedeDuration],\r\n      [0, 1 - front],\r\n      {\r\n        extrapolateLeft: \"clamp\",\r\n        extrapolateRight: \"clamp\",\r\n        easing: ZOOM_EASE,\r\n      },\r\n    );\r\n\r\n  // How much of the leftward shove has been spent. Nothing moves the lead word\r\n  // but the words arriving to move it, so this is just their pushes added up.\r\n  let shoved = 0;\r\n  for (let i = 1; i < words.length; i++) {\r\n    shoved +=\r\n      share[i] *\r\n      interpolate(\r\n        frame,\r\n        [wordStart(i), wordStart(i) + wordPushDuration],\r\n        [0, 1],\r\n        {\r\n          extrapolateLeft: \"clamp\",\r\n          extrapolateRight: \"clamp\",\r\n          easing: WORD_EASE,\r\n        },\r\n      );\r\n  }\r\n\r\n  // Unshoved, the line sits wherever puts the lead word in the middle of the\r\n  // frame — at any scale, so the word stays centred as it floats forward. Fully\r\n  // shoved, it sits on its resting left edge, which is where the finished\r\n  // sentence belongs. `shoved` walks between the two.\r\n  const translateX = (lineWidth / 2 - scale * leadCenter) * (1 - shoved);\r\n\r\n  return (\r\n    <AbsoluteFill\r\n      style={{\r\n        alignItems: \"center\",\r\n        justifyContent: \"center\",\r\n        background: \"transparent\",\r\n      }}\r\n    >\r\n      <span\r\n        ref={lineRef}\r\n        className={className}\r\n        style={{\r\n          position: \"relative\",\r\n          display: \"inline-block\",\r\n          fontSize,\r\n          fontWeight,\r\n          color: fill,\r\n          letterSpacing,\r\n          lineHeight: 1.1,\r\n          whiteSpace: \"nowrap\",\r\n          fontFamily: face,\r\n          // Pivot on the lead word's left edge, and on the baseline. See above:\r\n          // the baseline is what must not move.\r\n          transformOrigin: `0% ${baseline}px`,\r\n          scale,\r\n          translate: `${translateX}px`,\r\n          opacity: ready ? 1 : 0,\r\n          // The second half of the fix, and the one that stops the *shake* rather\r\n          // than the stick.\r\n          //\r\n          // Hinting distorts each glyph's outline so its stems land on whole\r\n          // pixels — great for a static paragraph, ruinous for type that is\r\n          // changing size. As the scale slides, every stem re-snaps to a different\r\n          // grid, so the letterforms visibly change shape from frame to frame.\r\n          // They boil. Measured over the fall-back, the line's shape invariant\r\n          // (ink area over width squared, which for a rigid shape being scaled\r\n          // literally cannot change) wandered by 3.41% with hinting on and 0.22%\r\n          // with it off — fifteen times steadier.\r\n          //\r\n          // `geometricPrecision` turns hinting off and asks for the outline to be\r\n          // rendered as it actually is. The type reads very slightly softer,\r\n          // because the stems are no longer being snapped — that is not blur, it\r\n          // is the absence of a lie, and it is what every professional motion tool\r\n          // does with type. It also forces sub-pixel glyph positioning on, which\r\n          // Blink otherwise only enables above a device scale factor of 1 — and a\r\n          // Remotion render is exactly 1.\r\n          textRendering: \"geometricPrecision\",\r\n          // Rendering and live playback want opposite things here, so give each\r\n          // what it needs.\r\n          //\r\n          // A render has no time budget: the browser re-shapes and re-rasterises\r\n          // every glyph at every new size, which is why the type stays genuinely\r\n          // crisp, and the two fixes above are what make that smooth. Compositing\r\n          // it would only replace real type with a rescaled texture — and worse,\r\n          // a render is spread across parallel browser tabs, each of which\r\n          // inherits a stale raster from whatever scale it drew last, so the same\r\n          // frame comes out differently depending on which tab drew it.\r\n          //\r\n          // The Player is the opposite: one continuous tab, and roughly eight\r\n          // milliseconds a frame on a 120Hz screen. Re-shaping a line of type at\r\n          // a brand-new size every frame is the most expensive way to draw text,\r\n          // and a frame that misses the budget is simply shown for the wrong\r\n          // length of time — stutter that no amount of CSS can fix. So for live\r\n          // playback, hand the scale to the compositor: measured on a single\r\n          // continuous tab it is smooth (0.016px of judder) with no loss of\r\n          // sharpness at all.\r\n          ...(getRemotionEnvironment().isRendering\r\n            ? null\r\n            : { willChange: \"transform\" as const }),\r\n        }}\r\n      >\r\n        {words.map((word, i) => {\r\n          const isLead = i === 0;\r\n          const start = wordStart(i);\r\n          const bounces = i >= 1 && i <= bounceWords;\r\n          return (\r\n            // The gap between words is a plain text node *between* the word\r\n            // spans, not inside one. A trailing space inside an inline-block sits\r\n            // at the end of that box's line and CSS strips it, which would run\r\n            // the sentence together.\r\n            // biome-ignore lint/suspicious/noArrayIndexKey: words are positional and never reorder\r\n            <Fragment key={i}>\r\n              {isLead ? null : \" \"}\r\n              <span\r\n                ref={(el) => {\r\n                  wordRefs.current[i] = el;\r\n                }}\r\n                style={{\r\n                  display: \"inline-block\",\r\n                  opacity: isLead\r\n                    ? interpolate(frame, [0, introDuration], [0, 1], {\r\n                        extrapolateLeft: \"clamp\",\r\n                        extrapolateRight: \"clamp\",\r\n                      })\r\n                    : interpolate(frame, [start, start + 3], [0, 1], {\r\n                        extrapolateLeft: \"clamp\",\r\n                        extrapolateRight: \"clamp\",\r\n                      }),\r\n                  // The lead word rises from below into the middle. Every other\r\n                  // word arrives from the right of its slot and pushes in.\r\n                  translate: isLead\r\n                    ? `0px ${interpolate(\r\n                        frame,\r\n                        [0, riseDuration],\r\n                        [riseDistance * fontSize, 0],\r\n                        {\r\n                          extrapolateLeft: \"clamp\",\r\n                          extrapolateRight: \"clamp\",\r\n                          easing: RISE_EASE,\r\n                        },\r\n                      )}px`\r\n                    : `${interpolate(\r\n                        frame,\r\n                        [start, start + wordPushDuration],\r\n                        [wordPush * fontSize, 0],\r\n                        {\r\n                          extrapolateLeft: \"clamp\",\r\n                          extrapolateRight: \"clamp\",\r\n                          easing: WORD_EASE,\r\n                        },\r\n                      )}px`,\r\n                }}\r\n              >\r\n                {/* Only a bouncing word is split into letters — the others stay\r\n                    one run, which keeps their kerning intact. */}\r\n                {bounces\r\n                  ? Array.from(word).map((letter, j) => {\r\n                      const rise = letterStart(i, j);\r\n                      const fall = rise + letterRise + letterHold;\r\n                      return (\r\n                        <span\r\n                          // biome-ignore lint/suspicious/noArrayIndexKey: letters are positional and never reorder\r\n                          key={j}\r\n                          style={{\r\n                            display: \"inline-block\",\r\n                            // Swell up off the baseline and settle back. The rise\r\n                            // clamps at 1 and the fall is 0 until it starts, so\r\n                            // the difference is one pulse: 0 → 1 → 0, with\r\n                            // `letterHold` frames of flat top between them.\r\n                            // Pivot on the baseline, not on `100%`. The bottom of\r\n                            // an inline-block sits *below* the baseline by the\r\n                            // descent, so pivoting there would drag the letter's\r\n                            // baseline upward as it swells — and a baseline that\r\n                            // moves is exactly what snaps to the pixel grid.\r\n                            transformOrigin: `50% ${baseline}px`,\r\n                            scale:\r\n                              1 +\r\n                              letterSwell *\r\n                                (interpolate(\r\n                                  frame,\r\n                                  [rise, rise + letterRise],\r\n                                  [0, 1],\r\n                                  {\r\n                                    extrapolateLeft: \"clamp\",\r\n                                    extrapolateRight: \"clamp\",\r\n                                    easing: LETTER_EASE,\r\n                                  },\r\n                                ) -\r\n                                  interpolate(\r\n                                    frame,\r\n                                    [fall, fall + letterFall],\r\n                                    [0, 1],\r\n                                    {\r\n                                      extrapolateLeft: \"clamp\",\r\n                                      extrapolateRight: \"clamp\",\r\n                                      easing: LETTER_EASE,\r\n                                    },\r\n                                  )),\r\n                          }}\r\n                        >\r\n                          {letter}\r\n                        </span>\r\n                      );\r\n                    })\r\n                  : word}\r\n              </span>\r\n            </Fragment>\r\n          );\r\n        })}\r\n        {/* Baseline ruler. An empty, zero-sized inline-block aligns its bottom\r\n            edge to the text baseline, so `offsetTop` reads the baseline straight\r\n            off the font's real metrics. Zero-sized, so it changes no layout. */}\r\n        <span\r\n          ref={baselineRef}\r\n          style={{ display: \"inline-block\", width: 0, height: 0 }}\r\n        />\r\n      </span>\r\n    </AbsoluteFill>\r\n  );\r\n}\r\n"}]}