mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-01 19:42:03 +00:00
* fix(docs): load the player from latest, not a pinned minor The catalog pages pinned the player CDN URL to a minor line, and that pin sat one line behind after the last release. Every page kept rendering, on the older build, so nothing surfaced it: the only symptom was that a fix published to npm never appeared on the docs. The generator derived its pin from the player's package.json, which is correct only if every page is regenerated on the release that moves it. That is the step that did not happen, and it has to happen across 175 generated pages plus three hand-written files for the pin to be true. A version carried in step across 178 places will be stale, and stale here is silent. Ask for latest instead and there is nothing to carry. This costs the ability to hold the docs back from a bad player release. Paid deliberately: the pin did not buy that either, it only delayed the good releases too. A test asserts no pinned version comes back, and fails if it stops finding the references at all, so it cannot pass by matching nothing. * refactor(scripts): list tracked files instead of walking the tree The pin guard hand-rolled a recursive directory walk with its own skip list and size cap, which the audit flagged: helpers living in a test file earn no coverage, so their complexity lands straight on the CRAP score. git already knows which files to read, and ignores node_modules and build output for us, so one call replaces the walker and both findings go away.
94 lines
3.2 KiB
Plaintext
94 lines
3.2 KiB
Plaintext
---
|
|
title: "Vignette"
|
|
description: "Cinematic radial vignette overlay using a pure-CSS gradient — darkens the edges to pull focus toward the center"
|
|
---
|
|
|
|
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="vignette 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@latest/dist/hyperframes-player.global.js"><\/script></head><body><script>fetch("/public/catalog/components/vignette.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/vignette.png");document.body.appendChild(p)});<\/script></body></html>`}
|
|
/>
|
|
|
|
## Install
|
|
|
|
<InstallCommand command="npx hyperframes add vignette" item="vignette" />
|
|
|
|
That writes one file: `compositions/components/vignette.html`.
|
|
|
|
## Source
|
|
|
|
<Accordion title={`vignette.html`}>
|
|
|
|
```html
|
|
<!--
|
|
Vignette — cinematic radial darkening overlay.
|
|
|
|
Usage: paste this snippet inside your composition's positioned stage.
|
|
The overlay covers the full viewport with pointer-events: none so it
|
|
sits on top of all content without blocking interaction.
|
|
|
|
Customize:
|
|
- --vignette-color: edge color and alpha (default rgba(0, 0, 0, 0.7))
|
|
- --vignette-size: where the transparent center ends (default 45%)
|
|
- --vignette-edge: where the color reaches its final stop (default 100%)
|
|
- --vignette-shape: ellipse | circle (default ellipse)
|
|
- z-index: defaults to 90 so grain-overlay (100) reads on top
|
|
-->
|
|
|
|
<div
|
|
id="hf-vignette"
|
|
style="
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
pointer-events: none;
|
|
z-index: 90;
|
|
"
|
|
></div>
|
|
|
|
<style>
|
|
#hf-vignette {
|
|
background: radial-gradient(
|
|
var(--vignette-shape, ellipse) at center,
|
|
transparent var(--vignette-size, 45%),
|
|
var(--vignette-color, rgba(0, 0, 0, 0.7)) var(--vignette-edge, 100%)
|
|
);
|
|
}
|
|
</style>
|
|
|
|
<!--
|
|
Timeline integration example (add to your composition's GSAP timeline):
|
|
|
|
// Fade the vignette in over the first second
|
|
tl.fromTo("#hf-vignette",
|
|
{ "--vignette-color": "rgba(0, 0, 0, 0)" },
|
|
{ "--vignette-color": "rgba(0, 0, 0, 0.7)", duration: 1, ease: "power2.out" },
|
|
0,
|
|
);
|
|
|
|
// Or breathe the size in and out (works with any easing)
|
|
tl.to("#hf-vignette", { "--vignette-size": "35%", duration: 1, ease: "sine.inOut" }, 2);
|
|
-->
|
|
```
|
|
|
|
</Accordion>
|
|
|
|
## Usage
|
|
|
|
Open `compositions/components/vignette.html` and paste its contents into your composition. See the comment header in the file for detailed instructions.
|
|
|
|
{/* hf:generated-footer */}
|
|
|
|
Tagged `vignette` `overlay` `cinematic` `effect`.
|
|
|
|
## Related topics
|
|
|
|
- [Browse the complete Catalog](/catalog)
|
|
- [Add assets and Catalog items in Studio](/studio/assets-and-blocks)
|
|
- [Build a richer composition](/go-further)
|