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

# Code Snippet - Apple Terminal Solid Colors

> Apple Terminal Solid Colors profile: deep purple background with white text, per-character typing animation of a shell session.

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="code-snippet-apple-terminal-solid-colors 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/code-snippet-apple-terminal-solid-colors.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/code-snippet-apple-terminal-solid-colors.png");document.body.appendChild(p)});<\/script></body></html>`} />

## Install

<InstallCommand command="npx hyperframes add code-snippet-apple-terminal-solid-colors" item="code-snippet-apple-terminal-solid-colors" />

That writes one file: `compositions/code-snippet-apple-terminal-solid-colors.html`.

## Source

<Accordion title={`code-snippet-apple-terminal-solid-colors.html`}>
  ```html theme={null}
  <!doctype html>
  <html lang="en">
    <head>
      <meta charset="UTF-8" />
      <meta name="viewport" content="width=1920, height=1080" />
      <title>Apple Terminal Solid Colors</title>
      <style>
        html,
        body {
          margin: 0;
          padding: 0;
          width: 1920px;
          height: 1080px;
          overflow: hidden;
          background: #4c0099;
          font-family: "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
        }

        #scene {
          width: 1920px;
          height: 1080px;
          position: relative;
          display: flex;
          align-items: center;
          justify-content: center;
          background: radial-gradient(ellipse at center, #5a00b3 0%, #2e0060 100%);
        }

        .terminal-window {
          width: 1400px;
          height: 700px;
          border-radius: 10px;
          overflow: hidden;
          box-shadow:
            0 30px 80px rgba(0, 0, 0, 0.7),
            0 10px 30px rgba(76, 0, 153, 0.4);
          display: flex;
          flex-direction: column;
        }

        .titlebar {
          height: 38px;
          background: #3a0077;
          display: flex;
          align-items: center;
          padding: 0 14px;
          flex-shrink: 0;
          border-bottom: 1px solid #6600bb;
          position: relative;
        }

        .traffic-lights {
          display: flex;
          gap: 8px;
          align-items: center;
        }

        .traffic-lights span {
          width: 13px;
          height: 13px;
          border-radius: 50%;
          display: inline-block;
        }

        .traffic-lights .close {
          background: #ff5f57;
          border: 1px solid #e0443e;
        }

        .traffic-lights .minimize {
          background: #ffbd2e;
          border: 1px solid #dfa123;
        }

        .traffic-lights .fullscreen {
          background: #28c840;
          border: 1px solid #1aab29;
        }

        .window-title {
          position: absolute;
          left: 50%;
          transform: translateX(-50%);
          font-size: 13px;
          color: #ffffff;
          font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
          font-weight: 500;
          letter-spacing: -0.1px;
        }

        .terminal-canvas {
          flex: 1;
          background: #4c0099;
          padding: 18px 20px;
          overflow: hidden;
          font-size: 14px;
          line-height: 1.6;
          color: #ffffff;
        }

        .output-lines {
          margin-bottom: 4px;
        }

        .output-line {
          display: block;
          white-space: pre;
          opacity: 0;
          color: #ffffff;
        }

        .output-line.bold {
          font-weight: bold;
          color: #ffffff;
        }

        .output-line.dim {
          color: rgba(255, 255, 255, 0.55);
        }

        .output-line.accent {
          color: #cc99ff;
          font-weight: bold;
        }

        .input-line {
          display: flex;
          align-items: center;
          white-space: pre;
        }

        .prompt {
          color: #cc99ff;
          font-weight: bold;
          user-select: none;
        }

        .typed-command {
          color: #ffffff;
        }

        .cursor-block {
          display: inline-block;
          width: 9px;
          height: 16px;
          background: #ffffff;
          vertical-align: text-bottom;
          margin-left: 1px;
        }
      </style>
    </head>
    <body>
      <div
        id="scene"
        data-composition-id="code-snippet-apple-terminal-solid-colors"
        data-width="1920"
        data-height="1080"
      >
        <div class="terminal-window">
          <div class="titlebar">
            <div class="traffic-lights">
              <span class="close"></span>
              <span class="minimize"></span>
              <span class="fullscreen"></span>
            </div>
            <span class="window-title">bash — 80×24</span>
          </div>
          <div class="terminal-canvas">
            <div class="output-lines">
              <span class="output-line dim">Last login: Mon Jun 2 09:14:22 on ttys011</span>
              <span class="output-line">Initializing HyperFrames project...</span>
              <span class="output-line dim"> Creating project structure</span>
              <span class="output-line dim"> Copying template files</span>
              <span class="output-line dim"> Installing dependencies</span>
              <span class="output-line"> added 142 packages in 3.4s</span>
              <span class="output-line accent"> ✓ Project ready at ./my-video</span>
              <span class="output-line bold"> Run: cd my-video && npx hyperframes preview</span>
            </div>
            <div class="input-line">
              <span class="prompt">user@Mac ~ % </span><span class="typed-command"></span
              ><span class="cursor-block"></span>
            </div>
          </div>
        </div>
      </div>

      <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
      <script>
        window.__timelines = window.__timelines || {};

        const command = "npx hyperframes init my-video";
        const typedEl = document.querySelector(".typed-command");
        const cursorEl = document.querySelector(".cursor-block");
        const outputLines = document.querySelectorAll(".output-line");

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

        tl.set(typedEl, { text: "" }, 0);

        const charDuration = 1.5 / command.length;
        command.split("").forEach((char, i) => {
          tl.add(
            () => {
              typedEl.textContent = command.slice(0, i + 1);
            },
            0.5 + i * charDuration,
          );
        });

        tl.set(cursorEl, { opacity: 0 }, 2.2);
        tl.set(outputLines[0], { opacity: 1 }, 2.3);

        tl.add(() => {
          typedEl.textContent = "";
        }, 2.5);

        outputLines.forEach((line, i) => {
          if (i === 0) return;
          tl.set(line, { opacity: 1 }, 2.8 + i * 0.1);
        });

        tl.add(() => {
          const inputLine = document.querySelector(".input-line");
          const newPrompt = document.createElement("div");
          newPrompt.className = "input-line";
          newPrompt.innerHTML =
            '<span class="prompt">user@Mac ~ % </span><span class="typed-command"></span><span class="cursor-block" id="final-cursor"></span>';
          inputLine.style.display = "none";
          inputLine.parentNode.appendChild(newPrompt);
        }, 4.2);

        const blinkTimes = [4.4, 4.8, 5.2, 5.6, 6.0, 6.4];
        blinkTimes.forEach((t, i) => {
          tl.add(() => {
            const fc = document.getElementById("final-cursor");
            if (fc) fc.style.opacity = i % 2 === 0 ? "0" : "1";
          }, t);
        });
        tl.add(() => {
          const fc = document.getElementById("final-cursor");
          if (fc) fc.style.opacity = "1";
        }, 6.8);

        window.__timelines["code-snippet-apple-terminal-solid-colors"] = tl;
      </script>
    </body>
  </html>
  ```
</Accordion>

## Usage

After installing, add the block to your host composition:

```html theme={null}
<div
  data-composition-id="code-snippet-apple-terminal-solid-colors"
  data-composition-src="compositions/code-snippet-apple-terminal-solid-colors.html"
  data-start="0"
  data-duration="12"
  data-track-index="1"
  data-width="1920"
  data-height="1080"
></div>
```

## Features

* Faithful recreation of macOS Terminal.app Solid Colors profile — #4C0099 deep purple background with white text
* macOS window chrome with traffic light buttons and centered title bar
* Per-character GSAP typing animation — command types out character by character
* Output lines reveal sequentially after command executes
* Cursor blinks three times at the end then holds steady
* Self-contained HTML — no external assets, only GSAP CDN

Tagged `code` `developer` `showcase` `terminal` `apple` `apple-terminal`.

## Related topics

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