mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-01 19:42:03 +00:00
Pure-CSS radial darkening overlay that fills its positioned parent and pulls focus toward the center. Shape, size, and color are exposed as CSS custom properties (--vignette-shape, --vignette-size, --vignette-edge, --vignette-color), so a GSAP timeline can animate any of them — the snippet's header comment shows the pattern for fading the vignette in. The Components section currently has four entries; this fills the cinematic-cinematography gap a video editor expects out of the box without bundling any asset (the effect is a single radial-gradient). Default z-index 90 sits below grain-overlay (100) so grain reads on top of the darkened corners. Catalog page, registry index, and nav are regenerated via scripts/generate-catalog-pages.ts.
52 lines
1.5 KiB
HTML
Vendored
52 lines
1.5 KiB
HTML
Vendored
<!--
|
|
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);
|
|
-->
|