mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-01 19:42:03 +00:00
* feat(catalog): put the variables panel back, on payloads The panel drove its preview by loading an .html from docs/public, a type the host does not publish, so it showed an empty frame in production and was parked when the catalog was re-landed. It now mounts the same JSON payload the plain player uses and re-mounts it as values change, injecting them as window.__hfVariables into the composition head before any of its scripts run, which is where the runtime reads overrides from. Doing it in the markup rather than after load is what stops the composition initialising with the wrong values first. 172 items with variables get the panel back; the playhead carries across a change so a tweak mid-shot does not jump back to frame zero. * fix(docs): drop the unused url form and the needless escapes * fix(docs): the panel cannot reference a binding beside the export * feat(catalog): make importing an SVG the obvious move A reader arrives at this control with a shape, not with path data, and the panel asked for the coordinates first. Import is now the primary action in a drop target you can see is a drop target, and the raw path sits behind a disclosure for anyone who wants it. * feat(cli): let a fruitless catalog search report the gap An agent that searches by meaning and finds nothing worth installing knows something we do not: the name of a move the catalog is missing. There was no way to tell us, so that knowledge was lost at the end of every run. hyperframes feedback --search-miss "<query>" --wanted "<the move>" records it. It carries no rating, so it never lands in the rating metric, and it is a separate deliberate command rather than something catalog --query does on its own: plain search still sends nothing, which is what the CLI promises. --rating stops being required at the arg level, since a miss has no rating to give. The check moved into the run body, where an absent one is now handled rather than crashing on undefined. * feat(cli): carry tuned variable values into the install snippet Someone who tunes a block on its catalog page had no way to keep those values: the install command was the same one everybody gets, and the tuning stayed on the page. hyperframes add <item> --vars '<json>' now prints a mount element carrying data-variable-values, so the values land where the block is used. They ride on the host rather than being written into the installed file. That keeps the composition on disk byte-identical to the registry's, so a later reinstall can still tell an edit from an update, and it lets two mounts of the same block carry different values. * fix(catalog): serve the item's own directory so runtime paths resolve Some compositions assemble their asset URLs at run time — "compositions/components/" + texture + ".png" for the texture masks, a font the compiler pulled into _remote_media — and no scan of the markup can see a string that does not exist until a script concatenates it. Those items either rendered black or were dropped to a video that had never been uploaded. Each item that needs it now has its prepared directory published, and its payload carries a <base> pointing at it, so any relative path the composition invents resolves. caption-texture renders its masks again, and variable-font-flex has a preview at all for the first time: its MP4 and poster are both 403. Both layouts are published, because which one a composition asks for differs per item, and a directory only earns that if it is under 2 MB. The 12 MB texture sheet keeps the recorded video it already had. * fix(catalog): let the variables panel actually drive the composition Every control on the panel was inert. The values reached the composition and nothing repainted, because the payload had already been compiled: compiling inlines a mounted component and resolves its variables into the markup and CSS, so by the time a reader turns a knob there is nothing left to change. An item that declares variables now ships uncompiled, keeping the mount the runtime loads at run time, which is the only state where data-variable-values still means anything. The component travels inline as a data URI rather than a sibling file, because .html is the one type the docs host will not publish. The demo's own pinned values come off, so the reader's choices reach the mount instead of losing to the values the demo picked to show itself off. Measured on the rendered frame rather than the DOM: green rgb(98,207,144), blue rgb(6,6,199), violet rgb(177,147,230), and back to green. docs/public/catalog drops from 48 MB to 35 MB along the way, since an uncompiled payload carries far less than an inlined one. * feat(catalog): keep variable changes in the url A reader who tuned a piece lost it on reload, and had nothing to send anyone. The values now live in the query string, scoped by composition id so two links never read each other,and only the ones that differ from the defaults are written, so changing one knob gives a short URL rather than every variable spelled out. replaceState rather than pushState: dragging a slider should not leave a trail of history entries. An unreadable value is ignored rather than thrown, so a truncated or hand-edited link opens the piece at its defaults. * fix(catalog): only rewrite the url when a value actually changed * refactor(catalog): memoise the declared defaults on their content * feat(catalog): offer an install command carrying the tuned values The Install block is generated before anyone touches a knob, so it can only ever print the plain command. Someone who spent a minute tuning a piece copied it and got the defaults back. The panel now carries its own command in the Snippet tab, with --vars holding exactly the values that differ. An untouched piece still offers the same short command, so nothing gets noisier for the common case. * fix(catalog): a piece with nothing to render is a skip, not a failure caption-blend-difference is a stylesheet and a paragraph of prose — a class you add to your own captions, with no standalone scene to show. The generator treated that as a build failure, so every run ended by reporting something broken when nothing was. It now reports the shape it is and keeps its recorded video, which is the only honest preview such an item has. A genuine render failure still throws. * fix(catalog): restore variables from the url on a cold load A shared link opened at the defaults. The first render happens on the server, where there is no window to read the query string from, and React then hydrates against that markup and never revisits it — so the values only appeared once you touched a control. The URL is read again after mount, which is the first moment it exists. The value is also escaped once now rather than twice: URLSearchParams already decodes on the way out, and decoding a second time turned an SVG path full of percent-escapes into something that no longer parsed, besides doubling the length of every link. * fix(catalog): mount the preview with the values a link carried The frame was built from the declared defaults and the shared values were posted to it afterwards, which is too late for anything the composition reads once at init: a path arrived after the mark had already been drawn from the default one, so a link looked right in the panel and wrong on screen. * feat(catalog): the install command follows the values you tuned Copying the Install line gave the plain command back, because that block is generated before anyone touches a knob and had no way to know what changed. The tuned command only existed in the panel Snippet tab, which is not where anyone looks for it. The line now reads the same query string the panel writes, so the two agree without either component knowing the other exists, and a shared link carries the right command too. replaceState fires no event, so the panel announces its own writes. * fix(catalog): send a text variable to the preview once it is finished Every other control in the explorer reports a whole value on every event: a slider at any position is a position, a swatch is a colour. A text field is not. Typing v3 into a badge posted v first, so the preview remounted and rendered a composition built from half a word. The post now waits while a text field has focus and goes out when the edit is committed, with Enter or by clicking away. The field itself is unchanged and still tracks every keystroke. --------- Co-authored-by: Miguel Angel Simon Sierra <miguelangelsi07@gmail.com>
810 lines
33 KiB
Plaintext
810 lines
33 KiB
Plaintext
---
|
||
title: "Logo Brand Close"
|
||
description: "A display-scale wordmark cascades letter by letter into a centered lockup, the accent brand period lands last, an optional tagline and wide-tracked mono URL settle beneath, and the finished identity holds dead still to the end of the film."
|
||
---
|
||
|
||
import { InstallCommand } from "/snippets/install-command.jsx";
|
||
import { VariablesExplorer } from "/snippets/variables-explorer.jsx";
|
||
|
||
<VariablesExplorer
|
||
previewSrc="/public/catalog/components/logo-brand-close.json"
|
||
compositionId="logo-brand-close"
|
||
compositionSrc="compositions/components/logo-brand-close.html"
|
||
variables={[{"id":"wordmark","type":"string","role":"content","label":"Wordmark","description":"Brand name whose letters cascade into the centered lockup.","default":"HYPERFRAMES"},{"id":"tagline","type":"string","role":"content","label":"Tagline","description":"Optional tagline that settles beneath the wordmark. Empty hides it.","default":"Write HTML. Render video."},{"id":"url","type":"string","role":"content","label":"URL","description":"Optional mono URL line beneath the tagline. Empty hides it.","default":"hyperframes.heygen.com"},{"id":"accent","type":"enum","role":"style","label":"Accent","description":"Contract color used by the brand period at the end of the wordmark.","default":"green","options":[{"value":"green","label":"Green"},{"value":"blue","label":"Blue"},{"value":"violet","label":"Violet"}]},{"id":"exit","type":"enum","role":"style","label":"Exit","description":"Optional departure. Films end on the still hold, so the default is none.","default":"none","options":[{"value":"none","label":"None"},{"value":"fade","label":"Fade"},{"value":"up","label":"Up"}]}]}
|
||
>
|
||
|
||
```html logo-brand-close.html
|
||
<!doctype html>
|
||
<!--
|
||
logo-brand-close: HyperFrames video primitive (brand close)
|
||
|
||
The identity close that ends films. The wordmark lands at display scale,
|
||
a chars-aware fit sizing it to roughly three quarters of the frame width.
|
||
Letters cascade left to right (per-letter fade plus rise with a long
|
||
expo tail) while the whole wordmark settles from a slightly larger scale,
|
||
the accent brand period arrives last with a decisive pop, a readable
|
||
tagline settles beneath, a wide-tracked mono URL breathes in below, then
|
||
the finished lockup holds dead still to the end. Distinct from cta-close:
|
||
identity, not action. No button, no cursor.
|
||
|
||
Variables:
|
||
- wordmark (string): the brand name that cascades into place.
|
||
- tagline (string): optional line beneath the wordmark; empty hides it.
|
||
- url (string): optional mono URL line; empty hides it.
|
||
- accent (green | blue | violet): color of the brand period.
|
||
- exit (none | fade | up, default none): films end on the hold.
|
||
|
||
Envelope, fixed IN with elastic HOLD only (OUT exists only when exit is
|
||
not none):
|
||
IN_BASE = 2.6s, letter cascade + scale settle, period pop, tagline
|
||
settle, URL tracking settle
|
||
HOLD = max(0, D - IN - OUT), completely still
|
||
OUT_BASE = 0.5s only when exit is fade or up, otherwise 0
|
||
If D is shorter than IN_BASE + OUT_BASE, both compress together.
|
||
The timeline is never time-scaled.
|
||
|
||
Mount contract: the runtime clones only this template. #root fills the host
|
||
box, establishes the container query basis, has no data-width or data-height,
|
||
and registers one paused timeline under the literal logo-brand-close key.
|
||
-->
|
||
<html
|
||
lang="en"
|
||
data-composition-id="logo-brand-close"
|
||
data-composition-duration="4"
|
||
data-composition-variables='[
|
||
{ "id": "wordmark", "type": "string", "role": "content", "label": "Wordmark", "description": "Brand name whose letters cascade into the centered lockup.", "default": "HYPERFRAMES" },
|
||
{ "id": "tagline", "type": "string", "role": "content", "label": "Tagline", "description": "Optional tagline that settles beneath the wordmark. Empty hides it.", "default": "Write HTML. Render video." },
|
||
{ "id": "url", "type": "string", "role": "content", "label": "URL", "description": "Optional mono URL line beneath the tagline. Empty hides it.", "default": "hyperframes.heygen.com" },
|
||
{ "id": "accent", "type": "enum", "role": "style", "label": "Accent", "description": "Contract color used by the brand period at the end of the wordmark.", "default": "green", "options": [{ "value": "green", "label": "Green" }, { "value": "blue", "label": "Blue" }, { "value": "violet", "label": "Violet" }] },
|
||
{ "id": "exit", "type": "enum", "role": "style", "label": "Exit", "description": "Optional departure. Films end on the still hold, so the default is none.", "default": "none", "options": [{ "value": "none", "label": "None" }, { "value": "fade", "label": "Fade" }, { "value": "up", "label": "Up" }] }
|
||
]'
|
||
>
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<title>Logo Brand Close</title>
|
||
</head>
|
||
<body>
|
||
<template>
|
||
<div id="root" data-composition-id="logo-brand-close" data-duration="4" data-fps="30">
|
||
<style>
|
||
*,
|
||
*::before,
|
||
*::after {
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
#root {
|
||
position: absolute;
|
||
inset: 0;
|
||
overflow: hidden;
|
||
container-type: size;
|
||
isolation: isolate;
|
||
color: var(--fg, #f8fafc);
|
||
font-family: var(--font-body, Inter, system-ui, sans-serif);
|
||
pointer-events: none;
|
||
}
|
||
|
||
.lbc-clip {
|
||
position: absolute;
|
||
inset: 0;
|
||
display: grid;
|
||
place-items: center;
|
||
overflow: hidden;
|
||
background: var(--bg, #0b0c0e);
|
||
}
|
||
|
||
.lbc-lockup {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
width: 100cqw;
|
||
text-align: center;
|
||
will-change: transform, opacity;
|
||
}
|
||
|
||
/* Display scale: the JS chars-aware fit targets ~76cqw of set
|
||
width; 40cqh caps it in short, wide mounts. */
|
||
.lbc-wordmark {
|
||
display: flex;
|
||
align-items: baseline;
|
||
justify-content: center;
|
||
margin: 0;
|
||
color: var(--fg, #f8fafc);
|
||
font-family: var(--font-display, Inter, system-ui, sans-serif);
|
||
font-size: var(--lbc-wordmark-size, min(10.5cqw, 40cqh));
|
||
font-weight: 600;
|
||
line-height: 1.04;
|
||
letter-spacing: -0.035em;
|
||
white-space: nowrap;
|
||
will-change: transform;
|
||
}
|
||
|
||
.lbc-letter {
|
||
display: inline-block;
|
||
flex: 0 0 auto;
|
||
will-change: transform, opacity;
|
||
}
|
||
|
||
.lbc-space {
|
||
width: 0.34em;
|
||
}
|
||
|
||
.lbc-period {
|
||
color: var(--lbc-accent);
|
||
}
|
||
|
||
.lbc-tagline {
|
||
max-width: 88cqw;
|
||
margin: var(--space-2, 3cqmin) 0 0;
|
||
color: var(--fg, #f8fafc);
|
||
font-size: min(3.4cqw, 5.4cqmin);
|
||
font-weight: 500;
|
||
line-height: 1.3;
|
||
letter-spacing: 0.01em;
|
||
will-change: transform, opacity;
|
||
}
|
||
|
||
.lbc-url {
|
||
margin: var(--space-3, 4.6cqmin) 0 0;
|
||
color: var(--muted, #94a3b8);
|
||
font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
|
||
font-size: min(2.4cqw, 3.2cqmin);
|
||
font-weight: 500;
|
||
line-height: 1;
|
||
letter-spacing: 0.28em;
|
||
will-change: opacity;
|
||
}
|
||
</style>
|
||
|
||
<div
|
||
id="logo-brand-close-clip"
|
||
class="lbc-clip clip"
|
||
data-start="0"
|
||
data-duration="4"
|
||
data-track-index="0"
|
||
>
|
||
<div class="lbc-lockup">
|
||
<h2 class="lbc-wordmark"></h2>
|
||
<p class="lbc-tagline"></p>
|
||
<p class="lbc-url"></p>
|
||
</div>
|
||
</div>
|
||
|
||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||
<script>
|
||
(function () {
|
||
"use strict";
|
||
|
||
var root = document.getElementById("root");
|
||
var lockup = root.querySelector(".lbc-lockup");
|
||
var wordmarkElement = root.querySelector(".lbc-wordmark");
|
||
var taglineElement = root.querySelector(".lbc-tagline");
|
||
var urlElement = root.querySelector(".lbc-url");
|
||
var vars =
|
||
window.__hyperframes && window.__hyperframes.getVariables
|
||
? window.__hyperframes.getVariables()
|
||
: {};
|
||
|
||
var wordmark =
|
||
vars.wordmark == null
|
||
? "HYPERFRAMES"
|
||
: String(vars.wordmark).trim().replace(/\s+/g, " ");
|
||
if (wordmark.length === 0) wordmark = "HYPERFRAMES";
|
||
var tagline =
|
||
vars.tagline == null
|
||
? "Write HTML. Render video."
|
||
: String(vars.tagline).trim().replace(/\s+/g, " ");
|
||
var url = vars.url == null ? "hyperframes.heygen.com" : String(vars.url).trim();
|
||
var accentColors = {
|
||
green: "var(--brand, #71f5a7)",
|
||
blue: "var(--accent, #61a8ff)",
|
||
violet: "var(--accent-2, #c5a3ff)",
|
||
};
|
||
var accent = Object.prototype.hasOwnProperty.call(accentColors, vars.accent)
|
||
? vars.accent
|
||
: "green";
|
||
var exit = vars.exit === "fade" || vars.exit === "up" ? vars.exit : "none";
|
||
|
||
root.style.setProperty("--lbc-accent", accentColors[accent]);
|
||
wordmarkElement.setAttribute("aria-label", wordmark);
|
||
wordmarkElement.setAttribute("role", "img");
|
||
|
||
// The brand period: an accent dot ends the wordmark. If the
|
||
// wordmark already ends with "." that period takes the accent
|
||
// instead of appending a second one.
|
||
var characters = Array.from(wordmark);
|
||
if (characters[characters.length - 1] !== ".") characters.push(".");
|
||
|
||
var letters = characters.map(function (character, index) {
|
||
var letter = document.createElement("span");
|
||
letter.id = "logo-brand-close-letter-" + index;
|
||
letter.className = "lbc-letter";
|
||
if (/\s/.test(character)) {
|
||
letter.classList.add("lbc-space");
|
||
letter.textContent = " ";
|
||
} else {
|
||
letter.textContent = character;
|
||
}
|
||
if (index === characters.length - 1) letter.classList.add("lbc-period");
|
||
letter.setAttribute("aria-hidden", "true");
|
||
wordmarkElement.appendChild(letter);
|
||
return letter;
|
||
});
|
||
var periodLetter = letters[letters.length - 1];
|
||
var cascadeLetters = letters.slice(0, -1);
|
||
|
||
// Deterministic chars-aware fit: probe the set width at a fixed
|
||
// 100px font (letter-spacing rides in em, so the em ratio is a
|
||
// pure font metric), then size the wordmark so it lands at
|
||
// ~76cqw. The 40cqh term caps it in short, wide mounts. If the
|
||
// probe cannot measure (detached render), fall back to a
|
||
// per-glyph advance estimate.
|
||
wordmarkElement.style.fontSize = "100px";
|
||
var probedWidth = wordmarkElement.getBoundingClientRect().width;
|
||
wordmarkElement.style.fontSize = "";
|
||
var setWidthEm;
|
||
if (probedWidth > 0) {
|
||
setWidthEm = probedWidth / 100;
|
||
} else {
|
||
setWidthEm = characters.reduce(function (total, character) {
|
||
if (/\s/.test(character)) return total + 0.34;
|
||
if (/[.,:;!'’|]/.test(character)) return total + 0.3;
|
||
if (/[Iijlftr]/.test(character)) return total + 0.42;
|
||
if (/[MWmw@]/.test(character)) return total + 0.92;
|
||
return total + 0.64;
|
||
}, 0);
|
||
setWidthEm -= characters.length * 0.035;
|
||
}
|
||
setWidthEm = Math.max(0.3, setWidthEm);
|
||
var wordmarkSize = 76 / setWidthEm;
|
||
root.style.setProperty(
|
||
"--lbc-wordmark-size",
|
||
"min(" + wordmarkSize.toFixed(3) + "cqw, 40cqh)",
|
||
);
|
||
|
||
if (tagline.length === 0) taglineElement.remove();
|
||
else taglineElement.textContent = tagline;
|
||
if (url.length === 0) urlElement.remove();
|
||
else urlElement.textContent = url;
|
||
|
||
var IN_BASE = 2.6;
|
||
var OUT_BASE = exit === "none" ? 0 : 0.5;
|
||
var CASCADE_RISE_BASE = 1.15;
|
||
var CASCADE_STAGGER_BASE = 0.7;
|
||
var SETTLE_BASE = 2.4;
|
||
var PERIOD_AT_BASE = 0.95;
|
||
var PERIOD_DURATION_BASE = 0.9;
|
||
var TAGLINE_AT_BASE = 1.35;
|
||
var TAGLINE_DURATION_BASE = 0.9;
|
||
var URL_AT_BASE = 1.7;
|
||
var URL_DURATION_BASE = 0.85;
|
||
var duration = Math.max(0.001, parseFloat(root.dataset.duration || "4"));
|
||
var totalBase = IN_BASE + OUT_BASE;
|
||
var scale = duration < totalBase ? duration / totalBase : 1;
|
||
var IN = IN_BASE * scale;
|
||
var OUT = OUT_BASE * scale;
|
||
var STAGGER = cascadeLetters.length > 1 ? CASCADE_STAGGER_BASE * scale : 0;
|
||
var HOLD = Math.max(0, duration - (IN + OUT));
|
||
var OUT_START = IN + HOLD;
|
||
|
||
var tl = gsap.timeline({ paused: true });
|
||
|
||
// IN: per-letter fade plus rise with a long expo tail, while the
|
||
// whole wordmark settles down from a slightly larger scale.
|
||
if (cascadeLetters.length > 0) {
|
||
tl.fromTo(
|
||
cascadeLetters,
|
||
{ opacity: 0, y: "0.62em" },
|
||
{
|
||
opacity: 1,
|
||
y: "0em",
|
||
duration: CASCADE_RISE_BASE * scale,
|
||
stagger: { amount: STAGGER, from: "start" },
|
||
ease: "expo.out",
|
||
},
|
||
0,
|
||
);
|
||
}
|
||
|
||
tl.fromTo(
|
||
wordmarkElement,
|
||
{ scale: 1.04, transformOrigin: "50% 100%" },
|
||
{ scale: 1, duration: SETTLE_BASE * scale, ease: "expo.out" },
|
||
0,
|
||
);
|
||
|
||
// The brand period lands last: a decisive accent pop.
|
||
tl.fromTo(
|
||
periodLetter,
|
||
{ opacity: 0, scale: 0.2, y: "0.08em", transformOrigin: "50% 65%" },
|
||
{
|
||
opacity: 1,
|
||
scale: 1,
|
||
y: "0em",
|
||
duration: PERIOD_DURATION_BASE * scale,
|
||
ease: "back.out(1.8)",
|
||
},
|
||
PERIOD_AT_BASE * scale,
|
||
);
|
||
|
||
if (taglineElement.isConnected) {
|
||
tl.fromTo(
|
||
taglineElement,
|
||
{ opacity: 0, y: "0.9em" },
|
||
{
|
||
opacity: 1,
|
||
y: "0em",
|
||
duration: TAGLINE_DURATION_BASE * scale,
|
||
ease: "power3.out",
|
||
},
|
||
TAGLINE_AT_BASE * scale,
|
||
);
|
||
}
|
||
|
||
if (urlElement.isConnected) {
|
||
tl.fromTo(
|
||
urlElement,
|
||
// scaleX, not letterSpacing: tracking is a layout property, so
|
||
// the browser snaps it to integer device pixels and the
|
||
// ease-out tail stutters under seek-by-frame capture. The
|
||
// widening reads the same and stays on the compositor.
|
||
{ opacity: 0, scaleX: 1.06 },
|
||
{
|
||
opacity: 1,
|
||
scaleX: 1,
|
||
duration: URL_DURATION_BASE * scale,
|
||
ease: "power2.out",
|
||
},
|
||
URL_AT_BASE * scale,
|
||
);
|
||
}
|
||
|
||
// HOLD: dead still. No drift, no breath; the confidence is the
|
||
// stillness, and by default the film ends here.
|
||
|
||
if (exit === "fade") {
|
||
tl.to(lockup, { opacity: 0, duration: OUT, ease: "power2.in" }, OUT_START);
|
||
} else if (exit === "up") {
|
||
tl.to(
|
||
lockup,
|
||
{ opacity: 0, y: "-5cqh", duration: OUT, ease: "power2.in" },
|
||
OUT_START,
|
||
);
|
||
}
|
||
|
||
tl.seek(0);
|
||
window.__timelines = window.__timelines || {};
|
||
window.__timelines["logo-brand-close"] = tl;
|
||
})();
|
||
</script>
|
||
</div>
|
||
</template>
|
||
</body>
|
||
</html>
|
||
```
|
||
|
||
</VariablesExplorer>
|
||
|
||
## Install
|
||
|
||
<InstallCommand command="npx hyperframes add logo-brand-close" item="logo-brand-close" />
|
||
|
||
That writes one file: `compositions/components/logo-brand-close.html`.
|
||
|
||
## Paste it into your composition
|
||
|
||
Open `compositions/components/logo-brand-close.html` and copy what is inside into your own composition.
|
||
|
||
A component has no size or duration of its own. It takes both from the composition
|
||
you paste it into.
|
||
|
||
## Variables
|
||
|
||
Every one of these has a default, so the piece works untouched. Set the ones you
|
||
want to change on the element:
|
||
|
||
| Variable | Default | Accepts | What it does |
|
||
| --- | --- | --- | --- |
|
||
| `wordmark` | `HYPERFRAMES` | string | Brand name whose letters cascade into the centered lockup. |
|
||
| `tagline` | `Write HTML. Render video.` | string | Optional tagline that settles beneath the wordmark. Empty hides it. |
|
||
| `url` | `hyperframes.heygen.com` | string | Optional mono URL line beneath the tagline. Empty hides it. |
|
||
| `accent` | `green` | `green`, `blue`, `violet` | Contract color used by the brand period at the end of the wordmark. |
|
||
| `exit` | `none` | `none`, `fade`, `up` | Optional departure. Films end on the still hold, so the default is none. |
|
||
|
||
Set them with `data-variable-values` on the element that mounts it. These are the
|
||
defaults, so this behaves exactly like the preview above until you change one:
|
||
|
||
```html wrap
|
||
<div
|
||
data-composition-id="logo-brand-close"
|
||
data-composition-src="compositions/components/logo-brand-close.html"
|
||
data-variable-values='{"wordmark":"HYPERFRAMES","tagline":"Write HTML. Render video.","url":"hyperframes.heygen.com","accent":"green","exit":"none"}'
|
||
></div>
|
||
```
|
||
|
||
## Source
|
||
|
||
<Accordion title={`logo-brand-close.html`}>
|
||
|
||
```html
|
||
<!doctype html>
|
||
<!--
|
||
logo-brand-close: HyperFrames video primitive (brand close)
|
||
|
||
The identity close that ends films. The wordmark lands at display scale,
|
||
a chars-aware fit sizing it to roughly three quarters of the frame width.
|
||
Letters cascade left to right (per-letter fade plus rise with a long
|
||
expo tail) while the whole wordmark settles from a slightly larger scale,
|
||
the accent brand period arrives last with a decisive pop, a readable
|
||
tagline settles beneath, a wide-tracked mono URL breathes in below, then
|
||
the finished lockup holds dead still to the end. Distinct from cta-close:
|
||
identity, not action. No button, no cursor.
|
||
|
||
Variables:
|
||
- wordmark (string): the brand name that cascades into place.
|
||
- tagline (string): optional line beneath the wordmark; empty hides it.
|
||
- url (string): optional mono URL line; empty hides it.
|
||
- accent (green | blue | violet): color of the brand period.
|
||
- exit (none | fade | up, default none): films end on the hold.
|
||
|
||
Envelope, fixed IN with elastic HOLD only (OUT exists only when exit is
|
||
not none):
|
||
IN_BASE = 2.6s, letter cascade + scale settle, period pop, tagline
|
||
settle, URL tracking settle
|
||
HOLD = max(0, D - IN - OUT), completely still
|
||
OUT_BASE = 0.5s only when exit is fade or up, otherwise 0
|
||
If D is shorter than IN_BASE + OUT_BASE, both compress together.
|
||
The timeline is never time-scaled.
|
||
|
||
Mount contract: the runtime clones only this template. #root fills the host
|
||
box, establishes the container query basis, has no data-width or data-height,
|
||
and registers one paused timeline under the literal logo-brand-close key.
|
||
-->
|
||
<html
|
||
lang="en"
|
||
data-composition-id="logo-brand-close"
|
||
data-composition-duration="4"
|
||
data-composition-variables='[
|
||
{ "id": "wordmark", "type": "string", "role": "content", "label": "Wordmark", "description": "Brand name whose letters cascade into the centered lockup.", "default": "HYPERFRAMES" },
|
||
{ "id": "tagline", "type": "string", "role": "content", "label": "Tagline", "description": "Optional tagline that settles beneath the wordmark. Empty hides it.", "default": "Write HTML. Render video." },
|
||
{ "id": "url", "type": "string", "role": "content", "label": "URL", "description": "Optional mono URL line beneath the tagline. Empty hides it.", "default": "hyperframes.heygen.com" },
|
||
{ "id": "accent", "type": "enum", "role": "style", "label": "Accent", "description": "Contract color used by the brand period at the end of the wordmark.", "default": "green", "options": [{ "value": "green", "label": "Green" }, { "value": "blue", "label": "Blue" }, { "value": "violet", "label": "Violet" }] },
|
||
{ "id": "exit", "type": "enum", "role": "style", "label": "Exit", "description": "Optional departure. Films end on the still hold, so the default is none.", "default": "none", "options": [{ "value": "none", "label": "None" }, { "value": "fade", "label": "Fade" }, { "value": "up", "label": "Up" }] }
|
||
]'
|
||
>
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<title>Logo Brand Close</title>
|
||
</head>
|
||
<body>
|
||
<template>
|
||
<div id="root" data-composition-id="logo-brand-close" data-duration="4" data-fps="30">
|
||
<style>
|
||
*,
|
||
*::before,
|
||
*::after {
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
#root {
|
||
position: absolute;
|
||
inset: 0;
|
||
overflow: hidden;
|
||
container-type: size;
|
||
isolation: isolate;
|
||
color: var(--fg, #f8fafc);
|
||
font-family: var(--font-body, Inter, system-ui, sans-serif);
|
||
pointer-events: none;
|
||
}
|
||
|
||
.lbc-clip {
|
||
position: absolute;
|
||
inset: 0;
|
||
display: grid;
|
||
place-items: center;
|
||
overflow: hidden;
|
||
background: var(--bg, #0b0c0e);
|
||
}
|
||
|
||
.lbc-lockup {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
width: 100cqw;
|
||
text-align: center;
|
||
will-change: transform, opacity;
|
||
}
|
||
|
||
/* Display scale: the JS chars-aware fit targets ~76cqw of set
|
||
width; 40cqh caps it in short, wide mounts. */
|
||
.lbc-wordmark {
|
||
display: flex;
|
||
align-items: baseline;
|
||
justify-content: center;
|
||
margin: 0;
|
||
color: var(--fg, #f8fafc);
|
||
font-family: var(--font-display, Inter, system-ui, sans-serif);
|
||
font-size: var(--lbc-wordmark-size, min(10.5cqw, 40cqh));
|
||
font-weight: 600;
|
||
line-height: 1.04;
|
||
letter-spacing: -0.035em;
|
||
white-space: nowrap;
|
||
will-change: transform;
|
||
}
|
||
|
||
.lbc-letter {
|
||
display: inline-block;
|
||
flex: 0 0 auto;
|
||
will-change: transform, opacity;
|
||
}
|
||
|
||
.lbc-space {
|
||
width: 0.34em;
|
||
}
|
||
|
||
.lbc-period {
|
||
color: var(--lbc-accent);
|
||
}
|
||
|
||
.lbc-tagline {
|
||
max-width: 88cqw;
|
||
margin: var(--space-2, 3cqmin) 0 0;
|
||
color: var(--fg, #f8fafc);
|
||
font-size: min(3.4cqw, 5.4cqmin);
|
||
font-weight: 500;
|
||
line-height: 1.3;
|
||
letter-spacing: 0.01em;
|
||
will-change: transform, opacity;
|
||
}
|
||
|
||
.lbc-url {
|
||
margin: var(--space-3, 4.6cqmin) 0 0;
|
||
color: var(--muted, #94a3b8);
|
||
font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
|
||
font-size: min(2.4cqw, 3.2cqmin);
|
||
font-weight: 500;
|
||
line-height: 1;
|
||
letter-spacing: 0.28em;
|
||
will-change: opacity;
|
||
}
|
||
</style>
|
||
|
||
<div
|
||
id="logo-brand-close-clip"
|
||
class="lbc-clip clip"
|
||
data-start="0"
|
||
data-duration="4"
|
||
data-track-index="0"
|
||
>
|
||
<div class="lbc-lockup">
|
||
<h2 class="lbc-wordmark"></h2>
|
||
<p class="lbc-tagline"></p>
|
||
<p class="lbc-url"></p>
|
||
</div>
|
||
</div>
|
||
|
||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||
<script>
|
||
(function () {
|
||
"use strict";
|
||
|
||
var root = document.getElementById("root");
|
||
var lockup = root.querySelector(".lbc-lockup");
|
||
var wordmarkElement = root.querySelector(".lbc-wordmark");
|
||
var taglineElement = root.querySelector(".lbc-tagline");
|
||
var urlElement = root.querySelector(".lbc-url");
|
||
var vars =
|
||
window.__hyperframes && window.__hyperframes.getVariables
|
||
? window.__hyperframes.getVariables()
|
||
: {};
|
||
|
||
var wordmark =
|
||
vars.wordmark == null
|
||
? "HYPERFRAMES"
|
||
: String(vars.wordmark).trim().replace(/\s+/g, " ");
|
||
if (wordmark.length === 0) wordmark = "HYPERFRAMES";
|
||
var tagline =
|
||
vars.tagline == null
|
||
? "Write HTML. Render video."
|
||
: String(vars.tagline).trim().replace(/\s+/g, " ");
|
||
var url = vars.url == null ? "hyperframes.heygen.com" : String(vars.url).trim();
|
||
var accentColors = {
|
||
green: "var(--brand, #71f5a7)",
|
||
blue: "var(--accent, #61a8ff)",
|
||
violet: "var(--accent-2, #c5a3ff)",
|
||
};
|
||
var accent = Object.prototype.hasOwnProperty.call(accentColors, vars.accent)
|
||
? vars.accent
|
||
: "green";
|
||
var exit = vars.exit === "fade" || vars.exit === "up" ? vars.exit : "none";
|
||
|
||
root.style.setProperty("--lbc-accent", accentColors[accent]);
|
||
wordmarkElement.setAttribute("aria-label", wordmark);
|
||
wordmarkElement.setAttribute("role", "img");
|
||
|
||
// The brand period: an accent dot ends the wordmark. If the
|
||
// wordmark already ends with "." that period takes the accent
|
||
// instead of appending a second one.
|
||
var characters = Array.from(wordmark);
|
||
if (characters[characters.length - 1] !== ".") characters.push(".");
|
||
|
||
var letters = characters.map(function (character, index) {
|
||
var letter = document.createElement("span");
|
||
letter.id = "logo-brand-close-letter-" + index;
|
||
letter.className = "lbc-letter";
|
||
if (/\s/.test(character)) {
|
||
letter.classList.add("lbc-space");
|
||
letter.textContent = " ";
|
||
} else {
|
||
letter.textContent = character;
|
||
}
|
||
if (index === characters.length - 1) letter.classList.add("lbc-period");
|
||
letter.setAttribute("aria-hidden", "true");
|
||
wordmarkElement.appendChild(letter);
|
||
return letter;
|
||
});
|
||
var periodLetter = letters[letters.length - 1];
|
||
var cascadeLetters = letters.slice(0, -1);
|
||
|
||
// Deterministic chars-aware fit: probe the set width at a fixed
|
||
// 100px font (letter-spacing rides in em, so the em ratio is a
|
||
// pure font metric), then size the wordmark so it lands at
|
||
// ~76cqw. The 40cqh term caps it in short, wide mounts. If the
|
||
// probe cannot measure (detached render), fall back to a
|
||
// per-glyph advance estimate.
|
||
wordmarkElement.style.fontSize = "100px";
|
||
var probedWidth = wordmarkElement.getBoundingClientRect().width;
|
||
wordmarkElement.style.fontSize = "";
|
||
var setWidthEm;
|
||
if (probedWidth > 0) {
|
||
setWidthEm = probedWidth / 100;
|
||
} else {
|
||
setWidthEm = characters.reduce(function (total, character) {
|
||
if (/\s/.test(character)) return total + 0.34;
|
||
if (/[.,:;!'’|]/.test(character)) return total + 0.3;
|
||
if (/[Iijlftr]/.test(character)) return total + 0.42;
|
||
if (/[MWmw@]/.test(character)) return total + 0.92;
|
||
return total + 0.64;
|
||
}, 0);
|
||
setWidthEm -= characters.length * 0.035;
|
||
}
|
||
setWidthEm = Math.max(0.3, setWidthEm);
|
||
var wordmarkSize = 76 / setWidthEm;
|
||
root.style.setProperty(
|
||
"--lbc-wordmark-size",
|
||
"min(" + wordmarkSize.toFixed(3) + "cqw, 40cqh)",
|
||
);
|
||
|
||
if (tagline.length === 0) taglineElement.remove();
|
||
else taglineElement.textContent = tagline;
|
||
if (url.length === 0) urlElement.remove();
|
||
else urlElement.textContent = url;
|
||
|
||
var IN_BASE = 2.6;
|
||
var OUT_BASE = exit === "none" ? 0 : 0.5;
|
||
var CASCADE_RISE_BASE = 1.15;
|
||
var CASCADE_STAGGER_BASE = 0.7;
|
||
var SETTLE_BASE = 2.4;
|
||
var PERIOD_AT_BASE = 0.95;
|
||
var PERIOD_DURATION_BASE = 0.9;
|
||
var TAGLINE_AT_BASE = 1.35;
|
||
var TAGLINE_DURATION_BASE = 0.9;
|
||
var URL_AT_BASE = 1.7;
|
||
var URL_DURATION_BASE = 0.85;
|
||
var duration = Math.max(0.001, parseFloat(root.dataset.duration || "4"));
|
||
var totalBase = IN_BASE + OUT_BASE;
|
||
var scale = duration < totalBase ? duration / totalBase : 1;
|
||
var IN = IN_BASE * scale;
|
||
var OUT = OUT_BASE * scale;
|
||
var STAGGER = cascadeLetters.length > 1 ? CASCADE_STAGGER_BASE * scale : 0;
|
||
var HOLD = Math.max(0, duration - (IN + OUT));
|
||
var OUT_START = IN + HOLD;
|
||
|
||
var tl = gsap.timeline({ paused: true });
|
||
|
||
// IN: per-letter fade plus rise with a long expo tail, while the
|
||
// whole wordmark settles down from a slightly larger scale.
|
||
if (cascadeLetters.length > 0) {
|
||
tl.fromTo(
|
||
cascadeLetters,
|
||
{ opacity: 0, y: "0.62em" },
|
||
{
|
||
opacity: 1,
|
||
y: "0em",
|
||
duration: CASCADE_RISE_BASE * scale,
|
||
stagger: { amount: STAGGER, from: "start" },
|
||
ease: "expo.out",
|
||
},
|
||
0,
|
||
);
|
||
}
|
||
|
||
tl.fromTo(
|
||
wordmarkElement,
|
||
{ scale: 1.04, transformOrigin: "50% 100%" },
|
||
{ scale: 1, duration: SETTLE_BASE * scale, ease: "expo.out" },
|
||
0,
|
||
);
|
||
|
||
// The brand period lands last: a decisive accent pop.
|
||
tl.fromTo(
|
||
periodLetter,
|
||
{ opacity: 0, scale: 0.2, y: "0.08em", transformOrigin: "50% 65%" },
|
||
{
|
||
opacity: 1,
|
||
scale: 1,
|
||
y: "0em",
|
||
duration: PERIOD_DURATION_BASE * scale,
|
||
ease: "back.out(1.8)",
|
||
},
|
||
PERIOD_AT_BASE * scale,
|
||
);
|
||
|
||
if (taglineElement.isConnected) {
|
||
tl.fromTo(
|
||
taglineElement,
|
||
{ opacity: 0, y: "0.9em" },
|
||
{
|
||
opacity: 1,
|
||
y: "0em",
|
||
duration: TAGLINE_DURATION_BASE * scale,
|
||
ease: "power3.out",
|
||
},
|
||
TAGLINE_AT_BASE * scale,
|
||
);
|
||
}
|
||
|
||
if (urlElement.isConnected) {
|
||
tl.fromTo(
|
||
urlElement,
|
||
// scaleX, not letterSpacing: tracking is a layout property, so
|
||
// the browser snaps it to integer device pixels and the
|
||
// ease-out tail stutters under seek-by-frame capture. The
|
||
// widening reads the same and stays on the compositor.
|
||
{ opacity: 0, scaleX: 1.06 },
|
||
{
|
||
opacity: 1,
|
||
scaleX: 1,
|
||
duration: URL_DURATION_BASE * scale,
|
||
ease: "power2.out",
|
||
},
|
||
URL_AT_BASE * scale,
|
||
);
|
||
}
|
||
|
||
// HOLD: dead still. No drift, no breath; the confidence is the
|
||
// stillness, and by default the film ends here.
|
||
|
||
if (exit === "fade") {
|
||
tl.to(lockup, { opacity: 0, duration: OUT, ease: "power2.in" }, OUT_START);
|
||
} else if (exit === "up") {
|
||
tl.to(
|
||
lockup,
|
||
{ opacity: 0, y: "-5cqh", duration: OUT, ease: "power2.in" },
|
||
OUT_START,
|
||
);
|
||
}
|
||
|
||
tl.seek(0);
|
||
window.__timelines = window.__timelines || {};
|
||
window.__timelines["logo-brand-close"] = tl;
|
||
})();
|
||
</script>
|
||
</div>
|
||
</template>
|
||
</body>
|
||
</html>
|
||
```
|
||
|
||
</Accordion>
|
||
|
||
{/* hf:generated-footer */}
|
||
|
||
Tagged `motion-primitive` `typography` `brand` `logo` `end-card` `close`.
|
||
|
||
## Related topics
|
||
|
||
- [Browse the complete Catalog](/catalog)
|
||
- [Add assets and Catalog items in Studio](/studio/assets-and-blocks)
|
||
- [Build a richer composition](/go-further)
|