{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "type-mask",
  "type": "registry:component",
  "title": "typeMask",
  "description": "A giant word holds, then scales up exponentially until the negative space inside its letters blows past the screen edges — revealing the incoming scene through the type. A kinetic typographic mask. Onda-original.",
  "dependencies": [
    "remotion",
    "@remotion/transitions",
    "zod"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/transitions/type-mask/typeMask.tsx",
      "type": "registry:component",
      "target": "components/onda/transitions/type-mask/typeMask.tsx",
      "content": "import React from 'react';\nimport type { TransitionPresentation, TransitionPresentationComponentProps } from '@remotion/transitions';\nimport { AbsoluteFill, Easing, interpolate } from 'remotion';\nimport { typeMaskSchema, type TypeMaskOptions } from './schema';\n\nexport { typeMaskSchema, type TypeMaskOptions };\n\ntype TypeMaskProps = {\n  text: string;\n  holdFrames: number;\n  maxScale: number;\n  color: string;\n  fontFamily: string;\n};\n\nconst EASE = Easing.bezier(0.16, 1, 0.3, 1);\n\n// Render the word into an SVG data URI so it can drive a CSS mask. The viewBox\n// is square and the text is centered; scaling the host element scales this\n// mask with it, so the letterforms — and the negative space they frame — grow\n// together. White = revealed, transparent = hidden.\nfunction maskUri(text: string, fontFamily: string): string {\n  const svg =\n    `<svg xmlns='http://www.w3.org/2000/svg' width='1000' height='1000' viewBox='0 0 1000 1000'>` +\n    `<text x='500' y='500' text-anchor='middle' dominant-baseline='central' ` +\n    `font-family='${fontFamily.replace(/'/g, '\"')}' font-weight='700' font-size='420' fill='white'>` +\n    `${text}</text></svg>`;\n  return `url(\"data:image/svg+xml;utf8,${encodeURIComponent(svg)}\")`;\n}\n\nconst TypeMaskPresentation: React.FC<\n  TransitionPresentationComponentProps<TypeMaskProps>\n> = ({ presentationProgress, presentationDirection, children, passedProps }) => {\n  const { text, holdFrames, maxScale, color, fontFamily } = passedProps;\n  const isEntering = presentationDirection === 'entering';\n\n  // The outgoing scene renders untouched beneath; only the entering layer is\n  // masked by the type, so we leave exiting frames alone.\n  if (!isEntering) {\n    return <AbsoluteFill>{children}</AbsoluteFill>;\n  }\n\n  // Hold the type at rest, then scale it exponentially so the negative space\n  // inside the letters blows past the screen edges. Progress past `holdFrames`\n  // is remapped to 0..1 and eased — no overshoot, settles into full reveal.\n  const open = interpolate(presentationProgress, [holdFrames, 1], [0, 1], {\n    extrapolateLeft: 'clamp',\n    extrapolateRight: 'clamp',\n    easing: EASE,\n  });\n  // Exponential growth: 1 -> maxScale. Reads as an accelerating zoom into the type.\n  const scale = Math.pow(maxScale, open);\n\n  const uri = maskUri(text, fontFamily);\n\n  // The colored word holds solid over the outgoing scene, then dissolves as the\n  // interior opens to reveal the incoming scene through the type.\n  const wordOpacity = interpolate(open, [0, 0.18], [1, 0], {\n    extrapolateLeft: 'clamp',\n    extrapolateRight: 'clamp',\n  });\n\n  return (\n    <AbsoluteFill>\n      {/* Solid held word — fades out the instant the type starts opening. */}\n      <AbsoluteFill\n        style={{\n          transform: `scale(${scale})`,\n          opacity: wordOpacity,\n          maskImage: uri,\n          WebkitMaskImage: uri,\n          maskRepeat: 'no-repeat',\n          WebkitMaskRepeat: 'no-repeat',\n          maskPosition: 'center',\n          WebkitMaskPosition: 'center',\n          maskSize: 'contain',\n          WebkitMaskSize: 'contain',\n          backgroundColor: color,\n        }}\n      />\n      {/* Incoming scene, seen only through the type as it scales to fill. */}\n      <AbsoluteFill\n        style={{\n          transform: `scale(${scale})`,\n          maskImage: uri,\n          WebkitMaskImage: uri,\n          maskRepeat: 'no-repeat',\n          WebkitMaskRepeat: 'no-repeat',\n          maskPosition: 'center',\n          WebkitMaskPosition: 'center',\n          maskSize: 'contain',\n          WebkitMaskSize: 'contain',\n        }}\n      >\n        {/* Counter-scale so the scene content stays at 1:1 while the mask grows. */}\n        <AbsoluteFill style={{ transform: `scale(${1 / scale})` }}>\n          {children}\n        </AbsoluteFill>\n      </AbsoluteFill>\n    </AbsoluteFill>\n  );\n};\n\n/**\n * A giant word holds briefly, then scales up exponentially until the negative\n * space inside its letters blows past the screen edges — and the incoming\n * scene is revealed through the type. The masking word starts solid over the\n * outgoing scene, then dissolves into a window onto the next scene. Kinetic and\n * typographic; reaches for punch, not calm.\n *\n * Pair with the recommended Onda timing for the house feel:\n * `linearTiming({ durationInFrames: 24, easing: Easing.bezier(0.16, 1, 0.3, 1) })`\n *\n * Onda-original.\n */\nexport function typeMask(\n  options?: TypeMaskOptions,\n): TransitionPresentation<TypeMaskProps> {\n  const opts = typeMaskSchema.parse(options ?? {});\n  return {\n    component: TypeMaskPresentation,\n    props: {\n      text: opts.text,\n      holdFrames: opts.holdFrames,\n      maxScale: opts.maxScale,\n      color: opts.color,\n      fontFamily: opts.fontFamily,\n    },\n  };\n}\n\nexport default typeMask;\n"
    },
    {
      "path": "registry/transitions/type-mask/schema.ts",
      "type": "registry:component",
      "target": "components/onda/transitions/type-mask/schema.ts",
      "content": "import { z } from 'zod';\n\n/** Zod schema for {@link typeMask} options. */\nexport const typeMaskSchema = z.object({\n  /** Discriminator literal — matches this entry's registry slug. Auto-populated when omitted. */\n  kind: z.literal('type-mask').default('type-mask'),\n  /** The word held then blown up to mask the cut. Short, bold words read best. */\n  text: z.string().default('NEXT'),\n  /** Portion of the transition (0–1) the type holds at rest before it scales. */\n  holdFrames: z.number().min(0).max(0.9).default(0.35),\n  /** How large the type scales by the end — large enough to push every letterform past the edges. */\n  maxScale: z.number().min(2).max(60).default(22),\n  /** Fill of the masking type. Match your canvas so the held word reads as solid. */\n  color: z.string().default('var(--onda-text, #F2F2F4)'),\n  /** Type family for the mask word. Default Clash Display — boldest weight for the widest interior space. */\n  fontFamily: z.string().default('var(--onda-font-display, \"Clash Display\", sans-serif)'),\n});\n\nexport type TypeMaskOptions = z.input<typeof typeMaskSchema>;\n"
    },
    {
      "path": "registry/transitions/type-mask/type-mask.meta.json",
      "type": "registry:file",
      "target": "components/onda/transitions/type-mask/type-mask.meta.json",
      "content": "{\n  \"name\": \"type-mask\",\n  \"title\": \"typeMask\",\n  \"description\": \"A giant word holds, then scales up exponentially until the negative space inside its letters blows past the screen edges — revealing the incoming scene through the type. A kinetic typographic mask. Onda-original.\",\n  \"pickWhen\": \"the title word IS the cut — kinetic title sequences, branded openers. Once per piece; the typography is doing the work.\",\n  \"category\": \"transitions\",\n  \"tags\": [\n    \"transition\",\n    \"type\",\n    \"mask\",\n    \"kinetic\",\n    \"scene\"\n  ],\n  \"dependencies\": [\n    \"remotion\",\n    \"@remotion/transitions\",\n    \"zod\"\n  ]\n}\n"
    },
    {
      "path": "registry/transitions/type-mask/README.md",
      "type": "registry:file",
      "target": "components/onda/transitions/type-mask/README.md",
      "content": "# typeMask\n\nA giant word holds briefly, then scales up exponentially until the negative space inside its letters blows past the screen edges — and the incoming scene is revealed through the type. The masking word starts solid over the outgoing scene, then dissolves into a window onto the next scene. A kinetic, typographic cut that reaches for punch over calm.\n\nOnda-original. Use inside Remotion's `<TransitionSeries>`.\n\n## Options\n\n| Option | Type | Default | Notes |\n| --- | --- | --- | --- |\n| `text` | `string` | `'NEXT'` | The word held then blown up to mask the cut. Short, bold words read best. |\n| `holdFrames` | `number` | `0.35` | Portion of the transition (0–1) the type holds at rest before it scales. |\n| `maxScale` | `number` | `22` | How large the type scales by the end — large enough to push every letterform past the edges. |\n| `color` | `string` | `#F2F2F4` | Fill of the held masking type. |\n| `fontFamily` | `string` | `\"Clash Display\", sans-serif` | Type family for the mask word. Default Clash Display — boldest weight for the widest interior space. |\n\n## Usage\n\n```tsx\nimport { Easing } from 'remotion';\nimport { TransitionSeries, linearTiming } from '@remotion/transitions';\nimport { typeMask } from './components/onda/transitions/type-mask/typeMask';\n\n<TransitionSeries>\n  <TransitionSeries.Sequence durationInFrames={150}><SceneA /></TransitionSeries.Sequence>\n  <TransitionSeries.Transition\n    presentation={typeMask({ text: 'NEXT' })}\n    timing={linearTiming({ durationInFrames: 24, easing: Easing.bezier(0.16, 1, 0.3, 1) })}\n  />\n  <TransitionSeries.Sequence durationInFrames={150}><SceneB /></TransitionSeries.Sequence>\n</TransitionSeries>\n```\n"
    }
  ]
}
