mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-13 07:40:06 +00:00
Restores the 208 catalog items reverted after their previews 404'd in production, this time on the payload mechanism rather than the .html files that caused the outage. The generator no longer writes a preview document to docs/public. That writer, and the machinery under it, existed only to produce files the docs host discards, so it is gone rather than bypassed. Items now embed the composition itself via a payload, which is what the previous change already does for the items that were already in the catalog. The variables explorer is parked, not restored: it drove its preview through the same unpublished .html path, so it would have shown an empty frame. Items that declare variables get the live player plus the static variables table, and reconnecting the explorer to payloads is a follow-up.
135 lines
4.6 KiB
Plaintext
135 lines
4.6 KiB
Plaintext
---
|
|
title: "Terminal Simulator"
|
|
description: "A terminal window types commands and streams log output."
|
|
---
|
|
|
|
import { InstallCommand } from "/snippets/install-command.jsx";
|
|
|
|
<iframe
|
|
className="w-full aspect-video rounded-xl border-0 bg-zinc-100 dark:bg-zinc-800"
|
|
title="terminal-simulator 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/terminal-simulator.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/terminal-simulator.png");document.body.appendChild(p)});<\/script></body></html>`}
|
|
/>
|
|
|
|
## Install
|
|
|
|
<InstallCommand command="npx hyperframes add terminal-simulator" />
|
|
|
|
That writes one file: `compositions/components/terminal-simulator.html`.
|
|
|
|
## Source
|
|
|
|
<Accordion title={`terminal-simulator.html`}>
|
|
|
|
```html
|
|
<!--
|
|
Terminal Simulator - remocn component ported to HyperFrames authoring format.
|
|
|
|
Paste the markup and CSS into a composition. Drive the timeline integration
|
|
from a paused GSAP timeline so renders remain deterministic.
|
|
-->
|
|
|
|
<div class="hf-remocn-terminal-simulator">
|
|
<div class="chrome"><span class="dot"></span><span>Terminal Simulator</span></div>
|
|
<div class="body">
|
|
<div class="files">index.html<br />style.css<br />timeline.js</div>
|
|
<div class="editor">
|
|
<span class="line" style="width: 92%"></span><span class="line" style="width: 72%"></span
|
|
><span class="line" style="width: 84%"></span><span class="line" style="width: 58%"></span
|
|
><span class="line" style="width: 78%"></span>
|
|
</div>
|
|
</div>
|
|
<div class="terminal">$ hyperframes render --skill=terminal-simulator</div>
|
|
</div>
|
|
|
|
<style>
|
|
.hf-remocn-terminal-simulator {
|
|
--hf-accent: var(--accent, #18181b);
|
|
--hf-ink: #111827;
|
|
--hf-muted: #6b7280;
|
|
--hf-surface: #ffffff;
|
|
color: var(--hf-ink);
|
|
font-family: Inter, system-ui, sans-serif;
|
|
}
|
|
.hf-remocn-terminal-simulator {
|
|
width: 760px;
|
|
border-radius: 24px;
|
|
overflow: hidden;
|
|
background: #0f172a;
|
|
color: #e4e4e7;
|
|
box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2);
|
|
font-family: ui-monospace, Menlo, monospace;
|
|
}
|
|
.hf-remocn-terminal-simulator .chrome {
|
|
height: 48px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 0 18px;
|
|
background: #111827;
|
|
color: #94a3b8;
|
|
}
|
|
.hf-remocn-terminal-simulator .dot {
|
|
width: 11px;
|
|
height: 11px;
|
|
border-radius: 999px;
|
|
background: #ef4444;
|
|
box-shadow:
|
|
18px 0 #f59e0b,
|
|
36px 0 #22c55e;
|
|
}
|
|
.hf-remocn-terminal-simulator .body {
|
|
display: grid;
|
|
grid-template-columns: 210px 1fr;
|
|
min-height: 340px;
|
|
}
|
|
.hf-remocn-terminal-simulator .files {
|
|
padding: 22px;
|
|
border-right: 1px solid rgba(148, 163, 184, 0.18);
|
|
color: #94a3b8;
|
|
}
|
|
.hf-remocn-terminal-simulator .editor {
|
|
padding: 22px;
|
|
display: grid;
|
|
gap: 12px;
|
|
}
|
|
.hf-remocn-terminal-simulator .line {
|
|
display: block;
|
|
height: 16px;
|
|
border-radius: 999px;
|
|
background: rgba(228, 228, 231, 0.18);
|
|
transform: scaleX(var(--hf-line, 1));
|
|
transform-origin: left center;
|
|
opacity: var(--hf-line-opacity, 1);
|
|
}
|
|
.hf-remocn-terminal-simulator .terminal {
|
|
padding: 18px 22px 24px;
|
|
border-top: 1px solid rgba(148, 163, 184, 0.18);
|
|
color: #86efac;
|
|
min-height: 78px;
|
|
}
|
|
</style>
|
|
|
|
<!--
|
|
Timeline integration:
|
|
tl.fromTo('.hf-remocn-terminal-simulator .line', { '--hf-line': 0, '--hf-line-opacity': 0 }, { '--hf-line': 1, '--hf-line-opacity': 1, duration: 0.24, stagger: 0.08, ease: 'power2.out' }, startTime); tl.fromTo('.hf-remocn-terminal-simulator .terminal', { opacity: 0, y: 16 }, { opacity: 1, y: 0, duration: 0.34, ease: 'power2.out' }, startTime + 0.48);
|
|
-->
|
|
```
|
|
|
|
</Accordion>
|
|
|
|
## Usage
|
|
|
|
Open `compositions/components/terminal-simulator.html` and paste its contents into your composition. See the comment header in the file for timeline integration guidance.
|
|
|
|
{/* hf:generated-footer */}
|
|
|
|
Tagged `code-animation` `remocn-port`.
|
|
|
|
## Related topics
|
|
|
|
- [Browse the complete Catalog](/catalog)
|
|
- [Add assets and Catalog items in Studio](/studio/assets-and-blocks)
|
|
- [Build a richer composition](/go-further)
|