> ## Documentation Index
> Fetch the complete documentation index at: https://hyperframes-fix-nested-composition-media-inpoint.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cover Transitions

> Showcase of cover/uncover slide transitions

export const InstallCommand = ({command, item}) => {
  const [copied, setCopied] = React.useState(false);
  const [tuned, setTuned] = React.useState("");
  React.useEffect(() => {
    if (!item) return;
    const read = () => {
      try {
        const raw = new URLSearchParams(window.location.search).get(`vars-${item}`);
        if (!raw) return setTuned("");
        const parsed = JSON.parse(raw);
        if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return setTuned("");
        if (Object.keys(parsed).length === 0) return setTuned("");
        setTuned(` --vars '${JSON.stringify(parsed)}'`);
      } catch {
        setTuned("");
      }
    };
    read();
    window.addEventListener("hf-vars-changed", read);
    window.addEventListener("popstate", read);
    return () => {
      window.removeEventListener("hf-vars-changed", read);
      window.removeEventListener("popstate", read);
    };
  }, [item]);
  const fullCommand = `${command}${tuned}`;
  const copy = async () => {
    try {
      if (navigator.clipboard && window.isSecureContext) {
        await navigator.clipboard.writeText(fullCommand);
      } else {
        const previous = document.activeElement;
        const scratch = document.createElement("textarea");
        scratch.value = fullCommand;
        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">
        {fullCommand}
      </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="transitions-cover 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/blocks/transitions-cover.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/blocks/transitions-cover.png");document.body.appendChild(p)});<\/script></body></html>`} />

## Install

<InstallCommand command="npx hyperframes add transitions-cover" item="transitions-cover" />

That writes one file: `compositions/transitions-cover.html`.

## Source

<Accordion title={`transitions-cover.html`}>
  ```html theme={null}
  <!doctype html>
  <html lang="en">
    <head>
      <meta charset="UTF-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1.0" />
      <title>Cover Transitions Showcase</title>
      <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
      <style>
        * {
          margin: 0;
          padding: 0;
          box-sizing: border-box;
        }
        body {
          background: #000;
          overflow: hidden;
          font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
        }

        /* Title Card */
        #title-card {
          position: absolute;
          inset: 0;
          z-index: 10;
          background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 100%);
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          opacity: 1;
        }
        #title-card h1 {
          font-size: 72px;
          font-weight: 800;
          color: #fff;
          letter-spacing: -1px;
          opacity: 0;
          transform: translateY(30px);
        }
        #title-card .subtitle {
          font-size: 28px;
          font-weight: 400;
          color: rgba(255, 255, 255, 0.5);
          margin-top: 12px;
          opacity: 0;
          transform: translateY(20px);
        }

        /* Scenes */
        #scene1,
        #scene2 {
          position: absolute;
          inset: 0;
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
        }
        #scene1 {
          background: #1b263b;
          z-index: 2;
          opacity: 0;
        }
        #scene2 {
          background: #e07a5f;
          z-index: 1;
          opacity: 0;
        }

        .scene-number {
          font-size: 180px;
          font-weight: 900;
          line-height: 1;
          opacity: 0.12;
          letter-spacing: -6px;
        }
        #scene1 .scene-number {
          color: #fff;
        }
        #scene2 .scene-number {
          color: #000;
        }

        .scene-label {
          font-size: 48px;
          font-weight: 700;
          margin-top: -20px;
        }
        #scene1 .scene-label {
          color: #fff;
        }
        #scene2 .scene-label {
          color: #fff;
        }

        /* Info bar */
        .info-bar {
          position: absolute;
          bottom: 0;
          left: 0;
          right: 0;
          height: 80px;
          display: flex;
          align-items: center;
          justify-content: space-between;
          padding: 0 48px;
        }
        #scene1 .info-bar {
          background: rgba(0, 0, 0, 0.3);
        }
        #scene2 .info-bar {
          background: rgba(0, 0, 0, 0.2);
        }
        .info-bar .label {
          font-size: 18px;
          font-weight: 600;
          color: rgba(255, 255, 255, 0.7);
          text-transform: uppercase;
          letter-spacing: 2px;
        }
        .info-bar .desc {
          font-size: 16px;
          color: rgba(255, 255, 255, 0.5);
          font-style: italic;
        }

        /* Outro */
        #outro {
          position: absolute;
          inset: 0;
          z-index: 10;
          background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 100%);
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          opacity: 0;
        }
        #outro h2 {
          font-size: 56px;
          font-weight: 800;
          color: #fff;
          opacity: 0;
          transform: translateY(20px);
        }
        #outro .tag {
          font-size: 22px;
          color: rgba(255, 255, 255, 0.4);
          margin-top: 10px;
          opacity: 0;
          transform: translateY(15px);
        }
      </style>
    </head>
    <body>
      <div
        id="comp"
        data-composition-id="main"
        data-start="0"
        data-duration="21"
        data-width="1920"
        data-height="1080"
        style="position: relative; width: 1920px; height: 1080px; overflow: hidden; background: #000"
      >
        <!-- Title Card -->
        <div id="title-card">
          <h1 id="title-h1">Cover Transitions</h1>
          <div class="subtitle" id="title-sub">3 transition styles</div>
        </div>

        <!-- Scene A -->
        <div id="scene1">
          <div class="scene-number">ONE</div>
          <div class="scene-label">SCENE A</div>
          <div class="info-bar">
            <span class="label" id="info-label-a"></span>
            <span class="desc" id="info-desc-a"></span>
          </div>
        </div>

        <!-- Scene B -->
        <div id="scene2">
          <div class="scene-number">TWO</div>
          <div class="scene-label">SCENE B</div>
          <div class="info-bar">
            <span class="label" id="info-label-b"></span>
            <span class="desc" id="info-desc-b"></span>
          </div>
        </div>

        <!-- Staggered Blocks Wipes -->
        <div
          id="wipe-a"
          style="
            position: absolute;
            inset: 0;
            background: #f72585;
            z-index: 50;
            transform: translateX(-1920px);
          "
        ></div>
        <div
          id="wipe-b"
          style="
            position: absolute;
            inset: 0;
            background: #7209b7;
            z-index: 49;
            transform: translateX(-1920px);
          "
        ></div>

        <!-- Horizontal Blinds Container -->
        <div
          id="blinds-container"
          style="position: absolute; inset: 0; z-index: 50; pointer-events: none"
        ></div>

        <!-- Vertical Blinds Container -->
        <div
          id="vblinds-container"
          style="position: absolute; inset: 0; z-index: 50; pointer-events: none"
        ></div>

        <!-- Outro -->
        <div id="outro">
          <h2 id="outro-h2">Cover Transitions</h2>
          <div class="tag" id="outro-tag">End of showcase</div>
        </div>
      </div>

      <script>
        (function () {
          // Generate horizontal blind strips
          var blindsHTML = "";
          for (var i = 0; i < 8; i++) {
            blindsHTML +=
              '<div id="blind-' +
              i +
              '" style="position:absolute; left:0; width:1920px; height:135px; top:' +
              i * 135 +
              "px; background:" +
              [
                "#3A0CA3",
                "#4361EE",
                "#4CC9F0",
                "#F72585",
                "#3A0CA3",
                "#4361EE",
                "#4CC9F0",
                "#F72585",
              ][i] +
              '; transform:translateX(-1920px);"></div>';
          }
          document.getElementById("blinds-container").innerHTML = blindsHTML;

          // Generate vertical blind strips
          var vblindsHTML = "";
          for (var i = 0; i < 8; i++) {
            vblindsHTML +=
              '<div id="vblind-' +
              i +
              '" style="position:absolute; top:0; height:1080px; width:240px; left:' +
              i * 240 +
              "px; background:" +
              [
                "#3A0CA3",
                "#4361EE",
                "#4CC9F0",
                "#F72585",
                "#3A0CA3",
                "#4361EE",
                "#4CC9F0",
                "#F72585",
              ][i] +
              '; transform:translateY(-1080px);"></div>';
          }
          document.getElementById("vblinds-container").innerHTML = vblindsHTML;

          var tl = gsap.timeline({ paused: false });
          window.__timelines = window.__timelines || {};
          window.__timelines["main"] = tl;

          // Transition demos config
          var demos = [
            { label: "STAGGERED BLOCKS", desc: "Use a staggered color blocks transition" },
            { label: "HORIZONTAL BLINDS", desc: "Use a horizontal blinds transition" },
            { label: "VERTICAL BLINDS", desc: "Use a vertical blinds transition" },
          ];

          // Reset scenes helper
          function resetScenes(t, demoIndex) {
            tl.set("#scene1", { opacity: 1 }, t);
            tl.set("#scene2", { opacity: 0 }, t);
            tl.set("#info-label-a", { textContent: demos[demoIndex].label }, t);
            tl.set("#info-desc-a", { textContent: demos[demoIndex].desc }, t);
            tl.set("#info-label-b", { textContent: demos[demoIndex].label }, t);
            tl.set("#info-desc-b", { textContent: demos[demoIndex].desc }, t);
            // Reset wipes
            tl.set("#wipe-a", { x: -1920 }, t);
            tl.set("#wipe-b", { x: -1920 }, t);
            // Reset horizontal blinds
            for (var i = 0; i < 8; i++) {
              tl.set("#blind-" + i, { x: -1920 }, t);
            }
            // Reset vertical blinds
            for (var i = 0; i < 8; i++) {
              tl.set("#vblind-" + i, { y: -1080 }, t);
            }
          }

          // ===== TITLE CARD (0s - 3s) =====
          tl.to("#title-h1", { opacity: 1, y: 0, duration: 0.6, ease: "power2.out" }, 0.3);
          tl.to("#title-sub", { opacity: 1, y: 0, duration: 0.5, ease: "power2.out" }, 0.6);
          tl.to("#title-card", { opacity: 0, duration: 0.4, ease: "power1.inOut" }, 2.5);

          // ===== DEMO 1: STAGGERED BLOCKS (3s - 8s) =====
          var T1 = 3;
          resetScenes(T1, 0);
          // Show Scene A for a beat, then transition at midpoint
          var T = T1 + 2;
          tl.set("#wipe-a", { x: -1920 }, T - 0.01);
          tl.set("#wipe-b", { x: -1920 }, T - 0.01);
          tl.to("#wipe-a", { x: 0, duration: 0.25, ease: "power3.inOut" }, T);
          tl.to("#wipe-b", { x: 0, duration: 0.25, ease: "power3.inOut" }, T + 0.06);
          tl.set("#scene1", { opacity: 0 }, T + 0.2);
          tl.set("#scene2", { opacity: 1 }, T + 0.2);
          tl.to("#wipe-a", { x: 1920, duration: 0.25, ease: "power3.inOut" }, T + 0.28);
          tl.to("#wipe-b", { x: 1920, duration: 0.25, ease: "power3.inOut" }, T + 0.34);

          // ===== DEMO 2: HORIZONTAL BLINDS (8s - 13s) =====
          var T2 = 8;
          resetScenes(T2, 1);
          T = T2 + 2;
          var stagger = 0.03;
          for (var i = 0; i < 8; i++) {
            tl.fromTo(
              "#blind-" + i,
              { x: -1920 },
              { x: 0, duration: 0.2, ease: "power3.inOut" },
              T + i * stagger,
            );
          }
          tl.set("#scene1", { opacity: 0 }, T + 0.5);
          tl.set("#scene2", { opacity: 1 }, T + 0.5);
          for (var i = 0; i < 8; i++) {
            tl.to(
              "#blind-" + i,
              { x: 1920, duration: 0.2, ease: "power3.inOut" },
              T + 0.55 + i * stagger,
            );
          }

          // ===== DEMO 3: VERTICAL BLINDS (13s - 18s) =====
          var T3 = 13;
          resetScenes(T3, 2);
          T = T3 + 2;
          for (var i = 0; i < 8; i++) {
            tl.fromTo(
              "#vblind-" + i,
              { y: -1080 },
              { y: 0, duration: 0.2, ease: "power3.inOut" },
              T + i * 0.03,
            );
          }
          tl.set("#scene1", { opacity: 0 }, T + 0.5);
          tl.set("#scene2", { opacity: 1 }, T + 0.5);
          for (var i = 0; i < 8; i++) {
            tl.to(
              "#vblind-" + i,
              { y: 1080, duration: 0.2, ease: "power3.inOut" },
              T + 0.55 + i * 0.03,
            );
          }

          // ===== OUTRO (18s - 21s) =====
          tl.to("#scene1", { opacity: 0, duration: 0.3 }, 18);
          tl.to("#scene2", { opacity: 0, duration: 0.3 }, 18);
          tl.to("#outro", { opacity: 1, duration: 0.4, ease: "power1.inOut" }, 18.2);
          tl.to("#outro-h2", { opacity: 1, y: 0, duration: 0.5, ease: "power2.out" }, 18.5);
          tl.to("#outro-tag", { opacity: 1, y: 0, duration: 0.4, ease: "power2.out" }, 18.8);
        })();
      </script>
    </body>
  </html>
  ```
</Accordion>

## Usage

After installing, add the block to your host composition:

```html theme={null}
<div data-composition-id="transitions-cover" data-composition-src="compositions/transitions-cover.html" data-start="0" data-duration="21" data-track-index="1" data-width="1920" data-height="1080"></div>
```

Tagged `transition` `showcase`.

## Related topics

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