> ## Documentation Index
> Fetch the complete documentation index at: https://hyperframes.heygen.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scan Band

> A diagonal distortion band sweeps once across a clean wordmark, revealing clipped red and cyan offsets only inside the moving band.

export const InstallCommand = ({command}) => {
  const [copied, setCopied] = React.useState(false);
  const copy = async () => {
    try {
      if (navigator.clipboard && window.isSecureContext) {
        await navigator.clipboard.writeText(command);
      } else {
        const previous = document.activeElement;
        const scratch = document.createElement("textarea");
        scratch.value = command;
        scratch.setAttribute("readonly", "");
        scratch.style.position = "fixed";
        scratch.style.opacity = "0";
        document.body.appendChild(scratch);
        scratch.select();
        document.execCommand("copy");
        document.body.removeChild(scratch);
        previous?.focus?.();
      }
      setCopied(true);
      setTimeout(() => setCopied(false), 2000);
    } catch {}
  };
  return <div className="hf-install-command not-prose my-4 flex items-stretch overflow-hidden rounded-xl border border-zinc-200 bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-900">
      <code className="flex-1 overflow-x-auto whitespace-nowrap border-r border-zinc-200 px-4 py-3 font-mono text-sm text-zinc-800 dark:border-zinc-800 dark:text-zinc-100">
        {command}
      </code>
      <button type="button" onClick={copy} data-copied={copied ? "true" : "false"} aria-label={`Copy ${command} to the clipboard`} className="hf-install-copy">
        <svg className="hf-install-copy-clipboard" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 18 18" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
          <path d="M14.25 5.25H7.25C6.14543 5.25 5.25 6.14543 5.25 7.25V14.25C5.25 15.3546 6.14543 16.25 7.25 16.25H14.25C15.3546 16.25 16.25 15.3546 16.25 14.25V7.25C16.25 6.14543 15.3546 5.25 14.25 5.25Z" />
          <path d="M2.80103 11.998L1.77203 5.07397C1.61003 3.98097 2.36403 2.96397 3.45603 2.80197L10.38 1.77297C11.313 1.63397 12.19 2.16297 12.528 3.00097" />
        </svg>
        <svg className="hf-install-copy-check" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 18 18" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
          <path d="M2.75 9.5L6.5 13.25L15.25 4.5" />
        </svg>
      </button>
      <span className="hf-install-copy-status" role="status" aria-live="polite">
        {copied ? "Copied" : ""}
      </span>
    </div>;
};

<iframe className="w-full aspect-video rounded-xl border-0 bg-zinc-100 dark:bg-zinc-800" title="scan-band preview" loading="lazy" srcDoc={`<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;height:100%;overflow:hidden;background:transparent}hyperframes-player{display:block;width:100%;height:100%}</style><script src="https://cdn.jsdelivr.net/npm/@hyperframes/player@0.7/dist/hyperframes-player.global.js"><\/script></head><body><script>fetch("/public/catalog/components/scan-band.json").then(function(r){return r.json()}).then(function(d){var p=document.createElement("hyperframes-player");p.setAttribute("srcdoc",d.html);p.setAttribute("controls","");p.setAttribute("autoplay","");p.setAttribute("loop","");p.setAttribute("muted","");p.setAttribute("poster","https://static.heygen.ai/hyperframes-oss/docs/images/catalog/components/scan-band.png");document.body.appendChild(p)});<\/script></body></html>`} />

## Install

<InstallCommand command="npx hyperframes add scan-band" />

That writes one file: `compositions/components/scan-band.html`.

## Paste it into your composition

Open `compositions/components/scan-band.html` and copy what is inside into your own composition.

A component has no size or duration of its own. It takes both from the composition
you paste it into.

## Variables

Every one of these has a default, so the piece works untouched. Set the ones you
want to change on the element:

| Variable     | Default       | Accepts                    | What it does                                      |
| ------------ | ------------- | -------------------------- | ------------------------------------------------- |
| `wordmark`   | `HYPERFRAMES` | string                     | Text displayed by the scan effect.                |
| `band_angle` | `12`          | -30deg to 30deg, step 1deg | Diagonal angle of the distortion band in degrees. |

Set them with `data-variable-values` on the element that mounts it. These are the
defaults, so this behaves exactly like the preview above until you change one:

```html wrap theme={null}
<div
  data-composition-id="scan-band"
  data-composition-src="compositions/components/scan-band.html"
  data-variable-values='{"wordmark":"HYPERFRAMES","band_angle":12}'
></div>
```

## Source

<Accordion title={`scan-band.html`}>
  ```html theme={null}
  <!doctype html>
  <!--
    scan-band: HyperFrames video primitive

    A single diagonal distortion band crosses a clean wordmark. Inside the
    band, three clipped clones create red and cyan separation plus a small
    horizontal displacement. Everywhere outside the band remains clean.

    Variables:
      - wordmark (string, default "HYPERFRAMES"): displayed text.
      - band_angle (number, default 12): diagonal band angle in degrees.

    Envelope:
      IN_BASE  = 0.45s, the clean wordmark fades into place.
      HOLD     = elastic, the band sweeps once, then leaves a clean wordmark.
      OUT_BASE = 0.45s, the clean wordmark fades away.
      If the duration is shorter than IN_BASE + OUT_BASE, IN and OUT compress
      together and HOLD becomes zero. Only HOLD grows for longer mounts.

    Mount contract: the runtime clones only this template. #root fills the
    host box, establishes the container query basis, and registers one paused
    timeline under the hardcoded scan-band id.
  -->
  <html
    lang="en"
    data-composition-id="scan-band"
    data-composition-duration="3.5"
    data-composition-variables='[
      { "id": "wordmark", "type": "string", "role": "content", "label": "Wordmark", "description": "Text displayed by the scan effect.", "default": "HYPERFRAMES" },
      { "id": "band_angle", "type": "number", "role": "layout", "label": "Band angle", "description": "Diagonal angle of the distortion band in degrees.", "default": 12, "min": -30, "max": 30, "step": 1, "unit": "deg" }
    ]'
  >
    <head>
      <meta charset="UTF-8" />
      <title>Scan Band</title>
    </head>
    <body>
      <template>
        <div id="root" data-composition-id="scan-band" data-duration="3.5" data-fps="30">
          <style>
            *,
            *::before,
            *::after {
              box-sizing: border-box;
            }

            #root {
              position: absolute;
              inset: 0;
              overflow: hidden;
              container-type: size;
              isolation: isolate;
              background: var(--bg, #0b0c0e);
              color: var(--fg, #f7f8fa);
              font-family: var(--font-display, Inter, system-ui, sans-serif);
              pointer-events: none;
            }

            .sb-clip,
            .sb-stage,
            .sb-band,
            .sb-clone {
              position: absolute;
              inset: 0;
            }

            .sb-clip,
            .sb-stage,
            .sb-clone {
              display: grid;
              place-items: center;
            }

            .sb-stage {
              opacity: 0;
            }

            .sb-wordmark,
            .sb-clone {
              font-size: clamp(28px, 13cqw, 150px);
              font-weight: 850;
              line-height: 0.86;
              letter-spacing: -0.065em;
              white-space: nowrap;
            }

            .sb-wordmark {
              color: var(--fg, #f7f8fa);
              text-shadow: 0 1.2cqh 4cqh color-mix(in srgb, #000 45%, transparent);
            }

            .sb-band {
              --sb-band-position: -60%;
              --sb-half: 6%;
              --sb-lean: 10.6%;
              overflow: hidden;
              clip-path: polygon(
                calc(var(--sb-band-position) - var(--sb-half) - var(--sb-lean)) 0%,
                calc(var(--sb-band-position) + var(--sb-half) - var(--sb-lean)) 0%,
                calc(var(--sb-band-position) + var(--sb-half) + var(--sb-lean)) 100%,
                calc(var(--sb-band-position) - var(--sb-half) + var(--sb-lean)) 100%
              );
              will-change: clip-path;
            }

            .sb-clone {
              text-shadow: none;
            }

            .sb-clone-red {
              color: #ff3158;
              opacity: 0.9;
              transform: translateX(-0.8cqw);
            }

            .sb-clone-cyan {
              color: #36efff;
              opacity: 0.9;
              transform: translateX(1.7cqw);
            }

            .sb-clone-core {
              color: var(--fg, #f7f8fa);
              transform: translateX(0.65cqw);
            }
          </style>

          <div
            id="scan-band-clip"
            class="sb-clip clip"
            data-start="0"
            data-duration="3.5"
            data-track-index="0"
          >
            <div class="sb-stage" role="img">
              <span class="sb-wordmark"></span>
              <div class="sb-band" aria-hidden="true">
                <span class="sb-clone sb-clone-red"></span>
                <span class="sb-clone sb-clone-cyan"></span>
                <span class="sb-clone sb-clone-core"></span>
              </div>
            </div>
          </div>

          <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
          <script>
            (function () {
              "use strict";

              var root = document.getElementById("root");
              var stage = root.querySelector(".sb-stage");
              var wordmark = root.querySelector(".sb-wordmark");
              var band = root.querySelector(".sb-band");
              var clones = root.querySelectorAll(".sb-clone");
              var vars =
                window.__hyperframes && window.__hyperframes.getVariables
                  ? window.__hyperframes.getVariables()
                  : {};

              var text = vars.wordmark == null ? "HYPERFRAMES" : String(vars.wordmark);
              var angleValue = vars.band_angle;
              var bandAngle = Number.isFinite(angleValue)
                ? Math.max(-30, Math.min(30, angleValue))
                : 12;

              wordmark.textContent = text;
              stage.setAttribute("aria-label", text);
              clones.forEach(function (clone) {
                clone.textContent = text;
              });

              var lean = Math.tan((bandAngle * Math.PI) / 180) * 50;
              band.style.setProperty("--sb-lean", lean.toFixed(3) + "%");

              var IN_BASE = 0.45;
              var OUT_BASE = 0.45;
              var SWEEP_BASE = 1.65;
              var duration = Math.max(0.001, parseFloat(root.dataset.duration || "3.5"));
              var fixedTotal = IN_BASE + OUT_BASE;
              var phaseScale = duration < fixedTotal ? duration / fixedTotal : 1;
              var IN = IN_BASE * phaseScale;
              var OUT = OUT_BASE * phaseScale;
              var HOLD = Math.max(0, duration - IN - OUT);
              var OUT_START = IN + HOLD;
              var SWEEP = Math.min(SWEEP_BASE, HOLD);

              gsap.set(stage, { opacity: 0 });
              gsap.set(band, { "--sb-band-position": "-60%" });

              var tl = gsap.timeline({ paused: true });
              tl.to(stage, { opacity: 1, duration: IN, ease: "power2.out" }, 0);

              if (SWEEP > 0) {
                tl.fromTo(
                  band,
                  { "--sb-band-position": "-60%" },
                  {
                    "--sb-band-position": "160%",
                    duration: SWEEP,
                    ease: "power2.out",
                  },
                  IN,
                );
              }

              tl.to(stage, { opacity: 0, duration: OUT, ease: "power2.in" }, OUT_START);
              tl.seek(0);

              window.__timelines = window.__timelines || {};
              window.__timelines["scan-band"] = tl;
            })();
          </script>
        </div>
      </template>
    </body>
  </html>
  ```
</Accordion>

Tagged `motion-primitive` `typography` `scan` `chromatic` `distortion` `wordmark`.

## Related topics

* [Browse the complete Catalog](/catalog)
* [Add assets and Catalog items in Studio](/studio/assets-and-blocks)
* [Build a richer composition](/go-further)


## Related topics

- [Slit Scan Reveal](/catalog/components/slit-scan-reveal.md)
- [Camera Scan Gate](/catalog/components/camera-scan-gate.md)
- [Rubber Band Bumper](/catalog/components/rubber-band-bumper.md)
