mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-04 16:42:27 +00:00
feat(registry): say what a promoted template's slots mean, not where they sit (#3562)
* feat(registry): say what a promoted template's slots mean, not where they sit
Every declaration described its slot by position — appName was "small credit in the corner
of every banner" — and every editing contract described the supplied brand only by what it
may not touch, chatgpt-exchange going as far as "only the subject discussed inside the
conversation". An agent filling those slots has nothing telling it that the video is an
advertisement for that brand, and remixes shipped with an invented brand instead of the
real one.
Adds `portrays` to the 35 identity-bearing variables across seven templates: what the slot
stands for, as a list, kept orthogonal to `role` (which says which aspect of the
composition a knob affects, not what a value means to a viewer). Rewrites those variables'
descriptions to state meaning, and gives every TEMPLATE.md the affirmative sentence it was
missing. notes-reveal now records honestly that it declares no identity slot at all, which
is why a remix of it cannot carry a brand.
`portrays` is optional metadata: rendering ignores it, the promoted contract still projects
{id, type, role}, and packages that predate it keep working. Variable ids, types, roles,
labels, and defaults are untouched, so installs and renders see the same contract.
* feat(notes-reveal): give the template somewhere to say whose ad it is
This was the one promoted template that declared no identity slot at all, and the
previous commit could only record that honestly. A remix of it could not name the
advertiser, could not carry its domain, and had nowhere to place its mark — so the
ad it produced was unattributable no matter how good the copy was.
The closing card ends at y=1708, leaving 212px of dotted scene. A sign-off strip
lives there: `brandLogo` (portrays subject_logo) above `brandDomain` (portrays
subject_domain), in the card's own plum and Courier Prime. Putting it outside the
card means the hand-lettered headline and the checklist keep the geometry they were
designed with — verified by `hyperframes check`, which reports the same 0 errors and
the same warning counts as origin/main, with one more contrast check (367/367 AA).
No name slot: this template has no text slot that can hold a bare brand name.
`cardTop`'s marker line continues into the fixed words "OF ONE FILE", and a name set
beside a wordmark reads twice — rendering it proved that before this was committed.
The mark plus the domain carry the attribution, which is what the other end-card
templates do.
Rendered to check rather than assumed: the packaged default reads as the HyperFrames
wordmark over hyperframes.heygen.com, and a resolved symbol mark (Notion's cube over
notion.com) sits correctly in the same strip.
* fix(notes-reveal): make the note the ad, and stop the headline leaving the card
Three defects, all visible in the reported gamma remix.
The seven body lines carried their characters as pre-split `<span class="ch">`
elements so the reveal animation could address them by id. That made the note
permanently unwritable: 46% of the 24.9s runtime, and the only place the note
says anything, was fixed copy about making videos with HyperFrames -- shipped
inside an advertisement for a Dutch DIY chain. The spans are now built at
runtime from seven declared variables, keeping the same ids, so the animation
is untouched and the copy is the brand's.
`cardMid` and `cardBottom` ("OF", "ONE FILE") were literals with no variable at
all, so a remix could only ever change the first of the card's three lines.
Every text slot sat at a fixed left edge on one line, guarded only by a
character cap -- the wrong unit. `cardTop` allowed 12 characters; "THE POWER"
(9) fits and "CREATE DECKS" (12) does not, which is why both reported gamma
remixes shipped with the closing headline over the edge of the card. Slots are
now fitted to their box at render time, shrinking type only as far as needed and
never past the designed size. The card headlines also carried
`data-layout-allow-overflow`, switching off the one check that would have caught
it; those waivers are gone. The note's title and body keep theirs, because
`#note-body` is translated across the whole scene and leaves the canvas by
design.
Timing is preserved rather than regenerated: each body line is revealed inside
the frame window the packaged rhythm already used, so `JUMPS` and the hand-tuned
`SCROLLS` curves stay valid and the composition is still 24.867s for any length
of copy. A line whose length matches the packaged copy keeps its rhythm frame
for frame.
Verified: rendered with the packaged defaults, SSIM 1.000000 across all 746
frames against the previous template -- the design is bit-identical. Rendered
with the gamma values that overflowed, and with a stress set of long and
one-word values: both stay inside the card and the note, both still 24.867s.
`hyperframes check` passes, with layout warnings down from 28 to 8 and no new
issue class. Note that `check` takes no variable values, so it guards the
template's defaults and the fit is what guards a remix.
* fix(notes-reveal): make the fit floor and the character caps agree
A cap that admits a string still too wide at the floor font size puts the text
back outside its box -- the exact bug the fit was added for. With the floor at
0.6 and the title cap at 40, a 40-character title still overflowed `#note-body`
by 30px, because "Things nobody told me" is 21 characters and 900px at 88px, so
42.9px per character, and 40 characters need to reach about 0.45 of the design
size to fit.
Floor to 0.45 and the caps in: titles 34, body lines 52, cardTop and cardBottom
16. Every cap is now satisfiable with room to spare, and the common case stays
far from the floor.
Found by probing all eight promoted templates with values about 1.8x the length
of their packaged defaults, which is the length a real remix produces; short
sentinel values only ever prove a slot is wired.
Defaults are unaffected: SSIM 1.000000 across all 746 frames, still 24.867s,
`hyperframes check` still passes.
* fix(exchange): scroll the composer to follow the caret
`prompt` is an editable slot in both templates, but `.comp-text` is a
fixed-width single line with `white-space: pre` inside a composer that clips,
and the packaged prompt already reaches the mic -- it has no headroom at all.
A longer prompt therefore slid under the mic and the send button and lost its
tail, with the caret hidden behind them: the remix read as having typed into
nowhere, cut mid-word.
Both now scroll the typed text left to keep the caret in view, the way a real
single-line input does, on the very per-character times the reveal already uses.
The limit is measured to the opaque round button rather than the mic, because the
packaged prompt's caret already sits 2px past the mic's left edge in
chatgpt-exchange -- measuring to the mic would scroll the packaged composition.
Shrink-to-fit was the other option and it is worse: with no headroom it shrinks
the packaged prompt too, and it still cannot absorb a prompt twice as long
without unreadable type. It was tried, measured, and dropped.
A prompt that fits emits no keyframes and the element is never handed to GSAP at
all -- even a zero translate stamps a transform, which changes how the text
rasterizes.
claude-exchange puts this inside its existing `build()`, which already re-runs on
`document.fonts.ready`, so it measures the final font. chatgpt-exchange builds
once, so its scroll keyframes are kept in a list and rebuilt on the same event.
Verified on the packaged defaults: claude-exchange SSIM 1.000000 across 1284
frames. chatgpt-exchange is not frame-deterministic -- rendering it twice
unchanged gives 0.999959 with 249 frames under 0.9999, and before-vs-after gives
0.999967 with the same 249 -- so the change sits inside its own noise. Durations
unchanged at 14.9s and 21.4s. `hyperframes check` reports byte-identical results
to the unchanged templates.
* fix(notes-reveal): fit the checklist cells instead of counting their characters
The three checklist rows were the only text slots with no width fit, so
their character cap was doing the job a measurement should: it was set to 8
because that was the widest the packaged strings needed, and a gamma.com
remix delivered "DIRECT MEE" and rendered "DIRECT M".
Fit the labels and values like every other text slot -- dividing the
label's scaleX(0.86) back out of its column, since fitWidth measures the
untransformed width -- and return the cap to a backstop at 18.
"DIRECT MEE" needs no shrink at all: it ends at x=694 against a tick at
x=715, so the truncation was never about room. Measured: the packaged
defaults still render at their authored 44px and 50px, and all three values
clear the tick.
* fix(chatgpt-exchange): nest the caret scroll so its rebuild can be undone
`tl.to()` returns the TIMELINE, not the tween it created, so `caretScrollTweens`
held 49 references to the master timeline. The fonts-ready rebuild then called
`.kill()` on the master timeline 49 times and re-added its keyframes on top of
the ones it meant to replace. Measured with an overflowing prompt:
master timeline detached from the global timeline (tl.parent -> null)
scroll tweens on #cge-typed: 49 before the rebuild, 98 after
49 timestamps left with two competing tweens on the same property
GSAP's `Animation.kill()` interrupts and detaches rather than killing children,
so the composition kept rendering under an explicit seek -- which is why the
packaged-defaults SSIM check passed and never saw this. It is still wrong: the
timeline is off the ticker, and the stale keyframes were measured against the
fallback font.
Only an overflowing prompt reaches it, i.e. exactly the remix the scroll exists
for. The packaged prompt emits no steps, so nothing is created and nothing is
killed.
Now one nested child timeline holds the steps: a real object that can be killed
and replaced, and killing it cannot reach `tl`. Children sit at the same absolute
times and the nest is added at 0, so the motion is unchanged.
Verified: overflowing prompt holds at 49 scroll tweens across the rebuild with no
duplicated timestamps and the timeline stays attached. Packaged defaults against
the pre-feature baseline -- SSIM 0.999998 over 894 frames, 13 frames below
0.9999 against a 249-frame noise floor for this template, duration 14.9s
unchanged.
Found by Magi in review of #3562.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(lint): catch a timeline's return value being treated as a tween
Magi asked for a regression that makes the caret-scroll failure unable to return.
A render fixture cannot be that guard, and neither can a unit test. Both were
measured before choosing this:
- The unit-test DOM has no layout. In happy-dom `getBoundingClientRect()` is
{left: 0, width: 0} and offsetWidth/offsetLeft are 0, so the template's own
guard computes limit = -8 and returns before collecting a single keyframe,
whatever the prompt length. `document.fonts` does not exist there either, so
the rebuild never runs. Both preconditions are unreachable -- the test would
pass on the broken code and the fixed code alike. Rames flagged this; verified.
- A render fixture would not fail either. Rendering the long prompt through the
real pipeline on the broken vs fixed template gives SSIM 0.999994 over 894
frames with ZERO frames below 0.999. The renderer drives the composition by
explicit seek, and the duplicated keyframes are added last so they win, which
is exactly why `.kill()` on the master timeline stayed invisible. A golden mp4
would have cost a fixture and a shard and guarded nothing.
What is testable is the root cause, and it is a static property: `tl.to()` returns
the TIMELINE, `gsap.to()` returns a Tween, and the two read identically. So the
guard is a lint rule, which needs no DOM, fires on the source, and covers every
composition in the registry rather than this one template.
The rule keys on the timeline handles `collectTimelineVarNames` already finds,
which is what keeps `gsap.to()` and `Array.from()` out of it. Pushing a timeline
return into an array is flagged outright -- that is the collect-to-discard shape.
A bound return is flagged only once something tween-scoped is aimed at it, so a
pointless-but-harmless capture stays quiet.
Verified against the real files, not just synthetic ones: the pre-fix
chatgpt-exchange raises exactly one error and names the offending line; the fixed
file is clean. Across all 642 HTML files under registry/ and examples/ the rule
finds nothing, and lint output on the eight promoted blocks is identical to
origin/main error-for-error and warning-for-warning, so error severity costs no
existing template. 540 lint tests pass, 6 of them new.
Requested by Magi in review of #3562; unit-test DOM measurement by Rames Jusso.
This commit is contained in:
@@ -2,17 +2,24 @@
|
||||
|
||||
## Surface ownership
|
||||
|
||||
This template depicts a notes application and a hand-lettered checklist. The supplied website may provide the declared note and checklist copy; it does not own the notes application chrome.
|
||||
This template depicts a notes application and a hand-lettered checklist. The supplied website provides the declared note and checklist copy; it does not own the notes application chrome. The remix is an advertisement for that brand, and the sign-off strip under the closing card is where that brand is identified: place its real mark in `brandLogo` and its real domain in `brandDomain`.
|
||||
|
||||
**The seven note body lines are the video.** They are typed out over the first 20 of 24.9 seconds and are the only place the note says anything, so they carry the pitch. The packaged defaults tell HyperFrames' own story — "my videos sucked", "started HyperFrames three weeks ago" — and every one of them must be rewritten for the brand being advertised. Leaving them is shipping HyperFrames' marketing inside somebody else's ad.
|
||||
|
||||
Write them as one person's note, in the first person, arcing from a problem to this brand solving it: three lines of the problem, a turn where the brand enters, then the payoff. Use the brand's own language from the captured page, in the language of that page.
|
||||
|
||||
## Editable slots
|
||||
|
||||
Only defaults declared in `data-composition-variables` are editable:
|
||||
|
||||
- `titleL1`, `titleL2`, and `cardTop`
|
||||
- `noteLine1` through `noteLine7` — the typed note body, the substance of the ad
|
||||
- `titleL1` and `titleL2` — the note's title, two lines
|
||||
- `cardTop`, `cardMid`, `cardBottom` — the three hand-lettered lines of the closing card. `cardTop`'s last word gets the underline and `cardBottom`'s first word gets the ring, so put the word worth emphasising in those positions. `cardMid` is a short connector ("OF", "FOR", "VOOR"): keep it to one or two words.
|
||||
- `check1Label` through `check3Label`
|
||||
- `check1Value` through `check3Value`
|
||||
- `brandLogo` and `brandDomain` — the sign-off strip. `brandLogo` takes a transparent mark; leave it at its packaged default rather than substituting a nav icon or a generated image when no real mark is available, since an unidentified sign-off is better than a wrong one.
|
||||
|
||||
Typed copy is length-locked to within 20% of the original.
|
||||
Length is not locked. Every text slot is fitted to its box at render time, shrinking the type only as far as it must and never past the designed size, so a value the length of the default renders exactly as drawn and a longer one still stays inside the card or the note. The declared character caps are only a backstop for absurd input. Typing speed adapts to the line: each body line is revealed inside the same frame window the packaged copy used, so the note always finishes before the card appears and the composition stays 24.867s whatever you write.
|
||||
|
||||
## Safe editing mechanics
|
||||
|
||||
@@ -20,4 +27,4 @@ Call `set_template_variable_defaults` once with the existing variable ids and th
|
||||
|
||||
## Protected
|
||||
|
||||
Preserve notes chrome, paper treatment, fonts, colors, checklist geometry, scene structure, duration, timing, easing, handwriting motion, and reveal cadence.
|
||||
Preserve notes chrome, paper treatment, fonts, colors, checklist geometry, sign-off strip geometry, scene structure, duration, timing, easing, handwriting motion, and reveal cadence.
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<svg width="263" height="79" viewBox="0 0 263 79" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 16.6738H4.96V23.3838H11.53V16.6738H16.49V35.4538H11.53V27.6738H4.96V35.4538H0V16.6738Z" fill="black"/>
|
||||
<path d="M17.8899 28.0137C17.8899 23.4237 21.2399 20.0237 25.7999 20.0237C30.0099 20.0237 32.9399 23.0837 32.9399 27.5637C32.9399 28.2037 32.8599 28.8237 32.8299 29.3337H22.6099C23.0399 31.1337 24.6199 32.1237 27.1399 32.1237C28.7199 32.1237 30.2199 31.7237 31.2999 31.0237V34.6737C30.1699 35.3937 28.2999 35.8537 26.3599 35.8537C21.2599 35.8537 17.8799 32.6037 17.8799 28.0237L17.8899 28.0137ZM28.5699 26.1937C28.4899 24.5337 27.3899 23.5637 25.7499 23.5637C24.1099 23.5637 22.9599 24.5337 22.6099 26.1937H28.5699Z" fill="black"/>
|
||||
<path d="M37.85 33.8638L32 20.4238H37.29L40.46 28.1538L43.6 20.4238H48.48L40.33 39.5738H35.26L37.86 33.8638H37.85Z" fill="black"/>
|
||||
<path d="M48.1797 26.1138C48.1797 20.4238 52.7097 16.2438 58.9397 16.2438C61.2997 16.2438 63.5297 16.8038 64.8197 17.7238V21.9338C63.5597 20.9138 61.6797 20.2938 59.7497 20.2938C55.7797 20.2938 53.2597 22.6238 53.2597 26.1438C53.2597 29.6638 55.5697 31.8838 58.8897 31.8838C59.6397 31.8838 60.4997 31.7538 61.1997 31.5038V27.8838H57.4697V24.2338H65.5197V33.7038C63.6697 35.0938 61.1997 35.8738 58.5997 35.8738C52.5397 35.8738 48.1897 31.7438 48.1897 26.1138H48.1797Z" fill="black"/>
|
||||
<path d="M66.6604 28.0137C66.6604 23.4237 70.0104 20.0237 74.5704 20.0237C78.7804 20.0237 81.7104 23.0837 81.7104 27.5637C81.7104 28.2037 81.6304 28.8237 81.6004 29.3337H71.3804C71.8104 31.1337 73.3904 32.1237 75.9104 32.1237C77.4904 32.1237 78.9904 31.7237 80.0704 31.0237V34.6737C78.9404 35.3937 77.0704 35.8537 75.1304 35.8537C70.0304 35.8537 66.6504 32.6037 66.6504 28.0237L66.6604 28.0137ZM77.3404 26.1937C77.2604 24.5337 76.1604 23.5637 74.5204 23.5637C72.8804 23.5637 71.7304 24.5337 71.3804 26.1937H77.3404Z" fill="black"/>
|
||||
<path d="M82.9688 20.4238H87.8488V22.4138C88.7588 20.9638 90.3488 20.1038 92.3288 20.1038C95.4988 20.1038 97.3988 22.3338 97.3988 25.8138V35.4438H92.5188V26.8638C92.5188 25.0438 91.8188 24.1838 90.4788 24.1838C88.9488 24.1838 87.8488 25.3638 87.8488 27.2638V35.4438H82.9688V20.4238Z" fill="black"/>
|
||||
<path d="M195.219 26.1937L213.529 38.9937C216.009 40.7237 220.239 38.7637 221.009 35.5337L228.419 4.33374C229.189 1.10374 225.879 -0.856262 222.589 0.873738L198.199 13.6737C192.649 16.5837 191.059 23.2837 195.219 26.1937Z" fill="url(#paint0_linear_2204_3045)"/>
|
||||
<path d="M256.97 25.9638L232.58 38.7638C229.28 40.4938 225.98 38.5338 226.75 35.3038L234.16 4.10376C234.93 0.873757 239.16 -1.08624 241.64 0.643757L259.95 13.4438C264.12 16.3538 262.52 23.0538 256.97 25.9638Z" fill="url(#paint1_linear_2204_3045)"/>
|
||||
<path d="M252.115 72.502C250.192 72.502 248.268 72.0838 246.93 71.3728V65.6853C247.808 66.3126 248.937 66.689 250.066 66.689C251.739 66.689 252.784 65.8526 252.784 64.5562C252.784 63.8452 252.492 63.0925 251.655 62.0888L249.899 59.956C248.728 58.4923 248.226 56.9031 248.226 55.2721C248.226 51.0065 251.864 48.0791 256.883 48.0791C258.723 48.0791 260.438 48.4555 261.65 49.0828V54.7703C260.898 54.2266 259.768 53.8503 258.723 53.8503C257.092 53.8503 256.046 54.6867 256.046 55.8994C256.046 56.6522 256.423 57.405 257.259 58.4086L258.974 60.4996C260.187 62.047 260.73 63.5943 260.73 65.2671C260.73 69.5746 257.05 72.502 252.115 72.502Z" fill="black"/>
|
||||
<path d="M236.338 72.6269C228.392 72.6269 223.123 67.5667 223.123 60.4155C223.123 53.2643 228.351 47.9531 235.46 47.9531C242.026 47.9531 246.584 52.7206 246.584 59.7045C246.584 60.7082 246.459 61.6701 246.417 62.4647H230.483C231.152 65.2666 233.62 66.8139 237.551 66.8139C240.018 66.8139 242.36 66.1866 244.033 65.0993V70.7868C242.277 71.916 239.349 72.6269 236.338 72.6269ZM230.483 57.5717H239.767C239.642 54.9789 237.927 53.4734 235.376 53.4734C232.867 53.4734 231.027 54.9789 230.483 57.5717Z" fill="black"/>
|
||||
<path d="M184.998 72.0001V48.5809H192.609V51.6756C193.989 49.4173 196.373 48.0791 199.426 48.0791C202.521 48.0791 204.779 49.5428 206.075 52.052C207.497 49.5846 210.132 48.0791 213.352 48.0791C218.245 48.0791 221.214 51.592 221.214 57.0286V72.0001H213.603V58.5341C213.603 55.774 212.557 54.4357 210.634 54.4357C208.459 54.4357 206.912 56.234 206.912 59.0778V72.0001H199.3V58.5341C199.3 55.774 198.255 54.4357 196.373 54.4357C194.157 54.4357 192.609 56.234 192.609 59.0778V72.0001H184.998Z" fill="black"/>
|
||||
<path d="M167.26 72.4602C161.154 72.4602 156.596 67.2745 156.596 60.3324C156.596 53.3066 161.196 48.0791 167.302 48.0791C170.438 48.0791 173.031 49.4173 174.536 51.8429V48.5809H182.148V72.0001H174.536V68.4873C173.031 71.0801 170.438 72.4602 167.26 72.4602ZM169.393 66.1872C172.78 66.1872 174.536 63.3434 174.536 60.876V59.6632C174.536 57.2377 172.78 54.4357 169.393 54.4357C166.298 54.4357 164.207 56.7777 164.207 60.2905C164.207 63.7616 166.298 66.1872 169.393 66.1872Z" fill="black"/>
|
||||
<path d="M141.258 72V48.5808H148.827V52.9719C149.831 50.0445 151.796 48.2881 154.306 48.2881C154.975 48.2881 155.602 48.4135 156.02 48.6645V55.8993C155.435 55.5648 154.724 55.4393 153.887 55.4393C150.751 55.4393 148.869 57.6558 148.869 61.2941V72H141.258Z" fill="black"/>
|
||||
<path d="M122.643 71.9996V42.7256H139.371V49.124H130.379V54.477H138.911V60.5827H130.379V71.9996H122.643Z" fill="black"/>
|
||||
<path d="M105.645 72V48.5808H113.214V52.9719C114.218 50.0445 116.183 48.2881 118.692 48.2881C119.361 48.2881 119.989 48.4135 120.407 48.6645V55.8993C119.822 55.5648 119.111 55.4393 118.274 55.4393C115.138 55.4393 113.256 57.6558 113.256 61.2941V72H105.645Z" fill="black"/>
|
||||
<path d="M93.4397 72.6269C85.4939 72.6269 80.2246 67.5667 80.2246 60.4155C80.2246 53.2643 85.4521 47.9531 92.5615 47.9531C99.1273 47.9531 103.686 52.7206 103.686 59.7045C103.686 60.7082 103.56 61.6701 103.518 62.4647H87.5849C88.2541 65.2666 90.7214 66.8139 94.6525 66.8139C97.1199 66.8139 99.4618 66.1866 101.135 65.0993V70.7868C99.3782 71.916 96.4508 72.6269 93.4397 72.6269ZM87.5849 57.5717H96.869C96.7435 54.9789 95.0289 53.4734 92.4779 53.4734C89.9687 53.4734 88.1286 54.9789 87.5849 57.5717Z" fill="black"/>
|
||||
<path d="M53.3711 78.4404V48.5809H60.9823V52.052C62.446 49.501 65.0807 48.0791 68.3008 48.0791C74.3647 48.0791 78.9649 53.3066 78.9649 60.2487C78.9649 67.2745 74.3229 72.4602 68.259 72.4602C65.0807 72.4602 62.446 71.1637 60.9823 68.78V78.4404H53.3711ZM66.1262 66.1872C69.2627 66.1872 71.3119 63.7616 71.3119 60.2905C71.3119 56.8195 69.2627 54.4357 66.1262 54.4357C62.7388 54.4357 60.9823 57.2795 60.9823 59.7051V60.9178C60.9823 63.3434 62.7388 66.1872 66.1262 66.1872Z" fill="black"/>
|
||||
<path d="M31.9606 78.4405L36.0171 69.5329L26.9004 48.5811H35.1389L40.0737 60.6252L44.9666 48.5811H52.5779L39.8646 78.4405H31.9606Z" fill="black"/>
|
||||
<path d="M0 71.9996V42.7256H7.7367V53.1806H17.9826V42.7256H25.7193V71.9996H17.9826V59.8718H7.7367V71.9996H0Z" fill="black"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_2204_3045" x1="225.869" y1="-3.06048e-05" x2="222.845" y2="37.4821" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#06E3FA"/>
|
||||
<stop offset="1" stop-color="#4FDB5E"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_2204_3045" x1="230.87" y1="39" x2="244.661" y2="6.30303" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#06E3FA"/>
|
||||
<stop offset="1" stop-color="#4FDB5E"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.1 KiB |
+334
-125
@@ -4,13 +4,24 @@
|
||||
data-composition-variables='[
|
||||
{ "id": "titleL1", "type": "string", "role": "content", "label": "Note title line 1", "description": "First line of the note title.", "default": "Things nobody told me" },
|
||||
{ "id": "titleL2", "type": "string", "role": "content", "label": "Note title line 2", "description": "Second line of the note title.", "default": "about video." },
|
||||
{ "id": "cardTop", "type": "string", "role": "content", "label": "Card headline top", "description": "First marker line on the closing card.", "default": "THE POWER" },
|
||||
{ "id": "noteLine1", "type": "string", "role": "content", "label": "Note body line 1", "description": "First typed line of the note. The seven body lines are the bulk of the video: they must be about the brand this video promotes, not about video-making.", "default": "my videos sucked" },
|
||||
{ "id": "noteLine2", "type": "string", "role": "content", "label": "Note body line 2", "description": "Second typed line of the note.", "default": "my tools cost $$$" },
|
||||
{ "id": "noteLine3", "type": "string", "role": "content", "label": "Note body line 3", "description": "Third typed line of the note.", "default": "and re-edits never end." },
|
||||
{ "id": "noteLine4", "type": "string", "role": "content", "label": "Note body line 4", "description": "Fourth typed line of the note — the turn, where the brand enters.", "default": "then i tried writing html only" },
|
||||
{ "id": "noteLine5", "type": "string", "role": "content", "label": "Note body line 5", "description": "Fifth typed line of the note — name the brand here.", "default": "started HyperFrames three weeks ago" },
|
||||
{ "id": "noteLine6", "type": "string", "role": "content", "label": "Note body line 6", "description": "Sixth typed line of the note.", "default": "the grind is gone, but more than that —" },
|
||||
{ "id": "noteLine7", "type": "string", "role": "content", "label": "Note body line 7", "description": "Last typed line of the note — the payoff.", "default": "I ship videos weekly." },
|
||||
{ "id": "cardTop", "type": "string", "role": "content", "label": "Card headline top", "description": "First marker line on the closing card. The underline follows its last word.", "default": "THE POWER" },
|
||||
{ "id": "cardMid", "type": "string", "role": "content", "label": "Card headline middle", "description": "Short connector line between the two headline lines, centred on the card.", "default": "OF" },
|
||||
{ "id": "cardBottom", "type": "string", "role": "content", "label": "Card headline bottom", "description": "Last marker line on the closing card. Its first word is ringed.", "default": "ONE FILE" },
|
||||
{ "id": "check1Label", "type": "string", "role": "content", "label": "Checklist 1 label", "description": "Typewriter label of the first checklist row.", "default": "WRITE" },
|
||||
{ "id": "check1Value", "type": "string", "role": "content", "label": "Checklist 1 value", "description": "Marker value of the first checklist row.", "default": "HTML" },
|
||||
{ "id": "check2Label", "type": "string", "role": "content", "label": "Checklist 2 label", "description": "Typewriter label of the second checklist row.", "default": "RENDER" },
|
||||
{ "id": "check2Value", "type": "string", "role": "content", "label": "Checklist 2 value", "description": "Marker value of the second checklist row.", "default": "IN 4K" },
|
||||
{ "id": "check3Label", "type": "string", "role": "content", "label": "Checklist 3 label", "description": "Typewriter label of the third checklist row.", "default": "SHIP" },
|
||||
{ "id": "check3Value", "type": "string", "role": "content", "label": "Checklist 3 value", "description": "Marker value of the third checklist row.", "default": "TODAY" }
|
||||
{ "id": "check3Value", "type": "string", "role": "content", "label": "Checklist 3 value", "description": "Marker value of the third checklist row.", "default": "TODAY" },
|
||||
{ "id": "brandLogo", "type": "image", "role": "content", "label": "Brand logo", "description": "Transparent mark of the brand this video promotes, in the sign-off strip under the card.", "portrays": ["subject_logo"], "default": "assets/hyperframes-logo-black.svg" },
|
||||
{ "id": "brandDomain", "type": "string", "role": "content", "label": "Sign-off domain", "description": "Domain of the brand this video promotes, closing the sign-off strip. Use the real domain, or a call to action when no domain fits.", "portrays": ["subject_domain"], "default": "hyperframes.heygen.com" }
|
||||
]'
|
||||
>
|
||||
<head>
|
||||
@@ -126,6 +137,34 @@
|
||||
background: #602640;
|
||||
opacity: 0.92;
|
||||
}
|
||||
/* Sign-off strip: the card ends at y=1708, leaving 212px of dotted scene. The
|
||||
advertiser's identity lives here rather than inside the card, so the hand-lettered
|
||||
headline and checklist keep the geometry they were designed with. */
|
||||
#brand-strip {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 1742px;
|
||||
width: 1080px;
|
||||
height: 132px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 14px;
|
||||
}
|
||||
#brand-mark {
|
||||
display: block;
|
||||
height: 52px;
|
||||
width: auto;
|
||||
}
|
||||
#brand-domain {
|
||||
font-family: "Courier Prime", monospace;
|
||||
font-weight: 700;
|
||||
font-size: 27px;
|
||||
letter-spacing: 4px;
|
||||
color: #602640;
|
||||
opacity: 0.62;
|
||||
}
|
||||
#nrv-video {
|
||||
position: absolute;
|
||||
left: 380px;
|
||||
@@ -235,7 +274,10 @@
|
||||
font-weight: 400;
|
||||
letter-spacing: 0em;
|
||||
color: #191919;
|
||||
white-space: nowrap;
|
||||
/* `pre`, not `nowrap`: the per-character spans are built at runtime from the line
|
||||
variables, and a leading or trailing space in a supplied line would collapse under
|
||||
`nowrap` — the caret then stalls on a zero-width span. */
|
||||
white-space: pre;
|
||||
}
|
||||
#caret {
|
||||
position: absolute;
|
||||
@@ -330,7 +372,6 @@
|
||||
<div
|
||||
class="mk"
|
||||
id="hl1"
|
||||
data-layout-allow-overflow
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="left: 116px; top: 72px"
|
||||
@@ -341,7 +382,6 @@
|
||||
<div
|
||||
class="mk"
|
||||
id="hl2"
|
||||
data-layout-allow-overflow
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="left: 356px; top: 181px"
|
||||
@@ -351,7 +391,6 @@
|
||||
<div
|
||||
class="mk"
|
||||
id="hl3"
|
||||
data-layout-allow-overflow
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="left: 155px; top: 329px"
|
||||
@@ -372,8 +411,19 @@
|
||||
stroke="#602640"
|
||||
stroke-width="8"
|
||||
/></svg
|
||||
><span style="padding-left: 24px">ONE</span
|
||||
><span style="padding-left: 52px">FILE</span>
|
||||
><span
|
||||
id="hl3-head"
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="padding-left: 24px"
|
||||
>ONE</span
|
||||
><span
|
||||
id="hl3-tail"
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="padding-left: 52px"
|
||||
>FILE</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="cl-label" style="left: 74px; top: 1073px">WRITE</div>
|
||||
@@ -431,6 +481,10 @@
|
||||
</svg>
|
||||
<div class="cl-rule" style="left: 58px; top: 1412px"></div>
|
||||
</div>
|
||||
<div id="brand-strip">
|
||||
<img id="brand-mark" src="assets/hyperframes-logo-black.svg" alt="" />
|
||||
<div id="brand-domain">hyperframes.heygen.com</div>
|
||||
</div>
|
||||
<div id="nrv-video">
|
||||
<div id="nrv-play">
|
||||
<svg width="52" height="58" viewBox="0 0 44 48" fill="none">
|
||||
@@ -612,16 +666,7 @@
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="top: 283px"
|
||||
>
|
||||
<span class="ch" id="ch-0-0">m</span><span class="ch" id="ch-0-1">y</span
|
||||
><span class="ch" id="ch-0-2"> </span><span class="ch" id="ch-0-3">v</span
|
||||
><span class="ch" id="ch-0-4">i</span><span class="ch" id="ch-0-5">d</span
|
||||
><span class="ch" id="ch-0-6">e</span><span class="ch" id="ch-0-7">o</span
|
||||
><span class="ch" id="ch-0-8">s</span><span class="ch" id="ch-0-9"> </span
|
||||
><span class="ch" id="ch-0-10">s</span><span class="ch" id="ch-0-11">u</span
|
||||
><span class="ch" id="ch-0-12">c</span><span class="ch" id="ch-0-13">k</span
|
||||
><span class="ch" id="ch-0-14">e</span><span class="ch" id="ch-0-15">d</span>
|
||||
</div>
|
||||
></div>
|
||||
<div
|
||||
class="bodyline"
|
||||
id="line-1"
|
||||
@@ -629,17 +674,7 @@
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="top: 433px"
|
||||
>
|
||||
<span class="ch" id="ch-1-0">m</span><span class="ch" id="ch-1-1">y</span
|
||||
><span class="ch" id="ch-1-2"> </span><span class="ch" id="ch-1-3">t</span
|
||||
><span class="ch" id="ch-1-4">o</span><span class="ch" id="ch-1-5">o</span
|
||||
><span class="ch" id="ch-1-6">l</span><span class="ch" id="ch-1-7">s</span
|
||||
><span class="ch" id="ch-1-8"> </span><span class="ch" id="ch-1-9">c</span
|
||||
><span class="ch" id="ch-1-10">o</span><span class="ch" id="ch-1-11">s</span
|
||||
><span class="ch" id="ch-1-12">t</span><span class="ch" id="ch-1-13"> </span
|
||||
><span class="ch" id="ch-1-14">$</span><span class="ch" id="ch-1-15">$</span
|
||||
><span class="ch" id="ch-1-16">$</span>
|
||||
</div>
|
||||
></div>
|
||||
<div
|
||||
class="bodyline"
|
||||
id="line-2"
|
||||
@@ -647,20 +682,7 @@
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="top: 583px"
|
||||
>
|
||||
<span class="ch" id="ch-2-0">a</span><span class="ch" id="ch-2-1">n</span
|
||||
><span class="ch" id="ch-2-2">d</span><span class="ch" id="ch-2-3"> </span
|
||||
><span class="ch" id="ch-2-4">r</span><span class="ch" id="ch-2-5">e</span
|
||||
><span class="ch" id="ch-2-6">-</span><span class="ch" id="ch-2-7">e</span
|
||||
><span class="ch" id="ch-2-8">d</span><span class="ch" id="ch-2-9">i</span
|
||||
><span class="ch" id="ch-2-10">t</span><span class="ch" id="ch-2-11">s</span
|
||||
><span class="ch" id="ch-2-12"> </span><span class="ch" id="ch-2-13">n</span
|
||||
><span class="ch" id="ch-2-14">e</span><span class="ch" id="ch-2-15">v</span
|
||||
><span class="ch" id="ch-2-16">e</span><span class="ch" id="ch-2-17">r</span
|
||||
><span class="ch" id="ch-2-18"> </span><span class="ch" id="ch-2-19">e</span
|
||||
><span class="ch" id="ch-2-20">n</span><span class="ch" id="ch-2-21">d</span
|
||||
><span class="ch" id="ch-2-22">.</span>
|
||||
</div>
|
||||
></div>
|
||||
<div
|
||||
class="bodyline"
|
||||
id="line-3"
|
||||
@@ -668,23 +690,7 @@
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="top: 733px"
|
||||
>
|
||||
<span class="ch" id="ch-3-0">t</span><span class="ch" id="ch-3-1">h</span
|
||||
><span class="ch" id="ch-3-2">e</span><span class="ch" id="ch-3-3">n</span
|
||||
><span class="ch" id="ch-3-4"> </span><span class="ch" id="ch-3-5">i</span
|
||||
><span class="ch" id="ch-3-6"> </span><span class="ch" id="ch-3-7">t</span
|
||||
><span class="ch" id="ch-3-8">r</span><span class="ch" id="ch-3-9">i</span
|
||||
><span class="ch" id="ch-3-10">e</span><span class="ch" id="ch-3-11">d</span
|
||||
><span class="ch" id="ch-3-12"> </span><span class="ch" id="ch-3-13">w</span
|
||||
><span class="ch" id="ch-3-14">r</span><span class="ch" id="ch-3-15">i</span
|
||||
><span class="ch" id="ch-3-16">t</span><span class="ch" id="ch-3-17">i</span
|
||||
><span class="ch" id="ch-3-18">n</span><span class="ch" id="ch-3-19">g</span
|
||||
><span class="ch" id="ch-3-20"> </span><span class="ch" id="ch-3-21">h</span
|
||||
><span class="ch" id="ch-3-22">t</span><span class="ch" id="ch-3-23">m</span
|
||||
><span class="ch" id="ch-3-24">l</span><span class="ch" id="ch-3-25"> </span
|
||||
><span class="ch" id="ch-3-26">o</span><span class="ch" id="ch-3-27">n</span
|
||||
><span class="ch" id="ch-3-28">l</span><span class="ch" id="ch-3-29">y</span>
|
||||
</div>
|
||||
></div>
|
||||
<div
|
||||
class="bodyline"
|
||||
id="line-4"
|
||||
@@ -692,26 +698,7 @@
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="top: 883px"
|
||||
>
|
||||
<span class="ch" id="ch-4-0">s</span><span class="ch" id="ch-4-1">t</span
|
||||
><span class="ch" id="ch-4-2">a</span><span class="ch" id="ch-4-3">r</span
|
||||
><span class="ch" id="ch-4-4">t</span><span class="ch" id="ch-4-5">e</span
|
||||
><span class="ch" id="ch-4-6">d</span><span class="ch" id="ch-4-7"> </span
|
||||
><span class="ch" id="ch-4-8">H</span><span class="ch" id="ch-4-9">y</span
|
||||
><span class="ch" id="ch-4-10">p</span><span class="ch" id="ch-4-11">e</span
|
||||
><span class="ch" id="ch-4-12">r</span><span class="ch" id="ch-4-13">F</span
|
||||
><span class="ch" id="ch-4-14">r</span><span class="ch" id="ch-4-15">a</span
|
||||
><span class="ch" id="ch-4-16">m</span><span class="ch" id="ch-4-17">e</span
|
||||
><span class="ch" id="ch-4-18">s</span><span class="ch" id="ch-4-19"> </span
|
||||
><span class="ch" id="ch-4-20">t</span><span class="ch" id="ch-4-21">h</span
|
||||
><span class="ch" id="ch-4-22">r</span><span class="ch" id="ch-4-23">e</span
|
||||
><span class="ch" id="ch-4-24">e</span><span class="ch" id="ch-4-25"> </span
|
||||
><span class="ch" id="ch-4-26">w</span><span class="ch" id="ch-4-27">e</span
|
||||
><span class="ch" id="ch-4-28">e</span><span class="ch" id="ch-4-29">k</span
|
||||
><span class="ch" id="ch-4-30">s</span><span class="ch" id="ch-4-31"> </span
|
||||
><span class="ch" id="ch-4-32">a</span><span class="ch" id="ch-4-33">g</span
|
||||
><span class="ch" id="ch-4-34">o</span>
|
||||
</div>
|
||||
></div>
|
||||
<div
|
||||
class="bodyline"
|
||||
id="line-5"
|
||||
@@ -719,28 +706,7 @@
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="top: 1033px"
|
||||
>
|
||||
<span class="ch" id="ch-5-0">t</span><span class="ch" id="ch-5-1">h</span
|
||||
><span class="ch" id="ch-5-2">e</span><span class="ch" id="ch-5-3"> </span
|
||||
><span class="ch" id="ch-5-4">g</span><span class="ch" id="ch-5-5">r</span
|
||||
><span class="ch" id="ch-5-6">i</span><span class="ch" id="ch-5-7">n</span
|
||||
><span class="ch" id="ch-5-8">d</span><span class="ch" id="ch-5-9"> </span
|
||||
><span class="ch" id="ch-5-10">i</span><span class="ch" id="ch-5-11">s</span
|
||||
><span class="ch" id="ch-5-12"> </span><span class="ch" id="ch-5-13">g</span
|
||||
><span class="ch" id="ch-5-14">o</span><span class="ch" id="ch-5-15">n</span
|
||||
><span class="ch" id="ch-5-16">e</span><span class="ch" id="ch-5-17">,</span
|
||||
><span class="ch" id="ch-5-18"> </span><span class="ch" id="ch-5-19">b</span
|
||||
><span class="ch" id="ch-5-20">u</span><span class="ch" id="ch-5-21">t</span
|
||||
><span class="ch" id="ch-5-22"> </span><span class="ch" id="ch-5-23">m</span
|
||||
><span class="ch" id="ch-5-24">o</span><span class="ch" id="ch-5-25">r</span
|
||||
><span class="ch" id="ch-5-26">e</span><span class="ch" id="ch-5-27"> </span
|
||||
><span class="ch" id="ch-5-28">t</span><span class="ch" id="ch-5-29">h</span
|
||||
><span class="ch" id="ch-5-30">a</span><span class="ch" id="ch-5-31">n</span
|
||||
><span class="ch" id="ch-5-32"> </span><span class="ch" id="ch-5-33">t</span
|
||||
><span class="ch" id="ch-5-34">h</span><span class="ch" id="ch-5-35">a</span
|
||||
><span class="ch" id="ch-5-36">t</span><span class="ch" id="ch-5-37"> </span
|
||||
><span class="ch" id="ch-5-38">—</span>
|
||||
</div>
|
||||
></div>
|
||||
<div
|
||||
class="bodyline"
|
||||
id="line-6"
|
||||
@@ -748,19 +714,7 @@
|
||||
data-layout-allow-overlap
|
||||
data-layout-allow-occlusion
|
||||
style="top: 1183px"
|
||||
>
|
||||
<span class="ch" id="ch-6-0">I</span><span class="ch" id="ch-6-1"> </span
|
||||
><span class="ch" id="ch-6-2">s</span><span class="ch" id="ch-6-3">h</span
|
||||
><span class="ch" id="ch-6-4">i</span><span class="ch" id="ch-6-5">p</span
|
||||
><span class="ch" id="ch-6-6"> </span><span class="ch" id="ch-6-7">v</span
|
||||
><span class="ch" id="ch-6-8">i</span><span class="ch" id="ch-6-9">d</span
|
||||
><span class="ch" id="ch-6-10">e</span><span class="ch" id="ch-6-11">o</span
|
||||
><span class="ch" id="ch-6-12">s</span><span class="ch" id="ch-6-13"> </span
|
||||
><span class="ch" id="ch-6-14">w</span><span class="ch" id="ch-6-15">e</span
|
||||
><span class="ch" id="ch-6-16">e</span><span class="ch" id="ch-6-17">k</span
|
||||
><span class="ch" id="ch-6-18">l</span><span class="ch" id="ch-6-19">y</span
|
||||
><span class="ch" id="ch-6-20">.</span>
|
||||
</div>
|
||||
></div>
|
||||
<div id="caret"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1039,12 +993,19 @@
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<script>
|
||||
// The text every slot resolved to, kept for the timeline: the typewriter has to know how
|
||||
// many characters each body line ended up with.
|
||||
const NOTE_LINES = [];
|
||||
|
||||
// variables: every override falls back to its declared default
|
||||
(function () {
|
||||
var vars =
|
||||
window.__hyperframes && typeof window.__hyperframes.getVariables === "function"
|
||||
? window.__hyperframes.getVariables()
|
||||
: {};
|
||||
// `mx` is a backstop, not the layout rule. Every text slot below is width-fitted at
|
||||
// build time, so the cap only has to be low enough that the fit floor can still hold
|
||||
// the string inside its box -- it is not what keeps the design intact.
|
||||
function t(v, fb, mx) {
|
||||
if (typeof v !== "string") return fb;
|
||||
var s = v.trim();
|
||||
@@ -1054,18 +1015,72 @@
|
||||
document.getElementById("title-l1").textContent = t(
|
||||
vars.titleL1,
|
||||
"Things nobody told me",
|
||||
26,
|
||||
34,
|
||||
);
|
||||
document.getElementById("title-l2").textContent = t(vars.titleL2, "about video.", 26);
|
||||
document.getElementById("hl1").textContent = t(vars.cardTop, "THE POWER", 12);
|
||||
document.getElementById("title-l2").textContent = t(vars.titleL2, "about video.", 34);
|
||||
|
||||
// Body: build the per-character spans the reveal animation addresses by id, instead of
|
||||
// shipping them pre-split. Pre-split spans made the note's seven lines -- 46% of the
|
||||
// running time, and the only place the note says anything -- permanently unwritable,
|
||||
// so every remix of this template kept HyperFrames' own copy about making videos.
|
||||
var BODY_DEFAULTS = [
|
||||
"my videos sucked",
|
||||
"my tools cost $$$",
|
||||
"and re-edits never end.",
|
||||
"then i tried writing html only",
|
||||
"started HyperFrames three weeks ago",
|
||||
"the grind is gone, but more than that —",
|
||||
"I ship videos weekly.",
|
||||
];
|
||||
BODY_DEFAULTS.forEach(function (fallback, li) {
|
||||
var text = t(vars["noteLine" + (li + 1)], fallback, 52);
|
||||
NOTE_LINES.push(text);
|
||||
var host = document.getElementById("line-" + li);
|
||||
host.textContent = "";
|
||||
for (var ri = 0; ri < text.length; ri++) {
|
||||
var ch = document.createElement("span");
|
||||
ch.className = "ch";
|
||||
ch.id = "ch-" + li + "-" + ri;
|
||||
ch.textContent = text.charAt(ri);
|
||||
host.appendChild(ch);
|
||||
}
|
||||
});
|
||||
|
||||
// Card headline. `cardMid` and `cardBottom` were literals until now, which is why a
|
||||
// remix could only ever change the first of the three lines.
|
||||
document.getElementById("hl1").textContent = t(vars.cardTop, "THE POWER", 16);
|
||||
document.getElementById("hl2").textContent = t(vars.cardMid, "OF", 6);
|
||||
// The ring is a sibling of the text, so the words go in their own spans: the first one
|
||||
// is what the ring is drawn around.
|
||||
var bottom = t(vars.cardBottom, "ONE FILE", 16);
|
||||
var cut = bottom.indexOf(" ");
|
||||
var head = cut === -1 ? bottom : bottom.slice(0, cut);
|
||||
var tail = cut === -1 ? "" : bottom.slice(cut + 1);
|
||||
var hl3Head = document.getElementById("hl3-head");
|
||||
var hl3Tail = document.getElementById("hl3-tail");
|
||||
hl3Head.textContent = head;
|
||||
hl3Tail.textContent = tail;
|
||||
hl3Tail.style.display = tail ? "" : "none";
|
||||
|
||||
var labels = document.querySelectorAll(".cl-label");
|
||||
var values = document.querySelectorAll(".cl-value");
|
||||
labels[0].textContent = t(vars.check1Label, "WRITE", 8);
|
||||
values[0].textContent = t(vars.check1Value, "HTML", 8);
|
||||
labels[1].textContent = t(vars.check2Label, "RENDER", 8);
|
||||
values[1].textContent = t(vars.check2Value, "IN 4K", 8);
|
||||
labels[2].textContent = t(vars.check3Label, "SHIP", 8);
|
||||
values[2].textContent = t(vars.check3Value, "TODAY", 8);
|
||||
labels[0].textContent = t(vars.check1Label, "WRITE", 18);
|
||||
values[0].textContent = t(vars.check1Value, "HTML", 18);
|
||||
labels[1].textContent = t(vars.check2Label, "RENDER", 18);
|
||||
values[1].textContent = t(vars.check2Value, "IN 4K", 18);
|
||||
labels[2].textContent = t(vars.check3Label, "SHIP", 18);
|
||||
values[2].textContent = t(vars.check3Value, "TODAY", 18);
|
||||
document.getElementById("brand-domain").textContent = t(
|
||||
vars.brandDomain,
|
||||
"hyperframes.heygen.com",
|
||||
30,
|
||||
);
|
||||
// An image slot arrives as a URL. Leave the packaged mark in place when it is absent,
|
||||
// so a remix that could not resolve a logo signs off with no claim rather than a
|
||||
// broken image.
|
||||
if (typeof vars.brandLogo === "string" && vars.brandLogo.trim()) {
|
||||
document.getElementById("brand-mark").setAttribute("src", vars.brandLogo.trim());
|
||||
}
|
||||
})();
|
||||
const FPS = 30;
|
||||
const EV = [
|
||||
@@ -1384,6 +1399,196 @@
|
||||
const TEXT_X = 62,
|
||||
VIEW_TOP = 272;
|
||||
|
||||
// ---------- width fitting ----------
|
||||
// Every text slot sits at a fixed left edge with `white-space` holding it on one line, so
|
||||
// a value one word longer than the packaged default simply runs off its box. The only
|
||||
// protection used to be a character cap, which is the wrong unit: `cardTop` allowed 12
|
||||
// characters, "THE POWER" (9) fits, and "CREATE DECKS" (12) does not -- so both reported
|
||||
// gamma remixes shipped with the closing headline over the edge of the card.
|
||||
// Fitting shrinks the type until it fits and never grows it past the designed size, so a
|
||||
// value the length of the default renders exactly as drawn.
|
||||
//
|
||||
// The card headlines also carried `data-layout-allow-overflow`, which switched off the one
|
||||
// check that would have caught this; those waivers are gone. `#hl1`/`#hl2`/`#hl3` are
|
||||
// fixed on a card that never moves, so any overflow there is a defect. The note's title
|
||||
// and body lines keep theirs: `#note-body` is translated upward across the whole scene, so
|
||||
// they leave the canvas vertically by design. Note that `hyperframes check` only ever sees
|
||||
// the declared defaults -- it takes no variable values -- so the checker guards the
|
||||
// template and the fit is what guards a remix.
|
||||
// The floor and the character caps have to agree: a cap that admits a string still too wide
|
||||
// at the floor size puts the text back outside its box, which is the bug this whole pass is
|
||||
// about. Measured against the packaged copy -- "Things nobody told me" is 21 characters and
|
||||
// 900px at 88px, so 42.9px per character -- 0.45 leaves every declared cap satisfiable with
|
||||
// room to spare, and only absurd input ever gets near it.
|
||||
const FIT_FLOOR = 0.45;
|
||||
|
||||
// Measure with `offset*`, never `getBoundingClientRect()`. The card is rotated -3.03deg, so
|
||||
// a rect is the axis-aligned box of the rotated element and overstates the width by about
|
||||
// 7px -- enough to push the packaged "THE POWER" past its own limit and shrink a headline
|
||||
// that was already correct. `offsetWidth`/`offsetLeft` are layout values: no transform, no
|
||||
// render scale, and `offsetLeft` on a child is relative to the positioned ancestor, which
|
||||
// is exactly the coordinate space the baked-in decoration positions were authored in.
|
||||
function fitWidth(el, maxWidth, basePx) {
|
||||
el.style.fontSize = basePx + "px";
|
||||
const floor = Math.max(8, basePx * FIT_FLOOR);
|
||||
let px = basePx;
|
||||
// Integer steps: the renderer screenshots frames, so the result has to be identical on
|
||||
// every pass rather than converge to a fractional size.
|
||||
while (px > floor && el.offsetWidth > maxWidth) {
|
||||
px -= 1;
|
||||
el.style.fontSize = px + "px";
|
||||
}
|
||||
return px;
|
||||
}
|
||||
|
||||
// Room each slot has before it leaves its box. The card is 840 wide and each headline keeps
|
||||
// its own left inset; the note is 1080 wide behind an overflow-hidden viewport.
|
||||
const HL1_MAX = 840 - 116 - 24,
|
||||
HL2_MAX = 840 - 48,
|
||||
HL3_MAX = 840 - 155 - 24,
|
||||
NOTE_MAX = 1080 - TEXT_X - 40;
|
||||
// Checklist columns, read off the authored markup: the label sits at x=72-74 under a
|
||||
// scaleX(0.86), the marker value at x=389-390, and the tick at x=715.
|
||||
const CL_LABEL_X = 74,
|
||||
CL_VALUE_X = 389,
|
||||
CL_CHECK_X = 715,
|
||||
CL_GAP = 16,
|
||||
CL_LABEL_SCALE = 0.86;
|
||||
|
||||
function markSpan(id, text) {
|
||||
const el = document.createElement("span");
|
||||
el.id = id;
|
||||
el.textContent = text;
|
||||
el.setAttribute("data-layout-allow-overlap", "");
|
||||
el.setAttribute("data-layout-allow-occlusion", "");
|
||||
return el;
|
||||
}
|
||||
|
||||
function fitAll() {
|
||||
fitWidth(document.getElementById("title-l1"), NOTE_MAX, 88);
|
||||
fitWidth(document.getElementById("title-l2"), NOTE_MAX, 88);
|
||||
for (let li = 0; li < 7; li++) {
|
||||
fitWidth(document.getElementById("line-" + li), NOTE_MAX, 52.5);
|
||||
}
|
||||
|
||||
// The checklist cells had no fit, so their character cap was the only thing keeping a
|
||||
// value inside its column -- and a cap counts characters where the column measures
|
||||
// pixels. A gamma.com remix delivered "DIRECT MEE" and the cap of 8 rendered "DIRECT M".
|
||||
// Fit them like every other text slot so the cap can go back to being a backstop.
|
||||
// A label is scaleX(0.86), so its column has to be divided back out of the visual gap
|
||||
// before comparing against the untransformed offsetWidth fitWidth measures.
|
||||
const CL_LABEL_MAX = (CL_VALUE_X - CL_LABEL_X - CL_GAP) / CL_LABEL_SCALE;
|
||||
const CL_VALUE_MAX = CL_CHECK_X - CL_VALUE_X - CL_GAP;
|
||||
document.querySelectorAll(".cl-label").forEach((el) => fitWidth(el, CL_LABEL_MAX, 44));
|
||||
document.querySelectorAll(".cl-value").forEach((el) => fitWidth(el, CL_VALUE_MAX, 50));
|
||||
|
||||
// hl1: split into leading words and the last word, because the underline is drawn under
|
||||
// the last word. Rebuilt from the stored text each pass, so this is idempotent.
|
||||
const hl1 = document.getElementById("hl1");
|
||||
const hl1Text = hl1.dataset.text || hl1.textContent.trim();
|
||||
hl1.dataset.text = hl1Text;
|
||||
const lastSpace = hl1Text.lastIndexOf(" ");
|
||||
hl1.textContent = "";
|
||||
// The card and the note both exist during the 21.375-21.66s crossfade, so the headline
|
||||
// legitimately overlaps the note text there. hl1 carries the waiver for that; its child
|
||||
// spans have to carry it too, or the checker reports the crossfade as a defect.
|
||||
const hl1Head = markSpan(
|
||||
"hl1-head",
|
||||
lastSpace === -1 ? "" : hl1Text.slice(0, lastSpace + 1),
|
||||
);
|
||||
const hl1Tail = markSpan(
|
||||
"hl1-tail",
|
||||
lastSpace === -1 ? hl1Text : hl1Text.slice(lastSpace + 1),
|
||||
);
|
||||
hl1.appendChild(hl1Head);
|
||||
hl1.appendChild(hl1Tail);
|
||||
fitWidth(hl1, HL1_MAX, 110);
|
||||
|
||||
// Underline: follow the last word instead of sitting at a baked-in x. Every constant
|
||||
// below is read off the packaged geometry -- underline left 333, width 415, top 196,
|
||||
// under a 110px "THE POWER" whose box is left 116, top 72, height 160 and whose last
|
||||
// word measures left 261, width 411 inside it. Written this way the packaged copy lands
|
||||
// on exactly its authored pixels, and any other copy keeps the same relationship.
|
||||
// The stroke leads into the word rather than starting at it, which is why LEAD is large
|
||||
// and TAIL is not.
|
||||
const UL_LEAD = 44 / 110; // per em, before the word starts
|
||||
const UL_TAIL = 4 / 110; // per em, past where the word ends
|
||||
const UL_DROP = 124 / 160; // down the line box
|
||||
const ul = document.getElementById("hl-ul");
|
||||
const hl1Px = parseFloat(hl1.style.fontSize);
|
||||
ul.style.left = hl1.offsetLeft + hl1Tail.offsetLeft - UL_LEAD * hl1Px + "px";
|
||||
ul.style.width = Math.max(24, hl1Tail.offsetWidth + UL_TAIL * hl1Px) + "px";
|
||||
ul.style.top = hl1.offsetTop + UL_DROP * hl1.offsetHeight + "px";
|
||||
|
||||
// hl2 is a connector word, so centre it rather than trusting a baked-in left. The card
|
||||
// is rotated -3.03deg, which puts the optical centre a couple of pixels right of the
|
||||
// geometric one -- the packaged "OF" sits at 356 where geometry alone would say 354.
|
||||
const hl2 = document.getElementById("hl2");
|
||||
fitWidth(hl2, HL2_MAX, 100);
|
||||
hl2.style.left = Math.round((840 - hl2.offsetWidth) / 2) + 2 + "px";
|
||||
|
||||
// hl3: fit, then ring its first word. The ring is an SVG element and has no offset*
|
||||
// metrics, so it is placed from the head span's -- minus that span's padding, which is
|
||||
// leading space rather than glyph. Constants again reproduce the packaged ring: 220x150
|
||||
// at left -20, top -8, around a 110px "ONE" whose glyphs measure 226 wide, 157 tall.
|
||||
const hl3 = document.getElementById("hl3");
|
||||
fitWidth(hl3, HL3_MAX, 110);
|
||||
const head = document.getElementById("hl3-head");
|
||||
const headPad = parseFloat(getComputedStyle(head).paddingLeft) || 0;
|
||||
const glyphW = head.offsetWidth - headPad;
|
||||
const hl3Px = parseFloat(hl3.style.fontSize);
|
||||
const ringW = Math.max(40, glyphW - (6 / 110) * hl3Px);
|
||||
const ringH = Math.max(40, head.offsetHeight * (150 / 157));
|
||||
const ring = document.getElementById("hl-circle");
|
||||
ring.setAttribute("width", ringW);
|
||||
ring.setAttribute("height", ringH);
|
||||
ring.setAttribute("viewBox", "0 0 " + ringW + " " + ringH);
|
||||
ring.style.left = head.offsetLeft + headPad - (44 / 110) * hl3Px + "px";
|
||||
ring.style.top = head.offsetTop - (9 / 110) * hl3Px + "px";
|
||||
const ellipse = ring.querySelector("ellipse");
|
||||
ellipse.setAttribute("cx", ringW / 2 - (5 / 110) * hl3Px);
|
||||
ellipse.setAttribute("cy", ringH / 2 - (3 / 110) * hl3Px);
|
||||
ellipse.setAttribute("rx", ringW / 2 - (8 / 110) * hl3Px);
|
||||
ellipse.setAttribute("ry", ringH / 2 - (14 / 110) * hl3Px);
|
||||
}
|
||||
|
||||
// ---------- typewriter timing ----------
|
||||
// EV is the packaged per-character rhythm. Its per-line first/last frames are the window
|
||||
// JUMPS and SCROLLS were hand-tuned against, so the actual characters are distributed
|
||||
// across each line's own window rather than the table being regenerated: a line of any
|
||||
// length finishes before the caret jumps, and the composition's 24.867s and every scroll
|
||||
// curve stay exactly as designed.
|
||||
// EV is ordered line-major, so a per-line slice keeps its frames in typing order.
|
||||
const LINE_FRAMES = (() => {
|
||||
const byLine = [];
|
||||
EV.forEach(([li, , f]) => (byLine[li] = byLine[li] || []).push(f));
|
||||
return byLine;
|
||||
})();
|
||||
|
||||
function typingEvents(lines) {
|
||||
const out = [];
|
||||
lines.forEach((text, li) => {
|
||||
const packaged = LINE_FRAMES[li];
|
||||
if (!packaged || !packaged.length || !text.length) return;
|
||||
if (text.length === packaged.length) {
|
||||
// A line the same length as the packaged copy keeps its hand-tuned rhythm frame for
|
||||
// frame, so the template with its own defaults still renders bit-identically.
|
||||
for (let ri = 0; ri < text.length; ri++) out.push([li, ri, packaged[ri]]);
|
||||
return;
|
||||
}
|
||||
const f0 = packaged[0];
|
||||
const f1 = packaged[packaged.length - 1];
|
||||
const span = Math.max(1, f1 - f0);
|
||||
for (let ri = 0; ri < text.length; ri++) {
|
||||
const f = text.length === 1 ? f0 : f0 + Math.round((span * ri) / (text.length - 1));
|
||||
out.push([li, ri, f]);
|
||||
}
|
||||
});
|
||||
return out;
|
||||
}
|
||||
|
||||
const EVENTS = typingEvents(NOTE_LINES);
|
||||
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
const body = document.getElementById("note-body");
|
||||
const caret = document.getElementById("caret");
|
||||
@@ -1397,6 +1602,9 @@
|
||||
// gate-scale corrected (bodyRect.width / 1080) per renderer-traps.
|
||||
function build() {
|
||||
tl.clear();
|
||||
// Fit first: the caret rides each character's measured right edge, so the type has to be
|
||||
// at its final size before anything is measured.
|
||||
fitAll();
|
||||
const bodyRect = body.getBoundingClientRect();
|
||||
const scale = bodyRect.width / 1080;
|
||||
|
||||
@@ -1405,8 +1613,9 @@
|
||||
document.querySelectorAll(".ch").forEach((el) => tl.set(el, { autoAlpha: 0 }, 0));
|
||||
|
||||
// typing reveals + caret rides the revealed span's right edge
|
||||
EV.forEach(([li, ri, f]) => {
|
||||
EVENTS.forEach(([li, ri, f]) => {
|
||||
const el = document.getElementById(`ch-${li}-${ri}`);
|
||||
if (!el) return;
|
||||
const r = el.getBoundingClientRect();
|
||||
const cx = (r.right - bodyRect.left) / scale + CARET_GAP;
|
||||
const cy = LINE_TOPS[li] - 8;
|
||||
|
||||
@@ -28,14 +28,86 @@
|
||||
"description": "Second line of the note title.",
|
||||
"default": "about video."
|
||||
},
|
||||
{
|
||||
"id": "noteLine1",
|
||||
"type": "string",
|
||||
"role": "content",
|
||||
"label": "Note body line 1",
|
||||
"description": "First typed line of the note. The seven body lines are the bulk of the video: they must be about the brand this video promotes, not about video-making.",
|
||||
"default": "my videos sucked"
|
||||
},
|
||||
{
|
||||
"id": "noteLine2",
|
||||
"type": "string",
|
||||
"role": "content",
|
||||
"label": "Note body line 2",
|
||||
"description": "Second typed line of the note.",
|
||||
"default": "my tools cost $$$"
|
||||
},
|
||||
{
|
||||
"id": "noteLine3",
|
||||
"type": "string",
|
||||
"role": "content",
|
||||
"label": "Note body line 3",
|
||||
"description": "Third typed line of the note.",
|
||||
"default": "and re-edits never end."
|
||||
},
|
||||
{
|
||||
"id": "noteLine4",
|
||||
"type": "string",
|
||||
"role": "content",
|
||||
"label": "Note body line 4",
|
||||
"description": "Fourth typed line of the note — the turn, where the brand enters.",
|
||||
"default": "then i tried writing html only"
|
||||
},
|
||||
{
|
||||
"id": "noteLine5",
|
||||
"type": "string",
|
||||
"role": "content",
|
||||
"label": "Note body line 5",
|
||||
"description": "Fifth typed line of the note — name the brand here.",
|
||||
"default": "started HyperFrames three weeks ago"
|
||||
},
|
||||
{
|
||||
"id": "noteLine6",
|
||||
"type": "string",
|
||||
"role": "content",
|
||||
"label": "Note body line 6",
|
||||
"description": "Sixth typed line of the note.",
|
||||
"default": "the grind is gone, but more than that —"
|
||||
},
|
||||
{
|
||||
"id": "noteLine7",
|
||||
"type": "string",
|
||||
"role": "content",
|
||||
"label": "Note body line 7",
|
||||
"description": "Last typed line of the note — the payoff.",
|
||||
"default": "I ship videos weekly."
|
||||
},
|
||||
{
|
||||
"id": "cardTop",
|
||||
"type": "string",
|
||||
"role": "content",
|
||||
"label": "Card headline top",
|
||||
"description": "First marker line on the closing card.",
|
||||
"description": "First marker line on the closing card. The underline follows its last word.",
|
||||
"default": "THE POWER"
|
||||
},
|
||||
{
|
||||
"id": "cardMid",
|
||||
"type": "string",
|
||||
"role": "content",
|
||||
"label": "Card headline middle",
|
||||
"description": "Short connector line between the two headline lines, centred on the card.",
|
||||
"default": "OF"
|
||||
},
|
||||
{
|
||||
"id": "cardBottom",
|
||||
"type": "string",
|
||||
"role": "content",
|
||||
"label": "Card headline bottom",
|
||||
"description": "Last marker line on the closing card. Its first word is ringed.",
|
||||
"default": "ONE FILE"
|
||||
},
|
||||
{
|
||||
"id": "check1Label",
|
||||
"type": "string",
|
||||
@@ -83,6 +155,24 @@
|
||||
"label": "Checklist 3 value",
|
||||
"description": "Marker value of the third checklist row.",
|
||||
"default": "TODAY"
|
||||
},
|
||||
{
|
||||
"id": "brandLogo",
|
||||
"type": "image",
|
||||
"role": "content",
|
||||
"label": "Brand logo",
|
||||
"description": "Transparent mark of the brand this video promotes, in the sign-off strip under the card.",
|
||||
"portrays": ["subject_logo"],
|
||||
"default": "assets/hyperframes-logo-black.svg"
|
||||
},
|
||||
{
|
||||
"id": "brandDomain",
|
||||
"type": "string",
|
||||
"role": "content",
|
||||
"label": "Sign-off domain",
|
||||
"description": "Domain of the brand this video promotes, closing the sign-off strip. Use the real domain, or a call to action when no domain fits.",
|
||||
"portrays": ["subject_domain"],
|
||||
"default": "hyperframes.heygen.com"
|
||||
}
|
||||
],
|
||||
"files": [
|
||||
@@ -106,6 +196,11 @@
|
||||
"target": "assets/courier-prime-700.woff2",
|
||||
"type": "hyperframes:asset"
|
||||
},
|
||||
{
|
||||
"path": "assets/hyperframes-logo-black.svg",
|
||||
"target": "assets/hyperframes-logo-black.svg",
|
||||
"type": "hyperframes:asset"
|
||||
},
|
||||
{
|
||||
"path": "TEMPLATE.md",
|
||||
"target": "TEMPLATE.md",
|
||||
|
||||
Reference in New Issue
Block a user