{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "gather-lockup",
  "title": "Gather Lockup",
  "description": "Logo reveal in two and a half seconds. A wall of your work sits under a line of type. The line falls apart word by word, the wall cuts in to a row of four, and each slot swaps its picture and hands over to your mark and wordmark. Measured frame by frame off a reference recording.",
  "dependencies": [
    "remotion",
    "@remotion/google-fonts"
  ],
  "registryDependencies": [
    "https://snapcn.dev/r/snap-cn-ui.json"
  ],
  "files": [
    {
      "path": "registry/snap-cn/gather-lockup/index.tsx",
      "content": "// Gather Lockup · snapcn — https://snapcn.dev/docs/scenes/gather-lockup\n\"use client\";\n\nimport { loadFont as loadInterTight } from \"@remotion/google-fonts/InterTight\";\nimport { AbsoluteFill, Img, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport {\n  resolveFont,\n  type SnapCnTheme,\n  useSnapCnTheme,\n} from \"@/lib/snap-cn-ui\";\nimport {\n  CAPTIONS,\n  FRAMES,\n  IMAGES,\n  LOGO,\n  RATE,\n  SNAPCN_MARK,\n  TILES,\n  WORDS,\n} from \"./data\";\n\nconst { fontFamily: INTER_TIGHT } = loadInterTight(\"normal\", {\n  weights: [\"500\", \"600\"],\n  subsets: [\"latin\"],\n});\n\nconst STAGE_W = 1920;\nconst STAGE_H = 1080;\n/** Layout size of a tile before its transform; big, so percentages snap to nothing. */\nconst UNIT = 2000;\n\nexport interface GatherLockupProps {\n  /** The title: lines of words. Five words read best, the wall leaves on them. */\n  lines?: readonly (readonly string[])[];\n  /** Fifteen pictures: seven on the wall, four in the row, four they swap to. */\n  images?: readonly string[];\n  /** A caption under each of the seven tiles on the wall. */\n  captions?: readonly string[];\n  /** The wordmark the row turns into. */\n  wordmark?: string;\n  /** Your mark as SVG paths, like Cut Lockup's `logo`. Defaults to the snapcn mark. */\n  logo?: {\n    width: number;\n    height: number;\n    shapes: readonly string[];\n  };\n  font?: string;\n  /** Wordmark colour. Defaults to the theme's foreground. */\n  wordmarkColor?: string;\n  /** Letter spacing of the wordmark, in em. */\n  wordmarkTracking?: number;\n  /** CSS background under everything. Defaults to the theme's page colour. */\n  backdrop?: string;\n  speed?: number;\n  theme?: Partial<SnapCnTheme>;\n  mode?: \"light\" | \"dark\";\n}\n\n/** The pose in force at `frame`: the last key that has started. */\nexport const pose = <K extends readonly number[]>(\n  keys: readonly K[],\n  frame: number,\n) => {\n  let hit: K | undefined;\n  for (const k of keys) if ((k[0] ?? 0) <= frame) hit = k;\n  return hit;\n};\n\n/**\n * Letters of the wordmark at a key: the first `n` scaled from the six-letter\n * source, split before the last one shown when `split` is set.\n */\nexport const reveal = (word: string, n: number, split: number) => {\n  const shown =\n    n >= 6\n      ? word.length\n      : n >= 4\n        ? word.length - 1\n        : Math.ceil(word.length / 3);\n  return split\n    ? [word.slice(0, shown - 1), word.slice(shown - 1, shown)]\n    : [word.slice(0, shown), \"\"];\n};\n\nconst Title: React.FC<{\n  frame: number;\n  words: readonly string[];\n  fill: string;\n  font: string;\n}> = ({ frame, words, fill, font }) => (\n  <>\n    {WORDS.map((w, i) => {\n      const k = pose(w.keys, frame);\n      const word = words[i];\n      if (!k || !word || frame > w.until) return null;\n      return (\n        <text\n          key={`${i}-${word}`}\n          x={k[1]}\n          y={k[2]}\n          textAnchor={w.anchor}\n          fill={fill}\n          style={{\n            fontFamily: font,\n            fontWeight: 600,\n            fontSize: k[3],\n            letterSpacing: \"-0.02em\",\n            textRendering: \"geometricPrecision\",\n          }}\n        >\n          {word}\n        </text>\n      );\n    })}\n  </>\n);\n\n/**\n * Gather Lockup: a wall of your work under a line of type. The line falls apart\n * word by word, the wall cuts in to a row of four, then each slot swaps its\n * picture and hands over to your mark and wordmark. `t` is seconds into the clip.\n */\nexport const GatherLockupScene: React.FC<GatherLockupProps & { t: number }> = ({\n  t,\n  lines = [[\"Ship\"], [\"your\", \"demo\"], [\"in\", \"code\"]],\n  images = IMAGES,\n  captions = CAPTIONS,\n  wordmark = \"snapcn\",\n  logo = SNAPCN_MARK,\n  font,\n  wordmarkColor,\n  wordmarkTracking = -0.03,\n  backdrop,\n  theme,\n  mode,\n}) => {\n  const c = useSnapCnTheme(theme, mode);\n  const { width, height } = useVideoConfig();\n  const frame = Math.min(FRAMES - 1, Math.floor(t * RATE + 1e-6));\n  const family = resolveFont(font) ?? INTER_TIGHT;\n  const px = Math.max(width / STAGE_W, height / STAGE_H);\n  const words = lines.flat();\n  // ponytail: width by letter count, not measured; the source wordmark has six letters\n  const lockupShift = -0.28 * LOGO.wordSize * (wordmark.length - 6);\n  const mark = pose(LOGO.mark, frame);\n  const word = pose(LOGO.word, frame);\n  const [head, tail] = word\n    ? reveal(wordmark, word[1] ?? 0, word[2] ?? 0)\n    : [\"\", \"\"];\n  const scale = LOGO.size / Math.max(logo.width, logo.height);\n\n  return (\n    <AbsoluteFill\n      style={{ background: backdrop ?? c.background, overflow: \"hidden\" }}\n    >\n      <div\n        style={{\n          position: \"absolute\",\n          left: (width - STAGE_W * px) / 2,\n          top: (height - STAGE_H * px) / 2,\n          width: STAGE_W,\n          height: STAGE_H,\n          transform: `scale(${px})`,\n          transformOrigin: \"0 0\",\n        }}\n      >\n        {TILES.map((tile) => {\n          const k = pose(tile.keys, frame);\n          if (!k || frame > tile.until) return null;\n          const [, pic = 0, x = 0, y = 0, w = 0, h = 0] = k;\n          const [bx = 0, by = 0, bw = 0, bh = 0] = k.slice(6);\n          return (\n            // Unit box scaled up: left/top/width/height would snap to device pixels.\n            <div\n              key={tile.keys[0]?.[1]}\n              style={{\n                position: \"absolute\",\n                left: 0,\n                top: 0,\n                width: UNIT,\n                height: (UNIT * h) / w,\n                overflow: \"hidden\",\n                opacity: tile.opacity,\n                transformOrigin: \"0 0\",\n                transform: `translate(${x}px, ${y}px) scale(${w / UNIT})`,\n              }}\n            >\n              <Img\n                src={images[pic % Math.max(1, images.length)] ?? \"\"}\n                style={{\n                  position: \"absolute\",\n                  left: `${((bx - x) / w) * 100}%`,\n                  top: `${((by - y) / h) * 100}%`,\n                  width: `${(bw / w) * 100}%`,\n                  height: `${(bh / h) * 100}%`,\n                  maxWidth: \"none\",\n                  objectFit: \"cover\",\n                }}\n              />\n            </div>\n          );\n        })}\n\n        <svg\n          viewBox={`0 0 ${STAGE_W} ${STAGE_H}`}\n          width={STAGE_W}\n          height={STAGE_H}\n          style={{ position: \"absolute\", inset: 0 }}\n          aria-hidden\n        >\n          {TILES.map((tile, i) => {\n            const k = pose(tile.keys, frame);\n            if (!k || frame > tile.until || (k[1] ?? 0) > 6) return null;\n            const [, , x = 0, y = 0, , h = 0] = k;\n            return (\n              <g key={tile.keys[0]?.[1]} opacity={tile.opacity}>\n                <circle\n                  cx={x + 6}\n                  cy={y + h + 18}\n                  r={4.5}\n                  fill={c.foreground}\n                  opacity={0.5}\n                />\n                <text\n                  x={x + 19}\n                  y={y + h + 23}\n                  fill={c.foreground}\n                  opacity={0.45}\n                  style={{\n                    fontFamily: family,\n                    fontSize: 15,\n                    fontWeight: 500,\n                    textRendering: \"geometricPrecision\",\n                  }}\n                >\n                  {captions[i]}\n                </text>\n              </g>\n            );\n          })}\n          <Title\n            frame={frame}\n            words={words}\n            fill={c.foreground}\n            font={family}\n          />\n          {mark ? (\n            <g\n              transform={`translate(${(mark[1] ?? 0) + lockupShift} ${mark[2] ?? 0}) scale(${scale})`}\n            >\n              <title>{wordmark}</title>\n              {logo.shapes.map((d) => (\n                <path key={d} d={d} fill={c.primary} fillRule=\"evenodd\" />\n              ))}\n            </g>\n          ) : null}\n          {word ? (\n            <text\n              x={(word[3] ?? 0) + lockupShift}\n              y={word[4]}\n              fill={wordmarkColor ?? c.foreground}\n              style={{\n                fontFamily: family,\n                fontWeight: 600,\n                fontSize: LOGO.wordSize,\n                letterSpacing: `${wordmarkTracking}em`,\n                textRendering: \"geometricPrecision\",\n              }}\n            >\n              {head}\n              {tail ? <tspan dx={LOGO.gap}>{tail}</tspan> : null}\n            </text>\n          ) : null}\n        </svg>\n      </div>\n    </AbsoluteFill>\n  );\n};\n\nexport const GatherLockup: React.FC<GatherLockupProps> = ({\n  speed = 1,\n  ...props\n}) => {\n  const frame = useCurrentFrame();\n  const { fps } = useVideoConfig();\n  return <GatherLockupScene {...props} t={(frame * speed) / fps} />;\n};\n\nexport default GatherLockup;\n",
      "type": "registry:component",
      "target": "components/snap-cn/gather-lockup/index.tsx"
    },
    {
      "path": "registry/snap-cn/gather-lockup/data.ts",
      "content": "// Gather Lockup · snapcn — https://snapcn.dev/docs/scenes/gather-lockup\n/**\n * Measured frame by frame off a 45-frame, 24fps screen recording, on a 1920x1080\n * stage. Nothing here eases: the source cuts between held poses, so every table is\n * a list of poses keyed by the frame each one starts on.\n */\n\n/** The source's clock. Poses are frames of it. */\nexport const RATE = 24;\n/** Frames in the clip; the last pose is the lockup and it holds. */\nexport const FRAMES = 45;\n\nexport interface TileTrack {\n  /** from, picture, x, y, w, h, then the box the picture is laid into: x, y, w, h. */\n  keys: readonly (readonly number[])[];\n  /** Last frame on screen. */\n  until: number;\n  opacity: number;\n}\n\n/** Seven tiles. Pictures 0-6 are the wall, 7-10 the row, 11-14 the swaps. */\nexport const TILES: readonly TileTrack[] = [\n  {\n    keys: [\n      [0, 0, 620.0, 50.0, 221.1, 228.7, 582.25, 12.25, 296.6, 304.21],\n      [13, 0, 612.04, 50.11, 221.1, 228.7, 574.29, 12.36, 296.6, 304.21],\n      [17, 0, 1132.37, 3.37, 221.1, 228.7, 1094.62, -34.38, 296.6, 304.21],\n    ],\n    until: 17,\n    opacity: 0.4,\n  },\n  {\n    keys: [\n      [0, 1, 1180.0, 50.0, 211.5, 261.63, 1141.83, 11.68, 288.03, 338.3],\n      [10, 1, 1169.91, 50.0, 211.2, 261.6, 1131.54, 11.68, 288.0, 338.26],\n      [14, 1, 1098.4, 50.32, 211.58, 261.68, 1060.64, 12.57, 287.08, 337.19],\n      [15, 1, 977.07, 254.0, 198.96, 245.93, 940.71, 216.94, 272.19, 319.69],\n      [18, 9, 980.68, 378.42, 194.59, 195.24, 942.93, 340.67, 270.09, 270.74],\n      [21, 9, 980.68, 441.2, 194.64, 194.83, 942.81, 403.94, 270.07, 270.71],\n      [24, 9, 979.71, 447.99, 181.94, 181.46, 944.61, 413.16, 252.04, 252.65],\n      [26, 13, 979.5, 447.78, 182.62, 181.32, 941.74, 410.02, 258.12, 256.83],\n      [27, 13, 977.47, 470.4, 136.37, 135.91, 949.24, 442.55, 192.66, 191.69],\n    ],\n    until: 28,\n    opacity: 1,\n  },\n  {\n    keys: [\n      [0, 2, 120.0, 110.0, 179.43, 237.28, 82.82, 73.05, 256.38, 333.63],\n      [14, 2, 228.19, 110.02, 179.38, 237.22, 190.86, 73.07, 256.42, 333.68],\n      [15, 2, 414.74, 243.29, 182.27, 259.93, 376.99, 205.54, 257.77, 335.43],\n      [18, 7, 520.99, 425.53, 195.69, 193.59, 483.24, 387.78, 271.2, 269.1],\n      [20, 7, 520.88, 439.79, 195.72, 193.4, 483.46, 402.39, 270.67, 268.57],\n      [22, 11, 522.04, 438.98, 195.07, 194.27, 484.29, 401.23, 270.58, 269.77],\n      [24, 11, 552.3, 445.51, 182.02, 181.75, 517.65, 410.94, 251.38, 250.63],\n    ],\n    until: 24,\n    opacity: 1,\n  },\n  {\n    keys: [\n      [0, 3, 90.0, 560.0, 214.95, 234.82, 52.25, 522.25, 290.45, 310.33],\n      [14, 3, 102.35, 560.02, 214.95, 234.82, 64.6, 522.27, 290.45, 310.33],\n      [16, 3, 12.13, 479.16, 214.95, 234.82, -25.62, 441.41, 290.45, 310.33],\n    ],\n    until: 18,\n    opacity: 0.42,\n  },\n  {\n    keys: [\n      [0, 4, 1600.0, 190.0, 259.74, 223.69, 1562.24, 152.25, 335.24, 299.19],\n      [\n        10, 4, 1571.61, 172.42000000000002, 259.74, 223.69, 1533.85, 134.67,\n        335.24, 299.19,\n      ],\n      [13, 4, 1563.54, 172.34, 259.74, 223.69, 1525.78, 134.59, 335.24, 299.19],\n      [16, 4, 1639.07, 564.4, 259.74, 223.69, 1601.31, 526.65, 335.24, 299.19],\n    ],\n    until: 17,\n    opacity: 0.42,\n  },\n  {\n    keys: [\n      [0, 5, 520.0, 800.0, 163.01, 182.72, 486.4, 766.22, 229.61, 249.59],\n      [5, 5, 525.99, 800.0, 162.61, 182.72, 492.35, 766.22, 229.58, 249.56],\n      [6, 5, 526.47, 800.05, 162.09, 182.7, 492.35, 766.2, 229.64, 249.62],\n      [7, 5, 614.11, 799.97, 161.8, 182.75, 579.53, 766.16, 229.76, 249.75],\n      [10, 5, 622.31, 799.97, 160.72, 182.72, 588.6, 766.27, 229.36, 249.31],\n      [12, 5, 622.34, 779.56, 162.9, 182.8, 588.86, 746.31, 228.66, 248.55],\n      [15, 5, 752.31, 543.86, 182.02, 204.43, 714.55, 506.1, 257.53, 279.94],\n      [17, 8, 749.31, 496.69, 185.26, 185.26, 713.91, 460.99, 256.89, 257.12],\n      [19, 8, 749.91, 447.83, 193.75, 193.94, 712.28, 409.87, 269.18, 269.42],\n      [21, 8, 749.93, 441.63, 193.75, 194.0, 712.18, 403.87, 269.26, 269.5],\n      [24, 12, 762.93, 448.77, 181.48, 180.62, 725.18, 411.02, 256.99, 256.13],\n    ],\n    until: 26,\n    opacity: 1,\n  },\n  {\n    keys: [\n      [0, 6, 1330.0, 780.0, 192.35, 206.45, 1292.25, 742.24, 267.86, 281.96],\n      [11, 6, 1309.75, 779.87, 192.35, 206.45, 1272.0, 742.11, 267.86, 281.96],\n      [13, 6, 1187.38, 779.9, 192.35, 206.45, 1149.63, 742.14, 267.86, 281.96],\n      [15, 6, 1239.45, 638.43, 192.35, 206.45, 1201.7, 600.67, 267.86, 281.96],\n      [16, 6, 1239.42, 589.64, 191.97, 206.53, 1201.23, 551.57, 268.79, 282.95],\n      [18, 10, 1208.58, 463.2, 195.56, 193.59, 1170.82, 425.45, 271.07, 269.1],\n      [22, 10, 1208.63, 440.14, 195.51, 193.16, 1170.82, 402.2, 271.14, 269.17],\n      [\n        24, 10, 1192.69, 446.97, 183.67, 179.95, 1157.02, 411.29, 253.57,\n        251.73,\n      ],\n      [27, 14, 1136.2, 470.21, 135.32, 134.7, 1098.44, 432.46, 210.82, 210.2],\n    ],\n    until: 30,\n    opacity: 1,\n  },\n];\n\nexport interface WordTrack {\n  anchor: \"start\" | \"middle\" | \"end\";\n  /** from, x, baseline, font size. */\n  keys: readonly (readonly number[])[];\n  until: number;\n}\n\n/** Title words as they appear in `lines`, read left to right, top to bottom. */\nexport const WORDS: readonly WordTrack[] = [\n  {\n    anchor: \"middle\",\n    until: 14,\n    keys: [\n      [0, 972.67, 471.26, 123.07],\n      [10, 911.35, 471.32, 123.07],\n      [13, 913.46, 474.42, 117.25],\n    ],\n  },\n  {\n    anchor: \"end\",\n    until: 13,\n    keys: [\n      [0, 916.29, 581.72, 122.94],\n      [12, 875.76, 581.12, 122.7],\n      [13, 880.4, 579.8, 117.38],\n    ],\n  },\n  {\n    anchor: \"start\",\n    until: 14,\n    keys: [\n      [0, 938.37, 581.02, 126.12],\n      [13, 934.49, 578.99, 120.05],\n    ],\n  },\n  {\n    anchor: \"end\",\n    until: 14,\n    keys: [\n      [0, 1250.86, 690.01, 123.48],\n      [7, 1128.38, 690.12, 122.97],\n      [9, 1125.03, 690.31, 124.15],\n      [13, 1117.91, 682.68, 118.09],\n    ],\n  },\n  {\n    anchor: \"start\",\n    until: 13,\n    keys: [\n      [0, 1276.93, 689.91, 124.31],\n      [12, 1235.65, 689.8, 124.26],\n      [13, 1223.68, 683.76, 118.87],\n    ],\n  },\n];\n\n/** Mark keys are from, x, y; word keys are from, letters, split, x, baseline. */\nexport const LOGO = {\n  size: 78.2,\n  wordSize: 91.69,\n  gap: 10.79,\n  mark: [\n    [25, 623.46, 502.79],\n    [27, 747.51, 502.79],\n    [31, 760.99, 502.79],\n    [33, 765.03, 502.79],\n  ],\n  word: [\n    [27, 2, 0, 841.89, 571.55],\n    [29, 4, 1, 841.89, 571.55],\n    [31, 6, 0, 856.45, 571.55],\n    [33, 6, 0, 859.96, 571.55],\n  ],\n} as const;\n\n/** The snapcn mark. */\nexport const SNAPCN_MARK = {\n  width: 723,\n  height: 632,\n  shapes: [\n    \"M92.2 44.6C66.0 51.0 44.4 67.9 32.7 91.1C23.3 109.8 23.5 104.2 23.5 284.9C23.5 442.1 23.6 450.7 26.4 459.0C34.0 482.0 49.6 494.3 78.2 500.0C93.9 503.1 98.1 505.1 107.3 513.6C115.6 521.2 118.9 530.6 118.9 546.7C119.1 565.7 125.5 577.4 139.7 584.9L147.9 589.1L301.2 589.6C439.4 590.1 455.5 589.8 464.3 587.6C476.0 584.3 485.1 577.1 491.0 565.8L495.3 557.8L495.7 508.6C496.0 481.5 496.0 455.0 495.7 450.0L495.3 440.6L490.4 448.5C484.8 457.7 474.6 466.5 463.8 471.3L456.1 474.9L329.4 475.4C236.9 475.7 200.3 475.4 194.0 474.1C174.0 469.8 153.7 455.2 143.2 437.5C133.0 420.3 132.9 417.5 133.3 308.3L133.8 210.5L137.5 201.4C144.4 184.0 160.5 168.5 179.8 160.9L188.6 157.3L318.4 156.8C445.0 156.5 448.5 156.5 458.5 159.6C471.0 163.5 481.8 171.2 489.5 181.8L495.3 190.0L495.7 137.7C496.2 80.3 495.3 72.3 487.0 60.4C482.3 53.5 471.6 46.2 463.2 43.8C459.7 42.9 391.7 42.2 279.3 42.4C134.9 42.6 99.2 42.9 92.2 44.6ZM594.6 173.2C543.5 203.9 501.0 229.7 500.4 230.7C499.8 231.6 499.3 270.4 499.6 316.7L500.0 401.2L522.6 415.5C535.2 423.3 555.2 435.8 567.2 443.1C579.3 450.5 611.5 470.4 638.7 487.3C666.0 504.2 689.8 517.9 691.5 517.9C693.2 517.9 695.7 516.9 697.0 515.4C699.1 513.3 699.5 493.4 699.5 319.2C699.5 197.0 698.8 123.9 697.9 121.4C696.8 118.3 695.4 117.4 692.1 117.4C689.3 117.5 655.8 136.6 594.6 173.2Z\",\n  ],\n} as const;\n\nconst SHOWCASE = \"https://media.snapcn.dev/demos/showcase\";\n\n/** The art from our own showcase: seven on the wall, four in the row, four they swap to. */\nexport const IMAGES = [\n  `${SHOWCASE}/stock-830.webp`,\n  `${SHOWCASE}/937438c560ada1c83317f2c11b3454b0.jpg`,\n  `${SHOWCASE}/98f89cb9994f5c382ab964062c4039db.jpg`,\n  `${SHOWCASE}/stock-716.webp`,\n  `${SHOWCASE}/stock-906.webp`,\n  `${SHOWCASE}/b25b82db2892efff9be3204e860d30ee.jpg`,\n  `${SHOWCASE}/stock-896.webp`,\n  `${SHOWCASE}/821d815affa6496c39cbdeeec7a84603.jpg`,\n  `${SHOWCASE}/stock-903.webp`,\n  `${SHOWCASE}/stock-901.webp`,\n  `${SHOWCASE}/stock-564.webp`,\n  `${SHOWCASE}/stock-888.webp`,\n  `${SHOWCASE}/stock-857.webp`,\n  `${SHOWCASE}/stock-402.webp`,\n  `${SHOWCASE}/stock-953.webp`,\n] as const;\n\n/** A caption under each tile on the wall: what people cut with snapcn. */\nexport const CAPTIONS = [\n  \"Launch film\",\n  \"Product demo\",\n  \"Feature drop\",\n  \"Changelog\",\n  \"Pricing reel\",\n  \"Founder intro\",\n  \"Logo outro\",\n] as const;\n",
      "type": "registry:component",
      "target": "components/snap-cn/gather-lockup/data.ts"
    }
  ],
  "docs": "Docs and props: https://snapcn.dev/docs/scenes/gather-lockup?ref=cli — 60 frames at 24fps; paints its own background. Pass 15 images, and your logo as SVG paths (logo={{ width, height, shapes }}). — 82 Pro components too — charts, launch scenes, device shots: https://snapcn.dev/docs/pricing?ref=cli-docs",
  "type": "registry:component"
}
