The page
The page contract as a lookup table. Every meta, attribute, global and CSS property that the renderer and the checks read.
A film is one pageA page is one HTML file, films/<name>/page.html, that describes a whole film., films/<name>/page.html, with its own assets folder. This page lists what the page contractThe page contract is the set of rules that a page obeys so that the renderer, the checks and the judge can read it. contains. The list comes from AGENTS.md, harness/media/render-page.mjs, core/engine/page-seek.js and harness/media/page-audio.mjs.
All paths in the page are relative. A page that breaks a row below can still render, but the checks then measure the wrong thing.
Meta tags
The renderer reads <meta name="..." content="..."> before the page runs.
| meta | what it does | default | example |
|---|---|---|---|
duration | The film length in seconds, or auto (see below). | The end of the last animation. | <meta name="duration" content="12.4"> |
aspect | The aspectThe aspect is the width-to-height ratio of a film, such as 16:9, 9:16 or 1:1. of the film. --aspect on a render verb replaces it. | 16:9 | <meta name="aspect" content="9:16"> |
fps | The rate of your frame tables. The render rate is separate. | None. window.vawe.fps is undefined. | <meta name="fps" content="30"> |
message | The one thing a viewer must remember. The board, frame --world and the fresh judge read it. | None. | <meta name="message" content="zero fees"> |
spectacle | The second of the one big moment. Put quiet before it. | None. | <meta name="spectacle" content="6.2"> |
signature | Six dials, written as dial=value pairs split by ;: band, ease, stagger, seam, palette, thread. | None. | <meta name="signature" content="band=professional; ease=land"> |
loudness | A delivery loudness in LUFS. The mix then normalises to it. See Audio. | The mix is not normalised. | <meta name="loudness" content="-14"> |
blank | Seconds where an empty frame is intended, as from-to ranges split by commas. | None. A flat blank frame in the film is an error. | <meta name="blank" content="0-0.4, 4.8-5"> |
The attribute data-blank on <html> takes the same ranges as blank.
The length
duration has three forms. A number gives the length in seconds. The value auto gives the end of the last animation plus a hold. The hold is 1.2 s or the read time of the last worldA world is the one element that holds one beat of the film, marked with data-world="<id>"., rounded up to 1/30 s. Without the meta, the length is the end of the last animation, with no hold.
An auto page must have all its animations at load. A page that moves only through window.seek has no end to find, so it must state a number. Run bin/vawe dev <page> --lock-length to write the found number into the meta.
Attributes on elements
| attribute | on | what it does | read more |
|---|---|---|---|
data-world="<id>" | one element for each beat | Marks a world. The id is lowercase and matches the Shots ids of the brief. | Worlds |
data-chrome | an element | Marks the label of a product that you show as texture. It keeps a 2.5% cap floor and no read hold. | Text and fonts |
data-ui | an element | Marks a mock screen that is the subject of the film. Its text has a 3% cap floor. | Text and fonts |
data-texture="<reason>" | an element | Says why the text is texture. The reason needs 12 characters or more. | Text and fonts |
aria-hidden="true" | an element | Marks texture. The text checks skip the text when it is texture by measure. | Text and fonts |
data-aspect | <html> | The renderer sets it. Do not write it. | Aspect ratios |
The <audio> attributes are in Audio.
Globals
The renderer sets these before your scripts run.
| name | type | what it is |
|---|---|---|
window.seek(t) | function you define | Paints the frame for t seconds. See Time and seek. |
window.vawe.aspect | string | The aspect of this render, such as 16:9. |
window.vawe.width, window.vawe.height | number | The size of the layout viewport in pixels. A draft has the same values as a final. |
window.vawe.fps | number or undefined | The value of the fps meta. |
window.vawe.duration | number or undefined | The duration meta. For auto it is the found length in the render, and 0 while the renderer measures the length. |
window.vawe.onFrame(fn) | function | Registers a hook that runs after every seek with t. |
window.vawe.animationEnd() | function | Returns the end in seconds of the last finite animation, and whether an animation is infinite. |
CSS custom properties
| property | on | value |
|---|---|---|
--vw | :root | The viewport width in pixels, with the unit (1920px). |
--vh | :root | The viewport height in pixels, with the unit (1080px). |
--ease-<name> | :root | A named ease from core/motion/presets.js, such as --ease-land. Names with capitals become kebab case. |
Write calc(var(--vh) * 0.11). Never write * 0.11px, because --vh already has the unit.
Script blocks
| block | what it holds |
|---|---|
<script type="module"> | Your page code. |
<script type="application/json" id="authoring"> | The waivers of the page. See Waivers. |
Rules that no tag shows
- Every tunable number is a literalA literal is a tunable number that you write in the page: a [[f, v]] table row, a keyframe stop or a :root custom property. in the page: a
[[f, v]]table, a keyframe stop or a:rootcustom property.bin/vawe dev <page> --studioedits these in place. - A page can read options from the URL:
--param look=risoloadspage.html?look=riso, and the page reads it withnew URLSearchParams(location.search). - Sound is
<audio>tags: small effects on actions. A music track only comes from a file that you give.
A complete page
<!doctype html>
<meta charset="utf-8">
<meta name="duration" content="4">
<meta name="message" content="one page in">
<style>
body { margin: 0; background: #16151a; color: #fff; font: 700 calc(var(--vh) * 0.1) system-ui; }
h1 { position: absolute; left: 8%; top: 38%; margin: 0; }
#bar { position: absolute; left: 8%; top: 62%; width: 40%; height: calc(var(--vh) * 0.012);
background: #0a87ff; transform-origin: left; transform: scaleX(0); }
</style>
<div data-world="s1">
<h1 id="word">One page in</h1>
<div id="bar"></div>
</div>
<script type="module">
import { EASE } from '../../core/motion/presets.js';
document.getElementById('word').animate(
[{ transform: 'translateY(0.5em)', opacity: 0 }, { transform: 'none', opacity: 1 }],
{ duration: 500, delay: 300, easing: EASE.land, fill: 'both' });
window.seek = (t) => {
const p = Math.min(1, Math.max(0, (t - 0.6) / 1.2));
document.getElementById('bar').style.transform = `scaleX(${1 - (1 - p) ** 3})`;
};
</script>The heading moves on a Web Animation. The bar moves in window.seek(t). Both are pure functions of time, so frame 400 never needs frame 399.
Worked pages: films/examples/colour-sting/page.html (a 5 s sting) and films/examples/three-star/page.html (three.js).
Worlds
Time and seek
Waivers
Glossary
From the blogHTML to video format: the page contract · CSS animation to video: export an MP4 or WebM · Video as JSON or HTML? A blind test with AI agents · Seek CSS animations frame by frame in Puppeteer