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

# Minimal Gradient Background

> Procedural soft-blob gradient backdrop in a minimalist presentation style: two radial blobs drifting over a base color, with an animatable rounded-card bar mask and optional frosted-glass mode

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

## Install

<InstallCommand command="npx hyperframes add mk-background" item="mk-background" />

That writes one file: `compositions/mk-background.html`.

## Add it to your video

It runs for 10 seconds at 1920×1080. Paste this into your composition:

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

Move it in time with `data-start`. Put it on a different timeline row with
`data-track-index`. See [data attributes](/concepts/data-attributes) for the rest.

## Source

<Accordion title={`mk-background.html`}>
  ```html theme={null}
  <!doctype html>
  <html lang="en">
    <head>
      <meta charset="utf-8" />
      <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
      <style>
        *,
        *::before,
        *::after {
          margin: 0;
          padding: 0;
          box-sizing: border-box;
        }
        body {
          background: transparent;
          overflow: hidden;
        }
        #mk-bg-root {
          /* ---- mk tokens: override these in the host to re-skin the family ---- */
          --mk-font: "Inter", -apple-system, sans-serif;
          --mk-stage: #f5f5f7;
          --mk-base: #ffffff;
          --mk-blob-1: #ff7ac8;
          --mk-blob-2: #45d6c8;
          --mk-stage-dark: #000000;
          --mk-base-dark: #0a0a0c;
          --mk-blob-1-dark: #7d5cff;
          --mk-blob-2-dark: #2d1b69;
          --mk-radius-card: 40px;
          --mk-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);

          position: relative;
          width: 1920px;
          height: 1080px;
          overflow: hidden;
          background: var(--mk-stage);
        }
        #mk-bg-root.mk-dark {
          background: var(--mk-stage-dark);
        }
        /* The "Bar" — an animatable rounded-rect mask. Full-bleed by default,
           animatable down to a floating card over the stage. */
        #mk-bg-card {
          position: absolute;
          top: 0;
          left: 0;
          width: 1920px;
          height: 1080px;
          overflow: hidden;
          border-radius: 0;
          background: var(--mk-base);
          box-shadow: var(--mk-shadow);
        }
        .mk-dark #mk-bg-card {
          background: var(--mk-base-dark);
        }
        /* Soft radial blobs — the procedural "mesh gradient". Two oversized
           radial gradients with a long falloff, drifting slowly. */
        .mk-bg-blob {
          position: absolute;
          border-radius: 50%;
          will-change: transform;
        }
        #mk-bg-blob1 {
          background: radial-gradient(
            circle closest-side,
            var(--mk-blob-1) 0%,
            rgba(255, 255, 255, 0) 72%
          );
        }
        #mk-bg-blob2 {
          background: radial-gradient(
            circle closest-side,
            var(--mk-blob-2) 0%,
            rgba(255, 255, 255, 0) 72%
          );
        }
        .mk-dark #mk-bg-blob1 {
          background: radial-gradient(
            circle closest-side,
            var(--mk-blob-1-dark) 0%,
            rgba(0, 0, 0, 0) 72%
          );
        }
        .mk-dark #mk-bg-blob2 {
          background: radial-gradient(
            circle closest-side,
            var(--mk-blob-2-dark) 0%,
            rgba(0, 0, 0, 0) 72%
          );
        }
      </style>
    </head>
    <body>
      <div
        id="mk-bg-root"
        data-composition-id="mk-background"
        data-start="0"
        data-duration="10"
        data-width="1920"
        data-height="1080"
      >
        <div id="mk-bg-card">
          <div id="mk-bg-blob1" class="mk-bg-blob" data-layout-allow-overflow></div>
          <div id="mk-bg-blob2" class="mk-bg-blob" data-layout-allow-overflow></div>
        </div>
        <div
          id="mk-bg-drv"
          class="clip"
          data-start="0"
          data-duration="10"
          data-track-index="0"
          style="position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none"
        ></div>
      </div>
      <script>
        (function () {
          window.__timelines = window.__timelines || {};

          /* ---- published parameters (inspector-style CONFIG) ---- */
          var CONFIG = {
            scheme: "light", // "light" | "dark"
            animationIn: true, // fade/settle entrance
            animationOut: true, // fade exit
            drift: true, // ambient blob motion
            // Soft BG blobs: center as fraction of canvas, radius in px
            blob1: { x: 0.28, y: 0.32, r: 950, opacity: 0.85 },
            blob2: { x: 0.74, y: 0.66, r: 1100, opacity: 0.8 },
            // Bar mask (rounded-rect card). demo:true plays full-bleed -> card -> full-bleed
            bar: {
              demo: true, // full-bleed -> rounded card -> full-bleed showcase
              x: 240,
              y: 140,
              width: 1440,
              height: 800,
              roundness: 40,
            },
            // Content opacity + frost only matter with footage beneath the block
            contentOpacity: 1,
            frostBlur: 0, // px; e.g. 24 for the frosted-card look over footage
          };

          var W = 1920,
            H = 1080,
            DUR = 10;

          var root = document.getElementById("mk-bg-root");
          var card = document.getElementById("mk-bg-card");
          var blob1 = document.getElementById("mk-bg-blob1");
          var blob2 = document.getElementById("mk-bg-blob2");

          if (CONFIG.scheme === "dark") root.classList.add("mk-dark");

          function placeBlob(el, b) {
            var d = b.r * 2;
            el.style.width = d + "px";
            el.style.height = d + "px";
            el.style.left = b.x * W - b.r + "px";
            el.style.top = b.y * H - b.r + "px";
            el.style.opacity = String(b.opacity);
          }
          placeBlob(blob1, CONFIG.blob1);
          placeBlob(blob2, CONFIG.blob2);

          card.style.opacity = String(CONFIG.contentOpacity);
          if (CONFIG.frostBlur > 0) {
            card.style.backdropFilter = "blur(" + CONFIG.frostBlur + "px) saturate(1.4)";
          }

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

          /* entrance — fade + blobs settle (power3, no bounce) */
          if (CONFIG.animationIn) {
            tl.from(root, { opacity: 0, duration: 0.7, ease: "power2.out" }, 0);
            tl.from([blob1, blob2], { scale: 1.14, duration: 1.2, ease: "power3.out" }, 0);
          }

          /* ambient drift — slow sine yoyo, seek-safe timeline tweens */
          if (CONFIG.drift) {
            tl.to(
              blob1,
              { x: 70, y: 42, duration: 2.35, ease: "sine.inOut", yoyo: true, repeat: 3 },
              0.3,
            );
            tl.to(
              blob2,
              { x: -84, y: -36, duration: 2.35, ease: "sine.inOut", yoyo: true, repeat: 3 },
              0.3,
            );
          }

          /* bar-mask demo: full-bleed -> rounded card over the stage -> full-bleed.
             Offset via x/y transforms, not top/left: layout properties snap to
             integer device pixels and stutter under seek-by-frame capture. The
             card's CSS base is top:0/left:0, so the transform values match 1:1. */
          if (CONFIG.bar.demo) {
            tl.to(
              card,
              {
                y: CONFIG.bar.y,
                x: CONFIG.bar.x,
                width: CONFIG.bar.width,
                height: CONFIG.bar.height,
                borderRadius: CONFIG.bar.roundness,
                duration: 1.1,
                ease: "power3.inOut",
              },
              3.8,
            );
            tl.to(
              card,
              {
                y: 0,
                x: 0,
                width: W,
                height: H,
                borderRadius: 0,
                duration: 1.0,
                ease: "power3.inOut",
              },
              7.6,
            );
          }

          /* exit + hard kill */
          if (CONFIG.animationOut) {
            tl.to(root, { opacity: 0, duration: 0.4, ease: "power2.in" }, DUR - 0.45);
          }
          tl.set(root, { visibility: "hidden" }, DUR - 0.02);

          window.__timelines["mk-background"] = tl;
        })();
      </script>
    </body>
  </html>
  ```
</Accordion>

Tagged `background` `gradient` `minimal` `professional` `presentation`.

## Related topics

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