> ## 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.

# Gloss Sweep

> A card lands with a restrained slam, catches one diagonal specular gloss, and holds perfectly still.

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="gloss-sweep 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/gloss-sweep.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/gloss-sweep.png");document.body.appendChild(p)});<\/script></body></html>`} />

## Install

<InstallCommand command="npx hyperframes add gloss-sweep" />

That writes one file: `compositions/components/gloss-sweep.html`.

## Paste it into your composition

Open `compositions/components/gloss-sweep.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                            |
| ------------- | ------- | -------------------------- | --------------------------------------- |
| `text`        | `Pro`   | string                     | Text displayed on the card.             |
| `accent`      | `green` | `green`, `blue`, `violet`  | Color treatment for the card.           |
| `sweep_angle` | `25`    | -60deg to 60deg, step 1deg | Angle of the specular gloss 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="gloss-sweep"
  data-composition-src="compositions/components/gloss-sweep.html"
  data-variable-values='{"text":"Pro","accent":"green","sweep_angle":25}'
></div>
```

## Source

<Accordion title={`gloss-sweep.html`}>
  ```html theme={null}
  <!doctype html>
  <!--
    gloss-sweep: HyperFrames video primitive (celebrations / payoff)

    Concept: a compact card lands with a restrained slam, receives one
    diagonal specular sweep, then holds perfectly still. The gloss is the
    whole celebration. There is no pulse, confetti, drift, or exit.

    Variables:
      - text (string, default "Pro"): the card label.
      - accent (green | blue | violet, default green): the card color.
      - sweep_angle (number, default 25): gloss angle in degrees.

    Envelope (fixed IN, elastic HOLD, no OUT):
      IN_BASE  = 1.35s, small landing followed by one gloss sweep
      HOLD     = elastic = max(0, D - IN_BASE), completely still
      OUT_BASE = 0s, the card remains in its confident resting state
      If D is shorter than IN_BASE, the landing and sweep compress together.

    Mount contract: the runtime clones only this template. #root fills the
    host box, establishes the container query basis, has no data-width or
    data-height, and registers one paused timeline under the hardcoded
    gloss-sweep id.
  -->
  <html
    lang="en"
    data-composition-id="gloss-sweep"
    data-composition-duration="2.5"
    data-composition-variables='[
      { "id": "text", "type": "string", "role": "content", "label": "Label", "description": "Text displayed on the card.", "default": "Pro" },
      { "id": "accent", "type": "enum", "role": "style", "label": "Accent", "description": "Color treatment for the card.", "default": "green", "options": [{ "value": "green", "label": "Green" }, { "value": "blue", "label": "Blue" }, { "value": "violet", "label": "Violet" }] },
      { "id": "sweep_angle", "type": "number", "role": "style", "label": "Sweep angle", "description": "Angle of the specular gloss in degrees.", "default": 25, "min": -60, "max": 60, "step": 1, "unit": "deg" }
    ]'
  >
    <head>
      <meta charset="UTF-8" />
      <title>Gloss Sweep</title>
    </head>
    <body>
      <template>
        <div id="root" data-composition-id="gloss-sweep" data-duration="2.5" data-fps="30">
          <style>
            *,
            *::before,
            *::after {
              box-sizing: border-box;
            }

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

            .gs-clip {
              position: absolute;
              inset: 0;
              display: grid;
              place-items: center;
              overflow: hidden;
            }

            .gs-card {
              position: relative;
              display: grid;
              min-width: 48cqw;
              max-width: 78cqw;
              min-height: 34cqh;
              padding: 7cqh 9cqw;
              place-items: center;
              overflow: hidden;
              border: 0.22cqmin solid var(--gs-edge);
              border-radius: 5cqmin;
              background: linear-gradient(145deg, var(--gs-surface-bright), var(--gs-surface));
              box-shadow:
                0 3cqh 8cqh color-mix(in srgb, var(--bg, #05070d) 62%, transparent),
                inset 0 0 0 0.12cqmin color-mix(in srgb, white 12%, transparent);
              transform-origin: 50% 50%;
              will-change: transform;
            }

            .gs-label {
              position: relative;
              z-index: 1;
              max-width: 62cqw;
              overflow: hidden;
              color: var(--gs-label);
              font-size: clamp(8cqmin, 15cqmin, 18cqmin);
              font-weight: 780;
              line-height: 1;
              letter-spacing: -0.04em;
              text-align: center;
              text-overflow: ellipsis;
              white-space: nowrap;
            }

            .gs-gloss {
              --gs-sweep: -30;
              --gs-angle: 25deg;
              position: absolute;
              inset: 0;
              z-index: 2;
              opacity: 0;
              background: linear-gradient(
                var(--gs-angle),
                transparent calc(var(--gs-sweep) * 1% - 22%),
                rgba(255, 255, 255, 0.06) calc(var(--gs-sweep) * 1% - 9%),
                rgba(255, 255, 255, 0.72) calc(var(--gs-sweep) * 1%),
                rgba(255, 255, 255, 0.08) calc(var(--gs-sweep) * 1% + 9%),
                transparent calc(var(--gs-sweep) * 1% + 22%)
              );
              pointer-events: none;
            }
          </style>

          <div
            id="gloss-sweep-clip"
            class="gs-clip clip"
            data-start="0"
            data-duration="2.5"
            data-track-index="0"
          >
            <div class="gs-card">
              <span class="gs-label"></span>
              <span class="gs-gloss" aria-hidden="true"></span>
            </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 card = root.querySelector(".gs-card");
              var label = root.querySelector(".gs-label");
              var gloss = root.querySelector(".gs-gloss");
              var vars =
                window.__hyperframes && window.__hyperframes.getVariables
                  ? window.__hyperframes.getVariables()
                  : {};

              var accents = {
                green: {
                  surface: "#123b2c",
                  surfaceBright: "#1a513c",
                  edge: "#39d98a",
                  label: "#ecfff5",
                },
                blue: {
                  surface: "#123554",
                  surfaceBright: "#19486f",
                  edge: "#4db5ff",
                  label: "#eef8ff",
                },
                violet: {
                  surface: "#31205b",
                  surfaceBright: "#463078",
                  edge: "#a98cff",
                  label: "#f7f2ff",
                },
              };
              var accent = accents[vars.accent] ? vars.accent : "green";
              var palette = accents[accent];
              var text = vars.text == null ? "Pro" : String(vars.text);
              var angleValue = Number(vars.sweep_angle);
              var sweepAngle = Number.isFinite(angleValue)
                ? Math.max(-60, Math.min(60, angleValue))
                : 25;

              label.textContent = text;
              card.style.setProperty("--gs-surface", palette.surface);
              card.style.setProperty("--gs-surface-bright", palette.surfaceBright);
              card.style.setProperty("--gs-edge", palette.edge);
              card.style.setProperty("--gs-label", palette.label);
              gloss.style.setProperty("--gs-angle", sweepAngle + "deg");

              var IN_BASE = 1.35;
              var LAND_BASE = 0.5;
              var SWEEP_AT_BASE = 0.65;
              var SWEEP_BASE = 0.7;
              var duration = Math.max(0.001, parseFloat(root.dataset.duration || "2.5"));
              var scale = duration < IN_BASE ? duration / IN_BASE : 1;
              var LAND = LAND_BASE * scale;
              var SWEEP_AT = SWEEP_AT_BASE * scale;
              var SWEEP = SWEEP_BASE * scale;

              var tl = gsap.timeline({ paused: true });

              tl.fromTo(
                card,
                { y: "-5cqh", scale: 1.06 },
                { y: "0cqh", scale: 1, duration: LAND, ease: "expo.out" },
                0,
              );
              tl.set(gloss, { opacity: 1, "--gs-sweep": -30 }, SWEEP_AT);
              tl.to(gloss, { "--gs-sweep": 130, duration: SWEEP, ease: "power2.out" }, SWEEP_AT);
              tl.set(gloss, { opacity: 0 }, SWEEP_AT + SWEEP);
              tl.seek(0);

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

Tagged `motion-primitive` `celebration` `gloss` `card` `badge` `payoff`.

## 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

- [Shimmer Sweep](/catalog/components/shimmer-sweep.md)
- [Light Sweep Pass](/catalog/components/light-sweep-pass.md)
- [Word-Sweep Highlight](/catalog/blocks/mk-callout-highlight.md)
