Write HTML. Render video. Built for agents.
JavaScript aiai-agentsanimationclaude-codeffmpegframeworkgsaphtmlhtml-to-videomcpmotion-graphicspuppeteerrenderingtypescriptvideo-editor
feat(catalog): add 3D objects, cursors, snow, starfield and paper transitions (#4349)
Miguel Ángel590c192498ed
diff --git a/docs/catalog-gallery.css b/docs/catalog-gallery.cssindex e72bbd70c7..88caaa424b 100644--- a/docs/catalog-gallery.css+++ b/docs/catalog-gallery.css@@ -52,13 +52,14 @@#navigation-items li[data-group-tag] { --catalog-desc:""; }#navigation-items li[data-group-tag]::after { content:var(--catalog-desc); display:block; padding:0 12px 8px 40px; font-size:11px; line-height:1.5; color:var(--hf-text-secondary); }-#navigation-items li[data-title="3D motion"][data-group-tag] { --catalog-desc:"Three.js scenes: orbiting cards, particle fields, and depth-lit product shots."; }+#navigation-items li[data-title="3D"][data-group-tag] { --catalog-desc:"Three.js scenes and objects: camera moves, product turntables, glass, exploded layers."; }#navigation-items li[data-title="Carousels"][data-group-tag] { --catalog-desc:"Image cards that circle, orbit, or sweep a path across the frame."; }#navigation-items li[data-title="Text & captions"][data-group-tag] { --catalog-desc:"Word-by-word caption reveals, highlights, and kinetic type."; }#navigation-items li[data-title="Code"][data-group-tag] { --catalog-desc:"Code snippets that type, diff, highlight, and morph on screen."; }#navigation-items li[data-title="Transitions"][data-group-tag] { --catalog-desc:"Cuts between shots: zooms, warps, glitches, light leaks."; }#navigation-items li[data-title="Data & charts"][data-group-tag] { --catalog-desc:"Bar, line, and progress charts that animate their own data in."; }#navigation-items li[data-title="Scenes & demos"][data-group-tag] { --catalog-desc:"Full scenes: app showcases, chat exchanges, product demos."; }+#navigation-items li[data-title="Cursors"][data-group-tag] { --catalog-desc:"Pointers that glide, click, drag, select, and steer the eye across a UI."; }#navigation-items li[data-title="Motion & effects"][data-group-tag] { --catalog-desc:"General-purpose motion: hovers, pops, blurs, grids, paths."; }#navigation-items li[data-title="Surfaces"][data-group-tag] { --catalog-desc:"Background textures and screen treatments: grain, halftone, glass."; }#navigation-items li[data-title="Blocks"][data-group-tag] { --catalog-desc:"Flowcharts, sketched frames, speech bubbles, and outro cards."; }diff --git a/packages/cli/src/commands/catalog.test.ts b/packages/cli/src/commands/catalog.test.tsindex 03b43fd972..2b4d1708ca 100644--- a/packages/cli/src/commands/catalog.test.ts+++ b/packages/cli/src/commands/catalog.test.ts@@ -376,6 +376,28 @@ describe("catalog --json meaning search", () => {expect(envelope.shown).toBe(1);});+ it("treats a stray positional the same as --query, rather than dropping it", async () => {+ state.modelStatus = "declined";+ state.ranking = null;+ state.registry = [block("fade-through", ["transition"]), block("count-up", ["number"])];++ const envelope = await runEnvelope({ words: "transition" });++ expect(envelope.tier).toBe("words");+ expect(envelope.shown).toBe(1);+ });++ it("prefers an explicit --query over a positional", async () => {+ state.modelStatus = "declined";+ state.ranking = null;+ state.registry = [block("fade-through", ["transition"]), block("count-up", ["number"])];++ const envelope = await runEnvelope({ query: "number", words: "transition" });++ expect(envelope.shown).toBe(1);+ expect(envelope.report_gap).toContain("number");+ });+it("carries an on-device runtime failure into the JSON envelope", async () => {state.rankingError = new Error("model could not load");diff --git a/packages/cli/src/commands/catalog.ts b/packages/cli/src/commands/catalog.tsindex 4b7fd8a8c2..7e5ff21652 100644--- a/packages/cli/src/commands/catalog.ts+++ b/packages/cli/src/commands/catalog.ts@@ -7,6 +7,7 @@ export const examples: Example[] = [["Filter by tag", "hyperframes catalog --type block --tag social"],["Machine-readable JSON", "hyperframes catalog --json"],["Interactive picker (install on select)", "hyperframes catalog --human-friendly"],+ ["Search (positional, same as --query)", 'hyperframes catalog "crossfade"'],];import * as clack from "@clack/prompts";@@ -162,6 +163,11 @@ export default defineCommand({description: "Browse and install blocks and components from the registry",},args: {+ words: {+ type: "positional",+ description: "Search words, same as --query (e.g. `catalog crossfade`)",+ required: false,+ },type: {type: "string",description: 'Filter by type: "block" or "component"',@@ -181,7 +187,8 @@ export default defineCommand({query: {type: "string",description:- "Search by meaning when the on-device model is on, otherwise by name, title, description and tags",+ "Search by meaning when the on-device model is on, otherwise by name, title, description and tags. " ++ "A bare positional word works the same way (e.g. `catalog crossfade`).",},yes: {type: "boolean",@@ -235,7 +242,8 @@ export default defineCommand({? items.filter((item) => item.tags?.some((t) => t.toLowerCase() === tagFilter)): items;- const query = typeof args.query === "string" ? args.query.trim() : "";+ const query =+ (typeof args.query === "string" ? args.query.trim() : "") || args.words?.trim() || "";// Collected rather than only printed, so --json can carry the same reasons// the terminal shows. A machine that asked for a tier deserves to be told// it did not run.diff --git a/packages/cli/src/registry/localSearch.test.ts b/packages/cli/src/registry/localSearch.test.tsindex 8d31029c01..1dce7a77d2 100644--- a/packages/cli/src/registry/localSearch.test.ts+++ b/packages/cli/src/registry/localSearch.test.ts@@ -1,3 +1,6 @@+import { readFileSync, readdirSync } from "node:fs";+import { dirname, join, resolve } from "node:path";+import { fileURLToPath } from "node:url";import { describe, expect, it } from "vitest";import { hasNoSearchableTokens, rankByWords, searchByWords, tokenize } from "./localSearch.js";@@ -233,3 +236,55 @@ describe("the two spellings of a compound word find the same items", () => {expect(searchByWords("typewriter", typing, fieldsOf)[0]?.name).toBe("typewriter");});});++// ── Catalog vocabulary regression, against the real registry ────────────────+// A gap here is a tag gap, not a ranker gap: fix it in a registry-item.json.++describe("editor vocabulary finds the real catalog items that already do it", () => {+ const registryDir = resolve(dirname(fileURLToPath(import.meta.url)), "../../../../registry");++ interface RealItem {+ name: string;+ title: string;+ description: string;+ tags: string[];+ }++ function loadRealCatalog(): RealItem[] {+ const items: RealItem[] = [];+ for (const type of ["blocks", "components"]) {+ const typeDir = join(registryDir, type);+ for (const entry of readdirSync(typeDir, { withFileTypes: true })) {+ if (!entry.isDirectory()) continue;+ const name = entry.name;+ const manifestPath = join(typeDir, name, "registry-item.json");+ const manifest = JSON.parse(readFileSync(manifestPath, "utf8")) as Partial<RealItem>;+ items.push({+ name: manifest.name ?? name,+ title: manifest.title ?? "",+ description: manifest.description ?? "",+ tags: manifest.tags ?? [],+ });+ }+ }+ return items;+ }++ const realItems = loadRealCatalog();+ // Mirrors how catalog.ts:609-612 splits an item's text for the word tier.+ const realFieldsOf = (item: RealItem) => ({+ strong: `${item.name} ${item.title}`,+ weak: `${item.description} ${item.tags.join(" ")}`,+ });++ it.each([+ ["crossfade", "fade-through"],+ ["crossfade", "transitions-dissolve"],+ ["cross dissolve", "transitions-dissolve"],+ ["countdown timer", "count-up"],+ ["split screen comparison", "comparison-split"],+ ])("ranks %s -> %s in the top 3", (query, expectedName) => {+ const ranked = searchByWords(query, realItems, realFieldsOf).slice(0, 3);+ expect(ranked.map((item) => item.name)).toContain(expectedName);+ });+});diff --git a/registry/blocks/exploded-stack/exploded-stack.html b/registry/blocks/exploded-stack/exploded-stack.htmlnew file mode 100644index 0000000000..ecec9314f9--- /dev/null+++ b/registry/blocks/exploded-stack/exploded-stack.html@@ -0,0 +1,409 @@+<!doctype html>+<!--+ Exploded Stack: isometric layer plates sit as one stack, explode apart along the vertical+ axis with labels drawing in beside each layer, hold, then collapse back, so the clip loops.+ Seek-safe: every frame is render(t), driven by one linear GSAP clock.+-->+<html+ lang="en"+ data-composition-variables='[+ { "id": "title", "type": "string", "role": "content", "label": "Title", "default": "How a request moves", "maxLength": 32 },+ { "id": "layer_1", "type": "string", "role": "content", "label": "Top layer", "default": "Interface", "maxLength": 22 },+ { "id": "layer_2", "type": "string", "role": "content", "label": "Layer 2", "default": "API gateway", "maxLength": 22 },+ { "id": "layer_3", "type": "string", "role": "content", "label": "Layer 3", "default": "Services", "maxLength": 22 },+ { "id": "layer_4", "type": "string", "role": "content", "label": "Bottom layer", "default": "Data", "maxLength": 22 },+ { "id": "accent", "type": "color", "role": "style", "label": "Accent", "default": "#0a84ff" },+ { "id": "background", "type": "color", "role": "style", "label": "Backdrop", "default": "#f4f4f5" }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Exploded Stack</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ @font-face {+ font-family: "ES Inter";+ font-weight: 500;+ src: url(https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-500-normal.woff2)+ format("woff2");+ }+ @font-face {+ font-family: "ES Inter";+ font-weight: 700;+ src: url(https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-700-normal.woff2)+ format("woff2");+ }+ html,+ body {+ margin: 0;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #f4f4f5;+ }+ #es-root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: var(--es-bg, #f4f4f5);+ font-family: "ES Inter", system-ui, sans-serif;+ }+ #es-canvas,+ #es-leaders {+ position: absolute;+ inset: 0;+ width: 1920px;+ height: 1080px;+ display: block;+ }+ #es-title {+ position: absolute;+ left: 120px;+ top: 110px;+ font-size: 60px;+ font-weight: 700;+ letter-spacing: -0.02em;+ color: #14161c;+ }+ .es-label {+ position: absolute;+ left: 0;+ top: 0;+ display: flex;+ align-items: center;+ gap: 18px;+ font-size: 34px;+ font-weight: 500;+ color: #1b1e27;+ white-space: nowrap;+ opacity: 0;+ }+ .es-index {+ font-size: 20px;+ font-weight: 700;+ letter-spacing: 0.08em;+ }+ #es-leaders line {+ stroke: rgba(27, 30, 39, 0.35);+ stroke-width: 2;+ }+ </style>+ </head>+ <body>+ <div+ id="es-root"+ data-composition-id="exploded-stack"+ data-start="0"+ data-duration="5"+ data-width="1920"+ data-height="1080"+ >+ <canvas+ id="es-canvas"+ class="clip"+ data-start="0"+ data-duration="5"+ data-track-index="1"+ ></canvas>+ <svg id="es-leaders" viewBox="0 0 1920 1080" aria-hidden="true"></svg>+ <div id="es-title"></div>+ <div id="es-labels"></div>+ </div>++ <script>+ (function () {+ var html = document.documentElement;+ var defaults = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(function (v) {+ defaults[v.id] = v.default;+ });+ } catch (error) {+ /* malformed declaration: the scene module falls back to its own defaults */+ }+ var scoped =+ (window.__hyperframes &&+ window.__hyperframes.getVariables &&+ window.__hyperframes.getVariables()) ||+ {};+ var vars = Object.assign({}, defaults, window.__hfVariables || {}, scoped);+ var hex = function (v, fallback) {+ return /^#[0-9a-f]{6}$/i.test(String(v)) ? String(v) : fallback;+ };+ var root = document.getElementById("es-root");+ var duration = Math.max(0.001, parseFloat(root.dataset.duration) || 5);+ root.style.setProperty("--es-bg", hex(vars.background, "#f4f4f5"));+ document.getElementById("es-title").textContent = vars.title || "";++ var names = [vars.layer_1, vars.layer_2, vars.layer_3, vars.layer_4].map(function (n, i) {+ return String(n || ["Interface", "API gateway", "Services", "Data"][i]);+ });+ var labels = document.getElementById("es-labels");+ var leaders = document.getElementById("es-leaders");+ var svg = "http://www.w3.org/2000/svg";+ names.forEach(function (name, i) {+ var el = document.createElement("div");+ el.className = "es-label";+ el.innerHTML = '<span class="es-index">0' + (i + 1) + "</span><span></span>";+ el.lastChild.textContent = name;+ labels.appendChild(el);+ var line = document.createElementNS(svg, "line");+ var dot = document.createElementNS(svg, "circle");+ dot.setAttribute("r", "6");+ leaders.appendChild(line);+ leaders.appendChild(dot);+ });++ var clock = { t: 0 };+ var scene = {+ vars: vars,+ names: names,+ duration: duration,+ clock: clock,+ hex: hex,+ render: null,+ };+ window.__explodedStack = scene;+ window.__hf = window.__hf || {};+ window.__hf.buildReady = window.__hf.buildReady || {};+ window.__hf.buildReady["exploded-stack"] = new Promise(function (resolve) {+ scene.ready = resolve;+ });++ var tl = gsap.timeline({ paused: true });+ tl.to(clock, {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ if (scene.render) scene.render(clock.t);+ },+ });+ window.__timelines = window.__timelines || {};+ window.__timelines["exploded-stack"] = tl;+ })();+ </script>++ <script type="module">+ import * as THREE from "https://cdn.jsdelivr.net/npm/[email protected]/+esm";+ import { RoundedBoxGeometry } from "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/geometries/RoundedBoxGeometry.js/+esm";++ const host = window.__explodedStack;+ const V = host.vars;+ const hex = host.hex;+ const accent = new THREE.Color(hex(V.accent, "#0a84ff"));+ const D = host.duration;++ const renderer = new THREE.WebGLRenderer({+ canvas: document.getElementById("es-canvas"),+ antialias: true,+ alpha: true,+ preserveDrawingBuffer: true,+ });+ renderer.setPixelRatio(1);+ renderer.setSize(1920, 1080, false);+ renderer.outputColorSpace = THREE.SRGBColorSpace;++ const scene = new THREE.Scene();+ // True isometric: orthographic, 45 degrees around Y, arctan(1/sqrt 2) down.+ const view = 5.9;+ const camera = new THREE.OrthographicCamera(+ (-view * 16) / 9,+ (view * 16) / 9,+ view,+ -view,+ 0.1,+ 100,+ );+ camera.position.set(10, 10.7, 10);+ camera.lookAt(0, 0.7, 0);+ // Slide along the camera's right axis so the stack sits left and labels get the right.+ camera.position.add(new THREE.Vector3(1.9, 0, -1.9));+ camera.updateMatrixWorld();++ scene.add(new THREE.HemisphereLight(0xffffff, 0xd6d9e4, 2.2));+ const sun = new THREE.DirectionalLight(0xffffff, 1.4);+ sun.position.set(-4, 10, 6);+ scene.add(sun);++ const texture = (c) => {+ const tex = new THREE.CanvasTexture(c);+ tex.colorSpace = THREE.SRGBColorSpace;+ tex.anisotropy = renderer.capabilities.getMaxAnisotropy();+ return tex;+ };+ // White face with a hairline where the flat top meets the rounded edge.+ function faceTexture() {+ const c = document.createElement("canvas");+ c.width = c.height = 512;+ const g = c.getContext("2d");+ g.fillStyle = "#ffffff";+ g.fillRect(0, 0, 512, 512);+ g.strokeStyle = "#d6d8dd";+ g.lineWidth = 3;+ g.strokeRect(1.5, 1.5, 509, 509);+ return texture(c);+ }+ // White glyphs on transparent; the material colour tints them per frame.+ function glyphTexture(i) {+ const c = document.createElement("canvas");+ c.width = c.height = 512;+ const g = c.getContext("2d");+ g.strokeStyle = g.fillStyle = "#ffffff";+ g.lineWidth = 6;+ // Each layer gets its own motif, so the plates read as different systems.+ if (i === 0) {+ for (let k = 0; k < 3; k++) g.strokeRect(70 + k * 130, 150, 110, 212);+ } else if (i === 1) {+ for (let k = 0; k < 5; k++) {+ g.beginPath();+ g.moveTo(80, 110 + k * 72);+ g.lineTo(432, 110 + k * 72);+ g.stroke();+ }+ } else if (i === 2) {+ for (let y = 0; y < 3; y++)+ for (let x = 0; x < 3; x++) g.fillRect(96 + x * 120, 96 + y * 120, 80, 80);+ } else {+ for (let k = 0; k < 3; k++) {+ g.beginPath();+ g.ellipse(256, 150 + k * 100, 150, 40, 0, 0, Math.PI * 2);+ g.stroke();+ }+ }+ return texture(c);+ }++ const LAYERS = 4;+ const THICK = 0.22;+ const GAP = 1.55;+ const edge = new THREE.MeshStandardMaterial({ color: 0xffffff, roughness: 0.6 });+ const shadowCanvas = document.createElement("canvas");+ shadowCanvas.width = shadowCanvas.height = 256;+ const sg = shadowCanvas.getContext("2d");+ const sgrad = sg.createRadialGradient(128, 128, 40, 128, 128, 128);+ sgrad.addColorStop(0, "rgba(20,24,40,0.22)");+ sgrad.addColorStop(1, "rgba(20,24,40,0)");+ sg.fillStyle = sgrad;+ sg.fillRect(0, 0, 256, 256);+ const shadow = new THREE.Mesh(+ new THREE.PlaneGeometry(7, 7),+ new THREE.MeshBasicMaterial({+ map: new THREE.CanvasTexture(shadowCanvas),+ transparent: true,+ depthWrite: false,+ }),+ );+ shadow.rotation.x = -Math.PI / 2;+ shadow.position.y = -2.4;+ scene.add(shadow);+ const top = new THREE.MeshStandardMaterial({ map: faceTexture(), roughness: 0.7 });+ const plates = [];+ const glyphs = [];+ for (let i = 0; i < LAYERS; i++) {+ const plate = new THREE.Mesh(new RoundedBoxGeometry(4.2, THICK, 4.2, 4, 0.08), edge);+ // 4.04 = the flat top inside the 0.08 rounded edge.+ const face = new THREE.Mesh(new THREE.PlaneGeometry(4.04, 4.04), top);+ face.rotation.x = -Math.PI / 2;+ face.position.y = THICK / 2 + 0.002;+ const glyph = new THREE.MeshStandardMaterial({+ map: glyphTexture(i),+ roughness: 0.7,+ transparent: true,+ depthWrite: false,+ });+ const motif = new THREE.Mesh(new THREE.PlaneGeometry(4.04, 4.04), glyph);+ motif.rotation.x = -Math.PI / 2;+ motif.position.y = THICK / 2 + 0.004;+ plate.add(face, motif);+ scene.add(plate);+ plates.push(plate);+ glyphs.push(glyph);+ }++ // Beats in seconds at the 5 s default; another duration scales them.+ const BASE = 5;+ const OPEN_AT = 0.3,+ OPEN_FOR = 0.9,+ OPEN_STAGGER = 0.06;+ const LAND_AT = 1.25,+ LAND_EVERY = 0.7,+ DRAW = 0.3,+ FULL = 0.4,+ SETTLE = 0.3;+ const CLOSE_AT = LAND_AT + (LAYERS - 1) * LAND_EVERY + 0.7;+ const CLOSE_FOR = 0.6,+ CLOSE_STAGGER = 0.05,+ LIFT = 0.08;+ const clamp01 = (x) => Math.min(1, Math.max(0, x));+ const ease = (x) => {+ const u = clamp01(x);+ return u < 0.5 ? 4 * u * u * u : 1 - Math.pow(-2 * u + 2, 3) / 2;+ };+ const easeOut = (x) => 1 - Math.pow(1 - clamp01(x), 3);+ // Ease-out with a soft first frame, so the separation reads from OPEN_AT on.+ const easeOpen = (x) => easeOut(Math.pow(clamp01(x), 1.4));+ // 0 at rest, 1 from the moment layer i's label lands until FULL later.+ const focus = (T, i) => {+ const land = LAND_AT + i * LAND_EVERY;+ return easeOut((T - land + DRAW) / DRAW) * (1 - ease((T - land - FULL) / SETTLE));+ };+ const GLYPH_REST = new THREE.Color(0xc9ccd3);+ const INK_REST = new THREE.Color(0x8b909a);+ const ink = new THREE.Color();++ const labelEls = [...document.querySelectorAll(".es-label")];+ const indexEls = [...document.querySelectorAll(".es-index")];+ const lines = [...document.querySelectorAll("#es-leaders line")];+ const dots = [...document.querySelectorAll("#es-leaders circle")];+ const anchor = new THREE.Vector3();+ const toScreen = (v) => {+ const p = v.clone().project(camera);+ return [(p.x * 0.5 + 0.5) * 1920, (-p.y * 0.5 + 0.5) * 1080];+ };++ host.render = (t) => {+ const T = (t / D) * BASE;+ for (let i = 0; i < LAYERS; i++) {+ // Bottom plate stays put; the top plate travels furthest and leaves first.+ const order = LAYERS - 1 - i;+ const open =+ easeOpen((T - OPEN_AT - i * OPEN_STAGGER) / OPEN_FOR) -+ ease((T - CLOSE_AT - 0.05 - order * CLOSE_STAGGER) / CLOSE_FOR);+ const w = focus(T, i);+ const y = order * (THICK + 0.02 + open * GAP) - 2.2 + LIFT * w;+ plates[i].position.y = y;+ glyphs[i].color.copy(GLYPH_REST).lerp(accent, w);+ const inkHex = `#${ink.copy(INK_REST).lerp(accent, w).getHexString()}`;+ indexEls[i].style.color = inkHex;+ dots[i].style.fill = inkHex;++ const shown =+ easeOut((T - LAND_AT - i * LAND_EVERY + DRAW) / DRAW) *+ (1 - clamp01((T - CLOSE_AT) / 0.2));+ // The plate's right-hand corner, where a label has open space beside it.+ anchor.set(2.1, y, -2.1);+ const [ax, ay] = toScreen(anchor);+ const lx = ax + 90;+ labelEls[i].style.opacity = shown.toFixed(3);+ // Whole pixels: a fractional offset rasterises text differently by frame order.+ labelEls[i].style.transform =+ `translate(${Math.round(lx + 24 + (1 - shown) * 16)}px, ${Math.round(ay - 22)}px)`;+ lines[i].setAttribute("x1", ax.toFixed(1));+ lines[i].setAttribute("y1", ay.toFixed(1));+ lines[i].setAttribute("x2", (ax + 90 * shown).toFixed(1));+ lines[i].setAttribute("y2", ay.toFixed(1));+ lines[i].style.opacity = shown > 0 ? 1 : 0;+ dots[i].setAttribute("cx", ax.toFixed(1));+ dots[i].setAttribute("cy", ay.toFixed(1));+ dots[i].style.opacity = shown.toFixed(3);+ }+ renderer.render(scene, camera);+ };+ host.render(host.clock.t);+ host.ready();+ </script>+ </body>+</html>diff --git a/registry/blocks/exploded-stack/registry-item.json b/registry/blocks/exploded-stack/registry-item.jsonnew file mode 100644index 0000000000..9c26cb60eb--- /dev/null+++ b/registry/blocks/exploded-stack/registry-item.json@@ -0,0 +1,29 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "exploded-stack",+ "type": "hyperframes:block",+ "title": "Exploded Stack",+ "description": "Isometric layer plates explode apart with a label beside each layer, hold, then collapse back into one stack. Built for architecture and system diagrams.",+ "tags": [+ "3d-object",+ "three-js",+ "webgl",+ "isometric",+ "exploded-view",+ "layers",+ "diagram",+ "architecture"+ ],+ "dimensions": {+ "width": 1920,+ "height": 1080+ },+ "duration": 5,+ "files": [+ {+ "path": "exploded-stack.html",+ "target": "compositions/exploded-stack.html",+ "type": "hyperframes:composition"+ }+ ]+}diff --git a/registry/blocks/extruded-logo/assets/fonts/Geist-Bold.typeface.json b/registry/blocks/extruded-logo/assets/fonts/Geist-Bold.typeface.jsonnew file mode 100644index 0000000000..6bbc973bc4--- /dev/null+++ b/registry/blocks/extruded-logo/assets/fonts/Geist-Bold.typeface.json@@ -0,0 +1,557 @@+{+ "glyphs": {+ " ": { "ha": 317, "x_min": 0, "x_max": 0, "o": "" },+ "!": {+ "ha": 357,+ "x_min": 65,+ "x_max": 292,+ "o": "m 111 315 q 96 429 104 362 q 82 565 88 496 q 76 689 76 633 l 76 986 l 286 986 l 286 689 q 281 565 286 633 q 267 429 275 496 q 253 315 260 362 m 65 0 l 65 212 l 292 212 l 292 0"+ },+ "\"": {+ "ha": 542,+ "x_min": 58,+ "x_max": 483,+ "o": "m 88 599 l 58 869 l 58 986 l 224 986 l 214 599 m 328 599 l 318 986 l 483 986 l 483 869 l 454 599"+ },+ "#": {+ "ha": 818,+ "x_min": 4,+ "x_max": 810,+ "o": "m 403 0 l 554 986 l 744 986 l 593 0 m 4 226 l 28 393 l 758 393 l 735 226 m 69 0 l 222 986 l 412 986 l 260 0 m 57 585 l 81 750 l 810 750 l 786 585"+ },+ "$": {+ "ha": 931,+ "x_min": 72,+ "x_max": 858,+ "o": "m 415 -125 l 415 1111 l 529 1111 l 529 -125 m 485 -15 q 270 27 360 -15 q 130 146 181 69 q 72 324 79 222 l 281 335 q 314 238 289 278 q 381 177 339 197 q 488 157 424 157 q 575 169 539 157 q 630 206 611 181 q 649 268 649 231 q 633 327 649 301 q 570 374 617 353 q 433 415 524 396 q 235 478 310 443 q 126 568 160 514 q 92 704 92 622 q 135 856 92 790 q 259 958 178 921 q 453 994 340 994 q 656 953 572 994 q 785 838 739 911 q 843 667 832 764 l 636 658 q 608 744 631 707 q 545 803 585 782 q 450 824 506 824 q 340 792 381 824 q 300 711 300 761 q 317 651 300 675 q 378 609 335 626 q 500 575 422 592 q 713 507 635 549 q 825 408 792 465 q 858 278 858 351 q 812 122 858 188 q 683 20 767 56 q 485 -15 599 -15"+ },+ "%": {+ "ha": 1146,+ "x_min": 51,+ "x_max": 1096,+ "o": "m 282 508 q 117 569 182 508 q 51 753 51 629 q 117 938 51 878 q 282 997 182 997 q 447 938 382 997 q 511 753 511 878 q 447 569 511 629 q 282 508 382 508 m 282 614 q 349 649 326 614 q 371 753 371 683 q 349 857 371 822 q 282 892 326 892 q 216 857 239 892 q 193 753 193 822 q 216 649 193 683 q 282 614 239 614 m 865 -11 q 700 49 765 -11 q 635 233 635 110 q 700 418 635 358 q 865 478 765 478 q 1031 418 965 478 q 1096 233 1096 358 q 1031 49 1096 110 q 865 -11 965 -11 m 865 94 q 932 129 910 94 q 954 233 954 164 q 932 338 954 303 q 865 372 910 372 q 799 338 822 372 q 776 233 776 303 q 799 129 776 164 q 865 94 822 94 m 182 0 l 838 986 l 965 986 l 310 0"+ },+ "&": {+ "ha": 985,+ "x_min": 50,+ "x_max": 964,+ "o": "m 403 -22 q 140 47 231 -22 q 50 243 50 115 q 70 357 50 307 q 136 451 90 407 q 256 540 182 496 q 201 609 224 575 q 165 678 178 643 q 153 757 153 714 q 230 940 153 872 q 451 1008 307 1008 q 617 978 550 1008 q 717 894 683 947 q 750 772 750 840 q 698 624 750 685 q 538 503 646 564 l 693 308 q 729 456 728 360 l 940 435 q 906 282 935 356 q 829 156 876 208 l 964 0 l 718 0 l 682 43 q 565 -4 638 14 q 403 -22 492 -22 m 419 158 q 497 168 465 158 q 546 192 528 178 l 365 414 q 290 346 314 381 q 267 267 267 311 q 306 188 267 218 q 419 158 346 158 m 431 625 q 491 666 468 646 q 525 707 514 686 q 536 754 536 728 q 515 810 536 790 q 456 831 493 831 q 391 808 414 831 q 368 749 368 786 q 374 710 368 729 q 394 671 379 692 q 431 625 408 650"+ },+ "'": {+ "ha": 282,+ "x_min": 58,+ "x_max": 224,+ "o": "m 79 599 l 58 869 l 58 986 l 224 986 l 224 869 l 203 599"+ },+ "(": {+ "ha": 449,+ "x_min": 58,+ "x_max": 432,+ "o": "m 246 -153 q 58 444 58 143 q 246 1042 58 747 l 432 1042 q 264 444 264 743 q 306 147 264 296 q 432 -153 349 -3"+ },+ ")": {+ "ha": 449,+ "x_min": 17,+ "x_max": 390,+ "o": "m 201 -153 l 17 -153 q 143 147 101 -3 q 185 444 185 296 q 17 1042 185 743 l 201 1042 q 390 444 390 747 q 201 -153 390 143"+ },+ "*": {+ "ha": 586,+ "x_min": 51,+ "x_max": 535,+ "o": "m 222 504 l 114 567 l 193 688 l 51 685 l 51 824 l 193 822 l 114 943 l 222 1004 l 293 879 l 365 1004 l 474 943 l 393 822 l 535 824 l 535 685 l 393 688 l 474 567 l 365 504 l 293 631"+ },+ "+": {+ "ha": 792,+ "x_min": 56,+ "x_max": 736,+ "o": "m 311 58 l 311 739 l 481 739 l 481 58 m 56 314 l 56 482 l 736 482 l 736 314"+ },+ ",": {+ "ha": 328,+ "x_min": 51,+ "x_max": 278,+ "o": "m 67 -219 l 142 0 l 51 0 l 51 212 l 278 212 l 278 22 l 181 -219"+ },+ "-": { "ha": 579, "x_min": 51, "x_max": 528, "o": "m 51 319 l 51 490 l 528 490 l 528 319" },+ ".": { "ha": 328, "x_min": 51, "x_max": 278, "o": "m 51 0 l 51 212 l 278 212 l 278 0" },+ "/": {+ "ha": 725,+ "x_min": 44,+ "x_max": 661,+ "o": "m 44 -153 l 456 1042 l 661 1042 l 250 -153"+ },+ "0": {+ "ha": 971,+ "x_min": 65,+ "x_max": 906,+ "o": "m 486 -22 q 261 40 356 -22 q 116 217 167 101 q 65 492 65 332 q 117 767 65 651 q 262 946 168 883 q 486 1008 356 1008 q 709 946 615 1008 q 854 767 803 883 q 906 492 906 651 q 855 218 906 333 q 710 40 804 103 q 486 -22 615 -22 m 486 156 q 635 240 583 156 q 688 492 688 325 q 665 679 688 604 q 597 792 642 754 q 486 831 551 831 q 374 792 419 831 q 306 679 329 754 q 283 492 283 604 q 335 240 283 325 q 486 156 388 156"+ },+ "1": {+ "ha": 624,+ "x_min": 53,+ "x_max": 478,+ "o": "m 267 0 l 267 649 l 53 649 l 53 803 l 138 803 q 237 820 199 803 q 292 877 275 838 q 310 986 310 917 l 478 986 l 478 0"+ },+ "2": {+ "ha": 907,+ "x_min": 81,+ "x_max": 828,+ "o": "m 81 0 q 115 219 81 126 q 226 386 149 312 q 431 526 303 460 q 538 588 499 561 q 594 643 578 615 q 611 708 611 671 q 595 772 611 744 q 549 815 579 799 q 472 831 518 831 q 353 787 397 831 q 299 660 310 743 l 82 672 q 197 919 96 829 q 469 1008 297 1008 q 663 971 583 1008 q 785 867 743 933 q 828 711 828 800 q 802 581 828 633 q 719 483 776 528 q 569 389 662 439 q 393 272 450 325 q 332 178 336 218 l 828 178 l 828 0"+ },+ "3": {+ "ha": 903,+ "x_min": 61,+ "x_max": 842,+ "o": "m 450 -22 q 167 62 267 -22 q 61 289 68 146 l 276 297 q 328 190 283 224 q 450 156 374 156 q 539 170 500 156 q 601 215 578 185 q 624 292 624 246 q 575 398 624 362 q 443 433 526 433 l 356 433 l 356 590 l 443 590 q 549 617 507 590 q 592 710 592 644 q 557 798 592 765 q 447 831 522 831 q 335 800 372 831 q 289 721 297 769 l 76 732 q 187 933 90 857 q 447 1008 283 1008 q 644 975 564 1008 q 767 879 725 942 q 808 732 808 817 q 751 588 808 644 q 585 510 693 531 l 585 533 q 775 449 708 515 q 842 276 842 382 q 793 116 842 183 q 657 13 744 49 q 450 -22 569 -22"+ },+ "4": {+ "ha": 911,+ "x_min": 33,+ "x_max": 850,+ "o": "m 524 0 l 524 188 l 33 188 l 33 356 l 483 986 l 735 986 l 735 365 l 850 365 l 850 188 l 735 188 l 735 0 m 257 365 l 524 365 l 524 726"+ },+ "5": {+ "ha": 932,+ "x_min": 78,+ "x_max": 854,+ "o": "m 464 -22 q 260 14 343 -22 q 131 117 176 50 q 78 272 85 183 l 292 282 q 348 187 304 218 q 464 156 392 156 q 591 201 544 156 q 638 328 638 247 q 616 419 638 381 q 556 481 594 458 q 462 503 517 503 q 360 476 403 503 q 300 410 317 450 l 89 410 l 157 986 l 786 986 l 786 808 l 336 808 l 300 521 l 276 542 q 335 603 300 578 q 418 644 371 629 q 522 658 465 658 q 699 615 625 658 q 814 497 774 572 q 854 328 854 422 q 806 142 854 221 q 669 20 757 62 q 464 -22 582 -22"+ },+ "6": {+ "ha": 918,+ "x_min": 78,+ "x_max": 839,+ "o": "m 461 -22 q 249 32 335 -22 q 121 188 164 86 q 78 435 78 290 q 103 663 78 558 q 178 845 128 768 q 308 965 229 922 q 494 1008 388 1008 q 723 939 639 1008 q 835 750 807 869 l 639 736 q 590 808 622 782 q 494 835 558 835 q 342 750 397 835 q 279 489 286 665 l 250 494 q 299 569 265 535 q 384 626 332 604 q 506 647 436 647 q 681 607 606 647 q 798 494 757 567 q 839 325 839 422 q 792 137 839 214 q 660 19 744 60 q 461 -22 575 -22 m 460 146 q 583 194 536 146 q 629 322 629 242 q 609 414 629 375 q 552 475 589 453 q 467 497 515 497 q 375 475 415 497 q 312 414 335 453 q 290 322 290 375 q 311 231 290 271 q 370 168 332 190 q 460 146 408 146"+ },+ "7": {+ "ha": 756,+ "x_min": 28,+ "x_max": 756,+ "o": "m 228 0 q 267 296 228 153 q 376 568 306 439 q 542 808 447 697 l 28 808 l 28 986 l 756 986 l 756 821 q 583 581 653 704 q 477 317 512 458 q 442 0 442 175"+ },+ "8": {+ "ha": 928,+ "x_min": 50,+ "x_max": 878,+ "o": "m 464 -22 q 244 10 338 -22 q 101 108 151 43 q 50 268 50 174 q 119 451 50 379 q 304 542 189 522 l 307 514 q 154 590 211 532 q 97 738 97 649 q 140 879 97 818 q 265 974 183 940 q 464 1008 346 1008 q 662 974 581 1008 q 787 879 744 940 q 829 738 829 818 q 773 591 829 649 q 619 514 717 533 l 622 542 q 808 450 739 521 q 878 268 878 379 q 827 108 878 174 q 683 10 776 43 q 464 -22 590 -22 m 464 156 q 606 194 553 156 q 660 300 660 232 q 609 409 660 368 q 464 450 558 450 q 318 409 369 450 q 267 300 267 368 q 321 194 267 232 q 464 156 375 156 m 464 599 q 574 627 535 599 q 614 715 614 656 q 576 800 614 768 q 464 832 538 832 q 351 800 390 832 q 312 715 312 768 q 353 627 312 656 q 464 599 393 599"+ },+ "9": {+ "ha": 924,+ "x_min": 78,+ "x_max": 846,+ "o": "m 436 -22 q 215 41 300 -22 q 94 222 131 104 l 297 235 q 347 173 312 194 q 436 151 382 151 q 590 228 540 151 q 639 482 639 304 l 667 469 q 565 358 629 396 q 406 321 500 321 q 235 362 308 321 q 119 478 161 403 q 78 651 78 553 q 124 841 78 761 q 253 965 169 921 q 447 1008 336 1008 q 670 952 582 1008 q 802 789 758 896 q 846 528 846 682 q 821 297 846 399 q 747 124 796 194 q 620 15 697 53 q 436 -22 543 -22 m 451 472 q 542 494 504 472 q 601 557 581 517 q 622 654 622 597 q 602 752 622 710 q 544 817 582 794 q 454 840 507 840 q 367 817 404 840 q 309 753 329 794 q 289 656 289 711 q 310 558 289 599 q 367 495 331 518 q 451 472 403 472"+ },+ ":": {+ "ha": 432,+ "x_min": 103,+ "x_max": 329,+ "o": "m 103 0 l 103 212 l 329 212 l 329 0 m 103 494 l 103 707 l 329 707 l 329 494"+ },+ ";": {+ "ha": 432,+ "x_min": 103,+ "x_max": 329,+ "o": "m 103 494 l 103 707 l 329 707 l 329 494 m 118 -219 l 193 0 l 103 0 l 103 212 l 329 212 l 329 22 l 232 -219"+ },+ "<": {+ "ha": 764,+ "x_min": 56,+ "x_max": 694,+ "o": "m 694 31 l 56 301 l 56 510 l 694 781 l 694 600 l 140 367 l 140 444 l 694 211"+ },+ "=": {+ "ha": 767,+ "x_min": 56,+ "x_max": 711,+ "o": "m 56 482 l 56 651 l 711 651 l 711 482 m 56 162 l 56 331 l 711 331 l 711 162"+ },+ ">": {+ "ha": 764,+ "x_min": 69,+ "x_max": 708,+ "o": "m 69 31 l 69 211 l 624 444 l 624 367 l 69 600 l 69 781 l 708 510 l 708 301"+ },+ "?": {+ "ha": 821,+ "x_min": 51,+ "x_max": 771,+ "o": "m 301 311 q 333 483 301 424 q 438 578 364 542 q 515 624 489 604 q 549 667 540 644 q 557 719 557 689 q 523 803 557 771 q 426 836 489 836 q 316 798 356 836 q 268 685 276 760 l 51 696 q 106 857 60 786 q 232 968 151 928 q 426 1008 312 1008 q 615 971 539 1008 q 731 868 692 933 q 771 719 771 803 q 753 618 771 660 q 699 543 736 576 q 599 475 661 510 q 528 411 549 444 q 508 311 508 378 m 289 0 l 289 212 l 515 212 l 515 0"+ },+ "@": {+ "ha": 1336,+ "x_min": 58,+ "x_max": 1278,+ "o": "m 946 -101 q 780 -151 862 -135 q 608 -168 697 -168 q 312 -108 435 -168 q 124 66 189 -49 q 58 342 58 181 q 106 604 58 486 q 240 808 153 722 q 447 940 326 894 q 714 986 567 986 q 1010 925 883 986 q 1208 753 1138 864 q 1278 494 1278 643 q 1240 290 1278 376 q 1137 156 1203 203 q 983 108 1071 108 q 855 151 903 108 q 801 264 807 194 l 838 269 q 788 185 825 224 q 701 124 750 146 q 600 101 651 101 q 464 133 521 101 q 378 224 407 165 q 349 361 349 282 q 385 534 349 458 q 485 654 421 610 q 635 699 550 699 q 768 662 712 699 q 835 569 824 626 l 807 568 l 817 689 l 974 689 l 949 415 q 943 349 946 383 q 940 292 940 314 q 958 248 940 264 q 1006 232 975 232 q 1109 297 1071 232 q 1147 478 1147 361 q 1098 692 1147 606 q 951 821 1049 778 q 707 864 854 864 q 497 827 592 864 q 333 722 403 790 q 227 560 264 654 q 190 350 190 465 q 240 137 190 225 q 383 1 289 49 q 612 -46 478 -46 q 768 -32 696 -46 q 914 14 840 -18 m 643 239 q 723 264 690 239 q 773 331 756 289 q 790 422 790 372 q 778 495 790 464 q 739 544 765 526 q 671 561 712 561 q 594 537 626 561 q 545 470 562 512 q 528 375 528 428 q 556 276 528 314 q 643 239 583 239"+ },+ "A": {+ "ha": 1014,+ "x_min": 26,+ "x_max": 988,+ "o": "m 26 0 l 382 986 l 632 986 l 988 0 l 768 0 l 696 210 l 317 210 l 244 0 m 376 383 l 638 383 l 507 764"+ },+ "B": {+ "ha": 976,+ "x_min": 103,+ "x_max": 906,+ "o": "m 103 0 l 103 986 l 486 986 q 767 922 669 986 q 864 718 864 857 q 839 612 864 657 q 766 540 814 567 q 650 508 718 514 l 650 511 q 840 440 774 503 q 906 272 906 376 q 809 67 906 135 q 533 0 712 0 m 314 172 l 524 172 q 647 203 600 172 q 693 297 693 235 q 647 392 693 360 q 524 425 600 425 l 314 425 m 314 578 l 481 578 q 605 608 558 578 q 651 696 651 639 q 606 785 651 757 q 481 814 561 814 l 314 814"+ },+ "C": {+ "ha": 1019,+ "x_min": 58,+ "x_max": 968,+ "o": "m 521 -22 q 281 39 386 -22 q 117 215 176 100 q 58 492 58 331 q 115 765 58 649 q 278 944 172 881 q 525 1008 383 1008 q 826 913 718 1008 q 964 642 933 818 l 744 633 q 672 778 728 726 q 525 831 617 831 q 390 789 446 831 q 306 671 335 747 q 276 492 276 594 q 306 312 276 388 q 392 196 336 236 q 524 156 447 156 q 678 212 624 156 q 747 368 733 268 l 968 360 q 892 154 949 239 q 742 24 835 69 q 521 -22 650 -22"+ },+ "D": {+ "ha": 1000,+ "x_min": 103,+ "x_max": 942,+ "o": "m 103 0 l 103 986 l 443 986 q 812 858 683 986 q 942 492 942 729 q 815 128 942 256 q 451 0 688 0 m 314 178 l 443 178 q 655 255 586 178 q 724 493 724 332 q 655 731 724 654 q 443 808 586 808 l 314 808"+ },+ "E": {+ "ha": 864,+ "x_min": 103,+ "x_max": 800,+ "o": "m 103 0 l 103 986 l 789 986 l 789 808 l 314 808 l 314 582 l 772 582 l 772 407 l 314 407 l 314 178 l 800 178 l 800 0"+ },+ "F": {+ "ha": 839,+ "x_min": 103,+ "x_max": 783,+ "o": "m 103 0 l 103 986 l 783 986 l 783 808 l 197 808 l 314 929 l 314 478 l 197 569 l 758 569 l 758 394 l 197 394 l 314 486 l 314 0"+ },+ "G": {+ "ha": 1025,+ "x_min": 58,+ "x_max": 960,+ "o": "m 514 -22 q 269 43 371 -22 q 113 224 168 108 q 58 492 58 340 q 114 757 58 640 q 274 941 169 874 q 526 1008 379 1008 q 742 966 654 1008 q 883 846 831 924 q 957 662 936 768 l 739 653 q 674 783 724 735 q 528 831 625 831 q 387 786 443 831 q 303 665 331 742 q 276 492 276 589 q 303 317 276 393 q 387 199 331 242 q 532 156 443 156 q 645 182 597 156 q 720 254 693 208 q 753 358 747 300 l 528 358 l 528 512 l 960 512 l 960 0 l 829 0 l 818 211 l 843 200 q 782 85 829 135 q 666 6 735 35 q 514 -22 597 -22"+ },+ "H": {+ "ha": 1001,+ "x_min": 103,+ "x_max": 899,+ "o": "m 103 0 l 103 986 l 314 986 l 314 518 l 221 585 l 782 585 l 688 518 l 688 986 l 899 986 l 899 0 l 688 0 l 688 474 l 782 407 l 221 407 l 314 474 l 314 0"+ },+ "I": { "ha": 417, "x_min": 103, "x_max": 314, "o": "m 103 0 l 103 986 l 314 986 l 314 0" },+ "J": {+ "ha": 871,+ "x_min": 68,+ "x_max": 789,+ "o": "m 429 -22 q 234 26 314 -22 q 112 159 154 75 q 68 351 69 243 l 281 361 q 321 206 282 256 q 429 156 360 156 q 539 204 500 156 q 578 354 578 253 l 578 986 l 789 986 l 789 354 q 744 154 789 239 q 618 24 699 69 q 429 -22 538 -22"+ },+ "K": {+ "ha": 957,+ "x_min": 103,+ "x_max": 940,+ "o": "m 103 0 l 103 986 l 314 986 l 314 556 l 672 986 l 918 986 l 556 551 l 940 0 l 700 0 l 417 410 l 314 290 l 314 0"+ },+ "L": {+ "ha": 818,+ "x_min": 103,+ "x_max": 768,+ "o": "m 103 0 l 103 986 l 314 986 l 314 57 l 197 178 l 768 178 l 768 0"+ },+ "M": {+ "ha": 1271,+ "x_min": 103,+ "x_max": 1168,+ "o": "m 103 0 l 103 986 l 385 986 l 636 268 l 886 986 l 1168 986 l 1168 0 l 957 0 l 957 639 l 725 3 l 544 3 l 314 639 l 314 0"+ },+ "N": {+ "ha": 1042,+ "x_min": 103,+ "x_max": 939,+ "o": "m 103 0 l 103 986 l 336 986 l 728 306 l 728 986 l 939 986 l 939 0 l 703 0 l 314 657 l 314 0"+ },+ "O": {+ "ha": 1078,+ "x_min": 58,+ "x_max": 1019,+ "o": "m 539 -22 q 281 40 389 -22 q 116 218 174 103 q 58 492 58 333 q 116 766 58 650 q 281 945 174 882 q 539 1008 389 1008 q 797 945 689 1008 q 962 766 904 882 q 1019 492 1019 650 q 962 218 1019 333 q 797 40 904 103 q 539 -22 689 -22 m 538 156 q 680 195 621 156 q 770 310 739 235 q 801 492 801 385 q 770 674 801 599 q 680 790 739 750 q 538 831 621 831 q 397 790 456 831 q 308 674 339 750 q 276 492 276 599 q 308 310 276 385 q 398 195 339 235 q 538 156 457 156"+ },+ "P": {+ "ha": 933,+ "x_min": 103,+ "x_max": 876,+ "o": "m 103 0 l 103 986 l 497 986 q 776 900 675 986 q 876 664 876 814 q 831 492 876 565 q 701 380 786 419 q 497 340 615 340 l 314 340 l 314 0 m 314 518 l 485 518 q 614 555 568 518 q 660 664 660 592 q 615 772 660 735 q 485 808 569 808 l 314 808"+ },+ "Q": {+ "ha": 1068,+ "x_min": 58,+ "x_max": 1010,+ "o": "m 788 -86 l 711 10 q 634 -14 679 -6 q 535 -22 589 -22 q 282 44 389 -22 q 117 226 175 110 q 58 492 58 342 q 113 756 58 639 q 274 940 168 872 q 535 1008 381 1008 q 795 940 689 1008 q 956 756 901 872 q 1010 492 1010 639 q 963 250 1010 354 q 831 76 917 146 l 961 -86 m 535 156 q 568 158 553 156 q 597 165 583 160 l 460 333 l 635 333 l 707 238 q 770 338 749 276 q 792 492 792 400 q 765 659 792 582 q 681 783 738 736 q 535 831 624 831 q 388 783 444 831 q 303 659 331 736 q 276 492 276 582 q 303 326 276 403 q 388 202 331 249 q 535 156 446 156"+ },+ "R": {+ "ha": 968,+ "x_min": 103,+ "x_max": 899,+ "o": "m 103 0 l 103 986 l 535 986 q 723 950 643 986 q 846 848 803 914 q 889 692 889 782 q 860 571 889 624 q 783 485 832 518 q 669 443 733 451 l 665 456 q 815 413 764 456 q 874 283 867 371 l 899 0 l 683 0 l 665 250 q 630 334 661 307 q 524 361 599 361 l 314 361 l 314 0 m 314 538 l 511 538 q 630 573 588 538 q 672 674 672 608 q 629 774 672 740 q 504 808 586 808 l 314 808"+ },+ "S": {+ "ha": 946,+ "x_min": 72,+ "x_max": 874,+ "o": "m 493 -22 q 274 21 365 -22 q 131 142 182 64 q 72 325 79 219 l 285 335 q 319 235 293 276 q 388 174 344 194 q 496 153 432 153 q 585 165 549 153 q 642 203 622 178 q 661 267 661 229 q 644 327 661 301 q 581 374 628 353 q 442 417 533 396 q 238 482 315 446 q 126 573 161 518 q 92 711 92 628 q 135 867 92 800 q 262 971 179 933 q 461 1008 346 1008 q 668 965 583 1008 q 801 847 753 922 q 858 675 849 772 l 647 664 q 619 753 643 715 q 556 812 596 792 q 458 833 515 833 q 345 801 386 833 q 304 718 304 769 q 323 658 304 682 q 385 615 342 633 q 510 581 429 597 q 727 510 647 553 q 840 410 807 468 q 874 276 874 351 q 827 117 874 185 q 695 14 781 50 q 493 -22 610 -22"+ },+ "T": {+ "ha": 832,+ "x_min": 15,+ "x_max": 818,+ "o": "m 310 0 l 310 808 l 15 808 l 15 986 l 818 986 l 818 808 l 522 808 l 522 0"+ },+ "U": {+ "ha": 976,+ "x_min": 82,+ "x_max": 894,+ "o": "m 489 -22 q 273 24 364 -22 q 132 155 182 69 q 82 356 82 240 l 82 988 l 293 988 l 293 356 q 344 208 293 260 q 489 156 394 156 q 633 208 583 156 q 683 356 683 260 l 683 988 l 894 988 l 894 356 q 845 155 894 240 q 704 24 796 69 q 489 -22 612 -22"+ },+ "V": {+ "ha": 1014,+ "x_min": 26,+ "x_max": 988,+ "o": "m 382 0 l 26 986 l 244 986 l 507 238 l 769 986 l 988 986 l 631 0"+ },+ "W": {+ "ha": 1410,+ "x_min": 51,+ "x_max": 1358,+ "o": "m 318 0 l 51 986 l 272 986 l 442 292 l 612 986 l 797 986 l 969 292 l 1138 986 l 1358 986 l 1093 0 l 865 0 l 704 631 l 543 0"+ },+ "X": {+ "ha": 956,+ "x_min": 17,+ "x_max": 939,+ "o": "m 17 0 l 351 494 l 19 986 l 264 986 l 479 654 l 689 986 l 935 986 l 603 497 l 939 0 l 693 0 l 476 338 l 262 0"+ },+ "Y": {+ "ha": 876,+ "x_min": -10,+ "x_max": 886,+ "o": "m 333 0 l 333 383 l -10 986 l 224 986 l 439 589 l 653 986 l 886 986 l 544 383 l 544 0"+ },+ "Z": {+ "ha": 825,+ "x_min": 38,+ "x_max": 788,+ "o": "m 38 0 l 38 172 l 507 808 l 60 808 l 60 986 l 769 986 l 769 814 l 290 178 l 788 178 l 788 0"+ },+ "[": {+ "ha": 542,+ "x_min": 103,+ "x_max": 525,+ "o": "m 525 -153 l 103 -153 l 103 1042 l 525 1042 l 525 878 l 303 878 l 303 11 l 525 11"+ },+ "\\": {+ "ha": 696,+ "x_min": 39,+ "x_max": 657,+ "o": "m 657 -153 l 450 -153 l 39 1042 l 244 1042"+ },+ "]": {+ "ha": 542,+ "x_min": 17,+ "x_max": 439,+ "o": "m 17 -153 l 17 11 l 239 11 l 239 878 l 17 878 l 17 1042 l 439 1042 l 439 -153"+ },+ "^": {+ "ha": 640,+ "x_min": 56,+ "x_max": 585,+ "o": "m 56 532 l 222 935 l 418 935 l 585 532 l 435 532 l 300 849 l 340 849 l 207 532"+ },+ "_": { "ha": 779, "x_min": 51, "x_max": 728, "o": "m 51 -168 l 51 0 l 728 0 l 728 -168" },+ "`": { "ha": 386, "x_min": 51, "x_max": 335, "o": "m 176 831 l 51 1035 l 253 1035 l 335 831" },+ "a": {+ "ha": 825,+ "x_min": 51,+ "x_max": 807,+ "o": "m 312 -17 q 124 37 197 -17 q 51 186 51 90 q 113 338 51 285 q 296 417 175 392 l 536 464 q 503 573 536 536 q 410 610 471 610 q 317 583 350 610 q 274 503 283 556 l 64 512 q 174 698 85 635 q 410 761 264 761 q 660 682 576 761 q 744 450 744 603 l 744 196 q 755 153 744 164 q 786 143 765 143 l 807 143 l 807 0 q 776 -6 797 -3 q 733 -8 754 -8 q 651 7 689 -8 q 589 59 612 22 q 565 164 565 96 l 583 150 q 534 62 569 100 q 442 4 499 25 q 312 -17 386 -17 m 362 126 q 453 147 414 126 q 514 206 492 167 q 536 297 536 244 l 536 333 l 367 297 q 291 265 317 288 q 265 206 265 242 q 290 147 265 168 q 362 126 315 126"+ },+ "b": {+ "ha": 881,+ "x_min": 92,+ "x_max": 829,+ "o": "m 519 -17 q 384 17 442 -17 q 294 110 326 50 l 290 0 l 92 0 l 92 986 l 300 986 l 300 639 q 386 726 329 690 q 519 761 443 761 q 683 713 614 761 q 791 578 753 665 q 829 372 829 490 q 791 167 829 254 q 683 31 753 79 q 519 -17 614 -17 m 461 143 q 573 203 531 143 q 615 372 615 264 q 574 541 615 481 q 462 601 532 601 q 374 574 411 601 q 319 496 338 547 q 300 372 300 444 q 319 250 300 301 q 374 171 338 199 q 461 143 411 143"+ },+ "c": {+ "ha": 831,+ "x_min": 51,+ "x_max": 793,+ "o": "m 429 -17 q 231 31 315 -17 q 99 167 146 79 q 51 372 51 254 q 99 577 51 490 q 231 712 146 664 q 429 761 315 761 q 606 726 528 761 q 733 626 685 692 q 793 469 782 561 l 578 460 q 528 565 568 529 q 429 600 489 600 q 308 540 351 600 q 265 372 265 481 q 308 203 265 264 q 429 143 351 143 q 529 180 489 143 q 578 292 569 217 l 793 283 q 735 124 783 192 q 609 20 688 57 q 429 -17 531 -17"+ },+ "d": {+ "ha": 881,+ "x_min": 51,+ "x_max": 789,+ "o": "m 357 -17 q 194 31 262 -17 q 88 166 125 79 q 51 372 51 253 q 89 578 51 492 q 195 713 126 665 q 357 761 264 761 q 494 728 436 761 q 581 639 551 696 l 581 986 l 789 986 l 789 0 l 590 0 l 586 110 q 495 17 556 50 q 357 -17 435 -17 m 425 143 q 510 169 475 143 q 562 247 544 196 q 581 372 581 297 q 562 499 581 449 q 510 576 544 550 q 425 601 475 601 q 308 540 351 601 q 265 372 265 478 q 309 206 265 268 q 425 143 353 143"+ },+ "e": {+ "ha": 840,+ "x_min": 51,+ "x_max": 790,+ "o": "m 426 -17 q 228 31 312 -17 q 98 167 144 79 q 51 372 51 254 q 98 577 51 490 q 228 712 144 664 q 425 761 311 761 q 618 712 536 761 q 745 574 700 664 q 790 358 790 483 l 790 317 l 267 317 q 315 185 271 228 q 431 142 358 142 q 519 164 483 142 q 569 232 554 186 l 779 219 q 656 46 750 108 q 426 -17 561 -17 m 267 444 l 576 444 q 531 567 572 526 q 425 607 490 607 q 317 565 360 607 q 267 444 275 522"+ },+ "f": {+ "ha": 621,+ "x_min": 64,+ "x_max": 576,+ "o": "m 172 0 l 172 754 q 232 926 172 865 q 418 986 292 986 l 576 986 l 576 831 l 462 831 q 400 809 419 831 q 381 744 381 788 l 381 0 m 64 561 l 64 717 l 565 717 l 565 561"+ },+ "g": {+ "ha": 881,+ "x_min": 51,+ "x_max": 789,+ "o": "m 425 -225 q 247 -199 318 -225 q 133 -125 175 -172 q 74 -17 90 -78 l 288 -1 q 330 -58 299 -38 q 425 -79 361 -79 q 540 -44 500 -79 q 579 69 579 -8 l 579 149 q 494 66 553 97 q 364 35 436 35 q 201 80 272 35 q 91 206 131 125 q 51 397 51 288 q 91 586 51 504 q 201 715 131 668 q 361 761 271 761 q 499 725 443 761 q 585 629 556 689 l 585 744 l 789 744 l 789 74 q 743 -92 789 -26 q 615 -192 697 -158 q 425 -225 533 -225 m 424 189 q 538 244 496 189 q 581 399 581 300 q 562 511 581 464 q 508 583 543 558 q 424 608 472 608 q 307 551 349 608 q 265 399 265 494 q 308 245 265 301 q 424 189 351 189"+ },+ "h": {+ "ha": 849,+ "x_min": 92,+ "x_max": 757,+ "o": "m 92 0 l 92 986 l 300 986 l 300 571 l 272 571 q 316 678 283 636 q 398 740 349 719 q 506 761 447 761 q 644 725 589 761 q 728 625 700 689 q 757 479 757 561 l 757 0 l 549 0 l 549 429 q 523 554 549 512 q 436 596 497 596 q 336 553 372 596 q 300 424 300 510 l 300 0"+ },+ "i": {+ "ha": 390,+ "x_min": 88,+ "x_max": 303,+ "o": "m 92 0 l 92 744 l 300 744 l 300 0 m 88 836 l 88 1003 l 303 1003 l 303 836"+ },+ "j": {+ "ha": 460,+ "x_min": -4,+ "x_max": 372,+ "o": "m -4 -208 l -4 -53 l 78 -53 q 140 -36 119 -53 q 160 31 160 -19 l 160 744 l 369 744 l 369 25 q 313 -154 369 -100 q 121 -208 257 -208 m 157 836 l 157 1003 l 372 1003 l 372 836"+ },+ "k": {+ "ha": 899,+ "x_min": 92,+ "x_max": 835,+ "o": "m 92 0 l 92 986 l 300 986 l 300 439 l 576 744 l 826 744 l 538 438 l 835 0 l 607 0 l 403 319 l 300 210 l 300 0"+ },+ "l": {+ "ha": 435,+ "x_min": 92,+ "x_max": 410,+ "o": "m 286 0 q 143 46 194 0 q 92 194 92 92 l 92 986 l 300 986 l 300 217 q 315 169 300 183 q 360 156 331 156 l 410 156 l 410 0"+ },+ "m": {+ "ha": 1250,+ "x_min": 92,+ "x_max": 1158,+ "o": "m 92 0 l 92 744 l 279 744 l 286 565 l 267 574 q 313 675 282 633 q 389 739 344 717 q 486 761 433 761 q 637 707 579 761 q 711 561 694 653 l 685 560 q 728 670 697 625 q 806 738 760 715 q 908 761 851 761 q 1042 729 986 761 q 1128 634 1097 697 q 1158 479 1158 571 l 1158 0 l 950 0 l 950 421 q 924 552 950 508 q 838 596 897 596 q 774 575 800 596 q 733 515 747 554 q 718 418 718 475 l 718 0 l 531 0 l 531 418 q 506 550 531 504 q 419 596 481 596 q 355 575 382 596 q 314 514 328 554 q 300 418 300 474 l 300 0"+ },+ "n": {+ "ha": 849,+ "x_min": 92,+ "x_max": 757,+ "o": "m 92 0 l 92 744 l 279 744 l 288 526 l 261 533 q 306 667 272 617 q 392 739 340 717 q 504 761 443 761 q 641 726 585 761 q 727 628 697 692 q 757 479 757 565 l 757 0 l 549 0 l 549 410 q 539 511 549 469 q 504 574 529 553 q 435 596 479 596 q 335 548 369 596 q 300 410 300 500 l 300 0"+ },+ "o": {+ "ha": 858,+ "x_min": 51,+ "x_max": 807,+ "o": "m 429 -17 q 231 31 315 -17 q 99 167 146 79 q 51 372 51 254 q 99 577 51 490 q 231 712 146 664 q 429 761 315 761 q 628 712 543 761 q 760 577 712 664 q 807 372 807 490 q 760 167 807 254 q 628 31 712 79 q 429 -17 543 -17 m 429 143 q 550 203 507 143 q 593 372 593 264 q 550 541 593 481 q 429 601 507 601 q 308 541 351 601 q 265 372 265 481 q 308 203 265 264 q 429 143 351 143"+ },+ "p": {+ "ha": 881,+ "x_min": 92,+ "x_max": 829,+ "o": "m 92 -208 l 92 744 l 292 744 l 296 588 l 279 594 q 369 718 307 675 q 515 761 432 761 q 689 710 619 761 q 794 570 758 658 q 829 372 829 482 q 794 175 829 264 q 688 35 758 86 q 514 -17 618 -17 q 412 3 460 -17 q 331 60 365 24 q 282 146 297 96 l 300 157 l 300 -208 m 457 143 q 573 204 531 143 q 615 372 615 265 q 573 540 615 479 q 457 601 531 601 q 373 576 408 601 q 319 499 338 550 q 300 372 300 447 q 319 246 300 297 q 373 169 338 194 q 457 143 408 143"+ },+ "q": {+ "ha": 881,+ "x_min": 51,+ "x_max": 789,+ "o": "m 789 -208 l 581 -208 l 581 157 l 599 146 q 549 60 583 96 q 468 3 515 24 q 367 -17 421 -17 q 192 35 262 -17 q 87 175 122 86 q 51 372 51 264 q 87 570 51 482 q 192 710 122 658 q 365 761 261 761 q 512 718 450 761 q 601 594 575 675 l 585 588 l 589 744 l 789 744 m 424 143 q 508 169 474 143 q 562 246 543 194 q 581 372 581 297 q 562 499 581 447 q 508 576 543 550 q 424 601 472 601 q 308 540 350 601 q 265 372 265 479 q 308 204 265 265 q 424 143 350 143"+ },+ "r": {+ "ha": 590,+ "x_min": 92,+ "x_max": 539,+ "o": "m 92 0 l 92 744 l 289 744 l 296 528 l 281 532 q 344 694 299 644 q 471 744 390 744 l 539 744 l 539 572 l 471 572 q 375 557 412 572 q 319 508 338 542 q 300 418 300 475 l 300 0"+ },+ "s": {+ "ha": 793,+ "x_min": 51,+ "x_max": 743,+ "o": "m 410 -17 q 217 16 294 -17 q 98 105 139 49 q 51 235 57 161 l 262 242 q 307 160 272 189 q 410 131 342 131 q 497 149 465 131 q 528 204 528 167 q 517 244 528 228 q 473 272 506 260 q 376 293 440 283 q 192 342 258 314 q 97 414 125 369 q 69 522 69 458 q 152 695 69 629 q 400 761 235 761 q 577 728 506 761 q 688 637 649 694 q 738 506 728 579 l 528 497 q 506 559 524 533 q 462 599 489 585 q 399 614 436 614 q 313 591 343 614 q 283 531 283 568 q 297 485 283 503 q 340 457 310 468 q 422 439 371 446 q 612 392 542 422 q 712 318 682 362 q 743 208 743 274 q 701 86 743 136 q 585 10 660 36 q 410 -17 511 -17"+ },+ "t": {+ "ha": 618,+ "x_min": 57,+ "x_max": 581,+ "o": "m 400 0 q 231 53 285 0 q 176 224 176 107 l 176 919 l 385 919 l 385 249 q 408 175 385 194 q 476 156 431 156 l 581 156 l 581 0 m 57 589 l 57 744 l 581 744 l 581 589"+ },+ "u": {+ "ha": 843,+ "x_min": 92,+ "x_max": 753,+ "o": "m 336 -17 q 156 58 221 -17 q 92 265 92 132 l 92 744 l 300 744 l 300 314 q 326 188 300 228 q 410 149 353 149 q 509 192 474 149 q 544 324 544 236 l 544 744 l 753 744 l 753 0 l 562 0 l 557 214 l 583 208 q 504 40 567 97 q 336 -17 442 -17"+ },+ "v": {+ "ha": 846,+ "x_min": 29,+ "x_max": 817,+ "o": "m 301 0 l 29 744 l 247 744 l 424 210 l 599 744 l 817 744 l 543 0"+ },+ "w": {+ "ha": 1179,+ "x_min": 29,+ "x_max": 1150,+ "o": "m 250 0 l 29 744 l 239 744 l 367 240 l 504 744 l 674 744 l 811 240 l 940 744 l 1150 744 l 929 0 l 726 0 l 589 465 l 451 0"+ },+ "x": {+ "ha": 903,+ "x_min": 64,+ "x_max": 839,+ "o": "m 64 0 l 329 378 l 71 744 l 292 744 l 451 506 l 606 744 l 832 744 l 575 376 l 839 0 l 618 0 l 454 253 l 289 0"+ },+ "y": {+ "ha": 814,+ "x_min": 29,+ "x_max": 785,+ "o": "m 153 -208 l 153 -53 l 251 -53 q 305 -42 288 -53 q 332 -6 322 -32 l 347 38 l 290 38 l 29 744 l 242 744 l 412 232 l 572 744 l 785 744 l 499 -71 q 426 -176 474 -144 q 294 -208 379 -208"+ },+ "z": {+ "ha": 826,+ "x_min": 78,+ "x_max": 749,+ "o": "m 78 0 l 78 164 l 488 589 l 94 589 l 94 744 l 738 744 l 738 581 l 321 156 l 749 156 l 749 0"+ },+ "{": {+ "ha": 567,+ "x_min": 58,+ "x_max": 550,+ "o": "m 462 -174 q 257 -100 331 -174 q 183 89 183 -26 l 183 204 q 170 296 183 262 q 129 344 157 329 q 58 358 101 358 l 58 522 q 129 536 101 522 q 170 584 157 550 q 183 676 183 618 l 183 792 q 257 980 183 907 q 462 1053 331 1053 l 550 1053 l 550 874 q 422 850 462 878 q 382 758 382 822 l 382 662 q 334 508 382 564 q 222 444 286 453 l 222 436 q 335 373 288 429 q 382 218 382 317 l 382 121 q 422 27 382 57 q 550 0 462 -3 l 550 -174"+ },+ "|": {+ "ha": 408,+ "x_min": 103,+ "x_max": 306,+ "o": "m 103 -153 l 103 1042 l 306 1042 l 306 -153"+ },+ "}": {+ "ha": 567,+ "x_min": 17,+ "x_max": 508,+ "o": "m 104 -174 l 17 -174 l 17 0 q 144 27 104 -3 q 183 121 183 57 l 183 218 q 231 373 183 317 q 344 436 279 429 l 344 444 q 232 508 281 453 q 183 662 183 564 l 183 758 q 144 850 183 822 q 17 874 104 878 l 17 1053 l 104 1053 q 310 980 238 1053 q 382 792 382 907 l 382 676 q 395 584 382 618 q 436 536 408 550 q 508 522 464 522 l 508 358 q 436 344 464 358 q 395 296 408 329 q 382 204 382 262 l 382 89 q 310 -100 382 -26 q 104 -174 238 -174"+ },+ "~": {+ "ha": 726,+ "x_min": 56,+ "x_max": 671,+ "o": "m 478 333 q 404 348 435 333 q 340 399 374 362 q 305 435 318 424 q 283 451 292 447 q 261 454 274 454 q 219 426 233 454 q 204 340 204 397 l 56 340 q 108 524 56 457 q 250 592 160 592 q 326 575 294 592 q 389 524 357 558 q 433 481 418 490 q 467 471 447 471 q 509 499 496 471 q 522 585 522 528 l 671 585 q 619 401 671 468 q 478 333 567 333"+ }+ },+ "familyName": "Geist Bold",+ "ascender": 1396,+ "descender": -410,+ "underlinePosition": -100,+ "underlineThickness": 50,+ "boundingBox": { "xMin": -200, "xMax": 2338, "yMin": -253, "yMax": 958 },+ "resolution": 1000,+ "original_font_information": {+ "copyright": "Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font.git)",+ "licence_url": "https://openfontlicense.org"+ },+ "cssFontWeight": "bold",+ "cssFontStyle": "normal"+}diff --git a/registry/blocks/extruded-logo/assets/fonts/Geist-OFL.txt b/registry/blocks/extruded-logo/assets/fonts/Geist-OFL.txtnew file mode 100644index 0000000000..8d003fec6b--- /dev/null+++ b/registry/blocks/extruded-logo/assets/fonts/Geist-OFL.txt@@ -0,0 +1,92 @@+Copyright (c) 2023 Vercel, in collaboration with basement.studio++This Font Software is licensed under the SIL Open Font License, Version 1.1.+This license is copied below, and is also available with a FAQ at:+http://scripts.sil.org/OFL++-----------------------------------------------------------+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007+-----------------------------------------------------------++PREAMBLE+The goals of the Open Font License (OFL) are to stimulate worldwide+development of collaborative font projects, to support the font creation+efforts of academic and linguistic communities, and to provide a free and+open framework in which fonts may be shared and improved in partnership+with others.++The OFL allows the licensed fonts to be used, studied, modified and+redistributed freely as long as they are not sold by themselves. The+fonts, including any derivative works, can be bundled, embedded,+redistributed and/or sold with any software provided that any reserved+names are not used by derivative works. The fonts and derivatives,+however, cannot be released under any other type of license. The+requirement for fonts to remain under this license does not apply+to any document created using the fonts or their derivatives.++DEFINITIONS+"Font Software" refers to the set of files released by the Copyright+Holder(s) under this license and clearly marked as such. This may+include source files, build scripts and documentation.++"Reserved Font Name" refers to any names specified as such after the+copyright statement(s).++"Original Version" refers to the collection of Font Software components as+distributed by the Copyright Holder(s).++"Modified Version" refers to any derivative made by adding to, deleting,+or substituting -- in part or in whole -- any of the components of the+Original Version, by changing formats or by porting the Font Software to a+new environment.++"Author" refers to any designer, engineer, programmer, technical+writer or other person who contributed to the Font Software.++PERMISSION AND CONDITIONS+Permission is hereby granted, free of charge, to any person obtaining+a copy of the Font Software, to use, study, copy, merge, embed, modify,+redistribute, and sell modified and unmodified copies of the Font+Software, subject to the following conditions:++1) Neither the Font Software nor any of its individual components,+in Original or Modified Versions, may be sold by itself.++2) Original or Modified Versions of the Font Software may be bundled,+redistributed and/or sold with any software, provided that each copy+contains the above copyright notice and this license. These can be+included either as stand-alone text files, human-readable headers or+in the appropriate machine-readable metadata fields within text or+binary files as long as those fields can be easily viewed by the user.++3) No Modified Version of the Font Software may use the Reserved Font+Name(s) unless explicit written permission is granted by the corresponding+Copyright Holder. This restriction only applies to the primary font name as+presented to the users.++4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font+Software shall not be used to promote, endorse or advertise any+Modified Version, except to acknowledge the contribution(s) of the+Copyright Holder(s) and the Author(s) or with their explicit written+permission.++5) The Font Software, modified or unmodified, in part or in whole,+must be distributed entirely under this license, and must not be+distributed under any other license. The requirement for fonts to+remain under this license does not apply to any document created+using the Font Software.++TERMINATION+This license becomes null and void if any of the above conditions are+not met.++DISCLAIMER+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM+OTHER DEALINGS IN THE FONT SOFTWARE.diff --git a/registry/blocks/extruded-logo/extruded-logo.html b/registry/blocks/extruded-logo/extruded-logo.htmlnew file mode 100644index 0000000000..4f96cf9607--- /dev/null+++ b/registry/blocks/extruded-logo/extruded-logo.html@@ -0,0 +1,331 @@+<!doctype html>+<!--+ Extruded Logo: beveled 3D letters flip up one by one, the word swings slowly so light runs+ across the bevels, then settles facing the camera for a readable hold.+ Seek-safe: every frame is render(t), driven by one linear GSAP clock.+-->+<html+ lang="en"+ data-composition-variables='[+ { "id": "text", "type": "string", "role": "content", "label": "Word or lettermark", "description": "Basic Latin letters, digits and punctuation only; other characters render as ?", "default": "NOVA", "maxLength": 8 },+ { "id": "tagline", "type": "string", "role": "content", "label": "Tagline", "default": "Ships Thursday", "maxLength": 40 },+ { "id": "finish", "type": "enum", "role": "style", "label": "Finish", "default": "chrome", "options": [ { "value": "chrome", "label": "Chrome" }, { "value": "gold", "label": "Gold" }, { "value": "matte", "label": "Matte clay" } ] },+ { "id": "rim_color", "type": "color", "role": "style", "label": "Rim light", "default": "#fff4e6" },+ { "id": "background", "type": "color", "role": "style", "label": "Backdrop", "default": "#0c0d12" }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Extruded Logo</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ @font-face {+ font-family: "EL Inter";+ font-weight: 500;+ src: url(https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-500-normal.woff2)+ format("woff2");+ }+ html,+ body {+ margin: 0;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #0c0d12;+ }+ #el-root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background:+ radial-gradient(900px 560px at 50% 46%, rgba(255, 255, 255, 0.09), transparent 70%),+ var(--el-bg, #0c0d12);+ }+ #el-canvas {+ position: absolute;+ inset: 0;+ width: 1920px;+ height: 1080px;+ display: block;+ }+ #el-tagline {+ position: absolute;+ left: 0;+ right: 0;+ top: 790px;+ text-align: center;+ font:+ 500 38px/1.2 "EL Inter",+ system-ui,+ sans-serif;+ letter-spacing: 0.02em;+ color: rgba(236, 238, 245, 0.72);+ opacity: 0;+ }+ </style>+ </head>+ <body>+ <div+ id="el-root"+ data-composition-id="extruded-logo"+ data-start="0"+ data-duration="5"+ data-width="1920"+ data-height="1080"+ >+ <canvas+ id="el-canvas"+ class="clip"+ data-start="0"+ data-duration="5"+ data-track-index="1"+ ></canvas>+ <div id="el-tagline"></div>+ </div>++ <script>+ (function () {+ var html = document.documentElement;+ var defaults = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(function (v) {+ defaults[v.id] = v.default;+ });+ } catch (error) {+ /* malformed declaration: the scene module falls back to its own defaults */+ }+ var scoped =+ (window.__hyperframes &&+ window.__hyperframes.getVariables &&+ window.__hyperframes.getVariables()) ||+ {};+ var vars = Object.assign({}, defaults, window.__hfVariables || {}, scoped);+ var root = document.getElementById("el-root");+ var duration = Math.max(0.001, parseFloat(root.dataset.duration) || 5);+ if (/^#[0-9a-f]{6}$/i.test(String(vars.background)))+ root.style.setProperty("--el-bg", vars.background);+ var tagline = document.getElementById("el-tagline");+ tagline.textContent = vars.tagline || "";++ var clock = { t: 0 };+ var scene = { vars: vars, duration: duration, clock: clock, render: null };+ window.__extrudedLogo = scene;+ window.__hf = window.__hf || {};+ window.__hf.buildReady = window.__hf.buildReady || {};+ window.__hf.buildReady["extruded-logo"] = new Promise(function (resolve) {+ scene.ready = resolve;+ });++ var tl = gsap.timeline({ paused: true });+ tl.to(clock, {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ if (scene.render) scene.render(clock.t);+ },+ });+ tl.fromTo(+ tagline,+ { opacity: 0, y: 16 },+ { opacity: 1, y: 0, duration: 0.6, ease: "power2.out" },+ Math.min(1.7, duration * 0.34),+ );+ window.__timelines = window.__timelines || {};+ window.__timelines["extruded-logo"] = tl;+ })();+ </script>++ <script type="module">+ import * as THREE from "https://cdn.jsdelivr.net/npm/[email protected]/+esm";+ import { FontLoader } from "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/loaders/FontLoader.js/+esm";+ import { TextGeometry } from "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/geometries/TextGeometry.js/+esm";++ const host = window.__extrudedLogo;+ const V = host.vars;+ const hex = (v, fallback) => (/^#[0-9a-f]{6}$/i.test(String(v)) ? String(v) : fallback);++ const renderer = new THREE.WebGLRenderer({+ canvas: document.getElementById("el-canvas"),+ antialias: true,+ alpha: true,+ preserveDrawingBuffer: true,+ });+ renderer.setPixelRatio(1);+ renderer.setSize(1920, 1080, false);+ renderer.outputColorSpace = THREE.SRGBColorSpace;+ renderer.toneMapping = THREE.ACESFilmicToneMapping;++ const scene = new THREE.Scene();+ // Softbox studio: bright strips on black, so chrome shows crisp bands instead of grey.+ const studio = new THREE.Scene();+ studio.background = new THREE.Color(0x040406);+ const softbox = (w, h, x, y, z, color, power) => {+ const mat = new THREE.MeshBasicMaterial({+ color: new THREE.Color(color).multiplyScalar(power),+ side: THREE.DoubleSide,+ });+ const panel = new THREE.Mesh(new THREE.PlaneGeometry(w, h), mat);+ panel.position.set(x, y, z);+ panel.lookAt(0, 0, 0);+ studio.add(panel);+ };+ softbox(10, 2.2, 0, 7, 1, 0xffffff, 3);+ softbox(1.2, 7, -7, 1, 2, 0xffffff, 2.2);+ softbox(1.2, 7, 7, 1, -1, 0xffffff, 1.6);+ // Behind the camera: the panel the letter faces mirror. Vertical bars sweep across+ // the faces as the word swings.+ const bars = document.createElement("canvas");+ bars.width = 1024;+ bars.height = 256;+ const bg = bars.getContext("2d");+ const fade = bg.createLinearGradient(0, 0, 0, 256);+ fade.addColorStop(0, "#9a9ca3");+ fade.addColorStop(1, "#15161a");+ bg.fillStyle = fade;+ bg.fillRect(0, 0, 1024, 256);+ bg.fillStyle = "#ffffff";+ for (const [x, w] of [+ [150, 60],+ [430, 140],+ [760, 36],+ ])+ bg.fillRect(x, 0, w, 256);+ const mirror = new THREE.Mesh(+ new THREE.PlaneGeometry(22, 8),+ new THREE.MeshBasicMaterial({+ map: new THREE.CanvasTexture(bars),+ color: new THREE.Color(2.2, 2.2, 2.2),+ side: THREE.DoubleSide,+ }),+ );+ mirror.position.set(0, 1, 9);+ mirror.lookAt(0, 1, 0);+ studio.add(mirror);+ softbox(9, 1.4, 0, 0.5, -7, hex(V.rim_color, "#fff4e6"), 2);+ const pmrem = new THREE.PMREMGenerator(renderer);+ scene.environment = pmrem.fromScene(studio, 0.01).texture;++ const camera = new THREE.PerspectiveCamera(26, 1920 / 1080, 0.1, 100);+ camera.position.set(0, 0.9, 11);+ camera.lookAt(0, 0.35, 0);++ const rim = new THREE.DirectionalLight(new THREE.Color(hex(V.rim_color, "#fff4e6")), 5);+ rim.position.set(0, 3, -6);+ scene.add(rim);+ const key = new THREE.DirectionalLight(0xffffff, 1.4);+ key.position.set(-5, 4, 6);+ scene.add(key);++ const finishes = {+ chrome: { color: 0xe9ecf2, metalness: 1, roughness: 0.16 },+ gold: { color: 0xe7bf6a, metalness: 1, roughness: 0.2 },+ matte: { color: 0xe8e2d8, metalness: 0, roughness: 0.62 },+ };+ const material = new THREE.MeshStandardMaterial(finishes[V.finish] || finishes.chrome);++ // Beside this file when mounted; a runtime without assetUrl keeps the plain path.+ const assetUrl = (path) =>+ typeof __hyperframes !== "undefined" && __hyperframes.assetUrl+ ? __hyperframes.assetUrl(path)+ : path;+ // Geist Bold (OFL), basic Latin only, converted to three.js typeface JSON.+ const font = await new FontLoader().loadAsync(+ assetUrl("assets/fonts/Geist-Bold.typeface.json"),+ );+ const text = String(V.text || "NOVA")+ .toUpperCase()+ .slice(0, 8)+ .split("");+ const SIZE = 1.5;+ const scale = SIZE / font.data.resolution;+ const tracking = 0.08;+ const word = new THREE.Group();+ scene.add(word);++ // One mesh per letter, pivoting on its baseline so each can flip up on its own beat.+ const letters = [];+ let cursor = 0;+ for (const ch of text) {+ const advance = ((font.data.glyphs[ch] || font.data.glyphs["?"]).ha || 600) * scale;+ if (ch.trim()) {+ const geometry = new TextGeometry(ch, {+ font,+ size: SIZE,+ depth: 0.42,+ curveSegments: 10,+ bevelEnabled: true,+ bevelThickness: 0.06,+ bevelSize: 0.035,+ bevelSegments: 5,+ });+ geometry.computeBoundingBox();+ const b = geometry.boundingBox;+ geometry.translate(-(b.min.x + b.max.x) / 2, 0, -0.21);+ const pivot = new THREE.Group();+ pivot.position.x = cursor + advance / 2;+ pivot.add(new THREE.Mesh(geometry, material));+ word.add(pivot);+ letters.push(pivot);+ }+ cursor += advance + tracking;+ }+ const width = cursor - tracking;+ for (const p of letters) p.position.x -= width / 2;+ // Longer words shrink to keep a margin either side.+ word.scale.setScalar(Math.min(1, 7.4 / width));++ const shadowCanvas = document.createElement("canvas");+ shadowCanvas.width = 512;+ shadowCanvas.height = 128;+ const sg = shadowCanvas.getContext("2d");+ const grad = sg.createRadialGradient(256, 64, 0, 256, 64, 256);+ grad.addColorStop(0, "rgba(0,0,0,0.6)");+ grad.addColorStop(1, "rgba(0,0,0,0)");+ sg.setTransform(1, 0, 0, 0.25, 0, 48);+ sg.fillStyle = grad;+ sg.fillRect(0, 0, 512, 512);+ const shadow = new THREE.Mesh(+ new THREE.PlaneGeometry(Math.min(width, 7.4) * 1.25, 1.4),+ new THREE.MeshBasicMaterial({+ map: new THREE.CanvasTexture(shadowCanvas),+ transparent: true,+ depthWrite: false,+ }),+ );+ shadow.rotation.x = -Math.PI / 2;+ shadow.position.y = -0.02;+ scene.add(shadow);++ const clamp01 = (x) => Math.min(1, Math.max(0, x));+ const easeOutBack = (x) => {+ const u = clamp01(x) - 1;+ return 1 + 2.2 * u * u * u + 1.2 * u * u;+ };+ const easeInOut = (x) => {+ const u = clamp01(x);+ return u < 0.5 ? 4 * u * u * u : 1 - Math.pow(-2 * u + 2, 3) / 2;+ };++ host.render = (t) => {+ const D = host.duration;+ const k = Math.min(1, D / 5);+ letters.forEach((p, i) => {+ const u = easeOutBack((t - 0.1 * k - i * 0.13 * k) / (0.9 * k));+ // Lying face-down behind the baseline at 0, standing at 1.+ p.rotation.x = (1 - u) * (-Math.PI / 2);+ p.position.y = (1 - clamp01(u)) * -0.2;+ p.visible = t >= 0.1 * k + i * 0.13 * k;+ });+ const swing = easeInOut((t - 0.9 * k) / (D - 0.9 * k - 0.7 * k));+ word.rotation.y = -0.42 + swing * 0.42;+ word.rotation.x = 0.04 - swing * 0.04;+ renderer.render(scene, camera);+ };+ host.render(host.clock.t);+ host.ready();+ </script>+ </body>+</html>diff --git a/registry/blocks/extruded-logo/registry-item.json b/registry/blocks/extruded-logo/registry-item.jsonnew file mode 100644index 0000000000..01313093aa--- /dev/null+++ b/registry/blocks/extruded-logo/registry-item.json@@ -0,0 +1,30 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "extruded-logo",+ "type": "hyperframes:block",+ "title": "Extruded Logo",+ "description": "Beveled 3D letters flip up one by one, the word swings so light runs across the bevels, then settles for a readable hold. Chrome, gold or matte.",+ "tags": ["3d-object", "three-js", "webgl", "logo", "text", "extruded", "title-card"],+ "dimensions": {+ "width": 1920,+ "height": 1080+ },+ "duration": 5,+ "files": [+ {+ "path": "extruded-logo.html",+ "target": "compositions/extruded-logo.html",+ "type": "hyperframes:composition"+ },+ {+ "path": "assets/fonts/Geist-Bold.typeface.json",+ "target": "compositions/assets/fonts/Geist-Bold.typeface.json",+ "type": "hyperframes:asset"+ },+ {+ "path": "assets/fonts/Geist-OFL.txt",+ "target": "compositions/assets/fonts/Geist-OFL.txt",+ "type": "hyperframes:asset"+ }+ ]+}diff --git a/registry/blocks/glass-hero/glass-hero.html b/registry/blocks/glass-hero/glass-hero.htmlnew file mode 100644index 0000000000..7cdf186b47--- /dev/null+++ b/registry/blocks/glass-hero/glass-hero.html@@ -0,0 +1,281 @@+<!doctype html>+<!--+ Glass Hero: a glass object rises in front of a giant headline and turns, bending the type.+ The headline is drawn inside the scene because transmission only refracts what is rendered.+ Seek-safe: every frame is render(t), driven by one linear GSAP clock.+-->+<html+ lang="en"+ data-composition-variables='[+ { "id": "headline", "type": "string", "role": "content", "label": "Headline behind the glass", "default": "CLARITY", "maxLength": 12 },+ { "id": "subline", "type": "string", "role": "content", "label": "Subline", "default": "See every detail, nothing in the way.", "maxLength": 48 },+ { "id": "shape", "type": "enum", "role": "style", "label": "Glass shape", "default": "lens", "options": [ { "value": "lens", "label": "Lens" }, { "value": "ring", "label": "Ring" } ] },+ { "id": "glass_tint", "type": "color", "role": "style", "label": "Glass tint", "default": "#cfe9ff" },+ { "id": "type_color", "type": "color", "role": "style", "label": "Headline color", "default": "#f4efe4" },+ { "id": "background", "type": "color", "role": "style", "label": "Backdrop", "default": "#0b0b0c" }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Glass Hero</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ @font-face {+ font-family: "GH Caption";+ font-weight: 500;+ src: url(https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-500-normal.woff2)+ format("woff2");+ }+ html,+ body {+ margin: 0;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #0b0b0c;+ }+ #gh-root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #0b0b0c;+ }+ #gh-canvas {+ position: absolute;+ inset: 0;+ width: 1920px;+ height: 1080px;+ display: block;+ }+ #gh-subline {+ position: absolute;+ left: 0;+ right: 0;+ bottom: 118px;+ text-align: center;+ font:+ 500 36px/1.2 "GH Caption",+ system-ui,+ sans-serif;+ letter-spacing: 0.01em;+ color: rgba(244, 239, 228, 0.78);+ opacity: 0;+ }+ </style>+ </head>+ <body>+ <div+ id="gh-root"+ data-composition-id="glass-hero"+ data-start="0"+ data-duration="5"+ data-width="1920"+ data-height="1080"+ >+ <canvas+ id="gh-canvas"+ class="clip"+ data-start="0"+ data-duration="5"+ data-track-index="1"+ ></canvas>+ <div id="gh-subline"></div>+ </div>++ <script>+ (function () {+ var html = document.documentElement;+ var defaults = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(function (v) {+ defaults[v.id] = v.default;+ });+ } catch (error) {+ /* malformed declaration: the scene module falls back to its own defaults */+ }+ var scoped =+ (window.__hyperframes &&+ window.__hyperframes.getVariables &&+ window.__hyperframes.getVariables()) ||+ {};+ var vars = Object.assign({}, defaults, window.__hfVariables || {}, scoped);+ var root = document.getElementById("gh-root");+ var duration = Math.max(0.001, parseFloat(root.dataset.duration) || 5);+ var bg = /^#[0-9a-f]{6}$/i.test(String(vars.background)) ? vars.background : "#0b0b0c";+ root.style.background = bg;+ var subline = document.getElementById("gh-subline");+ subline.textContent = vars.subline || "";++ var clock = { t: 0 };+ var scene = { vars: vars, duration: duration, clock: clock, background: bg, render: null };+ window.__glassHero = scene;+ window.__hf = window.__hf || {};+ window.__hf.buildReady = window.__hf.buildReady || {};+ window.__hf.buildReady["glass-hero"] = new Promise(function (resolve) {+ scene.ready = resolve;+ });++ var tl = gsap.timeline({ paused: true });+ tl.to(clock, {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ if (scene.render) scene.render(clock.t);+ },+ });+ tl.fromTo(+ subline,+ { opacity: 0, y: 18 },+ { opacity: 1, y: 0, duration: 0.7, ease: "power2.out" },+ Math.min(1.5, duration * 0.3),+ );+ window.__timelines = window.__timelines || {};+ window.__timelines["glass-hero"] = tl;+ })();+ </script>++ <script type="module">+ import * as THREE from "https://cdn.jsdelivr.net/npm/[email protected]/+esm";++ const host = window.__glassHero;+ const V = host.vars;+ const hex = (v, fallback) => (/^#[0-9a-f]{6}$/i.test(String(v)) ? String(v) : fallback);++ const renderer = new THREE.WebGLRenderer({+ canvas: document.getElementById("gh-canvas"),+ antialias: true,+ preserveDrawingBuffer: true,+ });+ renderer.setPixelRatio(1);+ renderer.setSize(1920, 1080, false);+ renderer.outputColorSpace = THREE.SRGBColorSpace;+ // No tone mapping: the glass passes the ground and type through at their true values.++ const scene = new THREE.Scene();+ scene.background = new THREE.Color(host.background);+ const pmrem = new THREE.PMREMGenerator(renderer);+ // Studio light for the reflections: a soft key box overhead and two tall strips at the sides.+ const studio = new THREE.Scene();+ studio.background = new THREE.Color(0.08, 0.08, 0.08);+ const softbox = (w, h, x, y, z, level) => {+ const m = new THREE.Mesh(+ new THREE.PlaneGeometry(w, h),+ new THREE.MeshBasicMaterial({+ color: new THREE.Color(level, level, level),+ side: THREE.DoubleSide,+ }),+ );+ m.position.set(x, y, z);+ m.lookAt(0, 0, 0);+ studio.add(m);+ };+ softbox(8, 3, -1, 6, 2, 2.5);+ softbox(1.2, 9, -7, 0, -1, 4);+ softbox(1.2, 9, 7, 0, -1, 4);+ scene.environment = pmrem.fromScene(studio, 0.02).texture;++ const camera = new THREE.PerspectiveCamera(30, 1920 / 1080, 0.1, 100);+ camera.position.set(0, 0, 10);++ async function headlineTexture() {+ try {+ const face = new FontFace(+ "GH Inter",+ "url(https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-900-normal.woff2)",+ { weight: "900" },+ );+ document.fonts.add(await face.load());+ } catch (error) {+ console.error("[glass-hero] headline font failed to load, using system sans", error);+ }+ const c = document.createElement("canvas");+ c.width = 3840;+ c.height = 2160;+ const g = c.getContext("2d");+ g.fillStyle = host.background;+ g.fillRect(0, 0, c.width, c.height);+ const text = String(V.headline || "CLARITY").toUpperCase();+ let size = 1000;+ g.font = `900 ${size}px "GH Inter", system-ui, sans-serif`;+ while (g.measureText(text).width > 3100 && size > 200) {+ size -= 20;+ g.font = `900 ${size}px "GH Inter", system-ui, sans-serif`;+ }+ g.textAlign = "center";+ g.textBaseline = "middle";+ g.fillStyle = hex(V.type_color, "#f4efe4");+ g.fillText(text, c.width / 2, c.height * 0.47);+ const tex = new THREE.CanvasTexture(c);+ tex.colorSpace = THREE.SRGBColorSpace;+ tex.anisotropy = renderer.capabilities.getMaxAnisotropy();+ return tex;+ }++ // The backdrop plane fills the frustum at z = -2, so it reads as the page itself.+ const planeHeight = 2 * Math.tan(THREE.MathUtils.degToRad(camera.fov / 2)) * 12;+ const backdrop = new THREE.Mesh(+ new THREE.PlaneGeometry(planeHeight * (1920 / 1080), planeHeight),+ new THREE.MeshBasicMaterial({ map: await headlineTexture() }),+ );+ backdrop.position.z = -2;+ scene.add(backdrop);++ const geometries = {+ ring: () => new THREE.TorusGeometry(1.25, 0.46, 96, 200),+ lens: () => {+ const g = new THREE.SphereGeometry(1.6, 128, 64);+ g.scale(1, 1, 0.42);+ return g;+ },+ };+ const glass = new THREE.Mesh(+ (geometries[V.shape] || geometries.lens)(),+ new THREE.MeshPhysicalMaterial({+ color: 0xffffff,+ transmission: 1,+ thickness: 0.6,+ ior: 1.3,+ roughness: 0.03,+ metalness: 0,+ dispersion: 0.6,+ attenuationColor: new THREE.Color(hex(V.glass_tint, "#cfe9ff")),+ attenuationDistance: 2.2,+ specularIntensity: 1,+ clearcoat: 1,+ clearcoatRoughness: 0.04,+ }),+ );+ scene.add(glass);++ const key = new THREE.DirectionalLight(0xffffff, 2.4);+ key.position.set(-4, 5, 6);+ scene.add(key);++ const easeOut = (x) => 1 - Math.pow(1 - Math.min(1, Math.max(0, x)), 3);+ const lens = V.shape !== "ring";++ host.render = (t) => {+ // Rise and settle over the first 1.6 s, then keep turning; the turn never stops,+ // so a held frame still shows the type moving through the glass.+ const rise = easeOut(t / 1.8);+ glass.position.set(+ Math.sin(t * 0.55) * 0.35,+ -3.2 * (1 - rise) + Math.sin(t * 0.9) * 0.06,+ 1.2,+ );+ glass.scale.setScalar(0.62 + 0.14 * rise);+ glass.rotation.set(+ lens ? Math.sin(t * 0.7) * 0.35 : 0.5 + t * 0.22,+ lens ? Math.sin(t * 0.5) * 0.5 + 0.2 : t * 0.34,+ lens ? 0 : 0.2 + t * 0.08,+ );+ renderer.render(scene, camera);+ };+ host.render(host.clock.t);+ host.ready();+ </script>+ </body>+</html>diff --git a/registry/blocks/glass-hero/registry-item.json b/registry/blocks/glass-hero/registry-item.jsonnew file mode 100644index 0000000000..7419419535--- /dev/null+++ b/registry/blocks/glass-hero/registry-item.json@@ -0,0 +1,20 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "glass-hero",+ "type": "hyperframes:block",+ "title": "Glass Hero",+ "description": "A solid glass object rises in front of a giant headline and keeps turning, so the type bends and splits into colour through it.",+ "tags": ["3d-object", "three-js", "webgl", "glass", "refraction", "hero", "title-card"],+ "dimensions": {+ "width": 1920,+ "height": 1080+ },+ "duration": 5,+ "files": [+ {+ "path": "glass-hero.html",+ "target": "compositions/glass-hero.html",+ "type": "hyperframes:composition"+ }+ ]+}diff --git a/registry/blocks/product-turntable/product-turntable.html b/registry/blocks/product-turntable/product-turntable.htmlnew file mode 100644index 0000000000..cc3f717cbf--- /dev/null+++ b/registry/blocks/product-turntable/product-turntable.html@@ -0,0 +1,363 @@+<!doctype html>+<!--+ Product Turntable: one product turns a full revolution on a studio plinth, a seamless loop.+ model_url takes a .glb/.gltf; empty uses the built-in procedural drink can.+ Seek-safe: every frame is render(t), driven by one linear GSAP clock.+-->+<html+ lang="en"+ data-composition-variables='[+ { "id": "model_url", "type": "string", "role": "content", "label": "Model URL (.glb or .gltf)", "description": "Leave empty for the built-in drink can.", "default": "" },+ { "id": "product_name", "type": "string", "role": "content", "label": "Label wordmark", "default": "YUZU", "maxLength": 10 },+ { "id": "flavor", "type": "string", "role": "content", "label": "Label line", "default": "Sparkling Citrus", "maxLength": 28 },+ { "id": "caption", "type": "string", "role": "content", "label": "Caption", "default": "Sparkling Citrus · 355 ml", "maxLength": 40 },+ { "id": "label_color", "type": "color", "role": "style", "label": "Label color", "default": "#f2c230" },+ { "id": "ink_color", "type": "color", "role": "style", "label": "Label ink", "default": "#1d2a24" },+ { "id": "background", "type": "color", "role": "style", "label": "Backdrop", "default": "#e8e4dc" },+ { "id": "turns", "type": "number", "role": "motion", "label": "Turns per clip", "default": 1, "min": 1, "max": 4, "step": 1 }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Product Turntable</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ @font-face {+ font-family: "PT Caption";+ font-weight: 500;+ src: url(https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-500-normal.woff2)+ format("woff2");+ }+ html,+ body {+ margin: 0;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #e8e4dc;+ }+ #pt-root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background:+ radial-gradient(1100px 760px at 50% 38%, rgba(255, 255, 255, 0.72), transparent 70%),+ var(--pt-bg, #e8e4dc);+ }+ #pt-canvas {+ position: absolute;+ inset: 0;+ width: 1920px;+ height: 1080px;+ display: block;+ }+ #pt-caption {+ position: absolute;+ left: 96px;+ bottom: 96px;+ font:+ 500 30px/1 "PT Caption",+ system-ui,+ sans-serif;+ letter-spacing: 0.01em;+ color: rgba(20, 22, 24, 0.62);+ }+ </style>+ </head>+ <body>+ <div+ id="pt-root"+ data-composition-id="product-turntable"+ data-start="0"+ data-duration="6"+ data-width="1920"+ data-height="1080"+ >+ <canvas+ id="pt-canvas"+ class="clip"+ data-start="0"+ data-duration="6"+ data-track-index="1"+ ></canvas>+ <div id="pt-caption"></div>+ </div>++ <script>+ (function () {+ var html = document.documentElement;+ var defaults = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(function (v) {+ defaults[v.id] = v.default;+ });+ } catch (error) {+ /* malformed declaration: the scene module falls back to its own defaults */+ }+ var scoped =+ (window.__hyperframes &&+ window.__hyperframes.getVariables &&+ window.__hyperframes.getVariables()) ||+ {};+ var vars = Object.assign({}, defaults, window.__hfVariables || {}, scoped);+ var root = document.getElementById("pt-root");+ var duration = Math.max(0.001, parseFloat(root.dataset.duration) || 6);+ root.style.setProperty("--pt-bg", vars.background || "#e8e4dc");+ document.getElementById("pt-caption").textContent = vars.caption || "";++ var clock = { t: 0 };+ var scene = { vars: vars, duration: duration, clock: clock, render: null };+ window.__productTurntable = scene;+ window.__hf = window.__hf || {};+ window.__hf.buildReady = window.__hf.buildReady || {};+ window.__hf.buildReady["product-turntable"] = new Promise(function (resolve) {+ scene.ready = resolve;+ });++ var tl = gsap.timeline({ paused: true });+ tl.to(clock, {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ if (scene.render) scene.render(clock.t);+ },+ });+ window.__timelines = window.__timelines || {};+ window.__timelines["product-turntable"] = tl;+ })();+ </script>++ <script type="module">+ import * as THREE from "https://cdn.jsdelivr.net/npm/[email protected]/+esm";+ import { RoomEnvironment } from "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/environments/RoomEnvironment.js/+esm";+ import { GLTFLoader } from "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/loaders/GLTFLoader.js/+esm";++ const host = window.__productTurntable;+ const V = host.vars;+ const hex = (v, fallback) => (/^#[0-9a-f]{6}$/i.test(String(v)) ? String(v) : fallback);+ const turns = Math.max(1, Math.min(4, Math.round(Number(V.turns) || 1)));++ const renderer = new THREE.WebGLRenderer({+ canvas: document.getElementById("pt-canvas"),+ antialias: true,+ alpha: true,+ preserveDrawingBuffer: true,+ });+ renderer.setPixelRatio(1);+ renderer.setSize(1920, 1080, false);+ renderer.outputColorSpace = THREE.SRGBColorSpace;+ renderer.toneMapping = THREE.ACESFilmicToneMapping;+ renderer.toneMappingExposure = 1.3;++ const scene = new THREE.Scene();+ const pmrem = new THREE.PMREMGenerator(renderer);+ // Studio: two tall softbox strips (key 35 deg left, rim 120 deg right at 1.6x) over a dimmed room fill.+ const studio = new THREE.Scene();+ const room = new RoomEnvironment();+ room.traverse((o) => {+ if (o.isLight) o.intensity *= 0.3;+ if (o.material && o.material.emissiveIntensity) o.material.emissiveIntensity *= 0.3;+ });+ studio.add(room);+ for (const [deg, intensity] of [+ [-35, 5],+ [120, 8],+ ]) {+ const strip = new THREE.Mesh(+ new THREE.PlaneGeometry(1.2, 8),+ new THREE.MeshLambertMaterial({+ color: 0x000000,+ emissive: 0xffffff,+ emissiveIntensity: intensity,+ side: THREE.DoubleSide,+ }),+ );+ const a = THREE.MathUtils.degToRad(deg);+ strip.position.set(6 * Math.sin(a), 1, 6 * Math.cos(a));+ strip.lookAt(0, 1, 0);+ studio.add(strip);+ }+ scene.environment = pmrem.fromScene(studio, 0.02).texture;++ // Can and plinth vertically centred, about 140 px clear above and below.+ const camera = new THREE.PerspectiveCamera(24, 1920 / 1080, 0.1, 100);+ camera.position.set(0, 2.1, 9.4);+ camera.lookAt(0, 0.9, 0);++ const key = new THREE.DirectionalLight(0xffffff, 1.6);+ key.position.set(-3.5, 5, 4);+ scene.add(key);+ const rim = new THREE.DirectionalLight(0xfff1dc, 2.2);+ rim.position.set(4, 3, -4);+ scene.add(rim);++ // Plinth with a soft baked contact shadow: no shadow maps, no per-frame cost.+ const plinth = new THREE.Mesh(+ new THREE.CylinderGeometry(1.42, 1.46, 0.2, 96),+ new THREE.MeshStandardMaterial({ color: 0xf4f1ec, roughness: 0.55, metalness: 0 }),+ );+ plinth.position.y = -0.1;+ scene.add(plinth);++ function radialTexture(inner, outer) {+ const c = document.createElement("canvas");+ c.width = c.height = 256;+ const g = c.getContext("2d");+ const grad = g.createRadialGradient(128, 128, 0, 128, 128, 128);+ grad.addColorStop(0, inner);+ grad.addColorStop(1, outer);+ g.fillStyle = grad;+ g.fillRect(0, 0, 256, 256);+ const tex = new THREE.CanvasTexture(c);+ tex.colorSpace = THREE.SRGBColorSpace;+ return tex;+ }+ const shadow = new THREE.Mesh(+ new THREE.PlaneGeometry(2.4, 2.4),+ new THREE.MeshBasicMaterial({+ map: radialTexture("rgba(0,0,0,0.55)", "rgba(0,0,0,0)"),+ transparent: true,+ depthWrite: false,+ }),+ );+ shadow.rotation.x = -Math.PI / 2;+ shadow.position.y = 0.002;+ scene.add(shadow);++ const turntable = new THREE.Group();+ scene.add(turntable);++ async function labelTexture() {+ try {+ const face = new FontFace(+ "PT Inter",+ "url(https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-800-normal.woff2)",+ { weight: "800" },+ );+ document.fonts.add(await face.load());+ } catch (error) {+ console.error("[product-turntable] label font failed to load, using system sans", error);+ }+ const c = document.createElement("canvas");+ // 2.35:1 matches the label's circumference to height, so type is not stretched.+ c.width = 2048;+ c.height = 872;+ const g = c.getContext("2d");+ const label = hex(V.label_color, "#f2c230");+ const ink = hex(V.ink_color, "#1d2a24");+ g.fillStyle = label;+ g.fillRect(0, 0, 2048, 872);+ g.fillStyle = ink;+ g.fillRect(0, 70, 2048, 12);+ g.fillRect(0, 790, 2048, 12);+ const name = String(V.product_name || "YUZU").toUpperCase();+ const flavor = String(V.flavor || "").toUpperCase();+ // Two faces, front and back, so the wordmark reads twice per revolution.+ for (const cx of [512, 1536]) {+ g.save();+ g.textAlign = "center";+ g.textBaseline = "middle";+ let size = 280;+ g.font = `800 ${size}px "PT Inter", system-ui, sans-serif`;+ while (g.measureText(name).width > 600 && size > 80) {+ size -= 10;+ g.font = `800 ${size}px "PT Inter", system-ui, sans-serif`;+ }+ g.fillText(name, cx, 400);+ g.font = `800 50px "PT Inter", system-ui, sans-serif`;+ g.globalAlpha = 0.8;+ g.fillText(flavor, cx, 590, 540);+ g.restore();+ }+ g.save();+ g.textAlign = "center";+ g.font = `800 34px "PT Inter", system-ui, sans-serif`;+ g.globalAlpha = 0.7;+ for (const cx of [0, 1024, 2048]) g.fillText("355 ML", cx, 450);+ g.restore();+ const tex = new THREE.CanvasTexture(c);+ tex.colorSpace = THREE.SRGBColorSpace;+ tex.anisotropy = renderer.capabilities.getMaxAnisotropy();+ return tex;+ }++ async function builtInCan() {+ const can = new THREE.Group();+ const metal = new THREE.MeshStandardMaterial({+ color: 0xd4d7dc,+ metalness: 1,+ roughness: 0.24,+ });+ // Lathe profile (radius, height): domed base, straight wall, necked shoulder, rolled lip.+ const profile = [+ [0.0, 0.1],+ [0.46, 0.06],+ [0.6, 0.0],+ [0.66, 0.06],+ [0.67, 0.16],+ [0.67, 2.02],+ [0.63, 2.14],+ [0.56, 2.24],+ [0.555, 2.29],+ [0.575, 2.31],+ [0.56, 2.33],+ [0.5, 2.3],+ [0.0, 2.27],+ ].map(([x, y]) => new THREE.Vector2(x, y));+ can.add(new THREE.Mesh(new THREE.LatheGeometry(profile, 128), metal));+ const labelMat = new THREE.MeshPhysicalMaterial({+ map: await labelTexture(),+ metalness: 0.45,+ roughness: 0.32,+ clearcoat: 1,+ clearcoatRoughness: 0.12,+ });+ const label = new THREE.Mesh(+ new THREE.CylinderGeometry(0.674, 0.674, 1.8, 128, 1, true),+ labelMat,+ );+ label.position.y = 1.1;+ can.add(label);+ // Pull tab: a thin rounded plate on the lid.+ const tab = new THREE.Mesh(new THREE.CapsuleGeometry(0.07, 0.22, 4, 12), metal);+ tab.rotation.set(Math.PI / 2, 0, Math.PI / 2);+ tab.scale.set(1, 1, 0.25);+ tab.position.set(0.1, 2.285, 0);+ can.add(tab);+ return can;+ }++ function fitModel(object) {+ const box = new THREE.Box3().setFromObject(object);+ const size = box.getSize(new THREE.Vector3());+ const center = box.getCenter(new THREE.Vector3());+ const scale = Math.min(2.3 / size.y, 2.6 / Math.max(size.x, size.z));+ object.scale.setScalar(scale);+ object.position.set(-center.x * scale, -box.min.y * scale, -center.z * scale);+ const wrapper = new THREE.Group();+ wrapper.add(object);+ return wrapper;+ }++ // A model_url that fails to load fails the render; it never swaps in a different product.+ async function product() {+ const url = String(V.model_url || "").trim();+ if (!url) return builtInCan();+ const gltf = await new GLTFLoader().loadAsync(url);+ return fitModel(gltf.scene);+ }++ turntable.add(await product());++ host.render = (t) => {+ turntable.rotation.y = (t / host.duration) * turns * Math.PI * 2;+ renderer.render(scene, camera);+ };+ host.render(host.clock.t);+ host.ready();+ </script>+ </body>+</html>diff --git a/registry/blocks/product-turntable/registry-item.json b/registry/blocks/product-turntable/registry-item.jsonnew file mode 100644index 0000000000..7197766519--- /dev/null+++ b/registry/blocks/product-turntable/registry-item.json@@ -0,0 +1,20 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "product-turntable",+ "type": "hyperframes:block",+ "title": "Product Turntable",+ "description": "A product turns a full revolution on a studio plinth in a seamless loop. Drop in a GLB or glTF model, or keep the built-in drink can with your own label.",+ "tags": ["3d-object", "three-js", "webgl", "product", "turntable", "glb", "loop"],+ "dimensions": {+ "width": 1920,+ "height": 1080+ },+ "duration": 6,+ "files": [+ {+ "path": "product-turntable.html",+ "target": "compositions/product-turntable.html",+ "type": "hyperframes:composition"+ }+ ]+}diff --git a/registry/blocks/snow/demo.html b/registry/blocks/snow/demo.htmlnew file mode 100644index 0000000000..398e595381--- /dev/null+++ b/registry/blocks/snow/demo.html@@ -0,0 +1,166 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }++ html,+ body,+ #snow-demo {+ width: 1920px;+ height: 1080px;+ margin: 0;+ overflow: hidden;+ }++ #snow-demo-backdrop,+ #snow-demo-overlay {+ position: absolute;+ inset: 0;+ }++ #snow-demo-backdrop {+ background: linear-gradient(+ 180deg,+ #252f3c 0%,+ #2f3b4b 35%,+ #455367 60%,+ #63728a 72%,+ #7a8aa0 78%+ );+ }++ #snow-demo-backdrop svg {+ position: absolute;+ inset: 0;+ }++ #snow-demo-title {+ position: absolute;+ inset: 0;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 22px;+ color: #fff;+ font-family: Inter, system-ui, sans-serif;+ text-align: center;+ }++ #snow-demo-title h1 {+ margin: 0;+ font-size: 128px;+ font-weight: 600;+ letter-spacing: -0.03em;+ line-height: 1;+ }++ #snow-demo-title p {+ margin: 0;+ font-size: 36px;+ font-weight: 400;+ color: rgba(255, 255, 255, 0.78);+ }+ </style>+ </head>+ <body>+ <div+ id="snow-demo"+ data-composition-id="snow-demo"+ data-start="0"+ data-duration="6"+ data-width="1920"+ data-height="1080"+ >+ <div+ id="snow-demo-backdrop"+ class="clip"+ data-start="0"+ data-duration="6"+ data-track-index="0"+ >+ <svg viewBox="0 0 1920 1080" preserveAspectRatio="none" aria-hidden="true">+ <path+ fill="#8394aa"+ d="M0 830 L140 770 L260 798 L420 702 L520 746 L640 676 L790 760 L900 734 L1040 660 L1180 738 L1300 710 L1450 770 L1580 696 L1720 754 L1840 722 L1920 746 L1920 1080 L0 1080 Z"+ />+ <path+ fill="#4f5e73"+ d="M0 840 L180 792 L330 826 L520 770 L700 830 L880 788 L1060 840 L1240 782 L1420 826 L1600 776 L1780 820 L1920 798 L1920 1080 L0 1080 Z"+ />+ <path id="snow-demo-trees-far" fill="#1b2532" />+ <path id="snow-demo-trees-near" fill="#0c1118" />+ </svg>+ <div id="snow-demo-title">+ <h1>Winter release</h1>+ <p>Offline sync, shared folders and a faster search.</p>+ </div>+ </div>+ <div+ id="snow-demo-overlay"+ data-composition-id="snow"+ data-composition-src="snow.html"+ data-variable-values='{"density":"dense"}'+ data-start="0"+ data-duration="6"+ data-track-index="1"+ data-width="1920"+ data-height="1080"+ ></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};++ // Seeded pine treelines: same silhouette on every load.+ (function () {+ function rnd(n) {+ var x = Math.sin(n * 127.1 + 311.7) * 43758.5453;+ return x - Math.floor(x);+ }+ function pine(x, base, h) {+ var w = h * 0.3;+ var tiers = [+ [0, 1],+ [0.45, 0.62],+ [0.25, 0.62],+ [0.75, 0.3],+ [0.5, 0.3],+ [1, 0],+ ];+ var right = tiers.map(function (t) {+ return x + w * t[0] + " " + (base - h * t[1]);+ });+ var left = tiers+ .slice(1)+ .reverse()+ .map(function (t) {+ return x - w * t[0] + " " + (base - h * t[1]);+ });+ return "M" + right.concat(left).join(" L") + " Z";+ }+ function row(id, base, minH, maxH, step, seed) {+ var d = "M0 " + base + " L1920 " + base + " L1920 1080 L0 1080 Z";+ for (var x = -20, i = 0; x < 1960; i++) {+ d += pine(x, base + rnd(seed + i) * 14, minH + rnd(seed + i + 500) * (maxH - minH));+ x += step * (0.6 + rnd(seed + i + 900) * 0.8);+ }+ document.getElementById(id).setAttribute("d", d);+ }+ row("snow-demo-trees-far", 842, 46, 96, 30, 11);+ row("snow-demo-trees-near", 1010, 130, 280, 70, 71);+ })();++ var tl = gsap.timeline({ paused: true });+ tl.to({}, { duration: 6, ease: "none" }, 0);+ window.__timelines["snow-demo"] = tl;+ </script>+ </body>+</html>diff --git a/registry/blocks/snow/registry-item.json b/registry/blocks/snow/registry-item.jsonnew file mode 100644index 0000000000..2a2e1475ff--- /dev/null+++ b/registry/blocks/snow/registry-item.json@@ -0,0 +1,60 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "snow",+ "type": "hyperframes:block",+ "title": "Snow",+ "description": "Seek-safe falling-snow overlay: sparse or dense flakes drift down with size, speed and opacity correlated per flake for depth, radial-masked so the frame center stays clear",+ "tags": [+ "snow",+ "snowfall",+ "winter",+ "weather",+ "overlay",+ "ambient",+ "particles",+ "media-treatment-overlay",+ "loopable"+ ],+ "dimensions": {+ "width": 1920,+ "height": 1080+ },+ "duration": 6,+ "variables": [+ {+ "id": "density",+ "type": "enum",+ "role": "style",+ "label": "Density",+ "description": "Flake count across the frame.",+ "default": "sparse",+ "options": [+ { "value": "sparse", "label": "Sparse" },+ { "value": "dense", "label": "Dense" }+ ]+ },+ {+ "id": "speed",+ "type": "enum",+ "role": "style",+ "label": "Fall speed",+ "description": "How fast flakes fall and sway.",+ "default": "calm",+ "options": [+ { "value": "calm", "label": "Calm" },+ { "value": "gust", "label": "Gust" }+ ]+ }+ ],+ "files": [+ {+ "path": "snow.html",+ "target": "compositions/snow.html",+ "type": "hyperframes:composition"+ }+ ],+ "preview": {+ "poster": "https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/snow.png",+ "video": "https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/snow.mp4"+ }+}diff --git a/registry/blocks/snow/snow.html b/registry/blocks/snow/snow.htmlnew file mode 100644index 0000000000..7de7bf0d92--- /dev/null+++ b/registry/blocks/snow/snow.html@@ -0,0 +1,204 @@+<!doctype html>+<!--+ snow: HyperFrames video primitive (backgrounds / ambient overlay)++ Concept: snowflakes fall from top to bottom in a continuous seamless loop, drifting+ side to side, meant to sit on a track above real footage rather than as an opaque+ background. Each flake draws one depth value that sets size and opacity+ and buckets it into one of three fall-speed layers (near/mid/far); the loop invariant+ already forces fall speed to an integer number of cycles per mount, so three+ deliberately distinct per-layer counts keep near/far separation even on a short mount.+ A radial mask keeps the frame center clear for a subject or caption underneath.++ Variables:+ - density (sparse | dense, default sparse): flake count across the frame.+ - speed (calm | gust, default calm): how fast flakes fall and sway.++ Envelope: IN = 0, HOLD = the full elastic duration (the host clip's data-duration), OUT = 0.+ Each flake runs its own whole number of fall cycles (and, separately, sway cycles)+ during HOLD, so a longer mount adds more falls instead of stretching a single one thin.++ Loop invariant: a flake's vertical position is frac(integer * phase + const) and its+ sway is sin(2*PI * integer * phase + const), so phase = 0 and phase = 1 (t = 0 and+ t = duration) always match exactly.++ Sound: none.++ Mount contract: the runtime clones only this file's body. The root has no data-width or+ data-height requirement beyond the block's own declared dimensions, and registers one+ paused timeline under the hardcoded snow id.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }++ html,+ body {+ width: 1920px;+ height: 1080px;+ margin: 0;+ overflow: hidden;+ background: transparent;+ }++ #hf-snow {+ position: absolute;+ inset: 0;+ overflow: hidden;+ pointer-events: none;+ /* Center clearance: a subject placed mid-frame stays readable by default. */+ -webkit-mask-image: radial-gradient(+ circle 230px at 50% 50%,+ transparent 0 230px,+ #000 653px+ );+ mask-image: radial-gradient(circle 230px at 50% 50%, transparent 0 230px, #000 653px);+ }++ #hf-snow .hf-flake {+ position: absolute;+ top: 0;+ left: 0;+ border-radius: 50%;+ background: #fff;+ will-change: transform;+ }+ </style>+ </head>+ <body>+ <div+ id="snow"+ data-composition-id="snow"+ data-start="0"+ data-duration="6"+ data-width="1920"+ data-height="1080"+ data-composition-variables='[+ { "id": "density", "type": "enum", "role": "style", "label": "Density", "description": "Flake count across the frame.", "default": "sparse", "options": [{ "value": "sparse", "label": "Sparse" }, { "value": "dense", "label": "Dense" }] },+ { "id": "speed", "type": "enum", "role": "style", "label": "Fall speed", "description": "How fast flakes fall and sway.", "default": "calm", "options": [{ "value": "calm", "label": "Calm" }, { "value": "gust", "label": "Gust" }] }+ ]'+ >+ <div id="hf-snow" aria-hidden="true" data-layout-allow-overflow=""></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};++ (function () {+ var field = document.getElementById("hf-snow");+ // Mounted, the runtime strips data-duration off this file's root; the host clip carries it.+ var host = field.closest("[data-composition-id]");+ var vars =+ window.__hyperframes && window.__hyperframes.getVariables+ ? window.__hyperframes.getVariables()+ : {};++ // The host's data-width/data-height are authoritative over this file's own root+ // (compositionLoader.ts) — read them instead of a third hardcoded 1920x1080.+ var W = Number(host.getAttribute("data-width")) || 1920;+ var H = Number(host.getAttribute("data-height")) || 1080;+ var duration = Number(host.getAttribute("data-duration")) || 6;++ var COUNT = vars.density === "dense" ? 280 : 120;+ var fallSeconds = vars.speed === "gust" ? 2.2 : 4.5;+ var swaySeconds = vars.speed === "gust" ? 2.2 : 4;++ // Even 2D coverage with no clumping and no seed to store (Weyl low-discrepancy+ // sequence): successive multiples of an irrational constant, taken mod 1.+ var PHI = 0.6180339887498949; // (sqrt(5) - 1) / 2+ var RT2 = 0.4142135623730951; // sqrt(2) - 1++ function frac(x) {+ return x - Math.floor(x);+ }++ // Deterministic per-index hash (sin fold; no Math.random) for scalars that only+ // need decorrelation, not even coverage. registry/components/stop-motion-cadence's+ // rnd(n).+ function rnd(n) {+ var x = Math.sin(n * 127.1 + 311.7) * 43758.5453;+ return x - Math.floor(x);+ }++ var TAU = 2 * Math.PI;++ // A whole number of cycles over the mount for a given per-cycle duration; the+ // loop invariant forces this to round to an integer, so callers that need distinct+ // speeds must space their inputs, not just their multipliers (rounding a sub-1+ // product always collapses to 1 on a short mount).+ function wholeCycles(cycleSeconds) {+ return Math.max(1, Math.round(duration / cycleSeconds));+ }++ // Flakes enter above the top edge and exit below the bottom before wrapping, so the+ // loop seam never pops one into view mid-frame. It must clear the largest flake's+ // radius plus its blur (9px + 4px at 1080 tall); a correctness bound, not taste.+ var WRAP_MARGIN = 0.02;++ var fallBase = wholeCycles(fallSeconds);+ var swayBase = wholeCycles(swaySeconds);++ var flakes = [];+ var fragment = document.createDocumentFragment();+ for (var i = 0; i < COUNT; i++) {+ var laneX = frac(i * PHI + 0.07);+ // One depth draw drives size and opacity, and buckets the flake into+ // one of three fall-speed layers (far/mid/near). Layer cycle counts are offsets+ // from the shared base, not products of it, so they stay distinct on any mount.+ var depth = rnd(i);+ var sizePx = 2 + depth * depth * 16;+ // The nearest flakes sit in front of the focal plane: large, soft and half see-through.+ var bokeh = depth > 0.85;+ var opacity = bokeh ? 0.5 : 0.35 + depth * 0.55;+ var layer = depth < 1 / 3 ? 0 : depth < 2 / 3 ? 1 : 2;++ var el = document.createElement("div");+ el.className = "hf-flake";+ el.style.width = sizePx + "px";+ el.style.height = sizePx + "px";+ el.style.opacity = opacity;+ if (bokeh) el.style.filter = "blur(2px)";+ fragment.appendChild(el);++ flakes.push({+ el: el,+ laneX: laneX,+ fallCycles: fallBase + layer,+ fallPhi: frac(i * RT2 + 0.37),+ swayPx: 6 + depth * 24,+ swayCycles: swayBase + Math.round(rnd(i + 5000) * 2),+ swayPhi: TAU * rnd(i + 3000),+ });+ }+ field.appendChild(fragment);++ var state = { phase: 0 };++ function render() {+ var p = state.phase;+ for (var s = 0; s < flakes.length; s++) {+ var f = flakes[s];+ var yFrac = frac(f.fallCycles * p + f.fallPhi);+ var y = (-WRAP_MARGIN + yFrac * (1 + 2 * WRAP_MARGIN)) * H;+ var x = f.laneX * W + f.swayPx * Math.sin(TAU * f.swayCycles * p + f.swayPhi);+ f.el.style.transform =+ "translate(" + Math.round(x) + "px, " + Math.round(y) + "px) translate(-50%, -50%)";+ }+ }++ var tl = gsap.timeline({ paused: true });+ tl.to(state, { phase: 1, duration: duration, ease: "none", onUpdate: render }, 0);+ render();++ window.__timelines["snow"] = tl;+ })();+ </script>+ </body>+</html>diff --git a/registry/blocks/starfield/demo.html b/registry/blocks/starfield/demo.htmlnew file mode 100644index 0000000000..d234ddc89f--- /dev/null+++ b/registry/blocks/starfield/demo.html@@ -0,0 +1,118 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }++ html,+ body,+ #starfield-demo {+ width: 1920px;+ height: 1080px;+ margin: 0;+ overflow: hidden;+ }++ #starfield-demo-backdrop {+ position: absolute;+ inset: 0;+ background: #07080b;+ }++ #starfield-demo-title {+ position: absolute;+ inset: 0;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ font-family: Inter, system-ui, sans-serif;+ text-align: center;+ -webkit-font-smoothing: antialiased;+ }++ #starfield-demo-title h1 {+ margin: 0;+ font-size: 144px;+ font-weight: 600;+ letter-spacing: -0.04em;+ line-height: 1;+ color: #f4f4f5;+ }++ #starfield-demo-title p {+ margin: 24px 0 0;+ font-size: 40px;+ font-weight: 400;+ letter-spacing: -0.01em;+ color: #a1a1aa;+ }++ #starfield-demo-title time {+ margin-top: 40px;+ font-size: 24px;+ font-weight: 500;+ letter-spacing: 0.02em;+ color: #71717a;+ }++ #starfield-demo-overlay {+ position: absolute;+ inset: 0;+ }+ </style>+ </head>+ <body>+ <div+ id="starfield-demo"+ data-composition-id="starfield-demo"+ data-start="0"+ data-duration="6"+ data-width="1920"+ data-height="1080"+ >+ <div+ id="starfield-demo-backdrop"+ class="clip"+ data-start="0"+ data-duration="6"+ data-track-index="0"+ ></div>+ <div+ id="starfield-demo-title"+ class="clip"+ data-start="0"+ data-duration="6"+ data-track-index="1"+ >+ <h1>Northstar</h1>+ <p>Offline maps for the backcountry</p>+ <time datetime="2026-10-14">October 14, 2026</time>+ </div>+ <div+ id="starfield-demo-overlay"+ data-composition-id="starfield"+ data-composition-src="starfield.html"+ data-start="0"+ data-duration="6"+ data-track-index="2"+ data-variable-values='{"density":"dense"}'+ data-width="1920"+ data-height="1080"+ ></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};+ var tl = gsap.timeline({ paused: true });+ tl.to({}, { duration: 6, ease: "none" }, 0);+ window.__timelines["starfield-demo"] = tl;+ </script>+ </body>+</html>diff --git a/registry/blocks/starfield/registry-item.json b/registry/blocks/starfield/registry-item.jsonnew file mode 100644index 0000000000..1e382a96c9--- /dev/null+++ b/registry/blocks/starfield/registry-item.json@@ -0,0 +1,75 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "starfield",+ "type": "hyperframes:block",+ "title": "Starfield",+ "description": "Seek-safe night-sky overlay: sparse or dense stars in three size tiers that twinkle and drift in two parallax layers, radial-masked to keep the frame center clear",+ "tags": [+ "starfield",+ "night-sky",+ "stars",+ "twinkle",+ "sky",+ "weather",+ "overlay",+ "ambient",+ "particles",+ "media-treatment-overlay",+ "loopable"+ ],+ "dimensions": {+ "width": 1920,+ "height": 1080+ },+ "duration": 6,+ "variables": [+ {+ "id": "density",+ "type": "enum",+ "role": "style",+ "label": "Density",+ "description": "Star count across the frame.",+ "default": "sparse",+ "options": [+ { "value": "sparse", "label": "Sparse" },+ { "value": "dense", "label": "Dense" }+ ]+ },+ {+ "id": "tone",+ "type": "enum",+ "role": "style",+ "label": "Tone",+ "description": "Star color mix.",+ "default": "warm",+ "options": [+ { "value": "warm", "label": "Warm (white + yellow)" },+ { "value": "cool", "label": "Cool (white + blue)" },+ { "value": "white", "label": "White only" }+ ]+ },+ {+ "id": "speed",+ "type": "enum",+ "role": "style",+ "label": "Twinkle speed",+ "description": "How fast stars pulse.",+ "default": "slow",+ "options": [+ { "value": "slow", "label": "Slow" },+ { "value": "fast", "label": "Fast" }+ ]+ }+ ],+ "files": [+ {+ "path": "starfield.html",+ "target": "compositions/starfield.html",+ "type": "hyperframes:composition"+ }+ ],+ "preview": {+ "poster": "https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/starfield.png",+ "video": "https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/starfield.mp4"+ }+}diff --git a/registry/blocks/starfield/starfield.html b/registry/blocks/starfield/starfield.htmlnew file mode 100644index 0000000000..11ed70fb7d--- /dev/null+++ b/registry/blocks/starfield/starfield.html@@ -0,0 +1,187 @@+<!doctype html>+<!--+ starfield: HyperFrames video primitive (backgrounds / ambient overlay)++ Concept: a night sky of seeded stars in three size tiers, twinkling and drifting sideways+ in two parallax layers over a transparent field, meant to sit+ on a track above real footage rather than as an opaque background. A radial mask keeps+ the frame center clear for a subject or caption underneath.++ Variables:+ - density (sparse | dense, default sparse): star count across the frame.+ - tone (warm | cool | white, default warm): star color mix.+ - speed (slow | fast, default slow): how fast stars pulse.++ Envelope: IN = 0, HOLD = the full elastic duration (the host clip's data-duration), OUT = 0.+ Each star runs its own whole number of sine cycles during HOLD, so a longer mount adds+ more twinkle cycles instead of stretching a single one thin.++ Loop invariant: twinkle is sin(2*PI * integer * phase + const) and each star drifts once per+ mount, fading out at the end of its drift and back in at its start, so phase = 0 and+ phase = 1 (t = 0 and t = duration) always match exactly.++ Sound: none.++ Mount contract: the runtime clones only this file's body. The root has no data-width or+ data-height requirement beyond the block's own declared dimensions, and registers one+ paused timeline under the hardcoded starfield id.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }++ html,+ body {+ width: 1920px;+ height: 1080px;+ margin: 0;+ overflow: hidden;+ background: transparent;+ }++ #hf-starfield {+ position: absolute;+ inset: 0;+ overflow: hidden;+ pointer-events: none;+ /* Center clearance: a subject placed mid-frame stays readable by default. */+ -webkit-mask-image: radial-gradient(+ circle 230px at 50% 50%,+ transparent 0 230px,+ #000 653px+ );+ mask-image: radial-gradient(circle 230px at 50% 50%, transparent 0 230px, #000 653px);+ }++ #hf-starfield .hf-star {+ position: absolute;+ left: 0;+ top: 0;+ }+ </style>+ </head>+ <body>+ <div+ id="starfield"+ data-composition-id="starfield"+ data-start="0"+ data-duration="6"+ data-width="1920"+ data-height="1080"+ data-composition-variables='[+ { "id": "density", "type": "enum", "role": "style", "label": "Density", "description": "Star count across the frame.", "default": "sparse", "options": [{ "value": "sparse", "label": "Sparse" }, { "value": "dense", "label": "Dense" }] },+ { "id": "tone", "type": "enum", "role": "style", "label": "Tone", "description": "Star color mix.", "default": "warm", "options": [{ "value": "warm", "label": "Warm (white + yellow)" }, { "value": "cool", "label": "Cool (white + blue)" }, { "value": "white", "label": "White only" }] },+ { "id": "speed", "type": "enum", "role": "style", "label": "Twinkle speed", "description": "How fast stars pulse.", "default": "slow", "options": [{ "value": "slow", "label": "Slow" }, { "value": "fast", "label": "Fast" }] }+ ]'+ >+ <div id="hf-starfield" aria-hidden="true"></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};++ (function () {+ var field = document.getElementById("hf-starfield");+ // Mounted, the runtime strips data-duration off this file's root; the host clip carries it.+ var host = field.closest("[data-composition-id]");+ var vars =+ window.__hyperframes && window.__hyperframes.getVariables+ ? window.__hyperframes.getVariables()+ : {};++ var TONES = {+ warm: ["#fff7e0", "#ffe08a"],+ cool: ["#f2f8ff", "#a9d6ff"],+ white: ["#ffffff", "#ffffff"],+ };++ var COUNT = vars.density === "dense" ? 420 : 180;+ var palette = Object.prototype.hasOwnProperty.call(TONES, vars.tone)+ ? TONES[vars.tone]+ : TONES.warm;+ var cycleSeconds = vars.speed === "fast" ? 0.9 : 1.6;++ // Deterministic per-index hash (sin fold; no Math.random). registry/components/+ // stop-motion-cadence's rnd(n).+ function rnd(n) {+ var x = Math.sin(n * 127.1 + 311.7) * 43758.5453;+ return x - Math.floor(x);+ }++ var W = 1920;+ var H = 1080;+ var duration = Number(host.getAttribute("data-duration")) || 6;+ var TAU = 2 * Math.PI;+ var FADE = 0.12; // share of a star's drift spent fading in, and again fading out++ function smooth(x) {+ x = Math.min(1, Math.max(0, x / FADE));+ return x * x * (3 - 2 * x);+ }++ var stars = [];+ for (var i = 0; i < COUNT; i++) {+ // 70% faint 1 px far stars, 25% 1.6 px and 5% bright 2.6 px glowing near stars.+ var r = rnd(i + 7000);+ var tier = r < 0.7 ? 0 : r < 0.95 ? 1 : 2;+ var sizePx = [1, 1.6, 2.6][tier];+ var color = i % 3 === 0 ? palette[1] : palette[0];++ var el = document.createElement("div");+ el.className = "hf-star";+ el.style.width = sizePx + "px";+ el.style.height = sizePx + "px";+ el.style.background = color;+ if (tier === 2) {+ el.style.borderRadius = "50%";+ el.style.boxShadow = "0 0 3px 1px " + color + ", 0 0 8px 2px " + color + "80";+ }+ field.appendChild(el);++ // Whole cycles per star over the mount, drawn independently so the field as a+ // whole repeats only at t = duration, not every cycleSeconds.+ var cycles = Math.max(1, Math.round((duration / cycleSeconds) * (2 + rnd(i + 4000) * 2)));+ stars.push({+ el: el,+ x: rnd(i + 5000) * W - sizePx / 2,+ // Whole-pixel rows keep 1 px stars crisp; x stays fractional so drift is smooth.+ y: Math.round(rnd(i + 6000) * H - sizePx / 2),+ drift: (tier === 0 ? 2 : 5) * duration,+ lag: rnd(i + 8000),+ omega: TAU * cycles,+ phi: TAU * rnd(i + 1000),+ base: 0.75 + rnd(i + 2000) * 0.25,+ amp: tier === 2 ? 0.12 : 0.2 + rnd(i + 3000) * 0.2,+ });+ }++ var state = { phase: 0 };++ function render() {+ var p = state.phase;+ for (var s = 0; s < stars.length; s++) {+ var star = stars[s];+ var u = (p + star.lag) % 1;+ var twinkle = Math.min(1, star.base + star.amp * Math.sin(star.omega * p + star.phi));+ star.el.style.transform =+ "translate3d(" + (star.x - star.drift * (u - 0.5)) + "px," + star.y + "px,0)";+ star.el.style.opacity = twinkle * smooth(u) * smooth(1 - u);+ }+ }++ var tl = gsap.timeline({ paused: true });+ tl.to(state, { phase: 1, duration: duration, ease: "none", onUpdate: render }, 0);+ render();++ window.__timelines["starfield"] = tl;+ })();+ </script>+ </body>+</html>diff --git a/registry/blocks/transitions-dissolve/registry-item.json b/registry/blocks/transitions-dissolve/registry-item.jsonindex 9b529eff69..508c6c1870 100644--- a/registry/blocks/transitions-dissolve/registry-item.json+++ b/registry/blocks/transitions-dissolve/registry-item.json@@ -4,7 +4,7 @@"type": "hyperframes:block","title": "Dissolve Transitions","description": "Showcase of dissolve and fade transitions",- "tags": ["transition", "showcase"],+ "tags": ["transition", "showcase", "crossfade"],"dimensions": {"width": 1920,"height": 1080diff --git a/registry/components/CATALOG.md b/registry/components/CATALOG.mdindex 88d048eec0..0bf8845aa8 100644--- a/registry/components/CATALOG.md+++ b/registry/components/CATALOG.md@@ -45,20 +45,20 @@ variables: prefix (string, default "Ship"): fixed text before the slot. options### oversized-cursorgroup: Product demo.-what: A deliberately oversized macOS-style pointer enters off-screen, glides to a target, clicks to visibly ignite it, then accelerates back off-screen.+what: The look-here pointer: the macOS arrow at 3.5x its normal size enters from the frame edge, lands its tip on one control, clicks it on, settles just below it so the result stays in view, then exits off-screen.use_when: The scene needs a personified "someone clicks the thing and it works" beat with theatrical scale.-avoid_when: The click target is your own slotted UI or the pressed state must persist; use press-ripple, which presses a slot and holds it.+avoid_when: A normal-size cursor should press your own slotted button and confirm it; use press-ripple.pairs_with: browser-device-stage, cut-the-curve.variables: cursor_variant (enum light or dark, default light): pointer body tone. target_x (number percent, default 55) and target_y (number percent, default 55): tip landing point. click_label (string, default "Generate"): label on the clicked pill. exit (enum none, fade, up, default none): fade and up also depart the ignited target.### press-ripplegroup: Product demo.-what: A cursor decel-arrives from off-stage, lands slightly off-center on a caller-positioned target, compresses with it in lockstep, releases with ink ripple rings, and holds the pressed state.+what: A cursor decel-arrives from off-stage, lands slightly off-center on a caller-positioned target, compresses with it in lockstep, releases with two small click rings at the tip while the label swaps to a check, then exits while the confirmed state holds.use_when: The payoff beat: the user presses the button and the film rests on that satisfied pressed state.-avoid_when: The cursor itself is the star or must leave after the click; use oversized-cursor for the enter-click-exit arc.+avoid_when: The pointer itself should be the look-here star at theatrical scale; use oversized-cursor.pairs_with: browser-device-stage, cta-close.-variables: label (string, default "Get started"): text in the default pill; ignored when the target slot is replaced. target_x (number percent, default 50) and target_y (number percent, default 50): zone center. press_at (number seconds, default 1.4): press cue. cursor (enum light or dark, default light): pointer tone. accent (enum green, blue, violet, default green): ripple ink and pressed fill. exit (enum none, fade, up, default none).+variables: label (string, default "Get started"): text in the default pill; ignored when the target slot is replaced. target_x (number percent, default 50) and target_y (number percent, default 50): zone center. done_label (string, default "Saved"): label after the press. press_at (number seconds, default 0.9): press cue. cursor (enum light or dark, default light): pointer tone. accent (enum green, blue, violet, default green): click rings and the confirmation check. exit (enum none, fade, up, default none).### browser-device-stagediff --git a/registry/components/agent-cursor/agent-cursor.html b/registry/components/agent-cursor/agent-cursor.htmlnew file mode 100644index 0000000000..42aaa54ab8--- /dev/null+++ b/registry/components/agent-cursor/agent-cursor.html@@ -0,0 +1,398 @@+<!doctype html>+<!--+ Agent Cursor (actor primitive), mountable sub-composition++ concept: an AI agent operating a UI. The cursor carries an accent name label that types+ out what the agent is doing, then the cursor moves to each target and clicks with a+ small ring. The label slides to the tip's left on the right of the frame. The last step shows a check.++ mount contract: loaded by a host through data-composition-src; only <template> is+ cloned. #root fills the host clip (inset:0). See demo.html.++ variables:+ agent_name (string) the name on the tag+ steps (string) comma-separated: a reading line, one line per target, a done line+ targets (string) semicolon-separated "x,y" click points in % of the host box+ accent (color) label fill and click ring color++ envelope (default 4.8s, two targets): enter and read 0-0.95s, then per target 1.35s+ (type 0.35s, move 0.5s, dwell 0.2s, click), done line, exit in the last 0.5s.+-->+<html+ lang="en"+ data-composition-id="agent-cursor"+ data-composition-duration="4.8"+ data-composition-variables='[+ { "id": "agent_name", "type": "string", "role": "content", "label": "Agent name", "default": "Agent" },+ { "id": "steps", "type": "string", "role": "content", "label": "Status steps", "description": "Comma-separated: a reading line, one line per target, then a done line.", "default": "Reading the page,Opening Settings,Turning on backups,Done" },+ { "id": "targets", "type": "string", "role": "layout", "label": "Click targets", "description": "Semicolon-separated x,y points in percent of the frame.", "default": "25,47;76,30" },+ { "id": "accent", "type": "color", "role": "style", "label": "Accent", "default": "#0a84ff" }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Agent Cursor</title>+ </head>+ <body>+ <template>+ <style>+ #root {+ position: absolute;+ inset: 0;+ overflow: hidden;+ isolation: isolate;+ pointer-events: none;+ container-type: size;+ font-family: var(--font-body, Inter, system-ui, sans-serif);+ --ag-accent: #0a84ff;+ }+ .ag-actor {+ position: absolute;+ left: 0;+ top: 0;+ width: 0;+ height: 0;+ }+ .ag-arrow {+ position: absolute;+ overflow: visible;+ transform-origin: 20.833% 12.5%;+ filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));+ }+ .ag-arrow path {+ fill: #ffffff;+ stroke: #141414;+ stroke-width: 1.4;+ stroke-linejoin: round;+ }+ .ag-ring {+ position: absolute;+ left: 0;+ top: 0;+ box-sizing: border-box;+ border-radius: 50%;+ border: 1.5px solid var(--ag-accent);+ opacity: 0;+ }+ .ag-tag {+ position: absolute;+ left: 0;+ top: 0;+ display: flex;+ align-items: center;+ gap: 0.5cqw;+ padding: 0.45cqw 0.75cqw 0.45cqw 0.6cqw;+ border-radius: 0.3cqw;+ background: var(--ag-accent);+ box-shadow: 0 0.2cqw 0.5cqw rgba(0, 0, 0, 0.22);+ font-size: 1.15cqw;+ line-height: 1.2;+ white-space: nowrap;+ }+ .ag-mark {+ position: relative;+ width: 1cqw;+ height: 1cqw;+ flex: none;+ }+ .ag-dot,+ .ag-check {+ position: absolute;+ inset: 0;+ border-radius: 50%;+ background: #fff;+ }+ .ag-check {+ opacity: 0;+ }+ .ag-check svg {+ position: absolute;+ inset: 18%;+ fill: none;+ stroke: var(--ag-accent);+ stroke-width: 3.2;+ stroke-linecap: round;+ stroke-linejoin: round;+ }+ .ag-name {+ font-weight: 700;+ color: #fff;+ }+ .ag-sep {+ color: rgba(255, 255, 255, 0.6);+ }+ .ag-status {+ font-weight: 500;+ color: #fff;+ }+ </style>++ <div id="root" data-composition-id="agent-cursor" data-duration="4.8">+ <div class="ag-tag" id="ag-tag">+ <span class="ag-mark">+ <span class="ag-dot" id="ag-dot"></span>+ <span class="ag-check" id="ag-check">+ <svg viewBox="0 0 24 24"><path d="M5 12.5l4.5 4.5L19 7.5" /></svg>+ </span>+ </span>+ <span class="ag-name" id="ag-name"></span>+ <span class="ag-sep">·</span>+ <span class="ag-status" id="ag-status"></span>+ </div>+ <div class="ag-ring" id="ag-ring"></div>+ <div class="ag-actor" id="ag-actor">+ <svg class="ag-arrow" id="ag-arrow" viewBox="0 0 24 24" aria-hidden="true">+ <path d="M5 3 L5 19 L9 15 L12 22 L15 20.5 L11.5 14 L18 14 Z" />+ </svg>+ </div>+ </div>++ <script>+ (function () {+ "use strict";++ var html = document.documentElement;+ var root = document.getElementById("root");+ var actor = document.getElementById("ag-actor");+ var arrow = document.getElementById("ag-arrow");+ var ring = document.getElementById("ag-ring");+ var tag = document.getElementById("ag-tag");+ var statusEl = document.getElementById("ag-status");+ var dot = document.getElementById("ag-dot");+ var check = document.getElementById("ag-check");++ var DEFAULTS = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(+ function (variable) {+ DEFAULTS[variable.id] = variable.default;+ },+ );+ } catch (error) {+ /* malformed declaration falls back to the inline defaults below */+ }+ var scopedVariables = {};+ try {+ if (window.__hyperframes && typeof window.__hyperframes.getVariables === "function") {+ scopedVariables = window.__hyperframes.getVariables() || {};+ }+ } catch (error) {+ /* no scoped variables API in this context */+ }+ var vars = Object.assign({}, DEFAULTS, window.__hfVariables || {}, scopedVariables);++ // Hardcoded: the compositor rewrites the wrapper's attributes on mount.+ var compositionId = "agent-cursor";+ var duration = Math.max(+ 0.001,+ parseFloat(+ root.dataset.duration || html.getAttribute("data-composition-duration") || "4.8",+ ),+ );+ var W = root.clientWidth || 1920;+ var H = root.clientHeight || 1080;+ var ARROW = 64 * (W / 1920);+ arrow.style.width = arrow.style.height = ARROW + "px";+ arrow.style.left = (-5 / 24) * ARROW + "px";+ arrow.style.top = (-3 / 24) * ARROW + "px";+ var accent = /^#[0-9a-f]{3,8}$/i.test(String(vars.accent)) ? vars.accent : "#0a84ff";+ root.style.setProperty("--ag-accent", accent);+ document.getElementById("ag-name").textContent = String(vars.agent_name || "Agent");++ var steps = String(vars.steps || "")+ .split(",")+ .map(function (s) {+ return s.trim();+ })+ .filter(Boolean);+ var targets = String(vars.targets || "")+ .split(";")+ .map(function (pair) {+ var xy = pair.split(",").map(Number);+ return { x: (xy[0] / 100) * W, y: (xy[1] / 100) * H };+ })+ .filter(function (p) {+ return isFinite(p.x) && isFinite(p.y);+ });+ if (!targets.length) targets = [{ x: 0.5 * W, y: 0.5 * H }];+ if (!steps.length) steps = ["Working"];+ function stepText(i) {+ return steps[Math.min(i, steps.length - 1)];+ }++ // Beats at the default duration; a shorter composition compresses them evenly.+ var BEAT = 1.35;+ var needed = 0.95 + targets.length * BEAT + 0.65 + 0.5;+ var k = Math.min(1, duration / needed);+ var T_ENTER = 0.55 * k;+ var T_READ_END = 0.95 * k;+ var beats = targets.map(function (p, i) {+ var type = T_READ_END + i * BEAT * k;+ var move = type + 0.35 * k;+ return { type: type, move: move, land: move + 0.5 * k, click: move + 0.7 * k, to: p };+ });+ var T_DONE = T_READ_END + targets.length * BEAT * k;+ var T_EXIT = Math.max(T_DONE + 0.4 * k, duration - 0.5 * k);++ var first = targets[0];+ var READ_A = { x: (0.5 * W + first.x) / 2 - 0.03 * W, y: (0.5 * H + first.y) / 2 };+ var READ_B = { x: READ_A.x + 0.06 * W, y: READ_A.y + 0.01 * H };+ var START = { x: 1.08 * W, y: 1.15 * H };+ var END = { x: 1.1 * W, y: 1.2 * H };++ function clamp01(u) {+ return u < 0 ? 0 : u > 1 ? 1 : u;+ }+ var enter = gsap.parseEase("power3.out");+ var reading = gsap.parseEase("sine.inOut");+ var swap = gsap.parseEase("power2.inOut");+ var fade = gsap.parseEase("power2.out");+ var leave = gsap.parseEase("power2.in");+ var pop = gsap.parseEase("back.out(2.4)");+ function lerp(a, b, u) {+ return { x: a.x + (b.x - a.x) * u, y: a.y + (b.y - a.y) * u };+ }+ function bent(a, b, u) {+ var p = lerp(a, b, u);+ var lift = Math.sin(Math.PI * u) * 0.12;+ return { x: p.x - (b.y - a.y) * lift, y: p.y + (b.x - a.x) * lift };+ }++ function positionAt(t) {+ if (t <= T_ENTER) return lerp(START, READ_A, enter(clamp01(t / T_ENTER)));+ if (t <= T_READ_END)+ return lerp(READ_A, READ_B, reading(clamp01((t - T_ENTER) / (T_READ_END - T_ENTER))));+ var from = READ_B;+ for (var i = 0; i < beats.length; i++) {+ var b = beats[i];+ if (t <= b.move) return from;+ if (t <= b.land) return bent(from, b.to, enter((t - b.move) / (b.land - b.move)));+ from = b.to;+ }+ if (t <= T_EXIT) return from;+ return lerp(from, END, leave(clamp01((t - T_EXIT) / (duration - T_EXIT))));+ }++ // 1 when the tag belongs left of the tip, judged at the pose the tip is heading to.+ function leftAt(t) {+ var at = Math.min(Math.max(t, T_ENTER), T_EXIT);+ beats.forEach(function (b) {+ if (at > b.move && at < b.land) at = b.land;+ });+ return positionAt(at).x > 0.6 * W ? 1 : 0;+ }+ // Averaging the side over the last 0.3 s turns each flip into a seek-safe slide.+ function flipAt(t) {+ var n = 0;+ for (var i = 0; i < 30; i++) n += leftAt(t - i * 0.01 * k);+ return swap(n / 30);+ }++ function statusAt(t) {+ var index = 0;+ var since = t;+ beats.forEach(function (b, i) {+ if (t >= b.type) {+ index = i + 1;+ since = t - b.type;+ }+ });+ if (t >= T_DONE) {+ index = beats.length + 1;+ since = t - T_DONE;+ }+ var text = stepText(index);+ var typeDur = Math.min(0.3, text.length * 0.022) * k;+ var shown = Math.floor(clamp01(since / typeDur) * text.length);+ return text.slice(0, Math.max(index === 0 ? 0 : 1, shown));+ }++ function press(t) {+ var depth = 0;+ beats.forEach(function (b) {+ var d = t - b.click;+ if (d >= 0 && d < 0.08 * k) depth = d / (0.08 * k);+ else if (d >= 0.08 * k && d < 0.26 * k) depth = 1 - (d - 0.08 * k) / (0.18 * k);+ });+ return 1 - 0.1 * depth;+ }++ function renderRing(t) {+ var opacity = 0;+ beats.forEach(function (b) {+ var u = (t - b.click) / (0.28 * k);+ if (u < 0 || u >= 1) return;+ var e = fade(u);+ var r = ((0.6 + 1.8 * e) * W) / 100;+ opacity = 1 - e;+ ring.style.width = ring.style.height = (2 * r).toFixed(2) + "px";+ ring.style.transform =+ "translate(" + (b.to.x - r).toFixed(2) + "px," + (b.to.y - r).toFixed(2) + "px)";+ });+ ring.style.opacity = opacity.toFixed(3);+ }++ function render(t) {+ var p = positionAt(t);+ var gone = t >= duration;+ actor.style.transform = "translate(" + p.x.toFixed(2) + "px," + p.y.toFixed(2) + "px)";+ arrow.style.transform = "scale(" + press(t).toFixed(3) + ")";+ renderRing(t);++ statusEl.textContent = statusAt(t);+ // Slide between below-right of the tip and left of it, kept inside the frame.+ var flip = flipAt(t);+ var w = tag.offsetWidth;+ var h = tag.offsetHeight;+ var m = 0.01 * W;+ var x = p.x + (1 - flip) * 0.016 * W - flip * (0.005 * W + w);+ var y = p.y + (0.021 - 0.013 * flip) * W;+ x = Math.min(Math.max(x, m), W - m - w);+ y = Math.min(Math.max(y, m), H - m - h);+ var scale = 0.9 + 0.1 * enter(clamp01((t - 0.15 * k) / (0.35 * k)));+ tag.style.transformOrigin = (flip * 100).toFixed(1) + "% 0";+ tag.style.transform =+ "translate(" ++ x.toFixed(2) ++ "px," ++ y.toFixed(2) ++ "px) scale(" ++ scale.toFixed(3) ++ ")";+ var leaving = clamp01((t - T_EXIT) / (0.25 * k));+ var shown = clamp01((t - 0.15 * k) / (0.2 * k)) * (1 - leaving);+ tag.style.opacity = gone ? "0" : shown.toFixed(3);++ var done = clamp01((t - T_DONE) / (0.3 * k));+ check.style.opacity = done.toFixed(3);+ check.style.transform = "scale(" + (0.5 + 0.5 * pop(done)).toFixed(3) + ")";+ dot.style.opacity = (1 - done).toFixed(3);+ // The live dot breathes on a 1.2 s period until the check replaces it.+ dot.style.transform =+ "scale(" + (0.875 + 0.125 * Math.cos((2 * Math.PI * t) / 1.2)).toFixed(3) + ")";+ actor.style.opacity = gone ? "0" : "1";+ }++ var clock = { t: 0 };+ var tl = gsap.timeline({ paused: true });+ tl.to(+ clock,+ {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ render(clock.t);+ },+ },+ 0,+ );+ render(0);+ tl.seek(0);+ window.__timelines = window.__timelines || {};+ window.__timelines[compositionId] = tl;+ })();+ </script>+ </template>+ </body>+</html>diff --git a/registry/components/agent-cursor/demo.html b/registry/components/agent-cursor/demo.htmlnew file mode 100644index 0000000000..1d1bd9239e--- /dev/null+++ b/registry/components/agent-cursor/demo.html@@ -0,0 +1,253 @@+<!doctype html>+<!--+ Agent Cursor, standalone demo: an agent opens Settings and turns on backups. It mounts+ agent-cursor.html full-frame over the app window; the window reacts on the cursor's+ click beats (2.0s and 3.35s).+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Agent Cursor, Demo</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ width: 100%;+ height: 100%;+ overflow: hidden;+ }+ #root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #111318;+ font-family: Inter, system-ui, sans-serif;+ }+ .window {+ position: absolute;+ left: 360px;+ top: 170px;+ width: 1200px;+ height: 740px;+ border-radius: 24px;+ overflow: hidden;+ background: #ffffff;+ box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);+ }+ .side {+ position: absolute;+ left: 0;+ top: 0;+ bottom: 0;+ width: 280px;+ background: #f5f6fa;+ border-right: 1px solid #e6e8ef;+ }+ .brand {+ position: absolute;+ left: 28px;+ top: 36px;+ font-size: 22px;+ font-weight: 750;+ color: #151827;+ }+ .nav {+ position: absolute;+ left: 16px;+ width: 248px;+ height: 52px;+ line-height: 52px;+ padding-left: 18px;+ border-radius: 12px;+ font-size: 20px;+ font-weight: 600;+ color: #5b6173;+ }+ .nav-sel {+ position: absolute;+ left: 16px;+ width: 248px;+ height: 52px;+ border-radius: 12px;+ background: #ffffff;+ box-shadow: 0 2px 8px rgba(21, 24, 39, 0.08);+ }+ .view {+ position: absolute;+ left: 280px;+ top: 0;+ right: 0;+ bottom: 0;+ padding: 40px 48px;+ }+ .view h2 {+ margin: 0 0 28px;+ font-size: 34px;+ font-weight: 750;+ letter-spacing: -0.02em;+ color: #151827;+ }+ .row {+ position: relative;+ height: 88px;+ border-bottom: 1px solid #eceef4;+ }+ .row-title {+ position: absolute;+ left: 0;+ top: 18px;+ font-size: 21px;+ font-weight: 650;+ color: #151827;+ }+ .row-sub {+ position: absolute;+ left: 0;+ top: 50px;+ font-size: 17px;+ color: #7a8094;+ }+ .toggle {+ position: absolute;+ right: 12px;+ top: 28px;+ width: 60px;+ height: 34px;+ border-radius: 999px;+ background: #d6d9e3;+ }+ .toggle.on {+ background: #0a84ff;+ }+ .knob {+ position: absolute;+ left: 3px;+ top: 3px;+ width: 28px;+ height: 28px;+ border-radius: 50%;+ background: #ffffff;+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);+ }+ .toggle.on .knob {+ transform: translateX(26px);+ }+ .pill {+ position: absolute;+ right: 12px;+ top: 26px;+ padding: 8px 14px;+ border-radius: 10px;+ font-size: 16px;+ font-weight: 650;+ color: #5b6173;+ background: #eef0f5;+ }+ </style>+ </head>+ <body>+ <div+ id="root"+ data-composition-id="agent-cursor-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="4.8"+ >+ <div class="window clip" id="window" data-start="0" data-duration="4.8" data-track-index="0">+ <div class="side">+ <div class="brand">Workspace</div>+ <div class="nav-sel" id="nav-sel" style="top: 184px"></div>+ <div class="nav" style="top: 120px">Home</div>+ <div class="nav" id="nav-projects" style="top: 184px; color: #151827">Projects</div>+ <div class="nav" style="top: 248px">Team</div>+ <div class="nav" id="nav-settings" style="top: 312px">Settings</div>+ </div>++ <div class="view" id="projects">+ <h2>Projects</h2>+ <div class="row">+ <div class="row-title">Spring campaign</div>+ <div class="row-sub">Edited 2 hours ago by Priya</div>+ <div class="pill">In review</div>+ </div>+ <div class="row">+ <div class="row-title">Onboarding emails</div>+ <div class="row-sub">Edited yesterday by Marco</div>+ <div class="pill">Draft</div>+ </div>+ <div class="row">+ <div class="row-title">Pricing page refresh</div>+ <div class="row-sub">Edited Monday by Lena</div>+ <div class="pill">Shipped</div>+ </div>+ </div>++ <div class="view" id="settings" style="opacity: 0">+ <h2>Settings</h2>+ <div class="row">+ <div class="row-title">Automatic backups</div>+ <div class="row-sub" id="backup-sub">Off. Your workspace is not backed up.</div>+ <div class="toggle" id="backup-toggle"><div class="knob" id="backup-knob"></div></div>+ </div>+ <div class="row">+ <div class="row-title">Version history</div>+ <div class="row-sub">Keep every change for 30 days</div>+ <div class="toggle on"><div class="knob"></div></div>+ </div>+ <div class="row">+ <div class="row-title">Export workspace</div>+ <div class="row-sub">Download everything as a zip</div>+ <div class="pill">Export</div>+ </div>+ </div>+ </div>++ <div+ class="clip"+ id="agent-cursor"+ data-composition-id="agent-cursor"+ data-composition-src="./agent-cursor.html"+ data-variable-values='{"agent_name":"Agent","steps":"Reading the page,Opening Settings,Turning on backups,Done","targets":"24.8,47.6;76.1,30.2","accent":"#0a84ff"}'+ data-start="0"+ data-duration="4.8"+ data-track-index="1"+ data-width="1920"+ data-height="1080"+ style="position: absolute; inset: 0; width: 1920px; height: 1080px"+ ></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};+ var tl = gsap.timeline({ paused: true });++ // First click (2.0s): Settings opens.+ tl.to("#nav-sel", { y: 128, duration: 0.3, ease: "power3.out" }, 2.04);+ tl.to("#projects", { opacity: 0, x: -12, duration: 0.18, ease: "power2.in" }, 2.04);+ tl.to("#nav-projects", { color: "#5b6173", duration: 0.2 }, 2.04);+ tl.to("#nav-settings", { color: "#151827", duration: 0.2 }, 2.04);+ tl.fromTo(+ "#settings",+ { opacity: 0, x: 16 },+ { opacity: 1, x: 0, duration: 0.3, ease: "power3.out" },+ 2.16,+ );++ // Second click (3.35s): backups turn on.+ tl.to("#backup-toggle", { backgroundColor: "#0a84ff", duration: 0.2 }, 3.39);+ tl.to("#backup-knob", { x: 26, duration: 0.26, ease: "back.out(1.8)" }, 3.39);+ tl.set("#backup-sub", { textContent: "On. Next backup tonight at 2:00." }, 3.46);++ window.__timelines["agent-cursor-demo"] = tl;+ </script>+ </body>+</html>diff --git a/registry/components/agent-cursor/registry-item.json b/registry/components/agent-cursor/registry-item.jsonnew file mode 100644index 0000000000..4be5dbfd2f--- /dev/null+++ b/registry/components/agent-cursor/registry-item.json@@ -0,0 +1,55 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "agent-cursor",+ "type": "hyperframes:component",+ "title": "Agent Cursor",+ "description": "An AI agent operating a UI: a cursor with an accent name label that types out each step, clicks each target with a small ring, and ends on a check.",+ "tags": ["cursor", "motion-primitive", "agent", "ai", "status", "click"],+ "files": [+ {+ "path": "agent-cursor.html",+ "target": "compositions/components/agent-cursor.html",+ "type": "hyperframes:snippet"+ }+ ],+ "jobs": ["demonstrate"],+ "family": "pointers",+ "profile": "interaction",+ "syncPoints": [+ { "id": "first-click", "phase": "in", "offset": 2.0 },+ { "id": "second-click", "phase": "in", "offset": 3.35 },+ { "id": "done", "phase": "in", "offset": 3.65 }+ ],+ "variables": [+ {+ "id": "agent_name",+ "type": "string",+ "role": "content",+ "label": "Agent name",+ "default": "Agent"+ },+ {+ "id": "steps",+ "type": "string",+ "role": "content",+ "label": "Status steps",+ "description": "Comma-separated: a reading line, one line per target, then a done line.",+ "default": "Reading the page,Opening Settings,Turning on backups,Done"+ },+ {+ "id": "targets",+ "type": "string",+ "role": "layout",+ "label": "Click targets",+ "description": "Semicolon-separated x,y points in percent of the frame.",+ "default": "25,47;76,30"+ },+ {+ "id": "accent",+ "type": "color",+ "role": "style",+ "label": "Accent",+ "default": "#0a84ff"+ }+ ]+}diff --git a/registry/components/before-after-wipe/registry-item.json b/registry/components/before-after-wipe/registry-item.jsonindex 9daf70acdd..299d0fe4e3 100644--- a/registry/components/before-after-wipe/registry-item.json+++ b/registry/components/before-after-wipe/registry-item.json@@ -4,7 +4,17 @@"type": "hyperframes:component","title": "Before After Wipe","description": "Two full-bleed content slots compare before and after states as a persistent divider wipes the after layer over the before layer and rests at a configurable split. Callers fill the named before/after slot panels; token-styled defaults render when a slot is left empty.",- "tags": ["prop", "ui-props", "compare", "holdable", "before-after", "wipe", "slots"],+ "tags": [+ "prop",+ "ui-props",+ "compare",+ "comparison",+ "split-screen",+ "holdable",+ "before-after",+ "wipe",+ "slots"+ ],"jobs": ["compare"],"family": "ui-props","profile": "holdable",diff --git a/registry/components/count-up/registry-item.json b/registry/components/count-up/registry-item.jsonindex fc8c948971..e1f271c1ec 100644--- a/registry/components/count-up/registry-item.json+++ b/registry/components/count-up/registry-item.json@@ -3,8 +3,8 @@"name": "count-up","type": "hyperframes:component","title": "Count Up",- "description": "A token-native stat counter that eases between values and lands with a restrained scale pulse.",- "tags": ["motion-primitive", "proof", "stats", "counter", "number", "deterministic"],+ "description": "A token-native stat counter that eases between values, counting up or down, and lands with a restrained scale pulse.",+ "tags": ["motion-primitive", "proof", "stats", "counter", "number", "countdown", "deterministic"],"jobs": ["prove"],"family": "proof-stats","profile": "count",diff --git a/registry/components/cursor-annotate/cursor-annotate.html b/registry/components/cursor-annotate/cursor-annotate.htmlnew file mode 100644index 0000000000..bd22c13a3c--- /dev/null+++ b/registry/components/cursor-annotate/cursor-annotate.html@@ -0,0 +1,494 @@+<!doctype html>+<!--+ Annotate Cursor (actor primitive), mountable sub-composition++ concept: a marker pen glides to a region of the host UI, touches down and hand-draws+ one annotation around it (a loose loop, an underline, or an arrow), then lifts and+ leaves. The ink is revealed exactly under the nib: both read the same path length.++ mount contract: loaded by a host through data-composition-src; only <template> is+ cloned. #root fills the host clip (inset:0). See demo.html.++ variables:+ shape (circle|underline|arrow) the mark the pen draws+ color marker ink+ target_x, target_y, target_w, target_h (% of host box) the region being marked++ envelope (default 2.95s): glide in 0-0.5s, touch down, draw 0.7-1.8s, lift and step+ clear of the mark, hold, exit in the last 0.35s. Shorter durations compress every beat evenly.+ The ink is a tapered marker stroke: thick where the pen moves slowly, thin where it is fast.+-->+<html+ lang="en"+ data-composition-id="cursor-annotate"+ data-composition-duration="2.95"+ data-composition-variables='[+ { "id": "shape", "type": "enum", "role": "style", "label": "Mark", "default": "circle", "options": [ { "value": "circle", "label": "Loose loop" }, { "value": "underline", "label": "Underline" }, { "value": "arrow", "label": "Arrow" } ] },+ { "id": "color", "type": "color", "role": "style", "label": "Ink", "default": "#f43f5e" },+ { "id": "target_x", "type": "number", "role": "layout", "label": "Region left", "default": 40, "min": 0, "max": 95, "step": 1, "unit": "%" },+ { "id": "target_y", "type": "number", "role": "layout", "label": "Region top", "default": 38, "min": 0, "max": 95, "step": 1, "unit": "%" },+ { "id": "target_w", "type": "number", "role": "layout", "label": "Region width", "default": 20, "min": 2, "max": 90, "step": 1, "unit": "%" },+ { "id": "target_h", "type": "number", "role": "layout", "label": "Region height", "default": 16, "min": 2, "max": 90, "step": 1, "unit": "%" }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Annotate Cursor</title>+ </head>+ <body>+ <template>+ <style>+ #root {+ position: absolute;+ inset: 0;+ overflow: hidden;+ isolation: isolate;+ pointer-events: none;+ }+ .ca-ink {+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ overflow: visible;+ }+ .ca-ink path {+ fill: var(--ca-ink, #f43f5e);+ }+ .ca-pen {+ position: absolute;+ left: 0;+ top: 0;+ width: 0;+ height: 0;+ will-change: transform;+ }+ /* The nib sits at the svg origin, so the wrapper's translate places the nib. */+ .ca-pen svg {+ position: absolute;+ left: -40px;+ top: -200px;+ width: 240px;+ height: 240px;+ overflow: visible;+ }+ </style>++ <div id="root" data-composition-id="cursor-annotate" data-duration="2.95">+ <svg class="ca-ink" id="ca-ink" aria-hidden="true"></svg>+ <div class="ca-pen" id="ca-pen" aria-hidden="true">+ <svg viewBox="-40 -200 240 240" aria-hidden="true">+ <g id="ca-pen-body">+ <g transform="rotate(-50)">+ <path d="M0 0 L15 -5.5 L15 5.5 Z" fill="#1d1d22" />+ <path id="ca-pen-tip" d="M3 -1.4 L15 -5.5 L15 5.5 L3 1.4 Z" />+ <rect x="15" y="-7.5" width="14" height="15" rx="2" fill="#2a2a31" />+ <rect+ x="29"+ y="-9"+ width="62"+ height="18"+ rx="4"+ fill="#ffffff"+ stroke="#141414"+ stroke-width="2"+ />+ <rect x="36" y="-9" width="8" height="18" id="ca-pen-band" />+ <rect x="91" y="-9.5" width="16" height="19" rx="6" fill="#1d1d22" />+ </g>+ </g>+ </svg>+ </div>+ </div>++ <script>+ (function () {+ "use strict";++ var html = document.documentElement;+ var root = document.getElementById("root");+ var ink = document.getElementById("ca-ink");+ var pen = document.getElementById("ca-pen");+ var penBody = document.getElementById("ca-pen-body");+ var SVG_NS = "http://www.w3.org/2000/svg";++ var DEFAULTS = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(+ function (variable) {+ DEFAULTS[variable.id] = variable.default;+ },+ );+ } catch (error) {+ /* malformed declaration falls back to the inline defaults below */+ }+ var scopedVariables = {};+ try {+ if (window.__hyperframes && typeof window.__hyperframes.getVariables === "function") {+ scopedVariables = window.__hyperframes.getVariables() || {};+ }+ } catch (error) {+ /* no scoped variables API in this context */+ }+ var vars = Object.assign({}, DEFAULTS, window.__hfVariables || {}, scopedVariables);++ function num(value, fallback, lo, hi) {+ var n = Number(value);+ if (!isFinite(n)) n = fallback;+ return Math.max(lo, Math.min(hi, n));+ }++ // Hardcoded: the compositor rewrites the wrapper's attributes on mount.+ var compositionId = "cursor-annotate";+ var duration = Math.max(+ 0.001,+ parseFloat(+ root.dataset.duration || html.getAttribute("data-composition-duration") || "2.95",+ ),+ );+ var shape =+ ["circle", "underline", "arrow"].indexOf(vars.shape) >= 0 ? vars.shape : "circle";+ var color = /^#[0-9a-f]{3,8}$/i.test(String(vars.color)) ? vars.color : "#f43f5e";+ var W = root.clientWidth || 1920;+ var H = root.clientHeight || 1080;+ var unit = W / 1920;+ var box = {+ x: (num(vars.target_x, 40, 0, 100) / 100) * W,+ y: (num(vars.target_y, 38, 0, 100) / 100) * H,+ w: (num(vars.target_w, 20, 1, 100) / 100) * W,+ h: (num(vars.target_h, 16, 1, 100) / 100) * H,+ };++ ink.setAttribute("viewBox", "0 0 " + W + " " + H);+ root.style.setProperty("--ca-ink", color);+ document.getElementById("ca-pen-tip").setAttribute("fill", color);+ document.getElementById("ca-pen-band").setAttribute("fill", color);++ // Each mark is one or more strokes; a stroke maps u in [0,1] to a point on the page.+ // A hand loop: starts upper-left, runs a little past its start and wider on the way out.+ function loopStroke() {+ var cx = box.x + box.w / 2;+ var cy = box.y + box.h / 2;+ var rx = box.w * 0.62 + 18 * unit;+ var ry = box.h * 0.66 + 16 * unit;+ var tilt = (-5 * Math.PI) / 180;+ return [+ function (u) {+ var a = -2.55 + (Math.PI * 2 + 0.5) * u;+ var r = (1 + 0.035 * Math.sin(3 * a + 1.1)) * (1 + 0.08 * u);+ var ex = Math.cos(a) * rx * r;+ var ey = Math.sin(a) * ry * r;+ return [+ cx + ex * Math.cos(tilt) - ey * Math.sin(tilt),+ cy + ex * Math.sin(tilt) + ey * Math.cos(tilt),+ ];+ },+ ];+ }++ function underlineStroke() {+ var y = box.y + box.h + 14 * unit;+ var x0 = box.x - box.w * 0.04;+ var span = box.w * 1.08;+ return [+ function (u) {+ return [+ x0 + span * u,+ y + 4 * unit * Math.sin(u * Math.PI * 1.3) - 12 * unit * u * u,+ ];+ },+ ];+ }++ function smooth(x) {+ return x * x * (3 - 2 * x);+ }+ function lerp(a, b, u) {+ return [a[0] + (b[0] - a[0]) * u, a[1] + (b[1] - a[1]) * u];+ }++ // Shaft from below-left, curving onto the region; the head is one V that slows into its point.+ function arrowStrokes() {+ var tip = [box.x - 10 * unit, box.y + box.h + 8 * unit];+ var from = [+ tip[0] - Math.max(160 * unit, box.w * 0.7),+ tip[1] + Math.max(120 * unit, box.h * 0.9),+ ];+ var ctrl = [from[0] + (tip[0] - from[0]) * 0.15, tip[1] + (from[1] - tip[1]) * 0.05];+ var back = Math.atan2(ctrl[1] - tip[1], ctrl[0] - tip[0]);+ var len = 30 * unit;+ var barb = function (spread) {+ return [+ tip[0] + Math.cos(back + spread) * len,+ tip[1] + Math.sin(back + spread) * len,+ ];+ };+ return [+ function (u) {+ var v = 1 - u;+ return [+ v * v * from[0] + 2 * v * u * ctrl[0] + u * u * tip[0],+ v * v * from[1] + 2 * v * u * ctrl[1] + u * u * tip[1],+ ];+ },+ function (u) {+ return u < 0.5+ ? lerp(barb(0.5), tip, smooth(u * 2))+ : lerp(tip, barb(-0.5), smooth(u * 2 - 1));+ },+ ];+ }++ var paths =+ shape === "underline"+ ? underlineStroke()+ : shape === "arrow"+ ? arrowStrokes()+ : loopStroke();++ // Beats at the default 2.95s; a shorter composition compresses them evenly.+ var squeeze = Math.min(1, duration / 2.95);+ var T_LAND = 0.5 * squeeze;+ var T_DRAW = 0.7 * squeeze;+ var HOP = 0.2 * squeeze;+ var ASIDE_TIME = 0.35 * squeeze;+ var EXIT_TIME = 0.35 * squeeze;+ var drawTotal = (shape === "circle" ? 1.1 : shape === "arrow" ? 0.95 : 0.6) * squeeze;++ var glide = gsap.parseEase("power3.out");+ var strokeEase = gsap.parseEase("sine.inOut");+ var hop = gsap.parseEase("power2.inOut");+ var aside = gsap.parseEase("power2.out");+ var leave = gsap.parseEase("power2.in");++ function clamp01(u) {+ return u < 0 ? 0 : u > 1 ? 1 : u;+ }+ function arcLength(fn) {+ var sum = 0;+ var prev = fn(0);+ for (var i = 1; i <= 200; i++) {+ var p = fn(i / 200);+ sum += Math.hypot(p[0] - prev[0], p[1] - prev[1]);+ prev = p;+ }+ return sum;+ }++ // Samples at even steps of stroke time, so spacing between samples is the pen's speed.+ // Width follows speed (7u slow, 3u fast) and thins back to 3u as the pen lifts.+ var STEPS = 160;+ var MIN_W = 3 * unit;+ var MAX_W = 7 * unit;+ var strokes = paths.map(function (fn) {+ var pts = [];+ for (var k = 0; k <= STEPS; k++) {+ var u = strokeEase(k / STEPS);+ var p = fn(u);+ var a = fn(Math.max(0, u - 1e-4));+ var b = fn(Math.min(1, u + 1e-4));+ var tlen = Math.hypot(b[0] - a[0], b[1] - a[1]) || 1;+ pts.push({ x: p[0], y: p[1], nx: -(b[1] - a[1]) / tlen, ny: (b[0] - a[0]) / tlen });+ }+ pts.forEach(function (p, k) {+ var a = pts[Math.max(0, k - 1)];+ var b = pts[Math.min(STEPS, k + 1)];+ p.speed = Math.hypot(b.x - a.x, b.y - a.y);+ });+ return { pts: pts, length: arcLength(fn) };+ });+ var topSpeed = 0;+ strokes.forEach(function (s) {+ s.pts.forEach(function (p) {+ topSpeed = Math.max(topSpeed, p.speed);+ });+ });+ strokes.forEach(function (s) {+ s.pts.forEach(function (p, k) {+ var lift = 1 - smooth(clamp01((k / STEPS - 0.82) / 0.18));+ p.w = MIN_W + (MAX_W - MIN_W) * (1 - p.speed / topSpeed) * lift;+ });+ s.el = document.createElementNS(SVG_NS, "path");+ ink.appendChild(s.el);+ });++ var totalLength = strokes.reduce(function (sum, s) {+ return sum + s.length;+ }, 0);+ var windows = [];+ var cursorT = T_DRAW;+ strokes.forEach(function (s, i) {+ var span = (drawTotal - HOP * (strokes.length - 1)) * (s.length / totalLength);+ windows.push({ start: cursorT, end: cursorT + span });+ cursorT += span + (i < strokes.length - 1 ? HOP : 0);+ });+ var T_LIFT = cursorT;+ var T_EXIT = Math.max(T_LIFT + ASIDE_TIME, duration - EXIT_TIME);++ // The stroke as drawn by stroke-time f: its samples up to f, the last one interpolated.+ function drawnTo(s, f) {+ var x = clamp01(f) * STEPS;+ var k = Math.floor(x);+ var out = s.pts.slice(0, k + 1);+ if (k < STEPS && x > k) {+ var a = s.pts[k];+ var b = s.pts[k + 1];+ var m = x - k;+ out.push({+ x: a.x + (b.x - a.x) * m,+ y: a.y + (b.y - a.y) * m,+ nx: a.nx + (b.nx - a.nx) * m,+ ny: a.ny + (b.ny - a.ny) * m,+ w: a.w + (b.w - a.w) * m,+ });+ }+ return out;+ }++ // Filled outline of a variable-width stroke with round ends.+ function outline(pts) {+ if (pts.length < 2) return "";+ function side(p, dir) {+ var h = (p.w / 2) * dir;+ return (p.x + p.nx * h).toFixed(1) + " " + (p.y + p.ny * h).toFixed(1);+ }+ function cap(p) {+ var r = (p.w / 2).toFixed(2);+ return " A" + r + " " + r + " 0 0 0 ";+ }+ var last = pts[pts.length - 1];+ var d = "M" + side(pts[0], 1);+ for (var i = 1; i < pts.length; i++) d += " L" + side(pts[i], 1);+ d += cap(last) + side(last, -1);+ for (var j = pts.length - 2; j >= 0; j--) d += " L" + side(pts[j], -1);+ return d + cap(pts[0]) + side(pts[0], 1) + " Z";+ }++ function nibOf(s, f) {+ var pts = drawnTo(s, f);+ var p = pts[pts.length - 1];+ return { x: p.x, y: p.y };+ }+ var first = nibOf(strokes[0], 0);+ var endPoint = nibOf(strokes[strokes.length - 1], 1);++ // After the lift the nib steps straight away from the region until it clears the mark+ // by 40u, then keeps going that way off the frame.+ var inkBox = { l: box.x, t: box.y, r: box.x + box.w, b: box.y + box.h };+ strokes.forEach(function (s) {+ s.pts.forEach(function (p) {+ inkBox.l = Math.min(inkBox.l, p.x);+ inkBox.t = Math.min(inkBox.t, p.y);+ inkBox.r = Math.max(inkBox.r, p.x);+ inkBox.b = Math.max(inkBox.b, p.y);+ });+ });+ var away = { x: endPoint.x - (box.x + box.w / 2), y: endPoint.y - (box.y + box.h / 2) };+ var awayLen = Math.hypot(away.x, away.y) || 1;+ away = { x: away.x / awayLen, y: away.y / awayLen };+ function reach(p, l, t, r, b) {+ var hits = [];+ if (away.x > 1e-6) hits.push((r - p.x) / away.x);+ if (away.x < -1e-6) hits.push((l - p.x) / away.x);+ if (away.y > 1e-6) hits.push((b - p.y) / away.y);+ if (away.y < -1e-6) hits.push((t - p.y) / away.y);+ return Math.max(0, Math.min.apply(null, hits));+ }+ var clear = 40 * unit;+ var step = reach(+ endPoint,+ inkBox.l - clear,+ inkBox.t - clear,+ inkBox.r + clear,+ inkBox.b + clear,+ );+ var ASIDE = {+ x: Math.max(40 * unit, Math.min(W - 100 * unit, endPoint.x + away.x * step)),+ y: Math.max(100 * unit, Math.min(H - 40 * unit, endPoint.y + away.y * step)),+ };+ var off = reach(ASIDE, 0, 0, W, H) + 180 * unit;+ var END = { x: ASIDE.x + away.x * off, y: ASIDE.y + away.y * off };+ var START = { x: first.x + 0.3 * W, y: H * 1.25 };++ function mix(a, b, u) {+ return { x: a.x + (b.x - a.x) * u, y: a.y + (b.y - a.y) * u };+ }++ // Returns the nib position and how far off the paper it is (0 = touching).+ function penAt(t) {+ if (t <= T_LAND) return { p: mix(START, first, glide(clamp01(t / T_LAND))), lift: 1 };+ if (t <= T_DRAW)+ return { p: first, lift: 1 - clamp01((t - T_LAND) / (T_DRAW - T_LAND)) };+ for (var i = 0; i < windows.length; i++) {+ var w = windows[i];+ if (t <= w.end)+ return { p: nibOf(strokes[i], (t - w.start) / (w.end - w.start)), lift: 0 };+ var next = windows[i + 1];+ if (next && t < next.start) {+ var u = (t - w.end) / (next.start - w.end);+ return {+ p: mix(nibOf(strokes[i], 1), nibOf(strokes[i + 1], 0), hop(u)),+ lift: Math.sin(Math.PI * u),+ };+ }+ }+ if (t <= T_EXIT) {+ var a = clamp01((t - T_LIFT) / ASIDE_TIME);+ return { p: mix(endPoint, ASIDE, aside(a)), lift: Math.min(1, a * 2.5) };+ }+ return {+ p: mix(ASIDE, END, leave(clamp01((t - T_EXIT) / (duration - T_EXIT)))),+ lift: 1,+ };+ }++ function render(t) {+ strokes.forEach(function (s, i) {+ var w = windows[i];+ s.el.setAttribute("d", outline(drawnTo(s, (t - w.start) / (w.end - w.start))));+ });+ var state = penAt(t);+ var lift = state.lift;+ pen.style.transform =+ "translate(" + state.p.x.toFixed(2) + "px," + state.p.y.toFixed(2) + "px)";+ penBody.setAttribute(+ "transform",+ "scale(" ++ ((0.85 + 0.07 * lift) * unit).toFixed(4) ++ ") rotate(" ++ (-4 * lift).toFixed(2) ++ ")",+ );+ pen.style.filter =+ "drop-shadow(0 " ++ ((3 + 7 * lift) * unit).toFixed(1) ++ "px " ++ ((4 + 8 * lift) * unit).toFixed(1) ++ "px rgba(0,0,0," ++ (0.3 - 0.1 * lift).toFixed(3) ++ "))";+ }++ var clock = { t: 0 };+ var tl = gsap.timeline({ paused: true });+ tl.to(+ clock,+ {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ render(clock.t);+ },+ },+ 0,+ );+ render(0);+ tl.seek(0);+ window.__timelines = window.__timelines || {};+ window.__timelines[compositionId] = tl;+ })();+ </script>+ </template>+ </body>+</html>diff --git a/registry/components/cursor-annotate/demo.html b/registry/components/cursor-annotate/demo.htmlnew file mode 100644index 0000000000..e9ea1e9470--- /dev/null+++ b/registry/components/cursor-annotate/demo.html@@ -0,0 +1,176 @@+<!doctype html>+<!--+ Annotate Cursor, standalone demo: a signups chart whose launch-week spike gets+ circled. It mounts cursor-annotate.html full-frame over the card, starting at 0.35s.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Annotate Cursor, Demo</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ width: 100%;+ height: 100%;+ overflow: hidden;+ }+ #root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #f4f4f5;+ font-family: Inter, system-ui, sans-serif;+ }+ .card {+ position: absolute;+ left: 410px;+ top: 200px;+ width: 1100px;+ height: 640px;+ border-radius: 28px;+ background: #ffffff;+ box-shadow:+ 0 0 0 1px rgba(0, 0, 0, 0.05),+ 0 2px 4px rgba(0, 0, 0, 0.04),+ 0 24px 64px rgba(0, 0, 0, 0.08);+ }+ .eyebrow {+ position: absolute;+ left: 56px;+ top: 48px;+ font-size: 20px;+ font-weight: 600;+ color: #71717a;+ }+ .headline {+ position: absolute;+ left: 56px;+ top: 80px;+ font-size: 48px;+ font-weight: 750;+ letter-spacing: -0.02em;+ color: #18181b;+ }+ .delta {+ position: absolute;+ right: 56px;+ top: 56px;+ padding: 10px 18px;+ border-radius: 999px;+ background: #f4f4f5;+ color: #3f3f46;+ font-size: 20px;+ font-weight: 700;+ }+ .grid {+ position: absolute;+ left: 56px;+ right: 56px;+ height: 1px;+ background: #f0f0f2;+ }+ .bar {+ position: absolute;+ bottom: 80px;+ width: 70px;+ border-radius: 12px 12px 4px 4px;+ background: #d4d4d8;+ transform-origin: 50% 100%;+ }+ .bar.spike {+ background: #52525b;+ }+ .week {+ position: absolute;+ bottom: 36px;+ width: 70px;+ text-align: center;+ font-size: 17px;+ font-weight: 600;+ color: #a1a1aa;+ }+ .spike-label {+ position: absolute;+ left: 550px;+ top: 108px;+ width: 150px;+ text-align: center;+ font-size: 26px;+ font-weight: 750;+ color: #18181b;+ }+ </style>+ </head>+ <body>+ <div+ id="root"+ data-composition-id="cursor-annotate-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="3.3"+ >+ <div class="card clip" id="card" data-start="0" data-duration="3.3" data-track-index="0">+ <div class="eyebrow">Weekly signups</div>+ <div class="headline">12,480</div>+ <div class="delta">+38% this quarter</div>+ <div class="grid" style="top: 300px"></div>+ <div class="grid" style="top: 420px"></div>+ <div class="grid" style="top: 560px"></div>+ <div class="bar" style="left: 80px; height: 150px"></div>+ <div class="bar" style="left: 202px; height: 172px"></div>+ <div class="bar" style="left: 324px; height: 160px"></div>+ <div class="bar" style="left: 446px; height: 196px"></div>+ <div class="bar spike" style="left: 590px; height: 400px"></div>+ <div class="bar" style="left: 712px; height: 236px"></div>+ <div class="bar" style="left: 834px; height: 214px"></div>+ <div class="bar" style="left: 956px; height: 248px"></div>+ <div class="spike-label">+184%</div>+ <div class="week" style="left: 80px">W1</div>+ <div class="week" style="left: 202px">W2</div>+ <div class="week" style="left: 324px">W3</div>+ <div class="week" style="left: 446px">W4</div>+ <div class="week" style="left: 590px; color: #18181b">Launch</div>+ <div class="week" style="left: 712px">W6</div>+ <div class="week" style="left: 834px">W7</div>+ <div class="week" style="left: 956px">W8</div>+ </div>++ <div+ class="clip"+ id="cursor-annotate"+ data-composition-id="cursor-annotate"+ data-composition-src="./cursor-annotate.html"+ data-variable-values='{"shape":"circle","color":"#f43f5e","target_x":50.2,"target_y":28.5,"target_w":7.8,"target_h":11.5}'+ data-start="0.35"+ data-duration="2.95"+ data-track-index="1"+ data-width="1920"+ data-height="1080"+ style="position: absolute; inset: 0; width: 1920px; height: 1080px"+ ></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};+ var tl = gsap.timeline({ paused: true });+ // The chart settles before the pen enters at 0.35s.+ tl.fromTo(+ ".bar",+ { scaleY: 0.2 },+ { scaleY: 1, duration: 0.28, ease: "power3.out", stagger: 0.01 },+ 0,+ );+ window.__timelines["cursor-annotate-demo"] = tl;+ </script>+ </body>+</html>diff --git a/registry/components/cursor-annotate/registry-item.json b/registry/components/cursor-annotate/registry-item.jsonnew file mode 100644index 0000000000..b732ddc876--- /dev/null+++ b/registry/components/cursor-annotate/registry-item.json@@ -0,0 +1,87 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "cursor-annotate",+ "type": "hyperframes:component",+ "title": "Annotate Cursor",+ "description": "A marker pen glides onto the frame and hand-draws a loose loop, an underline, or an arrow around a region, the ink laid exactly under its nib, then lifts and leaves.",+ "tags": ["cursor", "motion-primitive", "pen", "annotation", "draw-on", "highlight"],+ "files": [+ {+ "path": "cursor-annotate.html",+ "target": "compositions/components/cursor-annotate.html",+ "type": "hyperframes:snippet"+ }+ ],+ "jobs": ["demonstrate"],+ "family": "pointers",+ "profile": "interaction",+ "syncPoints": [+ { "id": "ink-down", "phase": "in", "offset": 0.7 },+ { "id": "ink-done", "phase": "in", "offset": 1.8 }+ ],+ "variables": [+ {+ "id": "shape",+ "type": "enum",+ "role": "style",+ "label": "Mark",+ "default": "circle",+ "options": [+ { "value": "circle", "label": "Loose loop" },+ { "value": "underline", "label": "Underline" },+ { "value": "arrow", "label": "Arrow" }+ ]+ },+ {+ "id": "color",+ "type": "color",+ "role": "style",+ "label": "Ink",+ "default": "#f43f5e"+ },+ {+ "id": "target_x",+ "type": "number",+ "role": "layout",+ "label": "Region left",+ "default": 40,+ "min": 0,+ "max": 95,+ "step": 1,+ "unit": "%"+ },+ {+ "id": "target_y",+ "type": "number",+ "role": "layout",+ "label": "Region top",+ "default": 38,+ "min": 0,+ "max": 95,+ "step": 1,+ "unit": "%"+ },+ {+ "id": "target_w",+ "type": "number",+ "role": "layout",+ "label": "Region width",+ "default": 20,+ "min": 2,+ "max": 90,+ "step": 1,+ "unit": "%"+ },+ {+ "id": "target_h",+ "type": "number",+ "role": "layout",+ "label": "Region height",+ "default": 16,+ "min": 2,+ "max": 90,+ "step": 1,+ "unit": "%"+ }+ ]+}diff --git a/registry/components/cursor-context-menu/cursor-context-menu.html b/registry/components/cursor-context-menu/cursor-context-menu.htmlnew file mode 100644index 0000000000..85890ef901--- /dev/null+++ b/registry/components/cursor-context-menu/cursor-context-menu.html@@ -0,0 +1,562 @@+<!doctype html>+<!--+ Context Menu Cursor (actor primitive), mountable sub-composition++ concept: an arrow glides to a file in a folder window and right-clicks it; a context+ menu blooms from the tip (flipping left or up when it would leave the frame), the+ hover highlight follows the item under the tip as the cursor travels down, it clicks+ the chosen item, the menu collapses back toward the tip and the action happens:+ Duplicate adds a copy, Rename opens the name for editing, Move to Trash removes the+ file, anything else confirms with a toast.++ mount contract: loaded by a host through data-composition-src; only <template> is+ cloned. #root fills the host clip (inset:0) and draws its own folder window.++ variables:+ items (string) menu items, comma separated+ pick (number) index of the item the cursor chooses+ tone (light|dark)++ envelope (default 3.9s): glide 0-0.5s, right-click 0.7s, menu 0.77s, travel+ 1.2-1.65s, click 1.85s, action 2.15s, step aside 2.75-3.15s, hold. Shorter durations+ compress every beat evenly.+-->+<html+ lang="en"+ data-composition-id="cursor-context-menu"+ data-composition-duration="3.9"+ data-composition-variables='[+ { "id": "items", "type": "string", "role": "content", "label": "Menu items", "default": "Open,Rename,Duplicate,Share,Move to Trash" },+ { "id": "pick", "type": "number", "role": "content", "label": "Chosen item (0 = first)", "default": 2, "min": 0, "max": 9, "step": 1 },+ { "id": "tone", "type": "enum", "role": "style", "label": "Tone", "default": "light", "options": [ { "value": "light", "label": "Light" }, { "value": "dark", "label": "Dark" } ] }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Context Menu Cursor</title>+ </head>+ <body>+ <template>+ <style>+ #root {+ position: absolute;+ inset: 0;+ overflow: hidden;+ container-type: size;+ font-family: var(--font-body, Inter, system-ui, sans-serif);+ --cm-accent: #0a84ff;+ --cm-win: #ffffff;+ --cm-card: #f4f5f9;+ --cm-ink: #121522;+ --cm-dim: #7a8093;+ --cm-menu: #ffffff;+ --cm-thumb: #e7e9ee;+ --cm-line: rgba(18, 21, 34, 0.08);+ }+ #root[data-tone="dark"] {+ --cm-win: #171a23;+ --cm-card: #222632;+ --cm-ink: #eef0f7;+ --cm-dim: #8d93a6;+ --cm-menu: #262a37;+ --cm-thumb: #2c303c;+ --cm-line: rgba(255, 255, 255, 0.09);+ }+ .cm-stage {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ }+ .cm-window {+ position: relative;+ width: 64cqw;+ border-radius: 1.4cqw;+ background: var(--cm-win);+ box-shadow:+ 0 2.4cqw 6cqw rgba(8, 12, 28, 0.35),+ 0 0 0 1px var(--cm-line);+ }+ .cm-bar {+ display: flex;+ align-items: center;+ gap: 0.6cqw;+ height: 4.4cqw;+ padding: 0 1.8cqw;+ border-bottom: 1px solid var(--cm-line);+ font-size: 1.35cqw;+ font-weight: 650;+ color: var(--cm-ink);+ }+ .cm-dot {+ width: 0.8cqw;+ height: 0.8cqw;+ border-radius: 50%;+ background: var(--cm-line);+ }+ .cm-bar span {+ margin-left: 1cqw;+ }+ .cm-grid {+ position: relative;+ display: grid;+ grid-template-columns: repeat(3, 1fr);+ gap: 1.6cqw;+ padding: 2cqw;+ }+ .cm-file {+ position: relative;+ padding: 0.8cqw;+ border-radius: 1cqw;+ background: var(--cm-card);+ box-shadow: 0 0 0 0.16cqw transparent;+ }+ .cm-file.is-on {+ box-shadow: 0 0 0 0.16cqw var(--cm-accent);+ }+ .cm-thumb {+ height: 8.4cqw;+ border-radius: 0.7cqw;+ overflow: hidden;+ background: var(--cm-thumb);+ color: var(--cm-dim);+ }+ .cm-thumb svg {+ display: block;+ width: 100%;+ height: 100%;+ }+ .cm-name {+ margin-top: 0.8cqw;+ font-size: 1.4cqw;+ font-weight: 600;+ color: var(--cm-ink);+ white-space: nowrap;+ }+ .cm-name.is-edit {+ box-shadow: 0 0 0 0.14cqw var(--cm-accent);+ border-radius: 0.3cqw;+ }+ .cm-name.is-edit b {+ font-weight: 600;+ background: color-mix(in srgb, var(--cm-accent) 30%, transparent);+ }+ .cm-meta {+ margin-top: 0.3cqw;+ font-size: 1.1cqw;+ color: var(--cm-dim);+ }+ .cm-menu {+ position: absolute;+ left: 0;+ top: 0;+ width: 19cqw;+ padding: 0.55cqw;+ border-radius: 0.9cqw;+ background: var(--cm-menu);+ box-shadow:+ 0 1.2cqw 3cqw rgba(8, 12, 28, 0.3),+ 0 0 0 1px var(--cm-line);+ opacity: 0;+ will-change: transform, opacity;+ }+ .cm-item {+ position: relative;+ height: 3.3cqw;+ padding: 0 1.1cqw;+ line-height: 3.3cqw;+ border-radius: 0.55cqw;+ font-size: 1.5cqw;+ color: var(--cm-ink);+ }+ .cm-item.is-hover {+ background: var(--cm-accent);+ color: #ffffff;+ }+ .cm-sep {+ height: 1px;+ margin: 0.4cqw 0.6cqw;+ background: var(--cm-line);+ }+ .cm-toast {+ position: absolute;+ left: 50%;+ bottom: 5cqh;+ padding: 1cqw 1.8cqw;+ border-radius: 99px;+ background: #15182a;+ color: #ffffff;+ font-size: 1.3cqw;+ font-weight: 600;+ opacity: 0;+ white-space: nowrap;+ }+ .cm-cursor {+ position: absolute;+ left: 0;+ top: 0;+ transform-origin: 0 0;+ filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));+ will-change: transform;+ }+ .cm-cursor path {+ fill: #ffffff;+ stroke: #141414;+ stroke-width: 1.4;+ stroke-linejoin: round;+ }+ </style>++ <div id="root" data-composition-id="cursor-context-menu" data-duration="3.9">+ <div class="cm-stage">+ <div class="cm-window">+ <div class="cm-bar">+ <i class="cm-dot"></i><i class="cm-dot"></i><i class="cm-dot"></i+ ><span>Launch assets</span>+ </div>+ <div class="cm-grid" id="cm-grid"></div>+ </div>+ </div>+ <div class="cm-menu" id="cm-menu"></div>+ <div class="cm-toast" id="cm-toast"></div>+ <svg class="cm-cursor" id="cm-cursor" viewBox="0 0 24 24" aria-hidden="true">+ <path d="M5 3 L5 19 L9 15 L12 22 L15 20.5 L11.5 14 L18 14 Z" />+ </svg>+ </div>++ <script>+ (function () {+ "use strict";++ var html = document.documentElement;+ var root = document.getElementById("root");+ var grid = document.getElementById("cm-grid");+ var menu = document.getElementById("cm-menu");+ var toast = document.getElementById("cm-toast");+ var cursor = document.getElementById("cm-cursor");++ var DEFAULTS = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(+ function (variable) {+ DEFAULTS[variable.id] = variable.default;+ },+ );+ } catch (error) {+ /* malformed declaration falls back to the inline defaults below */+ }+ var scopedVariables = {};+ try {+ if (window.__hyperframes && typeof window.__hyperframes.getVariables === "function") {+ scopedVariables = window.__hyperframes.getVariables() || {};+ }+ } catch (error) {+ /* no scoped variables API in this context */+ }+ var vars = Object.assign({}, DEFAULTS, window.__hfVariables || {}, scopedVariables);++ // Hardcoded: the compositor rewrites the wrapper's attributes on mount.+ var compositionId = "cursor-context-menu";+ var duration = Math.max(+ 0.001,+ parseFloat(+ root.dataset.duration || html.getAttribute("data-composition-duration") || "3.9",+ ),+ );+ root.setAttribute("data-tone", vars.tone === "dark" ? "dark" : "light");+ var labels = String(vars.items || DEFAULTS.items || "Open")+ .split(",")+ .map(function (s) {+ return s.trim();+ })+ .filter(Boolean);+ if (!labels.length) labels = ["Open"];+ var pick = Math.max(0, Math.min(labels.length - 1, Math.round(Number(vars.pick) || 0)));++ // Thumbnails are drawn in a 206x100 box, the aspect of a grid cell.+ var THUMBS = {+ pdf:+ '<rect x="72" y="8" width="62" height="86" rx="1.5" fill="#000" opacity=".06"/>' ++ '<rect x="72" y="7" width="62" height="86" rx="1.5" fill="#fff"/>' ++ '<rect x="79" y="15" width="30" height="4.5" rx="1" fill="#1d2130"/>' ++ '<rect x="79" y="22.5" width="20" height="2.2" rx="1" fill="#9aa0ad"/>' ++ '<rect x="79" y="30" width="22" height="3" rx="1.5" fill="#0a84ff"/>' ++ '<rect x="88" y="35" width="26" height="3" rx="1.5" fill="#34c759"/>' ++ '<rect x="97" y="40" width="20" height="3" rx="1.5" fill="#ff9f0a"/>' ++ '<rect x="108" y="45" width="19" height="3" rx="1.5" fill="#0a84ff"/>' ++ '<g fill="#d5d8de"><rect x="79" y="54" width="48" height="2" rx="1"/>' ++ '<rect x="79" y="59" width="45" height="2" rx="1"/><rect x="79" y="64" width="48" height="2" rx="1"/>' ++ '<rect x="79" y="69" width="40" height="2" rx="1"/><rect x="79" y="74" width="47" height="2" rx="1"/>' ++ '<rect x="79" y="79" width="28" height="2" rx="1"/></g>',+ video:+ '<rect width="206" height="100" fill="#12141b"/>' ++ '<path d="M86 0 H120 L156 70 H50 Z" fill="#fff" opacity=".05"/>' ++ '<rect y="70" width="206" height="30" fill="#1b1e27"/>' ++ '<ellipse cx="103" cy="73" rx="48" ry="3.5" fill="#000" opacity=".5"/>' ++ '<rect x="72" y="29" width="62" height="40" rx="2.5" fill="#2a2f3b"/>' ++ '<rect x="75" y="32" width="56" height="34" rx="1" fill="#0e2a52"/>' ++ '<rect x="79" y="36" width="18" height="2.5" rx="1" fill="#fff" opacity=".9"/>' ++ '<rect x="79" y="40.5" width="12" height="1.6" rx=".8" fill="#fff" opacity=".45"/>' ++ '<path d="M64 69 H142 L147 73 H59 Z" fill="#3a404d"/>' ++ '<circle cx="103" cy="49" r="10" fill="#000" fill-opacity=".5" stroke="#fff" stroke-width="1.2"/>' ++ '<path d="M99.5 44 L108.5 49 L99.5 54 Z" fill="#fff"/>' ++ '<rect x="174" y="83" width="25" height="11" rx="2.5" fill="#000" opacity=".72"/>' ++ '<text x="186.5" y="91" font-size="7.5" font-weight="600" fill="#fff" text-anchor="middle">2:14</text>',+ md:+ '<rect x="16" y="8" width="174" height="100" rx="1.5" fill="#fff"/>' ++ '<g font-family="ui-monospace,Menlo,Consolas,monospace" font-size="6.4" fill="#4a5060">' ++ '<text x="24" y="21" fill="#1d2130" font-weight="700"># Pricing notes</text>' ++ '<text x="24" y="34">- Starter: $12 / seat</text>' ++ '<text x="24" y="44">- Pro: $29 / seat</text>' ++ '<text x="24" y="54">- Team: $79 / seat</text>' ++ '<text x="24" y="67" fill="#8a90a0">> Annual billing: 2 months free</text>' ++ '<text x="24" y="80" fill="#1d2130" font-weight="700">## Open questions</text>' ++ '<text x="24" y="92">- EU VAT on seat add-ons?</text></g>',+ jpg:+ '<defs><linearGradient id="cm-sky" x1="0" y1="0" x2="0" y2="1">' ++ '<stop offset="0" stop-color="#7db8ea"/><stop offset="1" stop-color="#e3f1fb"/></linearGradient>' ++ '<linearGradient id="cm-lake" x1="0" y1="0" x2="0" y2="1">' ++ '<stop offset="0" stop-color="#6d9cc4"/><stop offset="1" stop-color="#2f5d85"/></linearGradient></defs>' ++ '<rect width="206" height="62" fill="url(#cm-sky)"/>' ++ '<circle cx="160" cy="20" r="7" fill="#fffbe8"/>' ++ '<path d="M0 58 L22 36 L38 46 L64 20 L88 44 L104 34 L128 52 L150 30 L176 48 L192 38 L206 46 V62 H0 Z" fill="#9db3c9"/>' ++ '<path d="M64 20 L57 27 L61 25.5 L64 28 L67.5 25.5 L71 27 Z M150 30 L144 36 L148 34.5 L151 37 L154.5 34.5 L158.7 36 Z" fill="#fff"/>' ++ '<path d="M0 62 V50 C20 46 36 54 58 52 C84 50 100 58 124 56 C150 54 176 50 206 54 V62 Z" fill="#4c7a5a"/>' ++ '<rect y="62" width="206" height="38" fill="url(#cm-lake)"/>' ++ '<path d="M122 70 H150 M134 76 H168 M112 84 H132" stroke="#fff" stroke-opacity=".35"/>' ++ '<path d="M86 74 Q100 79 116 74 Z" fill="#c8553d"/>' ++ '<g fill="#23402f"><path d="M6 100 L15 60 L24 100 Z"/><path d="M19 100 L29 50 L39 100 Z"/>' ++ '<path d="M35 100 L42 70 L49 100 Z"/></g>',+ wav: (function () {+ // Speech-like waveform: words (sin lobes) with short pauses between them.+ var bars = "";+ for (var i = 0; i < 46; i++) {+ var h =+ 3 ++ 44 * Math.abs(Math.sin(i * 0.55)) * (0.55 + 0.45 * Math.abs(Math.sin(i * 1.7)));+ bars +=+ '<rect x="' ++ (13 + i * 4) ++ '" y="' ++ (50 - h / 2) ++ '" width="2.4" height="' ++ h ++ '" rx="1.2"/>';+ }+ return '<g fill="currentColor">' + bars + "</g>";+ })(),+ };+ var FILES = [+ ["Q3 roadmap", "pdf", "1.2 MB · PDF"],+ ["Launch film v4", "mp4", "2.4 GB · Video"],+ ["Pricing notes", "md", "18 KB · Text"],+ ["Team offsite", "jpg", "4.8 MB · Image"],+ ["Voiceover final", "wav", "38 MB · Audio"],+ ["Launch film v4 copy", "mp4", "2.4 GB · Video"],+ ];+ var TARGET = 1;+ var cards = FILES.map(function (f) {+ var card = document.createElement("div");+ card.className = "cm-file";+ card.innerHTML =+ '<div class="cm-thumb"><svg viewBox="0 0 206 100" preserveAspectRatio="xMidYMid slice">' ++ THUMBS[f[1] === "mp4" ? "video" : f[1]] ++ "</svg></div>" ++ '<div class="cm-name">' ++ f[0] ++ "." ++ f[1] ++ '</div><div class="cm-meta">' ++ f[2] ++ "</div>";+ grid.appendChild(card);+ return card;+ });+ var copy = cards[5];+ var targetName = cards[TARGET].querySelector(".cm-name");+ var rows = labels.map(function (label, i) {+ if (i > 0 && i === labels.length - 1 && /trash|delete/i.test(label)) {+ var sep = document.createElement("div");+ sep.className = "cm-sep";+ menu.appendChild(sep);+ }+ var row = document.createElement("div");+ row.className = "cm-item";+ row.textContent = label;+ menu.appendChild(row);+ return row;+ });+ var action = /duplicate/i.test(labels[pick])+ ? "duplicate"+ : /rename/i.test(labels[pick])+ ? "rename"+ : /trash|delete/i.test(labels[pick])+ ? "trash"+ : "toast";+ toast.textContent = labels[pick] + " · " + FILES[TARGET][0] + "." + FILES[TARGET][1];++ var W = root.clientWidth || 1920;+ var H = root.clientHeight || 1080;+ var u = W / 1920;+ var ARROW = 64 * u;+ cursor.style.width = cursor.style.height = ARROW + "px";+ cursor.style.left = (-5 / 24) * ARROW + "px";+ cursor.style.top = (-3 / 24) * ARROW + "px";++ // Layout-space offsets, which ignore any transform a host puts on the player.+ function offsetIn(el) {+ var x = 0;+ var y = 0;+ while (el && el !== root) {+ x += el.offsetLeft;+ y += el.offsetTop;+ el = el.offsetParent;+ }+ return { x: x, y: y };+ }++ var squeeze = Math.min(1, duration / 3.9);+ var T = {+ glide: 0.5,+ rclick: 0.7,+ bloom: 0.77,+ travel0: 1.2,+ travel1: 1.65,+ click: 1.85,+ collapse: 2.03,+ act: 2.15,+ away0: 2.75,+ away1: 3.15,+ };+ for (var key in T) T[key] *= squeeze;++ var bloomEase = gsap.parseEase("expo.out");+ var easeInOut = gsap.parseEase("power2.inOut");+ var easeOut = gsap.parseEase("power3.out");+ var springBack = gsap.parseEase("back.out(2.5)");+ function seg(t, a, b) {+ return Math.max(0, Math.min(1, (t - a) / (b - a)));+ }+ function lerp(a, b, k) {+ return { x: a.x + (b.x - a.x) * k, y: a.y + (b.y - a.y) * k };+ }+ // Right-click: press, a short hold, then a release that overshoots a touch.+ function press(t, at, depth) {+ var d = 0.05 * squeeze;+ if (t < at || t > at + d * 5) return 1;+ if (t < at + d) return 1 - depth * seg(t, at, at + d);+ if (t < at + d * 1.8) return 1 - depth;+ return 1 - depth + depth * springBack(seg(t, at + d * 1.8, at + d * 5));+ }++ function render(t) {+ var tc = offsetIn(cards[TARGET]);+ var cw = cards[TARGET].offsetWidth;+ var ch = cards[TARGET].offsetHeight;+ var anchor = { x: tc.x + cw * 0.62, y: tc.y + ch * 0.42 };++ // Open right and down from the tip, flipping on the side that would leave the frame.+ var mw = menu.offsetWidth;+ var mh = menu.offsetHeight;+ var left = anchor.x + mw + 6 * u > W - 24 * u;+ var up = anchor.y + mh + 6 * u > H - 24 * u;+ var mx = left ? anchor.x - mw - 6 * u : anchor.x + 6 * u;+ var my = up ? anchor.y - mh - 6 * u : anchor.y + 6 * u;+ menu.style.transformOrigin = (left ? "100%" : "0") + " " + (up ? "100%" : "0");++ var open = seg(t, T.bloom, T.bloom + 0.22 * squeeze);+ var shut = seg(t, T.collapse, T.collapse + 0.14 * squeeze);+ var menuScale = 0.95 + 0.05 * bloomEase(open) - 0.03 * shut;+ menu.style.opacity = String(Math.min(1, open * 3) * (1 - shut));+ menu.style.transform = "translate(" + mx + "px," + my + "px) scale(" + menuScale + ")";+ rows.forEach(function (row, i) {+ var k = easeOut(+ seg(t, T.bloom + i * 0.025 * squeeze, T.bloom + (i * 0.025 + 0.16) * squeeze),+ );+ row.style.opacity = String(k);+ row.style.transform = "translateY(" + (1 - k) * -4 * u + "px)";+ });++ var itemPoint = {+ x: mx + mw * 0.34,+ y: my + rows[pick].offsetTop + rows[pick].offsetHeight * 0.55,+ };+ var start = { x: -0.06 * W, y: 1.1 * H };+ // Rest just below the window so the cursor never covers the result.+ var win = grid.parentNode;+ var aside = {+ x: itemPoint.x + (left ? -1 : 1) * 160 * u,+ y: Math.min(H - 80 * u, offsetIn(win).y + win.offsetHeight + 36 * u),+ };+ var p;+ if (t < T.glide) p = lerp(start, anchor, easeOut(seg(t, 0, T.glide)));+ else if (t < T.travel0) p = anchor;+ else if (t < T.travel1)+ p = lerp(anchor, itemPoint, easeInOut(seg(t, T.travel0, T.travel1)));+ else if (t < T.away0) p = itemPoint;+ else p = lerp(itemPoint, aside, easeInOut(seg(t, T.away0, T.away1)));++ // The highlight is whichever row sits under the tip; it blinks once on the click.+ var live = open > 0.6 && shut === 0 && p.x > mx && p.x < mx + mw;+ var blink = t > T.click + 0.06 * squeeze && t < T.click + 0.12 * squeeze;+ rows.forEach(function (row) {+ var top = my + row.offsetTop;+ var hit = live && p.y >= top && p.y < top + row.offsetHeight;+ row.classList.toggle("is-hover", hit && !blink);+ });++ var done = t >= T.act;+ var k = easeOut(seg(t, T.act, T.act + 0.32 * squeeze));+ cards[TARGET].classList.toggle(+ "is-on",+ t >= T.rclick && !(done && action === "duplicate"),+ );+ copy.classList.toggle("is-on", done && action === "duplicate");+ var showCopy = action === "duplicate" ? k : 0;+ copy.style.opacity = String(showCopy);+ copy.style.transform =+ "translateY(" ++ (1 - showCopy) * 18 * u ++ "px) scale(" ++ (0.94 + 0.06 * showCopy) ++ ")";+ var gone = action === "trash" ? k : 0;+ cards[TARGET].style.opacity = String(1 - gone);+ cards[TARGET].style.transform = "scale(" + (1 - 0.08 * gone) + ")";+ var editing = done && action === "rename";+ targetName.classList.toggle("is-edit", editing);+ targetName.innerHTML = editing+ ? "<b>" + FILES[TARGET][0] + "</b>." + FILES[TARGET][1]+ : FILES[TARGET][0] + "." + FILES[TARGET][1];+ var showToast = action === "toast" ? k : 0;+ toast.style.opacity = String(showToast);+ toast.style.transform = "translate(-50%," + (1 - showToast) * 20 * u + "px)";++ var s = press(t, T.rclick, 0.1) * press(t, T.click, 0.12);+ cursor.style.transform = "translate(" + p.x + "px," + p.y + "px) scale(" + s + ")";+ }++ var clock = { t: 0 };+ var tl = gsap.timeline({ paused: true });+ tl.to(+ clock,+ {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ render(clock.t);+ },+ },+ 0,+ );+ render(0);+ tl.seek(0);+ window.__timelines = window.__timelines || {};+ window.__timelines[compositionId] = tl;+ })();+ </script>+ </template>+ </body>+</html>diff --git a/registry/components/cursor-context-menu/demo.html b/registry/components/cursor-context-menu/demo.htmlnew file mode 100644index 0000000000..9dd7e21456--- /dev/null+++ b/registry/components/cursor-context-menu/demo.html@@ -0,0 +1,69 @@+<!doctype html>+<!--+ Context Menu Cursor, standalone demo. Mounts cursor-context-menu.html full-frame over a+ flat light ground; the component draws its own folder window.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Context Menu Cursor, Demo</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ width: 100%;+ height: 100%;+ overflow: hidden;+ }+ #root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #f4f4f5;+ }+ .backdrop {+ position: absolute;+ inset: 0;+ }+ </style>+ </head>+ <body>+ <div+ id="root"+ data-composition-id="cursor-context-menu-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="3.9"+ >+ <div class="backdrop clip" data-start="0" data-duration="3.9" data-track-index="0"></div>+ <div+ class="clip"+ id="cursor-context-menu"+ data-composition-id="cursor-context-menu"+ data-composition-src="./cursor-context-menu.html"+ data-variable-values='{"items":"Open,Rename,Duplicate,Share,Move to Trash","pick":2,"tone":"light"}'+ data-start="0"+ data-duration="3.9"+ data-track-index="1"+ data-width="1920"+ data-height="1080"+ style="position: absolute; inset: 0; width: 1920px; height: 1080px"+ ></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};+ var tl = gsap.timeline({ paused: true });+ window.__timelines["cursor-context-menu-demo"] = tl;+ </script>+ </body>+</html>diff --git a/registry/components/cursor-context-menu/registry-item.json b/registry/components/cursor-context-menu/registry-item.jsonnew file mode 100644index 0000000000..824c9d6b1e--- /dev/null+++ b/registry/components/cursor-context-menu/registry-item.json@@ -0,0 +1,52 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "cursor-context-menu",+ "type": "hyperframes:component",+ "title": "Context Menu Cursor",+ "description": "A cursor right-clicks a file, a context menu blooms from its tip, the hover highlight tracks the item under it, and the chosen action plays out: duplicate, rename, move to trash, or a confirmation toast.",+ "tags": ["cursor", "motion-primitive", "menu", "right-click", "desktop", "files"],+ "files": [+ {+ "path": "cursor-context-menu.html",+ "target": "compositions/components/cursor-context-menu.html",+ "type": "hyperframes:snippet"+ }+ ],+ "jobs": ["demonstrate"],+ "family": "pointers",+ "profile": "interaction",+ "syncPoints": [+ { "id": "right-click", "phase": "in", "offset": 0.7 },+ { "id": "menu-pick", "phase": "in", "offset": 1.85 }+ ],+ "variables": [+ {+ "id": "items",+ "type": "string",+ "role": "content",+ "label": "Menu items",+ "default": "Open,Rename,Duplicate,Share,Move to Trash"+ },+ {+ "id": "pick",+ "type": "number",+ "role": "content",+ "label": "Chosen item (0 = first)",+ "default": 2,+ "min": 0,+ "max": 9,+ "step": 1+ },+ {+ "id": "tone",+ "type": "enum",+ "role": "style",+ "label": "Tone",+ "default": "light",+ "options": [+ { "value": "light", "label": "Light" },+ { "value": "dark", "label": "Dark" }+ ]+ }+ ]+}diff --git a/registry/components/cursor-drag-drop/cursor-drag-drop.html b/registry/components/cursor-drag-drop/cursor-drag-drop.htmlnew file mode 100644index 0000000000..72d57b85f8--- /dev/null+++ b/registry/components/cursor-drag-drop/cursor-drag-drop.html@@ -0,0 +1,464 @@+<!doctype html>+<!--+ Drag and Drop Cursor (actor primitive), mountable sub-composition++ concept: a task board where the cursor grabs the second card of "To do", lifts it,+ carries it in lockstep to the empty "In progress" slot, drops it with a small settle,+ and leaves. The list below closes the gap and both column counts update.++ mount contract: loaded by a host through data-composition-src; only <template> is+ cloned. #root fills the host clip and letterboxes a 1920x1080 board inside it.++ variables:+ card_label (string) title of the card that gets dragged+ accent (color) drop slot highlight+ tone (light|dark) board surface++ envelope (default 3.6s): arrive 0-0.5s, grab 0.7s, carry 0.9-2.0s, drop 2.0s,+ hold, drift aside 2.6s, exit in the last 0.5s. Shorter durations compress every beat evenly.+-->+<html+ lang="en"+ data-composition-id="cursor-drag-drop"+ data-composition-duration="3.6"+ data-composition-variables='[+ { "id": "card_label", "type": "string", "role": "content", "label": "Dragged card", "default": "Fix checkout validation" },+ { "id": "accent", "type": "color", "role": "style", "label": "Accent", "default": "#0a84ff" },+ { "id": "tone", "type": "enum", "role": "style", "label": "Board tone", "default": "light", "options": [ { "value": "light", "label": "Light" }, { "value": "dark", "label": "Dark" } ] }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Drag and Drop Cursor</title>+ </head>+ <body>+ <template>+ <style>+ #root {+ position: absolute;+ inset: 0;+ overflow: hidden;+ isolation: isolate;+ font-family: var(--font-body, Inter, system-ui, sans-serif);+ --dd-accent: #0a84ff;+ --dd-col: #eceef4;+ --dd-card: #ffffff;+ --dd-text: #151823;+ --dd-muted: #6b7085;+ --dd-line: rgba(21, 24, 35, 0.08);+ --dd-badge: #e4e4e7;+ --dd-badge-text: #3f3f46;+ }+ #root[data-tone="dark"] {+ --dd-col: #1b1e29;+ --dd-card: #262a38;+ --dd-text: #f2f3f7;+ --dd-muted: #9a9fb3;+ --dd-line: rgba(255, 255, 255, 0.08);+ --dd-badge: #3f3f46;+ --dd-badge-text: #e4e4e7;+ }+ .dd-stage {+ position: absolute;+ left: 0;+ top: 0;+ width: 1920px;+ height: 1080px;+ transform-origin: 0 0;+ }+ .dd-col {+ position: absolute;+ top: 200px;+ width: 520px;+ height: 690px;+ border-radius: 28px;+ background: var(--dd-col);+ }+ .dd-col-head {+ position: absolute;+ left: 28px;+ top: 30px;+ display: flex;+ align-items: center;+ gap: 14px;+ font-size: 26px;+ font-weight: 700;+ color: var(--dd-text);+ }+ .dd-count {+ min-width: 38px;+ padding: 4px 12px;+ border-radius: 999px;+ font-size: 20px;+ text-align: center;+ color: var(--dd-badge-text);+ background: var(--dd-badge);+ }+ .dd-card,+ .dd-slot {+ position: absolute;+ width: 480px;+ height: 120px;+ border-radius: 18px;+ }+ .dd-card {+ background: var(--dd-card);+ box-shadow:+ 0 1px 2px rgba(10, 12, 20, 0.08),+ 0 0 0 1px var(--dd-line);+ will-change: transform;+ }+ .dd-lift {+ position: absolute;+ inset: 0;+ border-radius: inherit;+ box-shadow: 0 28px 60px rgba(10, 12, 30, 0.28);+ opacity: 0;+ }+ .dd-chip {+ position: absolute;+ left: 24px;+ top: 20px;+ padding: 4px 12px;+ border-radius: 8px;+ font-size: 16px;+ font-weight: 600;+ color: var(--chip);+ background: color-mix(in srgb, var(--chip) 14%, transparent);+ }+ .dd-title {+ position: absolute;+ left: 24px;+ top: 58px;+ font-size: 24px;+ font-weight: 650;+ letter-spacing: -0.01em;+ color: var(--dd-text);+ white-space: nowrap;+ }+ .dd-meta {+ position: absolute;+ right: 24px;+ top: 18px;+ display: flex;+ align-items: center;+ gap: 10px;+ font-size: 16px;+ color: var(--dd-muted);+ }+ .dd-avatar {+ width: 34px;+ height: 34px;+ border-radius: 50%;+ display: grid;+ place-items: center;+ font-size: 13px;+ font-weight: 700;+ color: #ffffff;+ background: var(--av);+ }+ .dd-slot {+ border: 3px dashed color-mix(in srgb, var(--dd-muted) 45%, transparent);+ opacity: 0;+ }+ .dd-slot-hot {+ position: absolute;+ inset: -3px;+ border-radius: inherit;+ border: 3px solid var(--dd-accent);+ background: color-mix(in srgb, var(--dd-accent) 10%, transparent);+ opacity: 0;+ }+ .dd-cursor {+ position: absolute;+ left: 0;+ top: 0;+ /* The stage zoom (1.15) brings this to the family 3px/4px shadow. */+ filter: drop-shadow(0 2.6px 3.5px rgba(0, 0, 0, 0.3));+ will-change: transform;+ z-index: 20;+ }+ .dd-cursor svg {+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ }+ </style>++ <div id="root" data-composition-id="cursor-drag-drop" data-duration="3.6" data-tone="light">+ <div class="dd-stage" id="dd-stage">+ <div class="dd-col" style="left: 380px">+ <div class="dd-col-head">To do <span class="dd-count" id="dd-count-a">4</span></div>+ </div>+ <div class="dd-col" style="left: 1020px">+ <div class="dd-col-head">+ In progress <span class="dd-count" id="dd-count-b">0</span>+ </div>+ </div>+ <div class="dd-slot" id="dd-slot" style="left: 1040px; top: 300px">+ <div class="dd-slot-hot" id="dd-slot-hot"></div>+ </div>++ <div class="dd-card" id="dd-card-0" style="left: 400px; top: 300px">+ <div class="dd-chip" style="--chip: #d9480f">Marketing</div>+ <div class="dd-title">Draft onboarding email</div>+ <div class="dd-meta">Thu <span class="dd-avatar" style="--av: #e8590c">AR</span></div>+ </div>+ <div class="dd-card" id="dd-card-2" style="left: 400px; top: 576px">+ <div class="dd-chip" style="--chip: #2b8a3e">Video</div>+ <div class="dd-title">Record product walkthrough</div>+ <div class="dd-meta">Mon <span class="dd-avatar" style="--av: #2f9e44">KL</span></div>+ </div>+ <div class="dd-card" id="dd-card-3" style="left: 400px; top: 714px">+ <div class="dd-chip" style="--chip: #1971c2">Docs</div>+ <div class="dd-title">Update pricing FAQ</div>+ <div class="dd-meta">Tue <span class="dd-avatar" style="--av: #1c7ed6">SM</span></div>+ </div>+ <div class="dd-card" id="dd-card-1" style="left: 400px; top: 438px; z-index: 10">+ <div class="dd-lift" id="dd-lift"></div>+ <div class="dd-chip" style="--chip: #c2255c">Bug</div>+ <div class="dd-title" id="dd-label"></div>+ <div class="dd-meta">Today <span class="dd-avatar" style="--av: #d6336c">JP</span></div>+ </div>++ <div class="dd-cursor" id="dd-cursor" aria-hidden="true">+ <svg viewBox="0 0 24 24">+ <path+ d="M5 3 L5 19 L9 15 L12 22 L15 20.5 L11.5 14 L18 14 Z"+ fill="#ffffff"+ stroke="#141414"+ stroke-width="1.4"+ stroke-linejoin="round"+ />+ </svg>+ </div>+ </div>+ </div>++ <script>+ (function () {+ "use strict";++ var html = document.documentElement;+ var root = document.getElementById("root");+ var $ = function (id) {+ return document.getElementById(id);+ };++ var DEFAULTS = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(+ function (variable) {+ DEFAULTS[variable.id] = variable.default;+ },+ );+ } catch (error) {+ /* malformed declaration falls back to the inline defaults below */+ }+ var scopedVariables = {};+ try {+ if (window.__hyperframes && typeof window.__hyperframes.getVariables === "function") {+ scopedVariables = window.__hyperframes.getVariables() || {};+ }+ } catch (error) {+ /* no scoped variables API in this context */+ }+ var vars = Object.assign({}, DEFAULTS, window.__hfVariables || {}, scopedVariables);++ // Hardcoded: the compositor rewrites the wrapper's attributes on mount.+ var compositionId = "cursor-drag-drop";+ var duration = Math.max(+ 0.001,+ parseFloat(+ root.dataset.duration || html.getAttribute("data-composition-duration") || "3.6",+ ),+ );+ root.setAttribute("data-tone", vars.tone === "dark" ? "dark" : "light");+ if (vars.accent) root.style.setProperty("--dd-accent", String(vars.accent));+ $("dd-label").textContent = String(vars.card_label || "Fix checkout validation");++ var W = root.clientWidth || 1920;+ var H = root.clientHeight || 1080;+ var fit = Math.min(W / 1920, H / 1080);+ var ZOOM = 1.15;+ $("dd-stage").style.transform =+ "translate(" ++ (W - 1920 * fit) / 2 ++ "px," ++ (H - 1080 * fit) / 2 ++ "px) scale(" ++ fit ++ ") translate(960px,545px) scale(" ++ ZOOM ++ ") translate(-960px,-545px)";++ var s = Math.min(1, duration / 3.6);+ var T_ARRIVE = 0.5 * s;+ var T_PRESS = 0.7 * s;+ var T_CARRY = 0.9 * s;+ var T_DROP = 2.0 * s;+ var T_DRIFT = 2.6 * s;+ var T_EXIT = duration - 0.5 * s;++ var easeArrive = gsap.parseEase("power3.out");+ var easeOut = gsap.parseEase("power2.out");+ var easeCarry = gsap.parseEase("power3.inOut");+ var easeExit = gsap.parseEase("power3.in");+ var easeSettle = gsap.parseEase("back.out(2.2)");+ function clamp01(u) {+ return u < 0 ? 0 : u > 1 ? 1 : u;+ }+ function smooth(u) {+ u = clamp01(u);+ return u * u * (3 - 2 * u);+ }+ function arc(p0, p1, bend, u) {+ var cx = (p0.x + p1.x) / 2 - (p1.y - p0.y) * bend;+ var cy = (p0.y + p1.y) / 2 + (p1.x - p0.x) * bend;+ var v = 1 - u;+ return {+ x: v * v * p0.x + 2 * v * u * cx + u * u * p1.x,+ y: v * v * p0.y + 2 * v * u * cy + u * u * p1.y,+ };+ }++ // Board coordinates: the grip point on the card, and where the card lands.+ var GRIP = { x: 730, y: 500 };+ var DROP = { x: 640, y: -138 };+ var ORIGIN = { x: 0, y: 0 };+ var START = { x: 2080, y: 1240 };+ var ASIDE = { x: GRIP.x + DROP.x + 110, y: GRIP.y + DROP.y + 90 };+ // 64px at 1920 wide on screen, in stage units.+ var ARROW = (64 * (W / 1920)) / (fit * ZOOM);+ var ARROW_TIP = { x: (5 / 24) * ARROW, y: (3 / 24) * ARROW };++ function carryAt(t) {+ if (t <= T_CARRY) return ORIGIN;+ if (t >= T_DROP) return DROP;+ return arc(ORIGIN, DROP, -0.12, easeCarry((t - T_CARRY) / (T_DROP - T_CARRY)));+ }+ function pointerAt(t) {+ if (t <= T_ARRIVE) return arc(START, GRIP, 0.18, easeArrive(clamp01(t / T_ARRIVE)));+ if (t <= T_DRIFT) {+ var c = carryAt(t);+ return { x: GRIP.x + c.x, y: GRIP.y + c.y };+ }+ var dropped = { x: GRIP.x + DROP.x, y: GRIP.y + DROP.y };+ if (t <= T_EXIT)+ return arc(dropped, ASIDE, 0.1, easeArrive(clamp01((t - T_DRIFT) / (0.5 * s))));+ return arc(ASIDE, START, -0.1, easeExit(clamp01((t - T_EXIT) / (duration - T_EXIT))));+ }++ function gapAt(t) {+ var c = carryAt(t);+ return Math.hypot(c.x - DROP.x, c.y - DROP.y);+ }+ // First time the card is over the drop column; the slot fades in from here.+ var T_HOT = T_DROP;+ for (var k = 0; k <= 200; k++) {+ var tk = T_CARRY + ((T_DROP - T_CARRY) * k) / 200;+ if (gapAt(tk) < 300) {+ T_HOT = tk;+ break;+ }+ }++ function liftAt(t) {+ if (t < T_PRESS) return 0;+ if (t < T_DROP) return smooth((t - T_PRESS) / (0.2 * s));+ return 1 - clamp01((t - T_DROP) / (0.28 * s));+ }+ function cardScaleAt(t) {+ if (t < T_DROP) return 1 + 0.04 * liftAt(t);+ var u = clamp01((t - T_DROP) / (0.34 * s));+ return 1.04 - 0.04 * easeSettle(u);+ }++ var card = $("dd-card-1");+ var lift = $("dd-lift");+ var below = [$("dd-card-2"), $("dd-card-3")];+ var slotHot = $("dd-slot-hot");+ var slot = $("dd-slot");+ var cursor = $("dd-cursor");+ var countA = $("dd-count-a");+ var countB = $("dd-count-b");+ cursor.style.width = cursor.style.height = ARROW + "px";+ cursor.style.transformOrigin = ARROW_TIP.x + "px " + ARROW_TIP.y + "px";+ // Pivot the lifted card on the grip point so it stays under the arrow tip.+ var gripX = GRIP.x - parseFloat(card.style.left);+ var gripY = GRIP.y - parseFloat(card.style.top);+ card.style.transformOrigin = gripX + "px " + gripY + "px";++ function render(t) {+ var c = carryAt(t);+ var lagged = carryAt(Math.max(0, t - 0.06));+ var ahead = carryAt(Math.min(duration, t + 0.02));+ var vx = (ahead.x - lagged.x) / 0.08;+ var tilt = Math.max(-3, Math.min(3, (vx / 1200) * 3)) * liftAt(t);+ card.style.transform =+ "translate(" ++ c.x.toFixed(2) ++ "px," ++ c.y.toFixed(2) ++ "px) rotate(" ++ tilt.toFixed(2) ++ "deg) scale(" ++ cardScaleAt(t).toFixed(4) ++ ")";+ lift.style.opacity = liftAt(t).toFixed(3);++ var close = easeCarry(clamp01((t - T_CARRY - 0.15 * s) / (0.4 * s)));+ below.forEach(function (el) {+ el.style.transform = "translateY(" + (-138 * close).toFixed(2) + "px)";+ });++ var hot =+ t < T_DROP ? smooth(1 - gapAt(t) / 300) : 1 - clamp01((t - T_DROP) / (0.3 * s));+ slotHot.style.opacity = hot.toFixed(3);+ slot.style.opacity = (+ t < T_DROP ? clamp01((t - T_HOT) / 0.12) : 1 - clamp01((t - T_DROP) / (0.3 * s))+ ).toFixed(3);++ countA.textContent = t >= T_CARRY + 0.15 * s ? "3" : "4";+ countB.textContent = t >= T_DROP ? "1" : "0";++ var p = pointerAt(t);+ // Held down at 0.9 from grab to drop, 100ms each way.+ var press =+ t < T_DROP+ ? 1 - 0.1 * easeOut(clamp01((t - T_PRESS) / 0.1))+ : 0.9 + 0.1 * easeOut(clamp01((t - T_DROP) / 0.1));+ cursor.style.transform =+ "translate(" ++ (p.x - ARROW_TIP.x).toFixed(2) ++ "px," ++ (p.y - ARROW_TIP.y).toFixed(2) ++ "px) scale(" ++ press.toFixed(4) ++ ")";+ }++ var clock = { t: 0 };+ var tl = gsap.timeline({ paused: true });+ tl.to(+ clock,+ {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ render(clock.t);+ },+ },+ 0,+ );+ render(0);+ tl.seek(0);+ window.__timelines = window.__timelines || {};+ window.__timelines[compositionId] = tl;+ })();+ </script>+ </template>+ </body>+</html>diff --git a/registry/components/cursor-drag-drop/demo.html b/registry/components/cursor-drag-drop/demo.htmlnew file mode 100644index 0000000000..dd2d809c01--- /dev/null+++ b/registry/components/cursor-drag-drop/demo.html@@ -0,0 +1,64 @@+<!doctype html>+<!--+ Drag and Drop Cursor, standalone demo: mounts cursor-drag-drop.html full-frame over a+ flat backdrop. The board and every reaction live inside the component.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Drag and Drop Cursor, Demo</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ width: 100%;+ height: 100%;+ overflow: hidden;+ }+ #root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #f4f4f5;+ }+ </style>+ </head>+ <body>+ <div+ id="root"+ data-composition-id="cursor-drag-drop-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="3.6"+ >+ <div+ class="clip"+ id="cursor-drag-drop"+ data-composition-id="cursor-drag-drop"+ data-composition-src="./cursor-drag-drop.html"+ data-variable-values='{"card_label":"Fix checkout validation","accent":"#0a84ff","tone":"light"}'+ data-start="0"+ data-duration="3.6"+ data-track-index="1"+ data-width="1920"+ data-height="1080"+ style="position: absolute; inset: 0; width: 1920px; height: 1080px"+ ></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};+ var tl = gsap.timeline({ paused: true });+ window.__timelines["cursor-drag-drop-demo"] = tl;+ </script>+ </body>+</html>diff --git a/registry/components/cursor-drag-drop/registry-item.json b/registry/components/cursor-drag-drop/registry-item.jsonnew file mode 100644index 0000000000..74a6555ca7--- /dev/null+++ b/registry/components/cursor-drag-drop/registry-item.json@@ -0,0 +1,49 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "cursor-drag-drop",+ "type": "hyperframes:component",+ "title": "Drag and Drop Cursor",+ "description": "A cursor grabs a task card, lifts and tilts it into its motion, carries it in lockstep to an empty column, drops it with a small settle, and the list closes the gap behind it.",+ "tags": ["cursor", "motion-primitive", "drag", "drop", "kanban", "product-demo"],+ "files": [+ {+ "path": "cursor-drag-drop.html",+ "target": "compositions/components/cursor-drag-drop.html",+ "type": "hyperframes:snippet"+ }+ ],+ "jobs": ["demonstrate"],+ "family": "pointers",+ "profile": "interaction",+ "syncPoints": [+ { "id": "grab", "phase": "in", "offset": 0.7 },+ { "id": "drop", "phase": "in", "offset": 2 }+ ],+ "variables": [+ {+ "id": "card_label",+ "type": "string",+ "role": "content",+ "label": "Dragged card",+ "default": "Fix checkout validation"+ },+ {+ "id": "accent",+ "type": "color",+ "role": "style",+ "label": "Accent",+ "default": "#0a84ff"+ },+ {+ "id": "tone",+ "type": "enum",+ "role": "style",+ "label": "Board tone",+ "default": "light",+ "options": [+ { "value": "light", "label": "Light" },+ { "value": "dark", "label": "Dark" }+ ]+ }+ ]+}diff --git a/registry/components/cursor-glyph-trail/README.md b/registry/components/cursor-glyph-trail/README.mdindex a29e1add5c..4ec539b8b6 100644--- a/registry/components/cursor-glyph-trail/README.md+++ b/registry/components/cursor-glyph-trail/README.md@@ -1,23 +1,23 @@# cursor-glyph-trail-An actor (default: a cursor dot) travels an authored path and deposits small dithered glyphs at its past positions. Each glyph pops in where the actor passed and decays in place; stamps land at fixed arc-length spacing along the path, so the per-second stamp rate scales with the actor's velocity. The jh3yy stamp-and-decay register: the trail is the residue of the motion, fully dissolved before the hold.+A tutorial cursor path. On a Settings screen the arrow clicks through three steps: turn on the email digest, pick Weekly, save. Each move leaves a dotted trail spaced evenly by distance (not by time), each click leaves a numbered step marker, and a step's trail fades as the next move begins, so a viewer can follow the path without the screen filling with noise. The markers stay, so the last frame reads as the recap.-4s authored, elastic HOLD, exit `none` by default.+3.5s authored, elastic HOLD, exit `none` by default.## Variables-| id | type | default | notes |-| --------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------- |-| `glyphs` | string | `░▒▓+·×` | Stamp charset; one glyph per stamp is chosen by a fixed-seed LCG. |-| `density` | enum | `med` | Arc-length spacing between stamps: `low` (4.6), `med` (2.9), `high` (1.8) percent units. |-| `path` | enum | `sweep` | `sweep` is an S-curve lower-left to upper-right; `arc` rises over the top; `zigzag` cuts three straight legs. |-| `fade` | number | `0.8` | Per-stamp decay window in seconds, clamped 0.3 to 1.5; per stamp varied 0.75x to 1.25x. |-| `accent` | enum | `green` | Trail and actor color: green rides `--brand`, blue rides `--accent`, violet rides `--accent-2`. |-| `exit` | enum | `none` | `none` holds until the cut; `fade` departs opacity-only; `up` rises out. |+| id | type | default | notes |+| --------- | ------ | ------- | ------------------------------------------------------------------------------------------------ |+| `glyphs` | string | `""` | Deprecated and ignored; still accepted so existing mounts keep working. |+| `density` | enum | `med` | Spacing between trail dots: `low` (30), `med` (21), `high` (15) px at 1920 wide. |+| `path` | enum | `sweep` | How each move bends: `sweep` a gentle curve, `arc` a deeper one, `zigzag` a straight line. |+| `fade` | number | `0.5` | Seconds a step trail takes to fade once the next move begins, clamped 0.3 to 1.5. |+| `accent` | enum | `green` | Trail and marker color: green rides `--brand`, blue rides `--accent`, violet rides `--accent-2`. |+| `exit` | enum | `none` | `none` holds until the cut; `fade` departs opacity-only; `up` rises out. |## Actor slot-The actor is a slot. Place an inert template anywhere in the HOST page (templates never render, and the runtime wipes the host clip's own children on mount, so the slot lives at document level):+The arrow can be replaced. Place an inert template anywhere in the HOST page (templates never render, and the runtime wipes the host clip's own children on mount, so the slot lives at document level); its content is centred on the click point:```html<template data-slot="cursor-glyph-trail-actor">@@ -25,7 +25,7 @@ The actor is a slot. Place an inert template anywhere in the HOST page (template</template>```-With no slot, the primitive renders a token cursor dot (accent core, hairline ring, contract tokens only).+With no slot, the component draws the family arrow (64 px at 1920 wide).## Mount@@ -34,9 +34,9 @@ With no slot, the primitive renders a token cursor dot (accent core, hairline riclass="clip"data-composition-id="cursor-glyph-trail"data-composition-src="./cursor-glyph-trail.html"- data-variable-values='{"path":"zigzag","density":"high","accent":"blue"}'+ data-variable-values='{"path":"sweep","density":"med","accent":"green"}'data-start="0"- data-duration="4"+ data-duration="3.5"data-track-index="0"></div>```@@ -45,7 +45,6 @@ Elastic root: no `data-width`/`data-height`; it fills whatever box the host clip## Notes-- Deterministic: the stamp table (positions, times, glyph choices, jitter, sizes, peaks, decay multipliers) is built once at mount from fixed LCG seed `0x67117a11`. Stamps carry no tweens: each stamp's opacity is recomputed on every timeline update as a pure function `f(tl.time() - t_i)` of its table row (two sequential tweens on one property render in direction-dependent order under GSAP seeks), and the actor position is recomputed from `tl.time()` the same way, so eventful seeks (`suppressEvents=false`, the engine's render path) land identical frames in any order and either direction.-- Density law: stamps land at fixed arc-length spacing, so faster travel deposits more stamps per second; the shared ease (power2-style inOut) makes the trail thin at the ends and dense through the middle.-- Every stamp's decay completes inside IN by construction (`IN = travel + pop + fade * 1.25 + margin`), so the HOLD is truly still: the actor rests at the path end and the field is empty.-- The travel ease is one shared function used by both the stamp-table sampler and the per-update actor position, so stamps always sit exactly on the actor's past path.+- Seek-safe: every frame is `render(t)`. The trail at time t is the part of each move's curve the cursor has covered by t, so seeking in any order lands the same frame.+- Dots are a round-capped zero-length dash pattern along the covered part of the curve, which is what spaces them by distance.+- Shorter durations compress every beat evenly.diff --git a/registry/components/cursor-glyph-trail/cursor-glyph-trail.html b/registry/components/cursor-glyph-trail/cursor-glyph-trail.htmlindex 76d342a385..7806315c08 100644--- a/registry/components/cursor-glyph-trail/cursor-glyph-trail.html+++ b/registry/components/cursor-glyph-trail/cursor-glyph-trail.html@@ -1,75 +1,30 @@<!doctype html><!--- cursor-glyph-trail: HyperFrames video primitive (product demo / trails)+ cursor-glyph-trail: a tutorial cursor path, mountable sub-composition- An actor (default: a cursor dot) travels an authored path and deposits- small dithered glyphs at its past positions. Each glyph pops in where the- actor passed and decays in place; stamps land at fixed arc-length spacing,- so the per-second stamp rate scales with the actor's velocity. The jh3yy- stamp-and-decay register: the trail is the residue of the motion, and it- has fully dissolved before the hold.+ concept: on a Settings screen the arrow clicks through three steps (turn on the email+ digest, pick Weekly, save). Each move leaves a dotted trail spaced evenly by distance, each+ click leaves a numbered step marker, and a step's trail fades as the next move begins, so+ the viewer can follow the path without the screen filling up.- The actor is a SLOT. Callers supply content by placing an inert template- anywhere in the HOST page (templates never render, and the runtime wipes- the host clip's own children on mount, so the slot lives at document- level):+ mount contract: loaded by a host through data-composition-src; only <template> is cloned.+ #root fills the host clip (inset:0) and draws its own settings window. A host may replace+ the arrow with <template data-slot="cursor-glyph-trail-actor"> at document level.- <template data-slot="cursor-glyph-trail-actor"> ... </template>-- With no slot, the primitive renders a token cursor dot (accent core,- hairline ring).-- Variables (declared in data-composition-variables below):- - glyphs (string): the stamp charset; one glyph is chosen per stamp by- a fixed-seed LCG. Default is a dithered block-and-punctuation set.- - density ("low" | "med" | "high", default "med"): arc-length spacing- between stamps; higher density means tighter spacing.- - path ("sweep" | "arc" | "zigzag", default "sweep"): the authored- travel path preset.- - fade (number seconds, default 0.8, clamped 0.3 to 1.5): the decay- window of each stamp; per-stamp decay varies 0.75x to 1.25x of it.- - accent ("green" | "blue" | "violet", default "green"): green rides- --brand, blue rides --accent, violet rides --accent-2.- - exit ("none" | "fade" | "up", default "none"): frame roots own- transitions; the default holds the final frame to the last pixel.-- Envelope, fixed IN and OUT with elastic HOLD only (never timeScale):- IN_BASE = TRAVEL (2.4s) + pop (0.07s) + fade * 1.25 + 0.05s margin;- the actor arrives at TRAVEL and every stamp's decay tween- ends inside IN, so the HOLD is truly still- HOLD = max(0, D - IN - OUT)- OUT_BASE = 0.45s only when exit != none- If D < IN_BASE + OUT_BASE, the whole envelope compresses together.-- Determinism: the stamp table (positions, times, glyph choices, jitter,- sizes, peaks, decay multipliers) is computed exactly once during- synchronous mount from fixed LCG seed 0x67117a11. On every timeline- update, each stamp's opacity is recomputed as a pure function- f(tl.time() - t_i) of its table row, and the actor's position as a pure- function of tl.time(); stamps deliberately carry NO tweens (two- sequential tweens on one property render in direction-dependent order- under GSAP seeks, which breaks byte-identical frames). No Math.random- at runtime, no wall clock, no incremental state, no- requestAnimationFrame. Eventful seeks (suppressEvents=false, the- engine's render path) land identical frames in any order and either- direction.-- Mount contract: the runtime clones only this template. #root fills the- host box (no data-width/data-height, container-type: size, cqmin units),- is styled via #root only, and registers one paused timeline under the- LITERAL "cursor-glyph-trail" key.+ envelope (default 3.5s): moves 0.1, 1.1, 2.1 (0.5s each), clicks 0.8, 1.8, 2.8, hold,+ optional 0.45s exit. Shorter durations compress every beat evenly.--><htmllang="en"data-composition-id="cursor-glyph-trail"- data-composition-duration="4"+ data-composition-duration="3.5"data-composition-variables='[- { "id": "glyphs", "type": "string", "role": "content", "label": "Glyphs", "description": "Stamp charset; one glyph per stamp is chosen deterministically.", "default": "░▒▓+·×" },- { "id": "density", "type": "enum", "role": "style", "label": "Density", "description": "Arc-length spacing between stamps along the path.", "default": "med", "options": [{ "value": "low", "label": "Low" }, { "value": "med", "label": "Medium" }, { "value": "high", "label": "High" }] },- { "id": "path", "type": "enum", "role": "timing", "label": "Path", "description": "Authored travel path preset.", "default": "sweep", "options": [{ "value": "sweep", "label": "Sweep" }, { "value": "arc", "label": "Arc" }, { "value": "zigzag", "label": "Zigzag" }] },- { "id": "fade", "type": "number", "role": "timing", "label": "Fade", "description": "Per-stamp decay window in seconds, clamped 0.3 to 1.5.", "default": 0.8 },- { "id": "accent", "type": "enum", "role": "style", "label": "Accent", "description": "Trail and actor color: green rides --brand, blue rides --accent, violet rides --accent-2.", "default": "green", "options": [{ "value": "green", "label": "Green" }, { "value": "blue", "label": "Blue" }, { "value": "violet", "label": "Violet" }] },- { "id": "exit", "type": "enum", "role": "timing", "label": "Exit", "description": "Optional departure. Default none: the settled actor holds until the frame cuts.", "default": "none", "options": [{ "value": "none", "label": "None" }, { "value": "fade", "label": "Fade" }, { "value": "up", "label": "Up" }] }+ { "id": "glyphs", "type": "string", "role": "content", "label": "Glyphs (deprecated)", "description": "Deprecated and ignored: the trail draws evenly spaced dots.", "default": "" },+ { "id": "density", "type": "enum", "role": "style", "label": "Density", "description": "Spacing between trail dots.", "default": "med", "options": [{ "value": "low", "label": "Low" }, { "value": "med", "label": "Medium" }, { "value": "high", "label": "High" }] },+ { "id": "path", "type": "enum", "role": "style", "label": "Path", "description": "How each move bends: sweep is a gentle curve, arc a deeper one, zigzag a straight line.", "default": "sweep", "options": [{ "value": "sweep", "label": "Sweep" }, { "value": "arc", "label": "Arc" }, { "value": "zigzag", "label": "Zigzag" }] },+ { "id": "fade", "type": "number", "role": "timing", "label": "Fade", "description": "Seconds a step trail takes to fade once the next move begins, clamped 0.3 to 1.5.", "default": 0.5 },+ { "id": "accent", "type": "enum", "role": "style", "label": "Accent", "description": "Trail and step marker color: green rides --brand, blue rides --accent, violet rides --accent-2.", "default": "green", "options": [{ "value": "green", "label": "Green" }, { "value": "blue", "label": "Blue" }, { "value": "violet", "label": "Violet" }] },+ { "id": "exit", "type": "enum", "role": "timing", "label": "Exit", "description": "Optional departure. Default none: the finished screen holds until the frame cuts.", "default": "none", "options": [{ "value": "none", "label": "None" }, { "value": "fade", "label": "Fade" }, { "value": "up", "label": "Up" }] }]'><head>@@ -78,313 +33,619 @@</head><body><template>- <div id="root" data-composition-id="cursor-glyph-trail" data-duration="4" data-fps="30">- <style>- *,- *::before,- *::after {- box-sizing: border-box;- }+ <style>+ #root {+ position: absolute;+ inset: 0;+ overflow: hidden;+ container-type: size;+ font-family: Inter, system-ui, sans-serif;+ -webkit-font-smoothing: antialiased;+ color: #1d1d1f;+ pointer-events: none;+ --cgt-ink: #1d1d1f;+ --cgt-dim: #6e6e73;+ --cgt-line: rgba(0, 0, 0, 0.07);+ }+ .cgt-stage {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ }+ .cgt-win {+ width: 60cqw;+ border-radius: 1.1cqw;+ background: #ffffff;+ overflow: hidden;+ box-shadow:+ 0 0 0 1px rgba(0, 0, 0, 0.06),+ 0 0.1cqw 0.2cqw rgba(0, 0, 0, 0.05),+ 0 1.4cqw 3.6cqw rgba(0, 0, 0, 0.1);+ }+ .cgt-bar {+ position: relative;+ display: flex;+ align-items: center;+ gap: 0.45cqw;+ height: 2.8cqw;+ padding: 0 1.1cqw;+ border-bottom: 1px solid var(--cgt-line);+ }+ .cgt-bar i {+ width: 0.62cqw;+ height: 0.62cqw;+ border-radius: 50%;+ background: rgba(0, 0, 0, 0.12);+ }+ .cgt-bar span {+ position: absolute;+ left: 0;+ right: 0;+ text-align: center;+ font-size: 0.8cqw;+ font-weight: 600;+ color: var(--cgt-dim);+ }+ .cgt-body {+ display: flex;+ }+ .cgt-nav {+ width: 14cqw;+ padding: 1.2cqw 0.8cqw;+ background: #f7f7f8;+ border-right: 1px solid var(--cgt-line);+ font-size: 0.86cqw;+ }+ .cgt-nav b {+ display: block;+ margin: 0.9cqw 0.6cqw 0.35cqw;+ font-size: 0.66cqw;+ font-weight: 600;+ letter-spacing: 0.04em;+ text-transform: uppercase;+ color: var(--cgt-dim);+ }+ .cgt-nav b:first-child {+ margin-top: 0;+ }+ .cgt-nav div {+ padding: 0.42cqw 0.6cqw;+ border-radius: 0.4cqw;+ color: #3a3a3c;+ }+ .cgt-nav .is-on {+ background: rgba(0, 0, 0, 0.06);+ color: var(--cgt-ink);+ font-weight: 600;+ }+ .cgt-main {+ flex: 1;+ padding: 2cqw 2.4cqw 1.8cqw;+ }+ .cgt-main h1 {+ margin: 0;+ font-size: 1.5cqw;+ font-weight: 650;+ letter-spacing: -0.01em;+ }+ .cgt-lede {+ margin: 0.35cqw 0 1.2cqw;+ font-size: 0.9cqw;+ color: var(--cgt-dim);+ }+ .cgt-row {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 2cqw;+ padding: 1.1cqw 0;+ border-top: 1px solid var(--cgt-line);+ }+ .cgt-label {+ font-size: 0.98cqw;+ font-weight: 600;+ }+ .cgt-desc {+ margin-top: 0.2cqw;+ font-size: 0.84cqw;+ color: var(--cgt-dim);+ }+ .cgt-toggle {+ --cgt-on: 0;+ position: relative;+ flex: none;+ width: 2.5cqw;+ height: 1.44cqw;+ border-radius: 1cqw;+ background: #e3e3e6;+ }+ .cgt-toggle::before {+ content: "";+ position: absolute;+ inset: 0;+ border-radius: inherit;+ background: var(--cgt-ink);+ opacity: var(--cgt-on);+ }+ .cgt-toggle i {+ position: absolute;+ left: 0.16cqw;+ top: 0.16cqw;+ width: 1.12cqw;+ height: 1.12cqw;+ border-radius: 50%;+ background: #ffffff;+ box-shadow: 0 0.06cqw 0.16cqw rgba(0, 0, 0, 0.25);+ transform: translateX(calc(var(--cgt-on) * 1.06cqw));+ }+ .cgt-seg {+ position: relative;+ display: flex;+ flex: none;+ padding: 0.16cqw;+ border-radius: 0.55cqw;+ background: #efeff1;+ font-size: 0.84cqw;+ font-weight: 500;+ }+ .cgt-seg span {+ position: relative;+ padding: 0.36cqw 0.95cqw;+ }+ .cgt-seg .cgt-pill {+ position: absolute;+ top: 0.16cqw;+ bottom: 0.16cqw;+ left: 0;+ padding: 0;+ border-radius: 0.42cqw;+ background: #ffffff;+ box-shadow:+ 0 0 0 0.5px rgba(0, 0, 0, 0.06),+ 0 0.06cqw 0.16cqw rgba(0, 0, 0, 0.14);+ }+ .cgt-foot {+ display: flex;+ justify-content: flex-end;+ gap: 0.6cqw;+ padding-top: 1.2cqw;+ border-top: 1px solid var(--cgt-line);+ }+ .cgt-btn {+ position: relative;+ padding: 0.5cqw 1cqw;+ border-radius: 0.5cqw;+ font-size: 0.86cqw;+ font-weight: 600;+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);+ }+ .cgt-primary {+ background: var(--cgt-ink);+ color: #ffffff;+ box-shadow: none;+ }+ .cgt-primary span {+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.3cqw;+ }+ .cgt-primary .cgt-saved {+ position: absolute;+ inset: 0;+ opacity: 0;+ }+ .cgt-saved svg {+ width: 0.8cqw;+ height: 0.8cqw;+ }+ .cgt-trail {+ position: absolute;+ inset: 0;+ overflow: visible;+ }+ .cgt-trail polyline {+ fill: none;+ stroke: var(--cgt-accent);+ stroke-linecap: round;+ }+ .cgt-trail circle {+ fill: none;+ stroke: var(--cgt-accent);+ }+ .cgt-step {+ position: absolute;+ left: 0;+ top: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ border-radius: 50%;+ background: var(--cgt-accent);+ color: #ffffff;+ font-weight: 650;+ font-variant-numeric: tabular-nums;+ box-shadow: 0 0 0 0.12cqw #ffffff;+ opacity: 0;+ }+ .cgt-actor {+ position: absolute;+ left: 0;+ top: 0;+ }+ .cgt-cursor {+ position: absolute;+ transform-origin: 20.833% 12.5%;+ filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));+ }+ .cgt-cursor path {+ fill: #ffffff;+ stroke: #141414;+ stroke-width: 1.4;+ stroke-linejoin: round;+ }+ .cgt-slot {+ position: absolute;+ transform: translate(-50%, -50%);+ }+ </style>++ <div id="root" data-composition-id="cursor-glyph-trail" data-duration="3.5">+ <div class="cgt-stage" id="cgt-stage">+ <div class="cgt-win" id="cgt-win">+ <div class="cgt-bar"><i></i><i></i><i></i><span>Settings</span></div>+ <div class="cgt-body">+ <nav class="cgt-nav">+ <b>Account</b>+ <div>Profile</div>+ <div class="is-on">Notifications</div>+ <div>Appearance</div>+ <b>Workspace</b>+ <div>Members</div>+ <div>Billing</div>+ <div>Integrations</div>+ </nav>+ <section class="cgt-main">+ <h1>Notifications</h1>+ <p class="cgt-lede">Choose what we email you, and how often.</p>+ <div class="cgt-row">+ <div>+ <div class="cgt-label">Email digest</div>+ <div class="cgt-desc">Comments, mentions and file changes in one email.</div>+ </div>+ <span class="cgt-toggle" id="cgt-digest"><i></i></span>+ </div>+ <div class="cgt-row" id="cgt-freq">+ <div>+ <div class="cgt-label">Frequency</div>+ <div class="cgt-desc">When the digest lands in your inbox.</div>+ </div>+ <div class="cgt-seg">+ <span class="cgt-pill" id="cgt-pill"></span><span id="cgt-daily">Daily</span+ ><span id="cgt-weekly">Weekly</span><span>Monthly</span>+ </div>+ </div>+ <div class="cgt-row">+ <div>+ <div class="cgt-label">Mentions</div>+ <div class="cgt-desc">Email me right away when someone mentions me.</div>+ </div>+ <span class="cgt-toggle" style="--cgt-on: 1"><i></i></span>+ </div>+ <div class="cgt-foot">+ <span class="cgt-btn">Cancel</span>+ <span class="cgt-btn cgt-primary" id="cgt-save"+ ><span id="cgt-save-label">Save changes</span+ ><span class="cgt-saved" id="cgt-saved"+ ><svg viewBox="0 0 16 16" aria-hidden="true">+ <path+ d="M3 8.5 L6.5 12 L13 4.5"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ /></svg+ >Saved</span+ ></span+ >+ </div>+ </section>+ </div>+ </div>+ <svg class="cgt-trail" id="cgt-trail" aria-hidden="true">+ <polyline></polyline>+ <polyline></polyline>+ <polyline></polyline>+ <circle></circle>+ </svg>+ <div class="cgt-step">1</div>+ <div class="cgt-step">2</div>+ <div class="cgt-step">3</div>+ <div class="cgt-actor" id="cgt-actor">+ <svg class="cgt-cursor" viewBox="0 0 24 24" aria-hidden="true">+ <path d="M5 3 L5 19 L9 15 L12 22 L15 20.5 L11.5 14 L18 14 Z" />+ </svg>+ </div>+ </div>+ </div>- #root {- position: absolute;- inset: 0;- overflow: hidden;- container-type: size;- isolation: isolate;- color: var(--fg, #f8fafc);- font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);- pointer-events: none;+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <script>+ (function () {+ "use strict";++ var html = document.documentElement;+ var root = document.getElementById("root");+ var stage = document.getElementById("cgt-stage");+ var win = document.getElementById("cgt-win");+ var trail = document.getElementById("cgt-trail");+ var lines = trail.querySelectorAll("polyline");+ var ring = trail.querySelector("circle");+ var badges = root.querySelectorAll(".cgt-step");+ var actor = document.getElementById("cgt-actor");+ var cursor = actor.querySelector(".cgt-cursor");+ var digest = document.getElementById("cgt-digest");+ var freq = document.getElementById("cgt-freq");+ var pill = document.getElementById("cgt-pill");+ var daily = document.getElementById("cgt-daily");+ var weekly = document.getElementById("cgt-weekly");+ var save = document.getElementById("cgt-save");+ var saveLabel = document.getElementById("cgt-save-label");+ var saved = document.getElementById("cgt-saved");++ var DEFAULTS = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(+ function (variable) {+ DEFAULTS[variable.id] = variable.default;+ },+ );+ } catch (error) {+ /* malformed declaration falls back to the inline defaults below */}-- .cgt-clip {- position: absolute;- inset: 0;- overflow: hidden;- background: var(--bg, transparent);+ var scopedVariables = {};+ try {+ if (window.__hyperframes && typeof window.__hyperframes.getVariables === "function") {+ scopedVariables = window.__hyperframes.getVariables() || {};+ }+ } catch (error) {+ /* no scoped variables API in this context */}-- .cgt-stage {- position: absolute;- inset: 0;- will-change: transform, opacity;+ var vars = Object.assign({}, DEFAULTS, window.__hfVariables || {}, scopedVariables);++ // Hardcoded: the compositor rewrites the wrapper's attributes on mount.+ var compositionId = "cursor-glyph-trail";+ var duration = Math.max(+ 0.001,+ parseFloat(+ root.dataset.duration || html.getAttribute("data-composition-duration") || "3.5",+ ),+ );+ var SPACING = { low: 30, med: 21, high: 15 }[vars.density] || 21;+ var BEND = { sweep: 0.12, arc: 0.26, zigzag: 0 }[vars.path];+ if (BEND === undefined) BEND = 0.12;+ var fadeRaw = parseFloat(vars.fade);+ var fade = isFinite(fadeRaw) ? Math.min(1.5, Math.max(0.3, fadeRaw)) : 0.5;+ var accentColors = {+ green: "var(--brand, #34c759)",+ blue: "var(--accent, #0a84ff)",+ violet: "var(--accent-2, #af52de)",+ };+ root.style.setProperty("--cgt-accent", accentColors[vars.accent] || accentColors.green);+ var exit = vars.exit === "fade" || vars.exit === "up" ? vars.exit : "none";++ var slot = document.querySelector('template[data-slot="cursor-glyph-trail-actor"]');+ if (slot) {+ var slotBox = document.createElement("div");+ slotBox.className = "cgt-slot";+ slotBox.appendChild(document.importNode(slot.content, true));+ cursor.replaceWith(slotBox);+ cursor = slotBox;}- .cgt-field {- position: absolute;- inset: 0;+ var W = root.clientWidth || 1920;+ var u = W / 1920;+ var ARROW = 64 * u;+ if (!slot) {+ cursor.style.width = cursor.style.height = ARROW + "px";+ cursor.style.left = (-5 / 24) * ARROW + "px";+ cursor.style.top = (-3 / 24) * ARROW + "px";}-- .cgt-stamp {- position: absolute;- opacity: 0;- line-height: 1;- font-weight: 500;- will-change: opacity;- user-select: none;+ var DOT = 6 * u;+ var BADGE = 30 * u;+ lines.forEach(function (line) {+ line.setAttribute("stroke-width", DOT);+ line.setAttribute("stroke-dasharray", "0 " + SPACING * u);+ });+ ring.setAttribute("stroke-width", 2 * u);+ badges.forEach(function (badge) {+ badge.style.width = badge.style.height = BADGE + "px";+ badge.style.fontSize = 15 * u + "px";+ });++ var BASE = 3.5;+ var OUT_BASE = exit === "none" ? 0 : 0.45;+ var squeeze = Math.min(1, duration / (BASE + OUT_BASE));+ var MOVE = 0.5 * squeeze;+ // Per step: move start, click; badge offset from the click point in 1920-wide px.+ var STEPS = [+ { go: 0.1, click: 0.8, bx: -34, by: -30 },+ { go: 1.1, click: 1.8, bx: -28, by: -36 },+ { go: 2.1, click: 2.8, bx: 34, by: -36 },+ ];+ STEPS.forEach(function (s) {+ s.go *= squeeze;+ s.click *= squeeze;+ });+ var LAST_FADE = 2.95 * squeeze;+ var OUT = OUT_BASE * squeeze;+ var OUT_START = duration - OUT;++ var easeOut = gsap.parseEase("power3.out");+ var easeInOut = gsap.parseEase("power2.inOut");+ var fadeEase = gsap.parseEase("power1.out");+ var exitEase = gsap.parseEase("power2.in");+ var ringEase = gsap.parseEase("power2.out");+ function seg(t, a, b) {+ return Math.max(0, Math.min(1, (t - a) / (b - a)));}- .cgt-actor {- position: absolute;- opacity: 0;- transform: translate(-50%, -50%);- will-change: opacity;+ // Layout-space offsets, which ignore any transform a host puts on the player.+ function offsetIn(el) {+ var x = 0;+ var y = 0;+ while (el && el !== root) {+ x += el.offsetLeft;+ y += el.offsetTop;+ el = el.offsetParent;+ }+ return { x: x, y: y };}-- .cgt-dot {- width: 3.4cqmin;- height: 3.4cqmin;- border-radius: 50%;- background: var(--cgt-accent);- border: 0.35cqmin solid color-mix(in srgb, var(--fg, #f8fafc) 82%, var(--cgt-accent));- box-shadow: 0 0.6cqmin 2.4cqmin color-mix(in srgb, var(--bg, #000000) 35%, transparent);+ function pointIn(el, fx, fy) {+ var o = offsetIn(el);+ return { x: o.x + el.offsetWidth * fx, y: o.y + el.offsetHeight * fy };}- </style>-- <div- id="cursor-glyph-trail-clip"- class="cgt-clip clip"- data-start="0"- data-duration="4"- data-track-index="0"- >- <div class="cgt-stage">- <div class="cgt-field" aria-hidden="true"></div>- <div class="cgt-actor">- <div class="cgt-dot"></div>- </div>- </div>- </div>-- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>- <script>- (function () {- "use strict";- var root = document.getElementById("root");- var stage = root.querySelector(".cgt-stage");- var field = root.querySelector(".cgt-field");- var actor = root.querySelector(".cgt-actor");- var vars =- window.__hyperframes && window.__hyperframes.getVariables- ? window.__hyperframes.getVariables()- : {};-- // Arc-length spacing (percent-of-stage units). Fixed spacing- // along the path means the per-second stamp rate rises and- // falls with the actor's velocity: the density law.- var spacingByDensity = { low: 4.6, med: 2.9, high: 1.8 };- var density = Object.prototype.hasOwnProperty.call(spacingByDensity, vars.density)- ? vars.density- : "med";- var pathName = vars.path === "arc" || vars.path === "zigzag" ? vars.path : "sweep";- var glyphSource =- typeof vars.glyphs === "string" && vars.glyphs.length > 0 ? vars.glyphs : "░▒▓+·×";- var glyphSet = Array.from(glyphSource);- var fadeRaw = parseFloat(vars.fade);- var fade = isFinite(fadeRaw) ? Math.min(1.5, Math.max(0.3, fadeRaw)) : 0.8;- // Each enum choice routes to a DIFFERENT contract token so the- // variable stays meaningful under a theme.- var accentColors = {- green: "var(--brand, #52525b)",- blue: "var(--accent, #52525b)",- violet: "var(--accent-2, #52525b)",- };- 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("--cgt-accent", accentColors[accent]);-- // SLOT. Caller templates live at HOST DOCUMENT level (the mount- // wipes host-clip children, and templates never render).- var hostDoc = root.ownerDocument;- var slotTemplate = null;- try {- slotTemplate = hostDoc.querySelector(- 'template[data-slot="cursor-glyph-trail-actor"]',- );- } catch (error) {- slotTemplate = null;- }- if (slotTemplate) {- actor.querySelector(".cgt-dot").remove();- actor.appendChild(hostDoc.importNode(slotTemplate.content, true));+ // A move is a quadratic curve sampled into a polyline with cumulative lengths.+ function leg(a, b) {+ var dx = b.x - a.x;+ var dy = b.y - a.y;+ var c = { x: (a.x + b.x) / 2 - dy * BEND, y: (a.y + b.y) / 2 + dx * BEND };+ var pts = [];+ var len = [0];+ for (var i = 0; i <= 48; i++) {+ var k = i / 48;+ var m = 1 - k;+ pts.push({+ x: m * m * a.x + 2 * m * k * c.x + k * k * b.x,+ y: m * m * a.y + 2 * m * k * c.y + k * k * b.y,+ });+ if (i)+ len.push(len[i - 1] + Math.hypot(pts[i].x - pts[i - 1].x, pts[i].y - pts[i - 1].y));}+ return { pts: pts, len: len, total: len[48] };+ }+ function at(L, s) {+ var i = 1;+ while (i < 48 && L.len[i] < s) i++;+ var k = (s - L.len[i - 1]) / (L.len[i] - L.len[i - 1] || 1);+ var a = L.pts[i - 1];+ var b = L.pts[i];+ return { i: i, x: a.x + (b.x - a.x) * k, y: a.y + (b.y - a.y) * k };+ }+ // Trail dots start clear of the previous marker and stop at the tip.+ function trailPoints(L, s0, s1) {+ if (s1 <= s0) return "";+ var p0 = at(L, s0);+ var p1 = at(L, s1);+ var out = [p0.x.toFixed(2) + "," + p0.y.toFixed(2)];+ for (var i = p0.i; i < p1.i; i++)+ out.push(L.pts[i].x.toFixed(2) + "," + L.pts[i].y.toFixed(2));+ out.push(p1.x.toFixed(2) + "," + p1.y.toFixed(2));+ return out.join(" ");+ }+ // Press to 0.9, a short hold, then release.+ function press(t, click) {+ var d = t - click;+ if (d < 0 || d > 0.22 * squeeze) return 1;+ if (d < 0.06 * squeeze) return 1 - 0.1 * (d / (0.06 * squeeze));+ if (d < 0.1 * squeeze) return 0.9;+ return 0.9 + 0.1 * easeOut(seg(d, 0.1 * squeeze, 0.22 * squeeze));+ }- // Envelope: fixed IN/OUT, elastic HOLD, never time-scaled.- var POP = 0.07;- var TRAVEL_BASE = 2.4;- var IN_BASE = TRAVEL_BASE + POP + fade * 1.25 + 0.05;- var OUT_BASE = exit === "none" ? 0 : 0.45;- var duration = Math.max(0.001, parseFloat(root.dataset.duration || "4"));- var totalBase = Math.max(0.001, IN_BASE + OUT_BASE);- var scale = duration < totalBase ? duration / totalBase : 1;- var TRAVEL = TRAVEL_BASE * scale;- var pop = POP * scale;- var fadeEff = fade * scale;- var IN = IN_BASE * scale;- var OUT = OUT_BASE * scale;- var HOLD = Math.max(0, duration - (IN + OUT));- var OUT_START = IN + HOLD;-- // Path presets in percent-of-stage coordinates.- var zigzagPoints = [- { x: 10, y: 34 },- { x: 38, y: 70 },- { x: 64, y: 32 },- { x: 90, y: 64 },+ function render(t) {+ var targets = [+ pointIn(win, 1.1, 1.12),+ pointIn(digest, 0.34, 0.5),+ pointIn(weekly, 0.5, 0.55),+ pointIn(save, 0.84, 0.62),];- function pathPoint(u) {- if (pathName === "arc") {- return { x: 12 + 76 * u, y: 68 - 40 * Math.sin(Math.PI * u) };- }- if (pathName === "zigzag") {- var segs = zigzagPoints.length - 1;- var s = Math.min(segs - 1e-9, Math.max(0, u * segs));- var i = Math.floor(s);- var f = s - i;- var a = zigzagPoints[i];- var b = zigzagPoints[i + 1];- return { x: a.x + (b.x - a.x) * f, y: a.y + (b.y - a.y) * f };- }- // sweep: an S-curve from lower left to upper right.- return { x: 8 + 84 * u, y: 50 + 16 * Math.cos(Math.PI * u) };- }-- // Shared travel ease, implemented once so the stamp table and- // the per-update actor position use the identical mapping.- function easeInOut(t) {- return t < 0.5 ? 2 * t * t : 1 - 2 * (1 - t) * (1 - t);- }- function clamp01(v) {- return v < 0 ? 0 : v > 1 ? 1 : v;- }-- // The LCG and every per-stamp decision live here, computed once- // before timeline construction from a fixed seed. A stamp's- // opacity at any time is then a pure function of timeline time.- var lcgState = 0x67117a11;- function next() {- lcgState = (Math.imul(1664525, lcgState) + 1013904223) >>> 0;- return lcgState / 4294967296;- }-- var spacing = spacingByDensity[density];- var STEPS = 600;- var stamps = [];- var acc = 0;- var prev = pathPoint(easeInOut(0));- for (var k = 1; k <= STEPS; k += 1) {- var f = k / STEPS;- var pos = pathPoint(easeInOut(f));- acc += Math.hypot(pos.x - prev.x, pos.y - prev.y);- prev = pos;- if (acc >= spacing) {- acc -= spacing;- stamps.push({- t: f * TRAVEL,- x: pos.x + (next() - 0.5) * 3.2,- y: pos.y + (next() - 0.5) * 3.2,- glyph: glyphSet[Math.floor(next() * glyphSet.length) % glyphSet.length],- rot: (next() - 0.5) * 20,- size: 1.9 + next() * 1.4,- peak: 0.45 + next() * 0.45,- mix: 55 + Math.floor(next() * 36),- fadeMul: 0.75 + next() * 0.5,- });- }- }-- var fragment = hostDoc.createDocumentFragment();- for (var s = 0; s < stamps.length; s += 1) {- var row = stamps[s];- var span = hostDoc.createElement("span");- span.className = "cgt-stamp";- span.textContent = row.glyph;- span.style.left = row.x.toFixed(3) + "%";- span.style.top = row.y.toFixed(3) + "%";- span.style.fontSize = row.size.toFixed(3) + "cqmin";- span.style.transform = "translate(-50%, -50%) rotate(" + row.rot.toFixed(2) + "deg)";- span.style.color =- "color-mix(in srgb, var(--cgt-accent) " + row.mix + "%, var(--fg, #f8fafc))";- row.el = span;- fragment.appendChild(span);- }- field.appendChild(fragment);-- // Pure per-update apply: the actor position and every stamp's- // opacity are functions of tl.time() alone. A stamp pops in- // over `pop` seconds and decays over its table row's window;- // by IN every value is exactly zero. Writes are idempotent, so- // the HOLD repaints identical values and stays truly still.- function stampOpacity(row, timeSeconds) {- var dt = timeSeconds - row.t;- if (dt <= 0) return 0;- if (dt < pop) {- var g = dt / pop;- return row.peak * (1 - (1 - g) * (1 - g));+ var tip = targets[0];+ var scale = 1;+ var ringK = 0;+ var ringAt = tip;+ STEPS.forEach(function (s, k) {+ var L = leg(targets[k], targets[k + 1]);+ var e = easeOut(seg(t, s.go, s.go + MOVE));+ var fadeFrom = k < 2 ? STEPS[k + 1].go : LAST_FADE;+ var alpha = 1 - fadeEase(seg(t, fadeFrom, fadeFrom + fade * squeeze));+ var shown = t > s.go && alpha > 0;+ lines[k].setAttribute("points", shown ? trailPoints(L, 22 * u, e * L.total) : "");+ lines[k].style.opacity = shown ? alpha.toFixed(4) : "0";+ if (t >= s.go) tip = at(L, e * L.total);+ scale *= press(t, s.click);++ var r = seg(t, s.click, s.click + 0.3 * squeeze);+ if (r > 0 && r < 1) {+ ringK = r;+ ringAt = targets[k + 1];}- var u = (dt - pop) / (fadeEff * row.fadeMul);- if (u >= 1) return 0;- return row.peak * (1 - u * u);- }-- function applyTime(timeSeconds) {- var u = easeInOut(clamp01(TRAVEL > 0 ? timeSeconds / TRAVEL : 1));- var p = pathPoint(u);- gsap.set(actor, { left: p.x.toFixed(4) + "%", top: p.y.toFixed(4) + "%" });- for (var i = 0; i < stamps.length; i += 1) {- stamps[i].el.style.opacity = stampOpacity(stamps[i], timeSeconds).toFixed(4);- }- }-- gsap.set(stage, { opacity: 1, y: "0cqh" });-- var tl = gsap.timeline({- paused: true,- onUpdate: function () {- applyTime(tl.time());- },+ var b = easeOut(seg(t, s.click, s.click + 0.2 * squeeze));+ badges[k].style.opacity = b.toFixed(4);+ badges[k].style.transform =+ "translate(" ++ (targets[k + 1].x + s.bx * u - BADGE / 2) ++ "px," ++ (targets[k + 1].y + s.by * u - BADGE / 2) ++ "px) scale(" ++ (0.9 + 0.1 * b) ++ ")";});-- // Anchor tween: an inert plain-object tween spanning the full- // authored duration so the timeline covers [0, D], onUpdate- // fires for every eventful seek, and holds never clamp short.- tl.to({ p: 0 }, { p: 1, duration: duration, ease: "none" }, 0);-- // Actor entrance: both endpoints authored.- tl.fromTo(- actor,- { opacity: 0 },- { opacity: 1, duration: 0.18 * scale, ease: "power2.out" },- 0,+ var re = ringEase(ringK);+ ring.setAttribute("cx", ringAt.x);+ ring.setAttribute("cy", ringAt.y);+ ring.setAttribute("r", (10 + 16 * re) * u);+ ring.style.opacity = ringK > 0 ? (0.5 * (1 - re)).toFixed(4) : "0";++ var on = easeOut(seg(t, STEPS[0].click, STEPS[0].click + 0.2 * squeeze));+ digest.style.setProperty("--cgt-on", on.toFixed(4));+ freq.style.opacity = (0.4 + 0.6 * on).toFixed(4);+ var pick = easeInOut(seg(t, STEPS[1].click, STEPS[1].click + 0.24 * squeeze));+ pill.style.width =+ daily.offsetWidth + (weekly.offsetWidth - daily.offsetWidth) * pick + "px";+ pill.style.transform =+ "translateX(" ++ (daily.offsetLeft + (weekly.offsetLeft - daily.offsetLeft) * pick) ++ "px)";+ var done = easeOut(+ seg(t, STEPS[2].click + 0.06 * squeeze, STEPS[2].click + 0.24 * squeeze),);+ saveLabel.style.opacity = (1 - done).toFixed(4);+ saved.style.opacity = done.toFixed(4);+ var pressed = press(t, STEPS[2].click);+ save.style.transform = "scale(" + (1 - (1 - pressed) * 0.3) + ")";- // Stamps carry no tweens: their opacity rides applyTime's pure- // table evaluation, and each decay completes inside IN by- // construction.-- // HOLD: truly still. All stamps are exactly zero by IN and the- // actor rests at path(1); repeated repaints write identical- // values.+ actor.style.transform = "translate(" + tip.x + "px," + tip.y + "px)";+ cursor.style.transform = scale === 1 ? "" : "scale(" + scale + ")";- // OUT: optional departure; exit none holds until the frame cuts.- if (exit === "up") {- tl.to(stage, { y: "-4cqh", duration: OUT, ease: "power2.in" }, OUT_START);- tl.to(stage, { opacity: 0, duration: OUT, ease: "power2.in" }, OUT_START);- } else if (exit === "fade") {- tl.to(stage, { opacity: 0, duration: OUT, ease: "power2.in" }, OUT_START);- }+ var x = exit === "none" ? 0 : exitEase(seg(t, OUT_START, OUT_START + OUT));+ stage.style.opacity = (1 - x).toFixed(4);+ stage.style.transform = exit === "up" ? "translateY(" + -4 * x + "cqh)" : "";+ }- tl.seek(0);- applyTime(0);- window.__timelines = window.__timelines || {};- window.__timelines["cursor-glyph-trail"] = tl;- })();- </script>- </div>+ var clock = { t: 0 };+ var tl = gsap.timeline({ paused: true });+ tl.to(+ clock,+ {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ render(clock.t);+ },+ },+ 0,+ );+ render(0);+ tl.seek(0);+ window.__timelines = window.__timelines || {};+ window.__timelines[compositionId] = tl;+ })();+ </script></template></body></html>diff --git a/registry/components/cursor-glyph-trail/demo.html b/registry/components/cursor-glyph-trail/demo.htmlindex dfd1c32a0f..3001edcf1b 100644--- a/registry/components/cursor-glyph-trail/demo.html+++ b/registry/components/cursor-glyph-trail/demo.html@@ -1,8 +1,8 @@<!doctype html><!--- cursor-glyph-trail demo. FULL-BLEED light mount: the primitive fills the- whole 1920x1080 frame on a light token block. Non-default path, density,- fade, and accent values prove the variable path.+ cursor-glyph-trail demo. Mounts the component full-frame over a flat light+ ground; the component draws its own settings window. --brand carries the+ trail color through the default "green" accent.--><html lang="en"><head>@@ -21,7 +21,7 @@width: 1920px;height: 1080px;overflow: hidden;- background: var(--bg, #eef0f3);+ background: #f4f4f5;}#root {@@ -30,7 +30,7 @@--muted: #5b6472;--surface: #ffffff;--border: #d3d8e0;- --brand: #3f3f46;+ --brand: #0a84ff;--accent: #3f3f46;--accent-2: #3f3f46;--font-display: "Inter", system-ui, sans-serif;@@ -39,7 +39,7 @@width: 1920px;height: 1080px;overflow: hidden;- background: radial-gradient(ellipse at 50% 42%, #f7f8fa 0%, var(--bg, #eef0f3) 72%);+ background: #f4f4f5;}.mount-bleed {@@ -59,7 +59,7 @@data-start="0"data-width="1920"data-height="1080"- data-duration="4"+ data-duration="3.5"data-fps="30"><div@@ -67,9 +67,9 @@class="mount-bleed clip"data-composition-id="cursor-glyph-trail"data-composition-src="./cursor-glyph-trail.html"- data-variable-values='{"path":"zigzag","density":"high","fade":1.0,"accent":"blue"}'+ data-variable-values='{"path":"sweep","density":"med","accent":"green"}'data-start="0"- data-duration="4"+ data-duration="3.5"data-track-index="0"data-width="1920"data-height="1080"diff --git a/registry/components/cursor-glyph-trail/registry-item.json b/registry/components/cursor-glyph-trail/registry-item.jsonindex 43e258b183..8d923e07f3 100644--- a/registry/components/cursor-glyph-trail/registry-item.json+++ b/registry/components/cursor-glyph-trail/registry-item.json@@ -3,13 +3,21 @@"name": "cursor-glyph-trail","type": "hyperframes:component","title": "Cursor Glyph Trail",- "description": "An actor travels an authored path depositing small dithered glyphs at its past positions, each popping in and decaying in place, stamp rate scaling with the actor's velocity.",- "tags": ["motion-primitive", "demonstrate", "trail", "cursor", "glyphs", "deterministic"],+ "description": "A tutorial cursor path: on a settings screen the arrow clicks through three steps, leaving a dotted trail spaced evenly by distance and a numbered marker at each click; each step's trail fades as the next move begins.",+ "tags": [+ "cursor",+ "motion-primitive",+ "demonstrate",+ "trail",+ "tutorial",+ "steps",+ "deterministic"+ ],"jobs": ["demonstrate"],"family": "demonstrate","profile": "stamp-decay",- "evidence": "Wave L1 frame study: jh3yy stamp-and-decay contact sheet (2069614221747224613/sheet-01)",- "syncPoints": [{ "id": "travel-complete", "phase": "in", "offset": 2.4 }],+ "evidence": "Step-capture guides (Scribe, Tango): one numbered marker per click, nothing else decorated",+ "syncPoints": [{ "id": "travel-complete", "phase": "in", "offset": 2.6 }],"files": [{"path": "cursor-glyph-trail.html",@@ -22,16 +30,16 @@"id": "glyphs","type": "string","role": "content",- "label": "Glyphs",- "description": "Stamp charset; one glyph per stamp is chosen deterministically.",- "default": "░▒▓+·×"+ "label": "Glyphs (deprecated)",+ "description": "Deprecated and ignored: the trail draws evenly spaced dots.",+ "default": ""},{"id": "density","type": "enum","role": "style","label": "Density",- "description": "Arc-length spacing between stamps along the path.",+ "description": "Spacing between trail dots.","default": "med","options": [{ "value": "low", "label": "Low" },@@ -42,9 +50,9 @@{"id": "path","type": "enum",- "role": "timing",+ "role": "style","label": "Path",- "description": "Authored travel path preset.",+ "description": "How each move bends: sweep is a gentle curve, arc a deeper one, zigzag a straight line.","default": "sweep","options": [{ "value": "sweep", "label": "Sweep" },@@ -57,15 +65,15 @@"type": "number","role": "timing","label": "Fade",- "description": "Per-stamp decay window in seconds, clamped 0.3 to 1.5.",- "default": 0.8+ "description": "Seconds a step trail takes to fade once the next move begins, clamped 0.3 to 1.5.",+ "default": 0.5},{"id": "accent","type": "enum","role": "style","label": "Accent",- "description": "Trail and actor color: green rides --brand, blue rides --accent, violet rides --accent-2.",+ "description": "Trail and step marker color: green rides --brand, blue rides --accent, violet rides --accent-2.","default": "green","options": [{ "value": "green", "label": "Green" },@@ -78,7 +86,7 @@"type": "enum","role": "timing","label": "Exit",- "description": "Optional departure. Default none: the settled actor holds until the frame cuts.",+ "description": "Optional departure. Default none: the finished screen holds until the frame cuts.","default": "none","options": [{ "value": "none", "label": "None" },diff --git a/registry/components/cursor-marquee-select/cursor-marquee-select.html b/registry/components/cursor-marquee-select/cursor-marquee-select.htmlnew file mode 100644index 0000000000..73d5198fb8--- /dev/null+++ b/registry/components/cursor-marquee-select/cursor-marquee-select.html@@ -0,0 +1,1048 @@+<!doctype html>+<!--+ Marquee Select Cursor (actor primitive), mountable sub-composition++ concept: a photo library grid. The cursor presses on empty space and drags a+ translucent selection rectangle; each tile selects (ring, inset, check badge pop) on+ the exact frame the rectangle first touches it, and a pill counts the selection up.++ mount contract: loaded by a host through data-composition-src; only <template> is+ cloned. #root fills the host clip and letterboxes a 1920x1080 library inside it.++ variables:+ accent (color) rectangle, rings, badges and pill+ start_x, start_y, end_x, end_y (% of board) where the drag presses and releases+ pill_label (string) the word after the count++ envelope (default 3.4s): arrive 0-0.5s, press 0.62s, drag 0.7-2.1s, release 2.1s,+ step aside, exit in the last 0.6s. Shorter durations compress every beat evenly.+-->+<html+ lang="en"+ data-composition-id="cursor-marquee-select"+ data-composition-duration="3.4"+ data-composition-variables='[+ { "id": "accent", "type": "color", "role": "style", "label": "Accent", "default": "#0a84ff" },+ { "id": "start_x", "type": "number", "role": "layout", "label": "Drag start X", "default": 20.5, "min": 0, "max": 100, "step": 0.5, "unit": "%" },+ { "id": "start_y", "type": "number", "role": "layout", "label": "Drag start Y", "default": 25.5, "min": 0, "max": 100, "step": 0.5, "unit": "%" },+ { "id": "end_x", "type": "number", "role": "layout", "label": "Drag end X", "default": 57, "min": 0, "max": 100, "step": 0.5, "unit": "%" },+ { "id": "end_y", "type": "number", "role": "layout", "label": "Drag end Y", "default": 52, "min": 0, "max": 100, "step": 0.5, "unit": "%" },+ { "id": "pill_label", "type": "string", "role": "content", "label": "Pill label", "default": "selected" }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Marquee Select Cursor</title>+ </head>+ <body>+ <template>+ <style>+ #root {+ position: absolute;+ inset: 0;+ overflow: hidden;+ isolation: isolate;+ font-family: var(--font-body, Inter, system-ui, sans-serif);+ --ms-accent: #0a84ff;+ }+ .ms-stage {+ position: absolute;+ left: 0;+ top: 0;+ width: 1920px;+ height: 1080px;+ transform-origin: 0 0;+ }+ .ms-panel {+ position: absolute;+ left: 360px;+ top: 150px;+ width: 1200px;+ height: 788px;+ border-radius: 32px;+ background: #ffffff;+ box-shadow:+ 0 40px 120px rgba(8, 10, 30, 0.35),+ 0 0 0 1px rgba(15, 18, 40, 0.06);+ }+ .ms-title {+ position: absolute;+ left: 56px;+ top: 44px;+ font-size: 34px;+ font-weight: 700;+ letter-spacing: -0.02em;+ color: #12141f;+ }+ .ms-sub {+ position: absolute;+ left: 56px;+ top: 90px;+ font-size: 19px;+ color: #6b7085;+ }+ .ms-pill {+ position: absolute;+ right: 56px;+ top: 48px;+ padding: 10px 20px;+ border-radius: 999px;+ font-size: 20px;+ font-weight: 650;+ color: #ffffff;+ background: var(--ms-accent);+ opacity: 0;+ transform-origin: 100% 50%;+ font-variant-numeric: tabular-nums;+ }+ .ms-tile {+ position: absolute;+ width: 250px;+ height: 160px;+ border-radius: 16px;+ will-change: transform;+ }+ .ms-photo {+ position: absolute;+ inset: 0;+ border-radius: inherit;+ overflow: hidden;+ }+ .ms-photo svg {+ display: block;+ width: 100%;+ height: 100%;+ }+ .ms-photo::after {+ content: "";+ position: absolute;+ inset: 0;+ border-radius: inherit;+ box-shadow:+ inset 0 0 0 1px rgba(0, 0, 0, 0.08),+ inset 0 0 40px rgba(0, 0, 0, 0.16);+ }+ .ms-name {+ position: absolute;+ left: 0;+ top: 168px;+ font-size: 15px;+ line-height: 18px;+ color: #6b7085;+ }+ .ms-ring {+ position: absolute;+ inset: -7px;+ border-radius: 22px;+ border: 4px solid var(--ms-accent);+ opacity: 0;+ }+ .ms-check {+ position: absolute;+ left: 12px;+ top: 12px;+ width: 34px;+ height: 34px;+ border-radius: 50%;+ background: var(--ms-accent);+ box-shadow: 0 0 0 3px #ffffff;+ opacity: 0;+ }+ .ms-check svg {+ width: 100%;+ height: 100%;+ fill: none;+ stroke: #ffffff;+ stroke-width: 2.6;+ stroke-linecap: round;+ stroke-linejoin: round;+ }+ .ms-rect {+ position: absolute;+ inset: 0;+ opacity: 0;+ z-index: 15;+ }+ /* Fill scales both ways; each edge scales along its length only, so it stays 1px. */+ .ms-rect > div {+ position: absolute;+ left: 0;+ top: 0;+ transform-origin: 0 0;+ background: color-mix(in srgb, var(--ms-accent), #000 22%);+ }+ .ms-rect .ms-fill {+ width: 100px;+ height: 100px;+ background: color-mix(in srgb, var(--ms-accent) 20%, transparent);+ }+ .ms-rect .ms-h {+ width: 100px;+ height: 1px;+ }+ .ms-rect .ms-v {+ width: 1px;+ height: 100px;+ }+ .ms-cursor {+ position: absolute;+ left: 0;+ top: 0;+ filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));+ will-change: transform;+ z-index: 20;+ }+ </style>++ <div id="root" data-composition-id="cursor-marquee-select" data-duration="3.4">+ <div class="ms-stage" id="ms-stage">+ <div class="ms-panel">+ <div class="ms-title">Summer shoot</div>+ <div class="ms-sub">12 photos, edited yesterday</div>+ <div class="ms-pill" id="ms-pill"></div>+ </div>+ <div id="ms-grid"></div>+ <div class="ms-rect" id="ms-rect">+ <div class="ms-fill"></div>+ <div class="ms-h"></div>+ <div class="ms-h"></div>+ <div class="ms-v"></div>+ <div class="ms-v"></div>+ </div>+ <div class="ms-cursor" id="ms-cursor" aria-hidden="true">+ <svg viewBox="0 0 24 24" width="100%" height="100%">+ <path+ d="M5 3 L5 19 L9 15 L12 22 L15 20.5 L11.5 14 L18 14 Z"+ fill="#ffffff"+ stroke="#141414"+ stroke-width="1.4"+ stroke-linejoin="round"+ />+ </svg>+ </div>+ </div>+ </div>++ <script>+ (function () {+ "use strict";++ var html = document.documentElement;+ var root = document.getElementById("root");+ var $ = function (id) {+ return document.getElementById(id);+ };++ var DEFAULTS = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(+ function (variable) {+ DEFAULTS[variable.id] = variable.default;+ },+ );+ } catch (error) {+ /* malformed declaration falls back to the inline defaults below */+ }+ var scopedVariables = {};+ try {+ if (window.__hyperframes && typeof window.__hyperframes.getVariables === "function") {+ scopedVariables = window.__hyperframes.getVariables() || {};+ }+ } catch (error) {+ /* no scoped variables API in this context */+ }+ var vars = Object.assign({}, DEFAULTS, window.__hfVariables || {}, scopedVariables);++ function num(value, fallback) {+ var n = Number(value);+ return Math.max(0, Math.min(100, isFinite(n) ? n : fallback));+ }++ // Hardcoded: the compositor rewrites the wrapper's attributes on mount.+ var compositionId = "cursor-marquee-select";+ var duration = Math.max(+ 0.001,+ parseFloat(+ root.dataset.duration || html.getAttribute("data-composition-duration") || "3.4",+ ),+ );+ if (vars.accent) root.style.setProperty("--ms-accent", String(vars.accent));+ var pillLabel = String(vars.pill_label || "selected");++ var W = root.clientWidth || 1920;+ var H = root.clientHeight || 1080;+ var fit = Math.min(W / 1920, H / 1080);+ $("ms-stage").style.transform =+ "translate(" ++ (W - 1920 * fit) / 2 ++ "px," ++ (H - 1080 * fit) / 2 ++ "px) scale(" ++ fit ++ ")";++ // Each photo is a 250x160 SVG scene; gradient ids are unique per scene.+ function grad(id, colors) {+ var stops = "";+ for (var i = 0; i < colors.length; i++) {+ stops +=+ '<stop offset="' + i / (colors.length - 1) + '" stop-color="' + colors[i] + '"/>';+ }+ return '<linearGradient id="' + id + '" x2="0" y2="1">' + stops + "</linearGradient>";+ }+ function each(n, fn) {+ var out = "";+ for (var i = 0; i < n; i++) out += fn(i);+ return out;+ }+ function frond(x, y, tx, ty, bend) {+ var mx = (x + tx) / 2;+ var my = (y + ty) / 2;+ var dx = ty - y;+ var dy = x - tx;+ return (+ '<path d="M' ++ x ++ " " ++ y ++ " Q" ++ (mx + dx * bend) ++ " " ++ (my + dy * bend) ++ " " ++ tx ++ " " ++ ty ++ " Q" ++ (mx + dx * bend * 0.3) ++ " " ++ (my + dy * bend * 0.3) ++ " " ++ x ++ " " ++ y ++ 'Z"/>'+ );+ }+ function boat(x, y, w, hull) {+ var shape =+ "M" ++ x ++ " " ++ y ++ " H" ++ (x + w) ++ " L" ++ (x + w - 9) ++ " " ++ (y + 10) ++ " H" ++ (x + 7) ++ "Z";+ return (+ '<path d="' ++ shape ++ '" fill="' ++ hull ++ '"/>' ++ '<path d="' ++ shape ++ '" fill="' ++ hull ++ '" opacity=".28" transform="translate(0 ' ++ (2 * y + 20) ++ ') scale(1 -1)"/>' ++ '<rect x="' ++ (x + w * 0.3) ++ '" y="' ++ (y - 8) ++ '" width="' ++ w * 0.32 ++ '" height="8" rx="1.5" fill="#f4f1ea"/>' ++ '<rect x="' ++ (x + w * 0.62) ++ '" y="' ++ (y - 40) ++ '" width="1.4" height="40" fill="#3b3b3b"/>'+ );+ }+ var SCENES = [+ [+ "beach-sunset.jpg",+ "<defs>" ++ grad("msBeSky", ["#34406e", "#b4607a", "#f39a5c", "#ffd59a"]) ++ grad("msBeSea", ["#f0a070", "#7c5a7c", "#3a3f6a"]) ++ grad("msBeSand", ["#e9c59b", "#c38e62"]) ++ "</defs>" ++ '<rect width="250" height="96" fill="url(#msBeSky)"/>' ++ '<circle cx="168" cy="90" r="28" fill="#ffd9a0" opacity=".3"/>' ++ '<circle cx="168" cy="90" r="15" fill="#fff3d6"/>' ++ '<rect y="94" width="250" height="40" fill="url(#msBeSea)"/>' ++ each(6, function (i) {+ return (+ '<rect x="' ++ (154 + i * 2) ++ '" y="' ++ (98 + i * 4.5) ++ '" width="' ++ (28 - i * 4) ++ '" height="1.6" rx=".8" fill="#ffe2b0" opacity="' ++ (0.85 - i * 0.12) ++ '"/>'+ );+ }) ++ '<path d="M0 126 Q70 114 140 121 T250 117 V160 H0Z" fill="url(#msBeSand)"/>' ++ '<path d="M0 126 Q70 114 140 121 T250 117" fill="none" stroke="#fff4e0" stroke-width="1.4" opacity=".7"/>' ++ '<path d="M44 160 Q48 112 32 72" fill="none" stroke="#2a1d24" stroke-width="4" stroke-linecap="round"/>' ++ '<g fill="#2a1d24">' ++ frond(32, 72, -4, 84, 0.25) ++ frond(32, 72, 2, 54, -0.3) ++ frond(32, 72, 36, 46, -0.3) ++ frond(32, 72, 66, 58, -0.25) ++ frond(32, 72, 64, 88, -0.2) ++ frond(32, 72, 12, 96, 0.2) ++ "</g>",+ ],+ [+ "mountain-lake.jpg",+ "<defs>" ++ grad("msLkSky", ["#86b8dc", "#dcebf3"]) ++ grad("msLkWater", ["#6d91a8", "#2a4a60"]) ++ "</defs>" ++ '<rect width="250" height="100" fill="url(#msLkSky)"/>' ++ '<g id="msLkRange"><path d="M0 92 L30 60 L52 74 L88 32 L118 66 L140 52 L176 82 L205 46 L250 78 V100 H0Z" fill="#8398ad"/>' ++ '<path d="M88 32 L77 46 L85 44 L91 50 L98 43 L104 50Z M205 46 L195 57 L203 55 L209 61 L216 56Z" fill="#f4f8fb"/>' ++ '<path d="M0 100 L40 76 L70 90 L110 70 L150 94 L190 78 L250 96 V100 H0Z" fill="#4d6477"/></g>' ++ '<rect y="100" width="250" height="60" fill="url(#msLkWater)"/>' ++ '<use href="#msLkRange" transform="translate(0 200) scale(1 -1)" opacity=".3"/>' ++ '<g fill="#22382c">' ++ each(42, function (i) {+ var h = 6 + ((i * 7) % 5) * 1.8;+ return (+ '<path d="M' ++ i * 6 ++ " 102 L" ++ (i * 6 + 3) ++ " " ++ (102 - h) ++ " L" ++ (i * 6 + 6) ++ ' 102Z"/>'+ );+ }) ++ "</g>" ++ each(5, function (i) {+ return (+ '<rect x="' ++ ((20 + i * 67) % 200) ++ '" y="' ++ (114 + i * 9) ++ '" width="44" height="1" fill="#ffffff" opacity=".22"/>'+ );+ }),+ ],+ [+ "city-night.jpg",+ "<defs>" ++ grad("msCtSky", ["#080c20", "#18244a", "#2c3a5e"]) ++ "</defs>" ++ '<rect width="250" height="160" fill="url(#msCtSky)"/>' ++ [+ [0, 34, 110],+ [30, 26, 78],+ [54, 40, 124],+ [92, 28, 92],+ [118, 44, 140],+ [160, 30, 84],+ [188, 36, 116],+ [222, 30, 96],+ ]+ .map(function (b, bi) {+ var top = 132 - b[2];+ var out =+ '<rect x="' ++ b[0] ++ '" y="' ++ top ++ '" width="' ++ b[1] ++ '" height="' ++ b[2] ++ '" fill="' ++ (bi % 2 ? "#18213f" : "#111931") ++ '"/>';+ for (var r = 0; r < Math.floor((b[2] - 10) / 9); r++) {+ for (var c = 0; c < Math.floor((b[1] - 6) / 7); c++) {+ if ((bi * 31 + r * 7 + c * 13) % 5 < 2) {+ out +=+ '<rect x="' ++ (b[0] + 4 + c * 7) ++ '" y="' ++ (top + 6 + r * 9) ++ '" width="3.5" height="5" fill="#ffcf7a" opacity="' ++ (0.55 + ((r + c) % 3) * 0.2) ++ '"/>';+ }+ }+ }+ return out;+ })+ .join("") ++ '<rect y="132" width="250" height="28" fill="#0b0f1e"/>' ++ '<rect y="141" width="250" height="1.4" fill="#ff5a48" opacity=".75"/>' ++ '<rect x="40" y="145" width="160" height="1" fill="#ff8a6a" opacity=".45"/>' ++ '<rect y="152" width="250" height="1.6" fill="#fff4dc" opacity=".7"/>',+ ],+ [+ "morning-coffee.jpg",+ '<rect width="250" height="160" fill="#8a5b3b"/>' ++ each(6, function (i) {+ return (+ '<rect x="' ++ (i * 42 + 20) ++ '" width="1.2" height="160" fill="#633d25" opacity=".6"/>' ++ '<path d="M' ++ (i * 42 + 6) ++ ' 0 q5 40 0 80 t0 80" fill="none" stroke="#a87752" stroke-width="1.2" opacity=".35"/>'+ );+ }) ++ '<circle cx="124" cy="88" r="56" fill="#000000" opacity=".2"/>' ++ '<circle cx="118" cy="82" r="54" fill="#f2eee8"/>' ++ '<circle cx="118" cy="82" r="42" fill="#e6e0d6"/>' ++ '<rect x="148" y="73" width="28" height="14" rx="7" fill="#fbfaf7"/>' ++ '<circle cx="118" cy="80" r="38" fill="#fbfaf7"/>' ++ '<circle cx="118" cy="80" r="31" fill="#5a331c"/>' ++ '<circle cx="118" cy="80" r="26" fill="#9a6236"/>' ++ '<path d="M118 94 C99 81 103 66 112 67 C115 67 118 70 118 73 C118 70 121 67 124 67 C133 66 137 81 118 94Z" fill="#f1e1c8"/>' ++ '<g transform="rotate(-35 72 118)" fill="#cfd3d8"><ellipse cx="72" cy="112" rx="5" ry="8"/><rect x="70.5" y="118" width="3" height="30" rx="1.5"/></g>' ++ '<circle cx="212" cy="36" r="17" fill="#c68646"/>' ++ '<g fill="#4a2a16"><circle cx="206" cy="30" r="2.4"/><circle cx="217" cy="34" r="2"/><circle cx="210" cy="43" r="2.2"/><circle cx="220" cy="42" r="1.6"/></g>',+ ],+ [+ "forest-path.jpg",+ "<defs>" ++ grad("msFoSky", ["#eef3d6", "#b4cc88"]) ++ "</defs>" ++ '<rect width="250" height="160" fill="url(#msFoSky)"/>' ++ '<g fill="#9aae7a" opacity=".8">' ++ each(9, function (i) {+ return (+ '<rect x="' ++ (8 + i * 29 + (i % 2) * 6) ++ '" width="' ++ (3 + (i % 3)) ++ '" height="160"/>'+ );+ }) ++ "</g>" ++ '<path d="M150 0 H176 L122 160 H94Z M198 0 H210 L170 160 H152Z" fill="#fffbe6" opacity=".22"/>' ++ '<g fill="#3a2d21"><rect x="16" width="13" height="160"/><rect x="58" width="7" height="160"/><rect x="178" width="9" height="160"/><rect x="214" width="16" height="160"/></g>' ++ '<path d="M0 0 H250 V24 Q222 40 196 27 Q170 44 142 29 Q116 46 90 29 Q62 42 36 27 Q16 38 0 30Z" fill="#577f38"/>' ++ '<path d="M0 108 Q125 98 250 108 V160 H0Z" fill="#4b7532"/>' ++ '<path d="M119 102 H131 L180 160 H70Z" fill="#c7a472"/>' ++ '<path d="M119 102 L70 160 H82 L121 102Z" fill="#a8865a"/>' ++ '<g fill="#3a5f27">' ++ each(6, function (i) {+ var x = i < 3 ? 10 + i * 20 : 186 + (i - 3) * 22;+ return (+ '<path d="M' ++ x ++ " 160 Q" ++ (x + 6) ++ " 136 " ++ (x + 16) ++ " 132 Q" ++ (x + 10) ++ " 142 " ++ (x + 12) ++ ' 160Z"/>'+ );+ }) ++ "</g>",+ ],+ [+ "aurora.jpg",+ "<defs>" ++ grad("msAuSky", ["#040a18", "#0b2033", "#12374a"]) ++ '<linearGradient id="msAuBand" x2="0" y2="1"><stop offset="0" stop-color="#b6ffe0" stop-opacity=".95"/><stop offset=".45" stop-color="#2fe39a" stop-opacity=".8"/><stop offset="1" stop-color="#14a37c" stop-opacity="0"/></linearGradient>' ++ '<filter id="msAuBlur" x="-20%" y="-40%" width="140%" height="180%"><feGaussianBlur stdDeviation="3"/></filter></defs>' ++ '<rect width="250" height="160" fill="url(#msAuSky)"/>' ++ '<g fill="#ffffff">' ++ each(34, function (i) {+ return (+ '<circle cx="' ++ ((i * 73.3) % 250).toFixed(1) ++ '" cy="' ++ ((i * 41.7) % 84).toFixed(1) ++ '" r="' ++ (i % 4 ? 0.6 : 1.1) ++ '" opacity=".8"/>'+ );+ }) ++ "</g>" ++ '<g filter="url(#msAuBlur)"><path d="M-10 74 C40 22 90 60 130 30 S210 8 260 36 L260 62 C210 34 170 62 130 54 S40 54 -10 96Z" fill="url(#msAuBand)"/>' ++ '<path d="M20 40 C70 10 120 36 170 16 S230 12 260 20 L260 30 C220 24 180 40 150 34 S70 30 20 52Z" fill="#6fe6ff" opacity=".35"/></g>' ++ '<path d="M0 124 L34 102 L60 114 L96 88 L130 112 L170 96 L206 116 L250 104 V160 H0Z" fill="#06101a"/>' ++ '<rect y="128" width="250" height="32" fill="#0a1a26"/>' ++ '<ellipse cx="120" cy="140" rx="90" ry="4" fill="#2fe39a" opacity=".25" filter="url(#msAuBlur)"/>' ++ '<g fill="#03080e">' ++ each(9, function (i) {+ var x = i < 5 ? i * 11 - 4 : 196 + (i - 5) * 14;+ var h = 18 + ((i * 5) % 4) * 5;+ return (+ '<path d="M' ++ x ++ " 132 L" ++ (x + 6) ++ " " ++ (132 - h) ++ " L" ++ (x + 12) ++ ' 132Z"/>'+ );+ }) ++ "</g>",+ ],+ [+ "desert-dunes.jpg",+ "<defs>" ++ grad("msDeSky", ["#5a9ed5", "#bcd9ec", "#f3e0c0"]) ++ "</defs>" ++ '<rect width="250" height="160" fill="url(#msDeSky)"/>' ++ '<circle cx="196" cy="30" r="18" fill="#fff8e6" opacity=".35"/>' ++ '<circle cx="196" cy="30" r="8" fill="#fffaf0"/>' ++ '<path d="M0 94 Q50 78 100 90 T200 84 T250 88 V160 H0Z" fill="#e4b27b"/>' ++ '<path d="M0 160 V124 Q70 96 130 98 Q190 102 250 120 V160Z" fill="#dc9a57"/>' ++ '<path d="M130 98 Q190 102 250 120 V160 H214 Q172 128 130 98Z" fill="#b1672f"/>' ++ '<path d="M0 160 V142 Q80 126 160 138 T250 136 V160Z" fill="#ebb67d"/>' ++ '<g fill="none" stroke="#c98a52" stroke-width="1" opacity=".55">' ++ each(4, function (i) {+ return (+ '<path d="M' ++ (10 + i * 12) ++ " " ++ (150 + i * 3) ++ " Q" ++ (80 + i * 10) ++ " " ++ (140 + i * 3) ++ " " ++ (150 + i * 8) ++ " " ++ (150 + i * 3) ++ '"/>'+ );+ }) ++ "</g>",+ ],+ [+ "window-portrait.jpg",+ "<defs>" ++ grad("msWpWin", ["#fbf4e6", "#dfe8ee"]) ++ "</defs>" ++ '<rect width="250" height="160" fill="#2b2622"/>' ++ '<rect x="40" y="18" width="120" height="120" fill="url(#msWpWin)"/>' ++ '<path d="M40 112 Q70 100 100 108 T160 104 V138 H40Z" fill="#c8d5c2"/>' ++ '<g fill="#2b2622"><rect x="98" y="18" width="4" height="120"/><rect x="40" y="76" width="120" height="4"/></g>' ++ '<rect x="37" y="15" width="126" height="126" fill="none" stroke="#1d1916" stroke-width="6"/>' ++ '<rect x="30" y="138" width="140" height="6" fill="#3a332d"/>' ++ '<path d="M40 144 H160 L204 160 H18Z" fill="#fbf4e6" opacity=".12"/>' ++ '<g fill="#15120f"><path d="M94 160 C96 122 110 106 128 102 C146 106 160 122 162 160Z"/>' ++ '<rect x="122" y="84" width="12" height="22"/><ellipse cx="128" cy="72" rx="15" ry="18"/>' ++ '<circle cx="136" cy="54" r="7"/></g>' ++ '<path d="M114 64 A15 18 0 0 1 124 54" fill="none" stroke="#fff3dc" stroke-width="1.2" opacity=".6"/>' ++ '<path d="M200 160 L203 132 H225 L228 160Z" fill="#7a4e34"/>' ++ '<g fill="#3d5838">' ++ each(5, function (i) {+ return (+ '<ellipse cx="214" cy="116" rx="5" ry="18" transform="rotate(' ++ (i * 22 - 44) ++ ' 214 132)"/>'+ );+ }) ++ "</g>",+ ],+ [+ "harbor-boats.jpg",+ "<defs>" ++ grad("msHbSky", ["#a6d2ea", "#e9f4f9"]) ++ grad("msHbSea", ["#3a84ae", "#1d5780"]) ++ "</defs>" ++ '<rect width="250" height="92" fill="url(#msHbSky)"/>' ++ '<path d="M0 64 Q60 44 120 58 T250 52 V80 H0Z" fill="#8cae98"/>' ++ [+ "#e4572e",+ "#f3c14b",+ "#f7f1e3",+ "#3d7ea6",+ "#e98a3a",+ "#f7f1e3",+ "#c0392b",+ "#f3c14b",+ "#6fa8a0",+ ]+ .map(function (c, i) {+ var x = i * 28;+ var h = 16 + ((i * 5) % 3) * 3;+ return (+ '<rect x="' ++ x ++ '" y="' ++ (86 - h) ++ '" width="27" height="' ++ h ++ '" fill="' ++ c ++ '"/><path d="M' ++ x ++ " " ++ (86 - h) ++ " L" ++ (x + 13.5) ++ " " ++ (78 - h) ++ " L" ++ (x + 27) ++ " " ++ (86 - h) ++ 'Z" fill="#7a3b2a"/>' ++ '<rect x="' ++ (x + 6) ++ '" y="' ++ (90 - h) ++ '" width="4" height="5" fill="#2d2a2a" opacity=".55"/>' ++ '<rect x="' ++ (x + 17) ++ '" y="' ++ (90 - h) ++ '" width="4" height="5" fill="#2d2a2a" opacity=".55"/>'+ );+ })+ .join("") ++ '<rect y="86" width="250" height="6" fill="#9b8f80"/>' ++ '<rect y="92" width="250" height="68" fill="url(#msHbSea)"/>' ++ boat(18, 112, 66, "#d64533") ++ boat(104, 124, 74, "#f4f0e6") ++ boat(190, 106, 52, "#f2b632") ++ '<g fill="#ffffff" opacity=".25">' ++ each(8, function (i) {+ return (+ '<rect x="' ++ ((i * 83) % 230) ++ '" y="' ++ (98 + i * 7) ++ '" width="26" height="1"/>'+ );+ }) ++ "</g>",+ ],+ [+ "poppy-closeup.jpg",+ "<defs>" ++ grad("msPpBg", ["#7aa34c", "#2c4b23"]) ++ '<filter id="msPpBlur" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="3"/></filter></defs>' ++ '<rect width="250" height="160" fill="url(#msPpBg)"/>' ++ '<g fill="#d2e8a2" opacity=".18">' ++ each(7, function (i) {+ return (+ '<circle cx="' ++ ((i * 97 + 20) % 250) ++ '" cy="' ++ ((i * 53 + 18) % 150) ++ '" r="' ++ (12 + ((i * 7) % 4) * 5) ++ '"/>'+ );+ }) ++ "</g>" ++ '<g filter="url(#msPpBlur)" fill="#d9412e" opacity=".45"><circle cx="30" cy="40" r="11"/><circle cx="222" cy="120" r="14"/></g>' ++ '<path d="M142 160 Q136 130 128 96" fill="none" stroke="#4e7a2c" stroke-width="5"/>' ++ '<g fill="#b91d15"><ellipse cx="100" cy="62" rx="40" ry="30" transform="rotate(-20 100 62)"/><ellipse cx="152" cy="60" rx="40" ry="30" transform="rotate(20 152 60)"/></g>' ++ '<g fill="#e6382a"><ellipse cx="106" cy="88" rx="38" ry="27" transform="rotate(14 106 88)"/><ellipse cx="148" cy="86" rx="38" ry="27" transform="rotate(-14 148 86)"/></g>' ++ '<g fill="none" stroke="#8e1410" stroke-width="1" opacity=".35"><path d="M126 78 Q100 90 80 104"/><path d="M126 78 Q152 92 172 102"/><path d="M126 70 Q104 52 82 44"/><path d="M126 70 Q150 50 170 42"/></g>' ++ '<circle cx="126" cy="74" r="12" fill="#231f16"/>' ++ '<g fill="#17130e">' ++ each(16, function (i) {+ var a = (i * Math.PI) / 8;+ return (+ '<circle cx="' ++ (126 + Math.cos(a) * 16).toFixed(1) ++ '" cy="' ++ (74 + Math.sin(a) * 16).toFixed(1) ++ '" r="1.8"/>'+ );+ }) ++ "</g>" ++ '<circle cx="126" cy="74" r="6" fill="#71803c"/>',+ ],+ [+ "snow-peak.jpg",+ "<defs>" ++ grad("msSnSky", ["#2567b2", "#7fb4e3", "#d7e9f6"]) ++ "</defs>" ++ '<rect width="250" height="160" fill="url(#msSnSky)"/>' ++ '<path d="M0 112 L36 86 L62 98 L92 80 L118 104 L190 92 L220 76 L250 94 V160 H0Z" fill="#9db6cd"/>' ++ '<path d="M30 160 L96 70 L110 78 L128 26 L150 64 L162 58 L232 160Z" fill="#56687a"/>' ++ '<path d="M128 26 L110 78 L96 70 L80 94 L100 90 L112 104 L124 84 L128 112 L136 80 L150 64Z" fill="#f7fbff"/>' ++ '<path d="M128 26 L150 64 L162 58 L182 92 L166 86 L150 100 L140 78 L136 80Z" fill="#c7d7e8"/>' ++ '<g fill="#ffffff" opacity=".7"><ellipse cx="54" cy="124" rx="62" ry="9"/><ellipse cx="196" cy="128" rx="70" ry="8"/><ellipse cx="120" cy="134" rx="80" ry="7"/></g>' ++ '<path d="M0 142 Q90 126 250 148 V160 H0Z" fill="#eef4fa"/>' ++ '<path d="M0 142 Q90 126 250 148" fill="none" stroke="#b9cde2" stroke-width="1.5"/>',+ ],+ [+ "market-stall.jpg",+ '<rect width="250" height="160" fill="#3b2a1f"/>' ++ '<rect width="250" height="34" fill="#f6efe2"/>' ++ '<g fill="#d7322b">' ++ each(10, function (i) {+ return (+ '<rect x="' ++ i * 25 ++ '" width="12.5" height="34"/><path d="M' ++ i * 25 ++ ' 34 a12.5 8 0 0 0 25 0Z"/>'+ );+ }) ++ "</g>" ++ '<rect y="40" width="250" height="8" fill="#000000" opacity=".22"/>' ++ [+ [8, 88, "#f0902a"],+ [88, 88, "#f4d23c"],+ [168, 88, "#cf2f2a"],+ [8, 138, "#7db13a"],+ [88, 138, "#e0402f"],+ [168, 138, "#3f5a2a"],+ ]+ .map(function (c) {+ var x = c[0];+ var top = c[1];+ var out = "";+ for (var k = 0; k < 11; k++) {+ var row = k < 6 ? 0 : 1;+ var cx = x + 9 + (row ? 6 + (k - 6) * 12 : k * 12);+ var cy = top - 5 - row * 9;+ out +=+ '<circle cx="' ++ cx ++ '" cy="' ++ cy ++ '" r="6.5" fill="' ++ c[2] ++ '"/>' ++ '<circle cx="' ++ (cx - 2) ++ '" cy="' ++ (cy - 2) ++ '" r="1.8" fill="#ffffff" opacity=".35"/>';+ }+ return (+ out ++ '<rect x="' ++ x ++ '" y="' ++ top ++ '" width="74" height="' ++ (c[1] === 88 ? 34 : 22) ++ '" fill="#a8743f"/><rect x="' ++ x ++ '" y="' ++ (top + 10) ++ '" width="74" height="1.4" fill="#7e5329"/><rect x="' ++ (x + 26) ++ '" y="' ++ (top + 3) ++ '" width="22" height="7" rx="1" fill="#f4efe4"/>'+ );+ })+ .join(""),+ ],+ ];+ var TILE_W = 250;+ var TILE_H = 160;+ var GAP_X = 30;+ var GAP_Y = 48;+ var LEFT = 415;+ var TOP = 280;+ var grid = $("ms-grid");+ var CHECK = '<svg viewBox="0 0 24 24"><path d="M6.5 12.5l3.6 3.6L17.5 8.5"/></svg>';+ var tiles = SCENES.map(function (p, i) {+ var box = {+ x: LEFT + (i % 4) * (TILE_W + GAP_X),+ y: TOP + Math.floor(i / 4) * (TILE_H + GAP_Y),+ };+ var el = document.createElement("div");+ el.className = "ms-tile";+ el.style.cssText = "left:" + box.x + "px;top:" + box.y + "px";+ el.innerHTML =+ '<div class="ms-ring"></div><div class="ms-photo"><svg viewBox="0 0 250 160" preserveAspectRatio="xMidYMid slice">' ++ p[1] ++ '</svg></div><div class="ms-check">' ++ CHECK ++ '</div><div class="ms-name">' ++ p[0] ++ "</div>";+ grid.appendChild(el);+ return {+ box: box,+ photo: el.querySelector(".ms-photo"),+ ring: el.querySelector(".ms-ring"),+ check: el.querySelector(".ms-check"),+ };+ });++ var s = Math.min(1, duration / 3.4);+ var T_ARRIVE = 0.5 * s;+ var T_PRESS = 0.62 * s;+ var T_DRAG = 0.7 * s;+ var T_RELEASE = 2.1 * s;+ var T_DRIFT = 2.2 * s;+ var T_EXIT = duration - 0.6 * s;++ var easeArrive = gsap.parseEase("power3.out");+ var easeDrag = gsap.parseEase("power2.out");+ var easeExit = gsap.parseEase("power3.in");+ var easePop = gsap.parseEase("back.out(2.4)");+ function clamp01(u) {+ return u < 0 ? 0 : u > 1 ? 1 : u;+ }+ function arc(p0, p1, bend, u) {+ var cx = (p0.x + p1.x) / 2 - (p1.y - p0.y) * bend;+ var cy = (p0.y + p1.y) / 2 + (p1.x - p0.x) * bend;+ var v = 1 - u;+ return {+ x: v * v * p0.x + 2 * v * u * cx + u * u * p1.x,+ y: v * v * p0.y + 2 * v * u * cy + u * u * p1.y,+ };+ }++ var A = {+ x: (num(vars.start_x, 20.5) / 100) * 1920,+ y: (num(vars.start_y, 25.5) / 100) * 1080,+ };+ var B = { x: (num(vars.end_x, 57) / 100) * 1920, y: (num(vars.end_y, 52) / 100) * 1080 };+ var START = { x: 2060, y: 1220 };+ var ASIDE = { x: B.x + 120, y: B.y + 110 };+ // Family arrow: 64px at 1920 wide, in stage units so the stage's fit scale cancels out.+ var ARROW = (64 * (W / 1920)) / fit;+ var TIP = { x: (5 / 24) * ARROW, y: (3 / 24) * ARROW };++ function pointerAt(t) {+ if (t <= T_ARRIVE) return arc(START, A, 0.16, easeArrive(clamp01(t / T_ARRIVE)));+ if (t <= T_DRAG) return A;+ if (t <= T_RELEASE)+ return arc(A, B, 0.06, easeDrag((t - T_DRAG) / (T_RELEASE - T_DRAG)));+ if (t <= T_DRIFT) return B;+ if (t <= T_EXIT)+ return arc(B, ASIDE, 0.1, easeArrive(clamp01((t - T_DRIFT) / (0.4 * s))));+ return arc(ASIDE, START, -0.1, easeExit(clamp01((t - T_EXIT) / (duration - T_EXIT))));+ }+ function rectAt(t) {+ var p = pointerAt(Math.min(t, T_RELEASE));+ return {+ x0: Math.min(A.x, p.x),+ y0: Math.min(A.y, p.y),+ x1: Math.max(A.x, p.x),+ y1: Math.max(A.y, p.y),+ };+ }+ function touches(r, b) {+ return r.x1 >= b.x && r.x0 <= b.x + TILE_W && r.y1 >= b.y && r.y0 <= b.y + TILE_H;+ }++ // The first frame the rectangle touches each tile, found by walking the drag path.+ var FPS = 240;+ tiles.forEach(function (tile) {+ tile.at = Infinity;+ for (var f = Math.ceil(T_DRAG * FPS); f <= Math.ceil(T_RELEASE * FPS); f++) {+ if (touches(rectAt(f / FPS), tile.box)) {+ tile.at = f / FPS;+ break;+ }+ }+ });++ var rect = $("ms-rect");+ var rectParts = rect.children;+ var cursor = $("ms-cursor");+ cursor.style.width = cursor.style.height = ARROW + "px";+ var pill = $("ms-pill");++ function render(t) {+ var r = rectAt(t);+ var dragging = t >= T_DRAG && t < T_RELEASE;+ var rectAlpha =+ t < T_DRAG+ ? 0+ : dragging+ ? clamp01((t - T_DRAG) / 0.06)+ : 1 - clamp01((t - T_RELEASE) / (0.18 * s));+ rect.style.opacity = rectAlpha.toFixed(3);+ var sx = Math.max(0.001, (r.x1 - r.x0) / 100).toFixed(4);+ var sy = Math.max(0.001, (r.y1 - r.y0) / 100).toFixed(4);+ var at = function (x, y) {+ return "translate(" + x.toFixed(2) + "px," + y.toFixed(2) + "px) ";+ };+ rectParts[0].style.transform = at(r.x0, r.y0) + "scale(" + sx + "," + sy + ")";+ rectParts[1].style.transform = at(r.x0, r.y0) + "scaleX(" + sx + ")";+ rectParts[2].style.transform = at(r.x0, r.y1 - 1) + "scaleX(" + sx + ")";+ rectParts[3].style.transform = at(r.x0, r.y0) + "scaleY(" + sy + ")";+ rectParts[4].style.transform = at(r.x1 - 1, r.y0) + "scaleY(" + sy + ")";++ var count = 0;+ var firstAt = Infinity;+ tiles.forEach(function (tile) {+ var on = t >= tile.at && touches(r, tile.box);+ var u = on ? clamp01((t - tile.at) / 0.24) : 0;+ if (on) count++;+ if (on) firstAt = Math.min(firstAt, tile.at);+ tile.ring.style.opacity = clamp01(u * 2).toFixed(3);+ tile.photo.style.transform =+ "scale(" + (1 - 0.06 * clamp01(u * 1.6)).toFixed(4) + ")";+ tile.check.style.opacity = clamp01(u * 3).toFixed(3);+ tile.check.style.transform = "scale(" + (0.5 + 0.5 * easePop(u)).toFixed(4) + ")";+ });++ var pillU = count > 0 ? clamp01((t - firstAt) / 0.22) : 0;+ pill.textContent = count + " " + pillLabel;+ pill.style.opacity = pillU.toFixed(3);+ pill.style.transform = "scale(" + (0.94 + 0.06 * easePop(pillU)).toFixed(4) + ")";++ var p = pointerAt(t);+ var press =+ t >= T_PRESS && t < T_PRESS + 0.2 * s+ ? 1 - 0.1 * Math.sin(Math.PI * clamp01((t - T_PRESS) / (0.2 * s)))+ : 1;+ cursor.style.transformOrigin = TIP.x + "px " + TIP.y + "px";+ cursor.style.transform =+ "translate(" ++ (p.x - TIP.x).toFixed(2) ++ "px," ++ (p.y - TIP.y).toFixed(2) ++ "px) scale(" ++ press.toFixed(4) ++ ")";+ }++ var clock = { t: 0 };+ var tl = gsap.timeline({ paused: true });+ tl.to(+ clock,+ {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ render(clock.t);+ },+ },+ 0,+ );+ render(0);+ tl.seek(0);+ window.__timelines = window.__timelines || {};+ window.__timelines[compositionId] = tl;+ })();+ </script>+ </template>+ </body>+</html>diff --git a/registry/components/cursor-marquee-select/demo.html b/registry/components/cursor-marquee-select/demo.htmlnew file mode 100644index 0000000000..6f8a6ee260--- /dev/null+++ b/registry/components/cursor-marquee-select/demo.html@@ -0,0 +1,64 @@+<!doctype html>+<!--+ Marquee Select Cursor, standalone demo: mounts cursor-marquee-select.html full-frame over a+ flat backdrop. The photo grid and every reaction live inside the component.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Marquee Select Cursor, Demo</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ width: 100%;+ height: 100%;+ overflow: hidden;+ }+ #root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #111318;+ }+ </style>+ </head>+ <body>+ <div+ id="root"+ data-composition-id="cursor-marquee-select-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="3.4"+ >+ <div+ class="clip"+ id="cursor-marquee-select"+ data-composition-id="cursor-marquee-select"+ data-composition-src="./cursor-marquee-select.html"+ data-variable-values='{"accent":"#0a84ff","pill_label":"selected"}'+ data-start="0"+ data-duration="3.4"+ data-track-index="1"+ data-width="1920"+ data-height="1080"+ style="position: absolute; inset: 0; width: 1920px; height: 1080px"+ ></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};+ var tl = gsap.timeline({ paused: true });+ window.__timelines["cursor-marquee-select-demo"] = tl;+ </script>+ </body>+</html>diff --git a/registry/components/cursor-marquee-select/registry-item.json b/registry/components/cursor-marquee-select/registry-item.jsonnew file mode 100644index 0000000000..d844e728eb--- /dev/null+++ b/registry/components/cursor-marquee-select/registry-item.json@@ -0,0 +1,76 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "cursor-marquee-select",+ "type": "hyperframes:component",+ "title": "Marquee Select Cursor",+ "description": "A cursor drags a selection rectangle across a photo grid; each tile rings and pops a check the frame the rectangle touches it, while a pill counts the selection up.",+ "tags": ["cursor", "motion-primitive", "select", "marquee", "grid", "product-demo"],+ "files": [+ {+ "path": "cursor-marquee-select.html",+ "target": "compositions/components/cursor-marquee-select.html",+ "type": "hyperframes:snippet"+ }+ ],+ "jobs": ["demonstrate"],+ "family": "pointers",+ "profile": "interaction",+ "syncPoints": [+ { "id": "press", "phase": "in", "offset": 0.62 },+ { "id": "release", "phase": "in", "offset": 2.1 }+ ],+ "variables": [+ { "id": "accent", "type": "color", "role": "style", "label": "Accent", "default": "#0a84ff" },+ {+ "id": "start_x",+ "type": "number",+ "role": "layout",+ "label": "Drag start X",+ "default": 20.5,+ "min": 0,+ "max": 100,+ "step": 0.5,+ "unit": "%"+ },+ {+ "id": "start_y",+ "type": "number",+ "role": "layout",+ "label": "Drag start Y",+ "default": 25.5,+ "min": 0,+ "max": 100,+ "step": 0.5,+ "unit": "%"+ },+ {+ "id": "end_x",+ "type": "number",+ "role": "layout",+ "label": "Drag end X",+ "default": 57,+ "min": 0,+ "max": 100,+ "step": 0.5,+ "unit": "%"+ },+ {+ "id": "end_y",+ "type": "number",+ "role": "layout",+ "label": "Drag end Y",+ "default": 52,+ "min": 0,+ "max": 100,+ "step": 0.5,+ "unit": "%"+ },+ {+ "id": "pill_label",+ "type": "string",+ "role": "content",+ "label": "Pill label",+ "default": "selected"+ }+ ]+}diff --git a/registry/components/cursor-text-select/cursor-text-select.html b/registry/components/cursor-text-select/cursor-text-select.htmlnew file mode 100644index 0000000000..842c9e99ba--- /dev/null+++ b/registry/components/cursor-text-select/cursor-text-select.html@@ -0,0 +1,440 @@+<!doctype html>+<!--+ Text Select Cursor (actor primitive), mountable sub-composition++ concept: an arrow glides onto a document and turns into an I-beam as its tip enters+ the text, presses before a phrase and drags the selection across it character by+ character, releases (the selection snaps to the word end), a format toolbar fades+ up centred above the selection, the pointer turns back into an arrow, clicks Bold, and the+ phrase turns bold.++ mount contract: loaded by a host through data-composition-src; only <template> is+ cloned. #root fills the host clip (inset:0) and draws its own document card.++ variables:+ title (string) the document heading+ text (string) the paragraph+ phrase (string) the words to select; must appear in text, else the middle words are used+ accent (color) selection tint and the active Bold button++ envelope (default 4.2s): glide 0-0.5s, drag 0.65-1.6s, release 1.65s, toolbar 1.75s,+ click Bold 2.7s, cursor drifts aside by 3.4s, hold. Shorter durations compress every beat evenly.+-->+<html+ lang="en"+ data-composition-id="cursor-text-select"+ data-composition-duration="4.2"+ data-composition-variables='[+ { "id": "title", "type": "string", "role": "content", "label": "Heading", "default": "Spring release notes" },+ { "id": "text", "type": "string", "role": "content", "label": "Paragraph", "default": "Our spring release ships on Thursday. Teams can now share a live review link, collect time-stamped comments, and approve the final cut without leaving the editor. Early customers cut their review rounds in half." },+ { "id": "phrase", "type": "string", "role": "content", "label": "Phrase to select", "default": "approve the final cut" },+ { "id": "accent", "type": "color", "role": "style", "label": "Accent", "default": "#0a84ff" }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Text Select Cursor</title>+ </head>+ <body>+ <template>+ <style>+ #root {+ position: absolute;+ inset: 0;+ overflow: hidden;+ container-type: size;+ font-family: var(--font-body, Inter, system-ui, sans-serif);+ --ts-accent: #0a84ff;+ }+ .ts-stage {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ }+ .ts-card {+ position: relative;+ width: 70cqw;+ padding: 4cqw 4.6cqw 4.4cqw;+ border-radius: 1.4cqw;+ background: #ffffff;+ box-shadow:+ 0 2.4cqw 6cqw rgba(8, 12, 28, 0.35),+ 0 0 0 1px rgba(15, 23, 42, 0.06);+ }+ .ts-meta {+ font-size: 1.1cqw;+ font-weight: 600;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ color: #8a90a2;+ }+ .ts-title {+ margin: 0.9cqw 0 1.8cqw;+ font-size: 3.1cqw;+ font-weight: 700;+ letter-spacing: -0.02em;+ color: #0f1222;+ }+ .ts-para {+ position: relative;+ margin: 0;+ font-size: 2.05cqw;+ line-height: 1.6;+ color: #30354a;+ }+ .ts-ch.is-sel {+ background: color-mix(in srgb, var(--ts-accent) 26%, transparent);+ }+ .ts-ch.is-bold {+ font-weight: 700;+ color: #0f1222;+ }+ .ts-toolbar {+ position: absolute;+ left: 0;+ top: 0;+ display: flex;+ gap: 0.3cqw;+ padding: 0.4cqw;+ border-radius: 0.9cqw;+ background: #15182a;+ box-shadow: 0 1cqw 2.4cqw rgba(8, 12, 28, 0.35);+ transform-origin: 50% 100%;+ opacity: 0;+ will-change: transform, opacity;+ }+ .ts-btn {+ display: flex;+ align-items: center;+ justify-content: center;+ width: 3.5cqw;+ height: 3.5cqw;+ border-radius: 0.6cqw;+ color: #e7e9f2;+ }+ .ts-btn svg {+ width: 1.8cqw;+ height: 1.8cqw;+ fill: none;+ stroke: currentColor;+ stroke-width: 2.2;+ stroke-linecap: round;+ stroke-linejoin: round;+ }+ .ts-btn.is-on {+ background: var(--ts-accent);+ color: #ffffff;+ }+ .ts-cursor {+ position: absolute;+ left: 0;+ top: 0;+ width: 0;+ height: 0;+ transform-origin: 0 0;+ will-change: transform;+ }+ .ts-arrow,+ .ts-ibeam {+ position: absolute;+ overflow: visible;+ filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));+ }+ .ts-arrow path {+ fill: #ffffff;+ stroke: #141414;+ stroke-width: 1.4;+ stroke-linejoin: round;+ }+ .ts-ibeam path {+ fill: none;+ stroke-linecap: round;+ stroke-linejoin: round;+ }+ </style>++ <div id="root" data-composition-id="cursor-text-select" data-duration="4.2">+ <div class="ts-stage">+ <div class="ts-card">+ <div class="ts-meta">Draft · edited just now</div>+ <h2 class="ts-title" id="ts-title"></h2>+ <p class="ts-para" id="ts-para"></p>+ </div>+ </div>+ <div class="ts-toolbar" id="ts-toolbar">+ <div class="ts-btn" id="ts-bold">+ <svg viewBox="0 0 24 24">+ <path d="M7 4h6.5a4 4 0 0 1 0 8H7zM7 12h7.5a4 4 0 0 1 0 8H7z" />+ </svg>+ </div>+ <div class="ts-btn">+ <svg viewBox="0 0 24 24"><path d="M14 4h-4M14 20h-4M13.5 4 10.5 20" /></svg>+ </div>+ <div class="ts-btn">+ <svg viewBox="0 0 24 24">+ <path+ d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"+ />+ </svg>+ </div>+ <div class="ts-btn">+ <svg viewBox="0 0 24 24"><path d="M5 5h14v10H10l-5 4z" /></svg>+ </div>+ </div>+ <div class="ts-cursor" id="ts-cursor" aria-hidden="true">+ <svg class="ts-arrow" id="ts-arrow" viewBox="0 0 24 24">+ <path d="M5 3 L5 19 L9 15 L12 22 L15 20.5 L11.5 14 L18 14 Z" />+ </svg>+ <svg class="ts-ibeam" id="ts-ibeam" viewBox="0 0 12 32">+ <path+ d="M2.5 2Q6 2 6 4.5Q6 2 9.5 2M2.5 30Q6 30 6 27.5Q6 30 9.5 30M6 4.5V27.5"+ stroke="#ffffff"+ stroke-width="3.4"+ />+ <path+ d="M2.5 2Q6 2 6 4.5Q6 2 9.5 2M2.5 30Q6 30 6 27.5Q6 30 9.5 30M6 4.5V27.5"+ stroke="#141414"+ stroke-width="1.3"+ />+ </svg>+ </div>+ </div>++ <script>+ (function () {+ "use strict";++ var html = document.documentElement;+ var root = document.getElementById("root");+ var para = document.getElementById("ts-para");+ var toolbar = document.getElementById("ts-toolbar");+ var boldBtn = document.getElementById("ts-bold");+ var cursor = document.getElementById("ts-cursor");+ var arrow = document.getElementById("ts-arrow");+ var ibeam = document.getElementById("ts-ibeam");++ var DEFAULTS = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(+ function (variable) {+ DEFAULTS[variable.id] = variable.default;+ },+ );+ } catch (error) {+ /* malformed declaration falls back to the inline defaults below */+ }+ var scopedVariables = {};+ try {+ if (window.__hyperframes && typeof window.__hyperframes.getVariables === "function") {+ scopedVariables = window.__hyperframes.getVariables() || {};+ }+ } catch (error) {+ /* no scoped variables API in this context */+ }+ var vars = Object.assign({}, DEFAULTS, window.__hfVariables || {}, scopedVariables);++ // Hardcoded: the compositor rewrites the wrapper's attributes on mount.+ var compositionId = "cursor-text-select";+ var duration = Math.max(+ 0.001,+ parseFloat(+ root.dataset.duration || html.getAttribute("data-composition-duration") || "4.2",+ ),+ );+ var text = String(vars.text || DEFAULTS.text || "");+ var phrase = String(vars.phrase || "");+ if (vars.accent) root.style.setProperty("--ts-accent", String(vars.accent));+ document.getElementById("ts-title").textContent = String(vars.title || "");++ // The phrase must be in the text; otherwise select the middle three words.+ var at = phrase ? text.indexOf(phrase) : -1;+ if (at < 0) {+ var words = text.split(" ");+ var from = Math.max(0, Math.floor(words.length / 2) - 1);+ phrase = words.slice(from, from + 3).join(" ");+ at = words.slice(0, from).join(" ").length + (from > 0 ? 1 : 0);+ }+ para.appendChild(document.createTextNode(text.slice(0, at)));+ var chars = [];+ for (var i = 0; i < phrase.length; i++) {+ var span = document.createElement("span");+ span.className = "ts-ch";+ span.textContent = phrase[i];+ para.appendChild(span);+ chars.push(span);+ }+ para.appendChild(document.createTextNode(text.slice(at + phrase.length)));++ var W = root.clientWidth || 1920;+ var H = root.clientHeight || 1080;+ var u = W / 1920;+ var ARROW = 64 * u;+ arrow.style.width = arrow.style.height = ARROW + "px";+ arrow.style.left = (-5 / 24) * ARROW + "px";+ arrow.style.top = (-3 / 24) * ARROW + "px";+ // macOS proportion: the I-beam's drawn height (28 of 32 units) is 1.2x the arrow's (19 of 24).+ var BEAM = (1.2 * ARROW * (19 / 24) * 32) / 28;+ ibeam.style.height = BEAM + "px";+ ibeam.style.width = BEAM * 0.375 + "px";+ ibeam.style.left = -BEAM * 0.1875 + "px";+ ibeam.style.top = -BEAM / 2 + "px";++ // Layout-space offsets, which ignore any transform a host puts on the player.+ function offsetIn(el) {+ var x = 0;+ var y = 0;+ while (el && el !== root) {+ x += el.offsetLeft;+ y += el.offsetTop;+ el = el.offsetParent;+ }+ return { x: x, y: y };+ }+ function charBox(k) {+ var o = offsetIn(chars[k]);+ return { l: o.x, r: o.x + chars[k].offsetWidth, t: o.y, h: chars[k].offsetHeight };+ }+ // Tip point for a fractional character count f: between the edges of character floor(f).+ function boundary(f) {+ var n = chars.length;+ var k = Math.min(n - 1, Math.max(0, Math.floor(f)));+ var box = charBox(k);+ var frac = Math.min(1, Math.max(0, f - k));+ return { x: box.l + (box.r - box.l) * frac, y: box.t + box.h / 2 };+ }++ var squeeze = Math.min(1, duration / 4.2);+ var T = {+ inEnd: 0.5,+ press: 0.6,+ drag0: 0.65,+ drag1: 1.6,+ release: 1.65,+ bar: 1.75,+ move0: 2.0,+ move1: 2.5,+ click: 2.7,+ bold: 2.77,+ away0: 2.95,+ away1: 3.4,+ };+ for (var key in T) T[key] *= squeeze;+ var DRAG_REACH = 0.9;++ var easeOut = gsap.parseEase("power3.out");+ var easeInOut = gsap.parseEase("power2.inOut");+ function seg(t, a, b) {+ return Math.max(0, Math.min(1, (t - a) / (b - a)));+ }+ function lerp(a, b, k) {+ return { x: a.x + (b.x - a.x) * k, y: a.y + (b.y - a.y) * k };+ }+ function dip(t, at) {+ var d = 0.07 * squeeze;+ if (t < at || t > at + d * 3.3) return 1;+ return t < at + d+ ? 1 - 0.12 * seg(t, at, at + d)+ : 0.88 + 0.12 * easeOut(seg(t, at + d, at + d * 3.3));+ }++ function render(t) {+ var n = chars.length;+ var bold = t >= T.bold;+ var f = t < T.drag0 ? 0 : n * DRAG_REACH * easeInOut(seg(t, T.drag0, T.drag1));+ var selected = t >= T.release ? n : Math.round(f);+ for (var i = 0; i < n; i++) {+ chars[i].classList.toggle("is-sel", i < selected);+ chars[i].classList.remove("is-bold");+ }++ // Anchor on the regular-weight layout so the toolbar does not shift when Bold lands.+ var first = charBox(0);+ var lineR = first.r;+ for (var j = 1; j < n && charBox(j).t === first.t; j++) lineR = charBox(j).r;+ var card = offsetIn(para.parentNode);+ var cardRight = card.x + para.parentNode.offsetWidth;+ var barW = toolbar.offsetWidth;+ var barX = Math.max(+ card.x + 16 * u,+ Math.min((first.l + lineR) / 2 - barW / 2, cardRight - 16 * u - barW),+ );+ var barY = first.t - 12 * u - toolbar.offsetHeight;+ for (i = 0; i < n; i++) chars[i].classList.toggle("is-bold", bold);+ var barK = easeOut(seg(t, T.bar, T.bar + 0.18 * squeeze));+ toolbar.style.opacity = String(barK);+ toolbar.style.transform =+ "translate(" ++ barX ++ "px," ++ (barY + 4 * u * (1 - barK)) ++ "px) scale(" ++ (0.96 + 0.04 * barK) ++ ")";+ var pressed = t >= T.click && t < T.click + 0.12 * squeeze;+ boldBtn.style.transform = pressed ? "scale(0.92)" : "";+ boldBtn.classList.toggle("is-on", bold);++ var start = { x: W * 1.08, y: H * 0.34 };+ var press = boundary(0);+ var release = boundary(n * DRAG_REACH);+ var target = {+ x: barX + boldBtn.offsetLeft + boldBtn.offsetWidth * 0.55,+ y: barY + boldBtn.offsetTop + boldBtn.offsetHeight * 0.6,+ };+ var aside = { x: cardRight + 80 * u, y: target.y + 140 * u };+ var p;+ if (t < T.inEnd) p = lerp(start, press, easeOut(seg(t, 0, T.inEnd)));+ else if (t < T.drag0) p = press;+ else if (t < T.move0) p = boundary(f);+ else if (t < T.move1) p = lerp(release, target, easeOut(seg(t, T.move0, T.move1)));+ else if (t < T.away0) p = target;+ else p = lerp(target, aside, easeInOut(seg(t, T.away0, T.away1)));++ // The I-beam takes over while the tip is inside the paragraph box.+ var box = offsetIn(para);+ var inside = Math.min(+ p.x - box.x,+ box.x + para.offsetWidth - p.x,+ p.y - box.y,+ box.y + para.offsetHeight - p.y,+ );+ var m = seg(inside, -24 * u, 0);+ var overBar =+ barK > 0 &&+ p.x > barX - 10 * u &&+ p.x < barX + toolbar.offsetWidth + 10 * u &&+ p.y > barY - 10 * u &&+ p.y < barY + toolbar.offsetHeight + 10 * u;+ if (overBar) m = 0;+ arrow.style.opacity = String(1 - m);+ ibeam.style.opacity = String(m);++ var s = dip(t, T.press) * dip(t, T.click);+ cursor.style.transform = "translate(" + p.x + "px," + p.y + "px) scale(" + s + ")";+ }++ var clock = { t: 0 };+ var tl = gsap.timeline({ paused: true });+ tl.to(+ clock,+ {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ render(clock.t);+ },+ },+ 0,+ );+ render(0);+ tl.seek(0);+ window.__timelines = window.__timelines || {};+ window.__timelines[compositionId] = tl;+ })();+ </script>+ </template>+ </body>+</html>diff --git a/registry/components/cursor-text-select/demo.html b/registry/components/cursor-text-select/demo.htmlnew file mode 100644index 0000000000..1bfb798620--- /dev/null+++ b/registry/components/cursor-text-select/demo.html@@ -0,0 +1,69 @@+<!doctype html>+<!--+ Text Select Cursor, standalone demo. Mounts cursor-text-select.html full-frame over a+ flat light backdrop; the component draws its own document card.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Text Select Cursor, Demo</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ width: 100%;+ height: 100%;+ overflow: hidden;+ }+ #root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #f4f4f5;+ }+ .backdrop {+ position: absolute;+ inset: 0;+ }+ </style>+ </head>+ <body>+ <div+ id="root"+ data-composition-id="cursor-text-select-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="4.2"+ >+ <div class="backdrop clip" data-start="0" data-duration="4.2" data-track-index="0"></div>+ <div+ class="clip"+ id="cursor-text-select"+ data-composition-id="cursor-text-select"+ data-composition-src="./cursor-text-select.html"+ data-variable-values='{"phrase":"approve the final cut","accent":"#0a84ff"}'+ data-start="0"+ data-duration="4.2"+ data-track-index="1"+ data-width="1920"+ data-height="1080"+ style="position: absolute; inset: 0; width: 1920px; height: 1080px"+ ></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};+ var tl = gsap.timeline({ paused: true });+ window.__timelines["cursor-text-select-demo"] = tl;+ </script>+ </body>+</html>diff --git a/registry/components/cursor-text-select/registry-item.json b/registry/components/cursor-text-select/registry-item.jsonnew file mode 100644index 0000000000..23fdffdb26--- /dev/null+++ b/registry/components/cursor-text-select/registry-item.json@@ -0,0 +1,52 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "cursor-text-select",+ "type": "hyperframes:component",+ "title": "Text Select Cursor",+ "description": "An arrow turns into an I-beam over a document, drags a selection across a phrase character by character, raises a format toolbar, turns back into an arrow and clicks Bold.",+ "tags": ["cursor", "motion-primitive", "text", "selection", "editor", "toolbar"],+ "files": [+ {+ "path": "cursor-text-select.html",+ "target": "compositions/components/cursor-text-select.html",+ "type": "hyperframes:snippet"+ }+ ],+ "jobs": ["demonstrate"],+ "family": "pointers",+ "profile": "interaction",+ "syncPoints": [+ { "id": "selection-released", "phase": "in", "offset": 1.65 },+ { "id": "bold-click", "phase": "in", "offset": 2.7 }+ ],+ "variables": [+ {+ "id": "title",+ "type": "string",+ "role": "content",+ "label": "Heading",+ "default": "Spring release notes"+ },+ {+ "id": "text",+ "type": "string",+ "role": "content",+ "label": "Paragraph",+ "default": "Our spring release ships on Thursday. Teams can now share a live review link, collect time-stamped comments, and approve the final cut without leaving the editor. Early customers cut their review rounds in half."+ },+ {+ "id": "phrase",+ "type": "string",+ "role": "content",+ "label": "Phrase to select",+ "default": "approve the final cut"+ },+ {+ "id": "accent",+ "type": "color",+ "role": "style",+ "label": "Accent",+ "default": "#0a84ff"+ }+ ]+}diff --git a/registry/components/cursor-zoom-follow/cursor-zoom-follow.html b/registry/components/cursor-zoom-follow/cursor-zoom-follow.htmlnew file mode 100644index 0000000000..9011340321--- /dev/null+++ b/registry/components/cursor-zoom-follow/cursor-zoom-follow.html@@ -0,0 +1,720 @@+<!doctype html>+<!--+ Zoom Follow Cursor (camera primitive), mountable sub-composition++ concept: screen-recording auto-zoom. A cursor works through three clicks on a screen while+ the camera pushes in toward each upcoming click, trails the cursor on a smooth spring, marks+ every click with a press and a ring, then eases back out to the full screen as the cursor leaves.++ mount contract: loaded by a host through data-composition-src; only <template> is cloned.+ #root fills the host clip (inset:0). See demo.html.++ variables:+ image (image) your own screenshot; empty shows the built-in dashboard+ zoom (1.2 to 2.6) camera scale while it follows the cursor+ click1_x .. click3_y (% of the screen) the three click points, in order+ accent (color) click ring and selection colour++ envelope (default 5.8s): zoom in 0.1-0.95s, clicks at 0.95s, 2.55s and 3.65s (the built-in+ dashboard also picks a menu row at 1.45s), zoom out 4.8-5.8s while the cursor exits.+ Shorter durations compress every beat evenly.+ The cursor lives in scene space, inside the camera: it is part of the recorded screen, so it+ zooms with the UI it points at. At zoom 1 it is the family's 64px-at-1920 arrow.+-->+<html+ lang="en"+ data-composition-id="cursor-zoom-follow"+ data-composition-duration="5.8"+ data-composition-variables='[+ { "id": "image", "type": "image", "role": "content", "label": "Screenshot", "description": "Your own screen capture. Leave empty for the built-in dashboard.", "default": "" },+ { "id": "zoom", "type": "number", "role": "style", "label": "Zoom", "default": 1.8, "min": 1.2, "max": 2.6, "step": 0.1 },+ { "id": "click1_x", "type": "number", "role": "layout", "label": "Click 1 X", "default": 68.5, "min": 0, "max": 100, "step": 0.5, "unit": "%" },+ { "id": "click1_y", "type": "number", "role": "layout", "label": "Click 1 Y", "default": 7.5, "min": 0, "max": 100, "step": 0.5, "unit": "%" },+ { "id": "click2_x", "type": "number", "role": "layout", "label": "Click 2 X", "default": 50, "min": 0, "max": 100, "step": 0.5, "unit": "%" },+ { "id": "click2_y", "type": "number", "role": "layout", "label": "Click 2 Y", "default": 48.5, "min": 0, "max": 100, "step": 0.5, "unit": "%" },+ { "id": "click3_x", "type": "number", "role": "layout", "label": "Click 3 X", "default": 90.5, "min": 0, "max": 100, "step": 0.5, "unit": "%" },+ { "id": "click3_y", "type": "number", "role": "layout", "label": "Click 3 Y", "default": 7.5, "min": 0, "max": 100, "step": 0.5, "unit": "%" },+ { "id": "accent", "type": "color", "role": "style", "label": "Ripple", "default": "#0a84ff" }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Zoom Follow Cursor</title>+ </head>+ <body>+ <template>+ <style>+ #root {+ position: absolute;+ inset: 0;+ overflow: hidden;+ isolation: isolate;+ container-type: size;+ background: #f4f5f9;+ font-family: var(--font-body, Inter, system-ui, sans-serif);+ color: #171a26;+ }+ .zf-cam,+ .zf-app,+ .zf-img {+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ }+ .zf-cam {+ /* No will-change: a cached camera layer drew different pixels for the same t after a seek. */+ transform-origin: 0 0;+ }+ .zf-img {+ object-fit: cover;+ display: none;+ }+ .zf-app div {+ position: absolute;+ }+ .zf-card {+ border-radius: 1cqw;+ background: #ffffff;+ box-shadow: 0 0 0 1px rgba(20, 24, 40, 0.07);+ }+ .zf-menu {+ padding: 0.35cqw;+ font-size: 1cqw;+ opacity: 0;+ transform-origin: 50% 0;+ box-shadow:+ 0 0 0 1px rgba(20, 24, 40, 0.07),+ 0 0.8cqw 2cqw rgba(20, 24, 40, 0.14);+ }+ .zf-menu p {+ margin: 0;+ padding: 0.65cqw 0.8cqw;+ border-radius: 0.65cqw;+ display: flex;+ align-items: center;+ justify-content: space-between;+ }+ .zf-menu p.hover {+ background: #f1f3f7;+ }+ .zf-state {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ }+ .zf-icon {+ width: 1cqw;+ height: 1cqw;+ fill: none;+ stroke: currentColor;+ stroke-width: 2;+ stroke-linecap: round;+ stroke-linejoin: round;+ }+ .zf-menu .zf-icon {+ color: var(--zf-accent);+ }+ .zf-side {+ left: 0;+ top: 0;+ width: 15%;+ height: 100%;+ background: #ffffff;+ box-shadow: 1px 0 0 rgba(20, 24, 40, 0.07);+ padding: 2.2cqw 1.6cqw;+ font-size: 1.05cqw;+ }+ .zf-side p {+ margin: 0 0 1.5cqw;+ color: #5d6275;+ }+ .zf-side p.on {+ color: #171a26;+ font-weight: 650;+ }+ .zf-h {+ font-size: 2.1cqw;+ font-weight: 700;+ letter-spacing: -0.02em;+ }+ .zf-sub {+ font-size: 0.95cqw;+ color: #7a7f93;+ }+ .zf-pill {+ height: 5.4%;+ border-radius: 0.7cqw;+ font-size: 1.05cqw;+ font-weight: 600;+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.6cqw;+ }+ .zf-range.open {+ box-shadow: 0 0 0 2px var(--zf-accent);+ }+ .zf-kpi b {+ display: block;+ font-size: 2cqw;+ margin-top: 0.5cqw;+ }+ .zf-kpi span {+ font-size: 0.95cqw;+ color: #7a7f93;+ }+ .zf-row {+ left: 2%;+ right: 2%;+ height: 20%;+ display: flex;+ align-items: center;+ justify-content: space-between;+ font-size: 1cqw;+ border-top: 1px solid #eef0f5;+ }+ .zf-bar {+ left: 6%;+ right: 6%;+ color: #5d6275;+ }+ .zf-bar i {+ display: block;+ height: 0.7cqw;+ margin-top: 0.5cqw;+ border-radius: 0.35cqw;+ background: #b9d8ff;+ }+ .zf-ripple {+ position: absolute;+ left: 0;+ top: 0;+ box-sizing: border-box;+ border: 0 solid var(--zf-accent);+ border-radius: 50%;+ opacity: 0;+ }+ .zf-cursor {+ position: absolute;+ left: 0;+ top: 0;+ filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));+ }+ .zf-cursor path {+ fill: #ffffff;+ stroke: #141414;+ stroke-width: 1.4;+ stroke-linejoin: round;+ }+ </style>++ <div id="root" data-composition-id="cursor-zoom-follow" data-duration="5.8">+ <div class="zf-cam" id="zf-cam">+ <img class="zf-img" id="zf-img" alt="" />+ <div class="zf-app" id="zf-app">+ <div class="zf-side">+ <p class="on">Overview</p>+ <p>Revenue</p>+ <p>Customers</p>+ <p>Invoices</p>+ <p>Settings</p>+ </div>+ <div class="zf-h" style="left: 18%; top: 4%">Revenue</div>+ <div class="zf-sub" style="left: 18%; top: 9.2%">Updated 2 minutes ago</div>+ <div+ class="zf-pill zf-card zf-range"+ id="zf-range"+ style="left: 62%; top: 4.8%; width: 13%"+ >+ <span id="zf-range-label">Last 30 days</span>+ <svg class="zf-icon" viewBox="0 0 16 16" style="color: #7a7f93">+ <path d="M4 6l4 4 4-4" />+ </svg>+ </div>+ <div+ class="zf-pill"+ id="zf-export"+ style="left: 85%; top: 4.8%; width: 11%; background: #171a26; color: #fff"+ >+ <span class="zf-state">Export</span>+ <span class="zf-state" style="opacity: 0">Exporting…</span>+ <span class="zf-state" style="opacity: 0; gap: 0.5cqw"+ ><svg class="zf-icon" viewBox="0 0 16 16"><path d="M3.5 8.5l3 3 6-7" /></svg+ >Exported</span+ >+ </div>+ <div+ class="zf-card zf-kpi"+ style="left: 18%; top: 16%; width: 24.5%; height: 13%; padding: 1.4cqw"+ >+ <span>Net revenue</span><b>$84,210</b>+ </div>+ <div+ class="zf-card zf-kpi"+ style="left: 44.75%; top: 16%; width: 24.5%; height: 13%; padding: 1.4cqw"+ >+ <span>Active customers</span><b>1,284</b>+ </div>+ <div+ class="zf-card zf-kpi"+ style="left: 71.5%; top: 16%; width: 24.5%; height: 13%; padding: 1.4cqw"+ >+ <span>Churn</span><b>2.1%</b>+ </div>+ <div class="zf-card" style="left: 18%; top: 32%; width: 51.25%; height: 35%">+ <svg+ viewBox="0 0 100 50"+ preserveAspectRatio="none"+ style="position: absolute; inset: 12% 4% 8%; width: 92%; height: 80%"+ >+ <path+ id="zf-line"+ d="M0 40 L10 36 L20 38 L30 30 L40 31 L50 22 L60 25 L70 17 L80 19 L90 10 L100 12"+ fill="none"+ stroke="#0a84ff"+ stroke-width="1.2"+ vector-effect="non-scaling-stroke"+ />+ </svg>+ <div+ class="zf-card"+ id="zf-tip"+ style="+ left: 60%;+ top: 8%;+ padding: 0.6cqw 0.9cqw;+ font-size: 0.95cqw;+ opacity: 0;+ box-shadow: 0 0.6cqw 1.6cqw rgba(20, 24, 40, 0.16);+ "+ >+ Aug 25 <b>$3,920</b>+ </div>+ </div>+ <div+ class="zf-card"+ style="+ left: 71.5%;+ top: 32%;+ width: 24.5%;+ height: 35%;+ padding: 1.4cqw;+ font-size: 1cqw;+ "+ >+ <b>Top plans</b>+ <div class="zf-bar" style="top: 26%">Team<i style="width: 46%"></i></div>+ <div class="zf-bar" style="top: 50%">Business<i style="width: 32%"></i></div>+ <div class="zf-bar" style="top: 74%">Starter<i style="width: 22%"></i></div>+ </div>+ <div class="zf-card" style="left: 18%; top: 70%; width: 78%; height: 26%">+ <div class="zf-row" style="top: 0; border: 0; color: #7a7f93">+ Customer<span>Plan</span><span>Amount</span>+ </div>+ <div class="zf-row" style="top: 20%">+ Northwind Outfitters<span>Team</span><span>$1,240</span>+ </div>+ <div class="zf-row" style="top: 40%">+ Lumen Dental<span>Starter</span><span>$320</span>+ </div>+ <div class="zf-row" style="top: 60%">+ Parkside Studio<span>Business</span><span>$2,880</span>+ </div>+ </div>+ <div class="zf-card zf-menu" id="zf-menu" style="left: 62%; top: 11%; width: 13%">+ <p>+ Last 7 days<svg class="zf-icon" style="opacity: 0" viewBox="0 0 16 16">+ <path d="M3.5 8.5l3 3 6-7" />+ </svg>+ </p>+ <p>+ Last 30 days<svg class="zf-icon" viewBox="0 0 16 16">+ <path d="M3.5 8.5l3 3 6-7" />+ </svg>+ </p>+ <p>+ Last 90 days<svg class="zf-icon" style="opacity: 0" viewBox="0 0 16 16">+ <path d="M3.5 8.5l3 3 6-7" />+ </svg>+ </p>+ </div>+ </div>+ <div class="zf-ripple" id="zf-ripple"></div>+ <svg class="zf-cursor" id="zf-cursor" viewBox="0 0 24 24" aria-hidden="true">+ <path d="M5 3 L5 19 L9 15 L12 22 L15 20.5 L11.5 14 L18 14 Z" />+ </svg>+ </div>+ </div>++ <script>+ (function () {+ "use strict";++ var html = document.documentElement;+ var root = document.getElementById("root");+ var cam = document.getElementById("zf-cam");+ var cursor = document.getElementById("zf-cursor");+ var ripple = document.getElementById("zf-ripple");+ var range = document.getElementById("zf-range");+ var tip = document.getElementById("zf-tip");+ var exportBtn = document.getElementById("zf-export");+ var exportStates = exportBtn.children;+ var rangeLabel = document.getElementById("zf-range-label");+ var menu = document.getElementById("zf-menu");+ var rows = menu.children;+ var line = document.getElementById("zf-line");++ var DEFAULTS = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(+ function (variable) {+ DEFAULTS[variable.id] = variable.default;+ },+ );+ } catch (error) {+ /* malformed declaration falls back to the inline defaults below */+ }+ var scopedVariables = {};+ try {+ if (window.__hyperframes && typeof window.__hyperframes.getVariables === "function") {+ scopedVariables = window.__hyperframes.getVariables() || {};+ }+ } catch (error) {+ /* no scoped variables API in this context */+ }+ var runtimeVars = Object.assign({}, window.__hfVariables || {}, scopedVariables);+ var vars = Object.assign({}, DEFAULTS, runtimeVars);++ function num(value, fallback, lo, hi) {+ var n = Number(value);+ if (!isFinite(n)) n = fallback;+ return Math.max(lo, Math.min(hi, n));+ }++ // Rebuilt from parsed digits, never the original string: a regex match+ // alone still carries the source text through, digit-by-digit reassembly+ // does not.+ function color(value, fallback) {+ var m = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.exec(String(value == null ? "" : value));+ if (!m) return fallback;+ var hex = m[1].length === 3 ? m[1].replace(/(.)/g, "$1$1") : m[1];+ var r = parseInt(hex.slice(0, 2), 16);+ var g = parseInt(hex.slice(2, 4), 16);+ var b = parseInt(hex.slice(4, 6), 16);+ return "rgb(" + r + "," + g + "," + b + ")";+ }++ // Hardcoded: the compositor rewrites the wrapper's attributes on mount.+ var compositionId = "cursor-zoom-follow";+ var duration = Math.max(+ 0.001,+ parseFloat(+ root.dataset.duration || html.getAttribute("data-composition-duration") || "5.8",+ ),+ );+ var W = root.clientWidth || 1920;+ var H = root.clientHeight || 1080;+ var ZOOM = num(vars.zoom, 1.8, 1, 3);+ var accent = color(vars.accent, "rgb(10,132,255)");+ var u = W / 1920;+ // Mirrors @hyperframes/parsers' isSafeMediaUrl allowlist: this+ // composition has no build step to import it from, so the same+ // scheme rule (relative or http/https/blob/data:image only) is+ // inlined rather than trusting the raw variable into img.src.+ function safeImageUrl(value) {+ var s = typeof value === "string" ? value.trim() : "";+ if (s === "") return "";+ var stripped = s.replace(/[\u0000-\u0020]/g, "");+ var scheme = /^([a-z][a-z0-9+.-]*):/i.exec(stripped);+ if (!scheme) return s;+ var proto = scheme[1].toLowerCase();+ if (proto === "https" || proto === "http" || proto === "blob") return s;+ if (proto === "data") return /^data:image\//i.test(s) ? s : "";+ return "";+ }+ // Runtime variables only: the declared default is empty (the built-in+ // dashboard), and page markup never becomes an image URL.+ var image = safeImageUrl(runtimeVars.image);+ var builtIn = image === "";+ if (!builtIn) {+ var img = document.getElementById("zf-img");+ img.src = image;+ img.style.display = "block";+ document.getElementById("zf-app").style.display = "none";+ }+ root.style.setProperty("--zf-accent", accent);+ ripple.style.borderWidth = 2 * u + "px";+ var ARROW = 64 * u;+ cursor.style.width = cursor.style.height = ARROW + "px";+ cursor.style.left = (-5 / 24) * ARROW + "px";+ cursor.style.top = (-3 / 24) * ARROW + "px";+ cursor.style.transformOrigin = (5 / 24) * ARROW + "px " + (3 / 24) * ARROW + "px";++ function pt(x, y) {+ return { x: (x / 100) * W, y: (y / 100) * H };+ }+ var CLICKS = [+ pt(num(vars.click1_x, 68.5, 0, 100), num(vars.click1_y, 7.5, 0, 100)),+ pt(num(vars.click2_x, 50, 0, 100), num(vars.click2_y, 48.5, 0, 100)),+ pt(num(vars.click3_x, 90.5, 0, 100), num(vars.click3_y, 7.5, 0, 100)),+ ];+ var START = pt(80, 88);+ var END = pt(104, 72);++ // Layout-space offsets inside the app, which ignore any transform a host puts on the player.+ function rowPoint(row) {+ return {+ x: menu.offsetLeft + row.offsetLeft + row.offsetWidth * 0.35,+ y: menu.offsetTop + row.offsetTop + row.offsetHeight * 0.5,+ };+ }++ var k = duration / 5.8;+ var T_C1 = 0.95 * k;+ var T_PICK = 1.45 * k;+ var T_C2 = 2.55 * k;+ var T_C3 = 3.65 * k;+ var EXIT_AT = 4.8 * k;+ var EXIT_END = 5.6 * k;+ function move(from, to, click, travel, dwell) {+ return {+ from: from,+ to: to,+ at: click - (travel + dwell) * k,+ end: click - dwell * k,+ click: click,+ };+ }+ // With a user image there is no menu, so the pick beat is skipped and the click ring carries it.+ var MOVES = [move(START, CLICKS[0], T_C1, 0.5, 0.2)];+ if (builtIn) MOVES.push(move(CLICKS[0], rowPoint(rows[2]), T_PICK, 0.25, 0.15));+ MOVES.push(move(MOVES[MOVES.length - 1].to, CLICKS[1], T_C2, 0.5, 0.2));+ MOVES.push(move(CLICKS[1], CLICKS[2], T_C3, 0.5, 0.2));++ function clamp01(u) {+ return u < 0 ? 0 : u > 1 ? 1 : u;+ }+ function mix(a, b, u) {+ return a + (b - a) * u;+ }+ var arriveEase = gsap.parseEase("power3.out");+ var easeInOut = gsap.parseEase("power2.inOut");+ var easeOut = gsap.parseEase("power2.out");+ var easeIn = gsap.parseEase("power2.in");+ var camEase = gsap.parseEase("power3.inOut");++ function arc(p0, p1, u, bend) {+ var cx = (p0.x + p1.x) / 2 - (p1.y - p0.y) * bend;+ var cy = (p0.y + p1.y) / 2 + (p1.x - p0.x) * bend;+ var w = 1 - u;+ return {+ x: w * w * p0.x + 2 * w * u * cx + u * u * p1.x,+ y: w * w * p0.y + 2 * w * u * cy + u * u * p1.y,+ };+ }++ function cursorAt(t) {+ var here = START;+ for (var i = 0; i < MOVES.length; i++) {+ var m = MOVES[i];+ if (t < m.at) return here;+ if (t <= m.end)+ return arc(m.from, m.to, arriveEase(clamp01((t - m.at) / (m.end - m.at))), 0.12);+ here = m.to;+ }+ if (t < EXIT_AT) return here;+ return arc(here, END, easeIn(clamp01((t - EXIT_AT) / (EXIT_END - EXIT_AT))), -0.1);+ }++ function zoomAt(t) {+ if (t < EXIT_AT) return mix(1, ZOOM, camEase(clamp01((t - 0.1 * k) / (0.85 * k))));+ return mix(ZOOM, 1, camEase(clamp01((t - EXIT_AT) / (1.0 * k))));+ }++ // The camera aims between the cursor and the click it is heading for, so the push leads.+ function aimAt(t) {+ var c = cursorAt(t);+ var next = null;+ for (var i = 0; i < MOVES.length; i++) {+ if (t <= MOVES[i].click) {+ next = MOVES[i].to;+ break;+ }+ }+ if (!next) return c;+ return { x: mix(c.x, next.x, 0.6), y: mix(c.y, next.y, 0.6) };+ }++ // A critically damped spring over the aim, integrated once at load and read back by time.+ var FPS = 60;+ var OMEGA = 6;+ var samples = [];+ var s = aimAt(0);+ var v = { x: 0, y: 0 };+ var SUB = 4;+ var dt = 1 / (FPS * SUB);+ var frames = Math.ceil(duration * FPS) + 1;+ for (var f = 0; f <= frames; f++) {+ samples.push({ x: s.x, y: s.y });+ for (var j = 0; j < SUB; j++) {+ var aim = aimAt((f * SUB + j) * dt);+ v.x += (OMEGA * OMEGA * (aim.x - s.x) - 2 * OMEGA * v.x) * dt;+ v.y += (OMEGA * OMEGA * (aim.y - s.y) - 2 * OMEGA * v.y) * dt;+ s.x += v.x * dt;+ s.y += v.y * dt;+ }+ }+ function cameraAt(t) {+ var p = Math.max(0, Math.min(frames, t * FPS));+ var i = Math.floor(p);+ var a = samples[i];+ var b = samples[Math.min(frames, i + 1)];+ return { x: mix(a.x, b.x, p - i), y: mix(a.y, b.y, p - i) };+ }++ function lastClickBefore(t) {+ var hit = null;+ MOVES.forEach(function (m) {+ if (t >= m.click) hit = { at: m.click, p: m.to };+ });+ return hit;+ }++ // 0..1: down over 80 ms, back up over 200 ms.+ function pressAt(since) {+ if (since < 0 || since >= 0.28) return 0;+ return since < 0.08 ? since / 0.08 : 1 - easeOut((since - 0.08) / 0.2);+ }+ // Elements at rest carry no transform: one left over from a transition drew different+ // pixels for the same t after a seek.+ function moving(u, css) {+ return u > 0 && u < 1 ? css : "";+ }+ function buttonPress(since) {+ var press = pressAt(since);+ return press ? "scale(" + (1 - 0.04 * press).toFixed(3) + ")" : "";+ }++ var LINE_30 = [40, 36, 38, 30, 31, 22, 25, 17, 19, 10, 12];+ var LINE_90 = [46, 44, 45, 40, 41, 35, 24, 19, 21, 15, 12];++ function render(t) {+ var z = zoomAt(t);+ var c = cameraAt(t);+ // Keep the zoomed window inside the screen so its edge never shows.+ var hw = W / (2 * z);+ var hh = H / (2 * z);+ var cx = Math.max(hw, Math.min(W - hw, c.x));+ var cy = Math.max(hh, Math.min(H - hh, c.y));+ cam.style.transform =+ "translate(" ++ (W / 2 - cx * z).toFixed(2) ++ "px," ++ (H / 2 - cy * z).toFixed(2) ++ "px) scale(" ++ z.toFixed(4) ++ ")";++ var p = cursorAt(t);+ var hit = lastClickBefore(t);+ var since = hit ? t - hit.at : 99;+ cursor.style.transform =+ "translate(" ++ p.x.toFixed(2) ++ "px," ++ p.y.toFixed(2) ++ "px) scale(" ++ (1 - 0.15 * pressAt(since)).toFixed(3) ++ ")";+ cursor.style.opacity = t >= duration ? "0" : "1";++ var ring = since / 0.35;+ ripple.style.opacity = ring < 1 ? (1 - ring).toFixed(3) : "0";+ if (ring < 1) {+ var r = (12 + 32 * easeOut(ring)) * u;+ ripple.style.width = ripple.style.height = (2 * r).toFixed(2) + "px";+ ripple.style.transform =+ "translate(" + (hit.p.x - r).toFixed(2) + "px," + (hit.p.y - r).toFixed(2) + "px)";+ }++ if (!builtIn) return;++ var picked = t >= T_PICK;+ var shown =+ easeOut(clamp01((t - T_C1) / 0.18)) * (1 - clamp01((t - T_PICK - 0.05) / 0.12));+ menu.style.opacity = shown.toFixed(3);+ menu.style.transform = moving(+ shown,+ "translateY(" ++ (-4 * u * (1 - shown)).toFixed(2) ++ "px) scale(" ++ (0.97 + 0.03 * shown).toFixed(4) ++ ")",+ );+ range.classList.toggle("open", shown > 0);+ range.style.transform = buttonPress(t - T_C1);+ rangeLabel.textContent = picked ? "Last 90 days" : "Last 30 days";+ for (var i = 0; i < rows.length; i++) {+ var row = rows[i];+ var x = p.x - menu.offsetLeft - row.offsetLeft;+ var y = p.y - menu.offsetTop - row.offsetTop;+ var over = x >= 0 && y >= 0 && x < row.offsetWidth && y < row.offsetHeight;+ row.classList.toggle("hover", shown > 0 && over);+ row.lastElementChild.style.opacity = i === (picked ? 2 : 1) ? "1" : "0";+ }++ var redraw = easeInOut(clamp01((t - T_PICK - 0.05) / 0.4));+ line.setAttribute(+ "d",+ LINE_30.map(function (y30, i) {+ return (i ? "L" : "M") + i * 10 + " " + mix(y30, LINE_90[i], redraw).toFixed(2);+ }).join(" "),+ );++ var tipOn = clamp01((t - T_C2) / 0.25);+ tip.style.opacity = tipOn.toFixed(3);+ tip.style.transform = moving(+ tipOn,+ "translateY(" + ((1 - tipOn) * 8).toFixed(2) + "px)",+ );++ // Export, then Exporting…, then a check held until the camera pulls out.+ var busy = clamp01((t - T_C3 - 0.05) / 0.15);+ var done = clamp01((t - T_C3 - 0.55 * k) / 0.15);+ var reset = clamp01((t - EXIT_AT) / 0.15);+ exportStates[0].style.opacity = Math.max(1 - busy, reset).toFixed(3);+ exportStates[1].style.opacity = (busy * (1 - done)).toFixed(3);+ exportStates[2].style.opacity = (done * (1 - reset)).toFixed(3);+ exportStates[2].firstElementChild.style.transform = moving(+ done,+ "scale(" + (0.5 + 0.5 * easeOut(done)).toFixed(3) + ")",+ );+ exportBtn.style.transform = buttonPress(t - T_C3);+ }++ var clock = { t: 0 };+ var tl = gsap.timeline({ paused: true });+ tl.to(+ clock,+ {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ render(clock.t);+ },+ },+ 0,+ );+ render(0);+ tl.seek(0);+ window.__timelines = window.__timelines || {};+ window.__timelines[compositionId] = tl;+ })();+ </script>+ </template>+ </body>+</html>diff --git a/registry/components/cursor-zoom-follow/demo.html b/registry/components/cursor-zoom-follow/demo.htmlnew file mode 100644index 0000000000..f3a21f0dd7--- /dev/null+++ b/registry/components/cursor-zoom-follow/demo.html@@ -0,0 +1,75 @@+<!doctype html>+<!--+ Zoom Follow Cursor, standalone demo: a screen recording framed on a flat dark ground. The mounted+ screen is the built-in dashboard; clicks land at 0.95s, 2.55s and 3.65s.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Zoom Follow Cursor, Demo</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ width: 100%;+ height: 100%;+ overflow: hidden;+ }+ #root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #111318;+ }+ .window {+ position: absolute;+ left: 160px;+ top: 90px;+ width: 1600px;+ height: 900px;+ border-radius: 22px;+ overflow: hidden;+ box-shadow:+ 0 0 0 1px #2a2d35,+ 0 24px 64px rgba(0, 0, 0, 0.5);+ }+ </style>+ </head>+ <body>+ <div+ id="root"+ data-composition-id="cursor-zoom-follow-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="5.8"+ >+ <div+ class="window clip"+ id="cursor-zoom-follow"+ data-composition-id="cursor-zoom-follow"+ data-composition-src="./cursor-zoom-follow.html"+ data-variable-values='{"zoom":1.8,"accent":"#0a84ff"}'+ data-start="0"+ data-duration="5.8"+ data-track-index="0"+ data-width="1600"+ data-height="900"+ ></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};+ var tl = gsap.timeline({ paused: true });+ window.__timelines["cursor-zoom-follow-demo"] = tl;+ </script>+ </body>+</html>diff --git a/registry/components/cursor-zoom-follow/registry-item.json b/registry/components/cursor-zoom-follow/registry-item.jsonnew file mode 100644index 0000000000..1327605406--- /dev/null+++ b/registry/components/cursor-zoom-follow/registry-item.json@@ -0,0 +1,128 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "cursor-zoom-follow",+ "type": "hyperframes:component",+ "title": "Zoom Follow Cursor",+ "description": "Screen-recording auto-zoom: the camera pushes in toward each upcoming click, trails the cursor on a smooth spring, marks every click with a press and a ring, then eases back out to the full screen as the cursor leaves.",+ "tags": ["cursor", "camera", "zoom", "screen-recording", "click", "product-demo"],+ "files": [+ {+ "path": "cursor-zoom-follow.html",+ "target": "compositions/components/cursor-zoom-follow.html",+ "type": "hyperframes:snippet"+ }+ ],+ "jobs": ["demonstrate"],+ "family": "pointers",+ "profile": "camera",+ "syncPoints": [+ {+ "id": "click-1",+ "phase": "hold",+ "offset": 0.95+ },+ {+ "id": "click-2",+ "phase": "hold",+ "offset": 2.55+ },+ {+ "id": "click-3",+ "phase": "hold",+ "offset": 3.65+ }+ ],+ "variables": [+ {+ "id": "image",+ "type": "image",+ "role": "content",+ "label": "Screenshot",+ "description": "Your own screen capture. Leave empty for the built-in dashboard.",+ "default": ""+ },+ {+ "id": "zoom",+ "type": "number",+ "role": "style",+ "label": "Zoom",+ "default": 1.8,+ "min": 1.2,+ "max": 2.6,+ "step": 0.1+ },+ {+ "id": "click1_x",+ "type": "number",+ "role": "layout",+ "label": "Click 1 X",+ "default": 68.5,+ "min": 0,+ "max": 100,+ "step": 0.5,+ "unit": "%"+ },+ {+ "id": "click1_y",+ "type": "number",+ "role": "layout",+ "label": "Click 1 Y",+ "default": 7.5,+ "min": 0,+ "max": 100,+ "step": 0.5,+ "unit": "%"+ },+ {+ "id": "click2_x",+ "type": "number",+ "role": "layout",+ "label": "Click 2 X",+ "default": 50,+ "min": 0,+ "max": 100,+ "step": 0.5,+ "unit": "%"+ },+ {+ "id": "click2_y",+ "type": "number",+ "role": "layout",+ "label": "Click 2 Y",+ "default": 48.5,+ "min": 0,+ "max": 100,+ "step": 0.5,+ "unit": "%"+ },+ {+ "id": "click3_x",+ "type": "number",+ "role": "layout",+ "label": "Click 3 X",+ "default": 90.5,+ "min": 0,+ "max": 100,+ "step": 0.5,+ "unit": "%"+ },+ {+ "id": "click3_y",+ "type": "number",+ "role": "layout",+ "label": "Click 3 Y",+ "default": 7.5,+ "min": 0,+ "max": 100,+ "step": 0.5,+ "unit": "%"+ },+ {+ "id": "accent",+ "type": "color",+ "role": "style",+ "label": "Ripple",+ "default": "#0a84ff"+ }+ ]+}diff --git a/registry/components/curtain-reveal/curtain-reveal.html b/registry/components/curtain-reveal/curtain-reveal.htmlnew file mode 100644index 0000000000..e1c364479f--- /dev/null+++ b/registry/components/curtain-reveal/curtain-reveal.html@@ -0,0 +1,377 @@+<!doctype html>+<!--+ curtain-reveal: HyperFrames video primitive (transitions / stage reveal).++ Two velvet stage curtains meet at center, covering the frame. On cue they+ gather outward: each fold narrows, hardest at the outer edge, and the hem+ sweeps up slightly as the fabric bunches at the sides, revealing the stage+ underneath. An optional pelmet frames the top edge and never moves; an+ optional warm spotlight comes up as the curtains part.++ The stage is a SLOT. Callers supply it by placing an inert template+ anywhere in the HOST page (templates never render, and the runtime wipes+ the host clip's own children on mount, so the slot lives at document level):++ <template data-slot="curtain-reveal-stage"> ... </template>++ Slot content may be an <img>, a muted <video>, or arbitrary HTML; direct+ img/video children are stretched to cover the stage (packages/producer+ drives a slotted <video>'s own data-start/data-duration exactly like any+ other clip -- this primitive never reads or sets currentTime itself). With+ no slot, the stage renders a token spotlight card so the reveal reads on+ its own.++ Variables (declared in data-composition-variables below):+ - tone ("red" | "burgundy" | "navy" | "forest", default "burgundy"): curtain+ color.+ - pelmet ("on" | "off", default "on"): static valance framing the top.+ - spotlight ("on" | "off", default "on"): soft glow blooming over the+ stage as the curtains part.++ Envelope, fixed IN with elastic HOLD only (never timeScale):+ IN_BASE = 1.1s the curtains gather and part+ HOLD = max(0, D - IN); the stage stands revealed, still+ If D < IN_BASE, IN compresses to D (no hold).++ Determinism: no randomness anywhere in this primitive. Fold widths are a+ fixed table, the pelmet trim is a closed-form sine wave sampled at a fixed+ point count, and every fold's pose is a closed-form function of one tweened+ draw progress. Any seek order lands identical frames.++ Mount contract: the runtime clones only this template. #root fills the+ host box (no data-width/data-height, container-type: size, cqmin units),+ is styled via #root only, and registers one paused timeline under the+ LITERAL "curtain-reveal" key.+-->+<html+ lang="en"+ data-composition-id="curtain-reveal"+ data-composition-duration="2.4"+ data-composition-variables='[+ { "id": "tone", "type": "enum", "role": "style", "label": "Curtain tone", "description": "Curtain color.", "default": "burgundy", "options": [{ "value": "red", "label": "Red" }, { "value": "burgundy", "label": "Burgundy" }, { "value": "navy", "label": "Navy" }, { "value": "forest", "label": "Forest" }] },+ { "id": "pelmet", "type": "enum", "role": "style", "label": "Pelmet", "description": "Static valance framing the top of the stage.", "default": "on", "options": [{ "value": "on", "label": "On" }, { "value": "off", "label": "Off" }] },+ { "id": "spotlight", "type": "enum", "role": "style", "label": "Spotlight", "description": "Soft glow blooming over the stage as the curtains part.", "default": "on", "options": [{ "value": "on", "label": "On" }, { "value": "off", "label": "Off" }] }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Curtain Reveal</title>+ </head>+ <body>+ <template>+ <div id="root" data-composition-id="curtain-reveal" data-duration="2.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, #1d1b16);+ font-family: var(--font-display, "Inter", system-ui, sans-serif);+ background: #060607;+ }++ .cvr-clip {+ position: absolute;+ inset: 0;+ overflow: hidden;+ }++ .cvr-stage {+ position: absolute;+ inset: 0;+ overflow: hidden;+ }++ .cvr-stage > img,+ .cvr-stage > video {+ display: block;+ width: 100%;+ height: 100%;+ object-fit: cover;+ }++ .cvr-stage-default {+ position: absolute;+ inset: 0;+ display: grid;+ place-items: center;+ background: radial-gradient(60% 60% at 50% 42%, #2a2a2e 0%, #0c0c0d 78%);+ }++ .cvr-stage-default-mark {+ font-size: 4.5cqmin;+ font-weight: 700;+ letter-spacing: 0.32em;+ text-transform: uppercase;+ color: #fff;+ opacity: 0.4;+ }++ .cvr-spotlight {+ position: absolute;+ inset: 0;+ background: radial-gradient(+ 34% 52% at 50% 44%,+ rgba(255, 196, 128, 0.42) 0%,+ rgba(255, 196, 128, 0) 72%+ );+ mix-blend-mode: screen;+ opacity: 0;+ pointer-events: none;+ }++ .cvr-curtain {+ position: absolute;+ inset: 0;+ }++ .cvr-fold {+ position: absolute;+ top: 0;+ left: 0;+ height: 100%;+ transform-origin: 0 0;+ border-radius: 0 0 50% 50% / 0 0 1.6cqh 1.6cqh;+ background:+ linear-gradient(+ 180deg,+ rgba(0, 0, 0, 0.45) 0%,+ rgba(0, 0, 0, 0) 16%,+ rgba(0, 0, 0, 0) 82%,+ rgba(0, 0, 0, 0.5) 100%+ ),+ linear-gradient(+ 90deg,+ var(--cvr-fold-dark) 0%,+ var(--cvr-fold-mid) 20%,+ var(--cvr-fold-light) calc(var(--crest) - 14%),+ var(--cvr-fold-sheen) var(--crest),+ var(--cvr-fold-light) calc(var(--crest) + 10%),+ var(--cvr-fold-mid) 80%,+ var(--cvr-fold-dark) 100%+ );+ }+ .cvr-fold::after {+ content: "";+ position: absolute;+ inset: 0;+ border-radius: inherit;+ background: #000;+ opacity: var(--shade, 0);+ }+ .cvr-fold:last-child {+ box-shadow: 1.2cqw 0 2.4cqw rgba(0, 0, 0, 0.55);+ }+ /* The right curtain lays out from the right edge. */+ .cvr-curtain-right .cvr-fold {+ left: auto;+ right: 0;+ transform-origin: 100% 0;+ }+ .cvr-curtain-right .cvr-fold:last-child {+ box-shadow: -1.2cqw 0 2.4cqw rgba(0, 0, 0, 0.55);+ }++ .cvr-pelmet {+ position: absolute;+ top: 0;+ left: 0;+ right: 0;+ height: 11%;+ background: var(--cvr-pelmet-color, #4a0e1f);+ box-shadow: 0 0.6cqmin 1.4cqmin rgba(0, 0, 0, 0.55);+ clip-path: var(--cvr-pelmet-hem);+ }+ </style>++ <div+ id="curtain-reveal-clip"+ class="cvr-clip clip"+ data-start="0"+ data-duration="2.4"+ data-track-index="0"+ >+ <div class="cvr-stage" id="cvr-stage">+ <div class="cvr-stage-default">+ <span class="cvr-stage-default-mark" aria-hidden="true">Stage</span>+ </div>+ </div>+ <div class="cvr-spotlight" id="cvr-spotlight"></div>++ <div class="cvr-curtain" id="cvr-curtain-left"></div>+ <div class="cvr-curtain cvr-curtain-right" id="cvr-curtain-right"></div>++ <div class="cvr-pelmet" id="cvr-pelmet"></div>+ </div>++ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <script>+ (function () {+ "use strict";++ var root = document.getElementById("root");+ var stage = document.getElementById("cvr-stage");+ var spotlight = document.getElementById("cvr-spotlight");+ var curtainLeft = document.getElementById("cvr-curtain-left");+ var curtainRight = document.getElementById("cvr-curtain-right");+ var pelmet = document.getElementById("cvr-pelmet");++ var vars =+ window.__hyperframes && window.__hyperframes.getVariables+ ? window.__hyperframes.getVariables()+ : {};++ // fold: [dark, mid, light, sheen]+ var toneTable = {+ red: { fold: ["#3d0810", "#8a1a26", "#b23345", "#cc5c6e"], pelmet: "#4a0e1a" },+ burgundy: { fold: ["#2b0912", "#5c1a2c", "#7d2c42", "#a04c62"], pelmet: "#3a0f1e" },+ navy: { fold: ["#070d1f", "#152a5c", "#274a8f", "#4f72b4"], pelmet: "#0c1836" },+ forest: { fold: ["#0c1f13", "#1f4a2b", "#356b3f", "#5c9166"], pelmet: "#12291a" },+ };+ var tone = Object.prototype.hasOwnProperty.call(toneTable, vars.tone)+ ? vars.tone+ : "burgundy";+ var palette = toneTable[tone];+ root.style.setProperty("--cvr-fold-dark", palette.fold[0]);+ root.style.setProperty("--cvr-fold-mid", palette.fold[1]);+ root.style.setProperty("--cvr-fold-light", palette.fold[2]);+ root.style.setProperty("--cvr-fold-sheen", palette.fold[3]);+ root.style.setProperty("--cvr-pelmet-color", palette.pelmet);++ var pelmetOn = vars.pelmet !== "off";+ var spotlightOn = vars.spotlight !== "off";+ pelmet.style.display = pelmetOn ? "" : "none";++ // Slot. Caller templates live at the host document level (the+ // mount wipes host-clip children, and templates never render).+ var hostDoc = root.ownerDocument;+ var slotTemplate = null;+ try {+ slotTemplate = hostDoc.querySelector('template[data-slot="curtain-reveal-stage"]');+ } catch (error) {+ slotTemplate = null;+ }+ if (slotTemplate) {+ var defaultMark = stage.querySelector(".cvr-stage-default");+ if (defaultMark) defaultMark.remove();+ stage.appendChild(hostDoc.importNode(slotTemplate.content, true));+ }++ // Closed-form scalloped hem: a fixed point count sampled from a+ // sine wave, never randomised, so the trim is identical on every+ // render of every instance.+ function hemPolygon(scallops, ampPct, baseY) {+ var STEPS = 24;+ var pts = ["0% 0%", "100% 0%"];+ for (var i = 0; i <= STEPS; i += 1) {+ var t = i / STEPS;+ var y = baseY + Math.sin(t * Math.PI * scallops) * ampPct;+ pts.push((100 - t * 100).toFixed(2) + "% " + y.toFixed(2) + "%");+ }+ return "polygon(" + pts.join(", ") + ")";+ }++ root.style.setProperty("--cvr-pelmet-hem", hemPolygon(5, 14, 78));++ // Fold widths in px at 1920 wide, outer edge first. Both sum to+ // 1075 px: from 5cqw off frame to just past center.+ var PX = 100 / 1920;+ function buildCurtain(el, dir, widths) {+ var total = 0;+ var folds = widths.map(function (w, i) {+ var fold = document.createElement("div");+ fold.className = "cvr-fold";+ // Slight overlap hides seams between neighbouring folds.+ fold.style.width = w * PX + 0.2 + "cqw";+ fold.style.setProperty("--crest", 44 + ((i * 5) % 13) + "%");+ el.appendChild(fold);+ total += w;+ return { el: fold, w: w * PX, u: i / (widths.length - 1) };+ });+ return { folds: folds, dir: dir, anchor: 51 - total * PX };+ }+ var curtains = [+ buildCurtain(curtainLeft, 1, [88, 124, 70, 106, 136, 80, 112, 62, 98, 130, 69]),+ buildCurtain(curtainRight, -1, [104, 66, 128, 84, 120, 62, 100, 134, 76, 112, 89]),+ ];++ // p = eased draw progress. Folds nearer the outer edge compress+ // harder, and the hem sweeps up toward the lead edge.+ function poseCurtains(p) {+ curtains.forEach(function (c) {+ var x = c.anchor;+ c.folds.forEach(function (f) {+ var sx = 1 - p * (0.86 - 0.16 * f.u);+ var sy = 1 - p * 0.07 * f.u * f.u;+ f.el.style.transform =+ "translateX(" ++ (c.dir * x).toFixed(3) ++ "cqw) scale(" ++ sx.toFixed(4) ++ ", " ++ sy.toFixed(4) ++ ")";+ f.el.style.setProperty("--shade", (0.34 * (1 - sx)).toFixed(3));+ x += f.w * sx;+ });+ });+ }++ // Envelope: fixed IN, elastic HOLD, never time-scaled.+ var IN_BASE = 1.1;+ var duration = Math.max(0.001, parseFloat(root.dataset.duration || "2.4"));+ var IN = Math.min(IN_BASE, duration);++ gsap.set(spotlight, { opacity: 0 });++ // Seek-safe driver: GSAP assigns `p` on every render, seek()+ // included, so the setter re-poses the folds; onUpdate is+ // suppressed on seek.+ var drawn = 0;+ var draw = {};+ Object.defineProperty(draw, "p", {+ get: function () {+ return drawn;+ },+ set: function (next) {+ drawn = next;+ poseCurtains(next);+ },+ });+ poseCurtains(0);++ var tl = gsap.timeline({ paused: true });+ tl.fromTo(draw, { p: 0 }, { p: 1, duration: IN, ease: "power2.inOut" }, 0);+ if (spotlightOn) {+ // Clamped to end by IN: uncapped, start (IN * 0.25) + duration+ // (IN * 0.85) lands at IN * 1.10 -- fine while the hold covers+ // it, but a short composition that compresses the hold away+ // would push GSAP's auto-extended timeline past data-duration.+ var spotlightStart = IN * 0.25;+ var spotlightDuration = Math.min(IN * 0.85, IN - spotlightStart);+ tl.fromTo(+ spotlight,+ { opacity: 0 },+ { opacity: 0.9, duration: spotlightDuration, ease: "power1.out" },+ spotlightStart,+ );+ }+ tl.set({}, {}, duration);+ tl.seek(0);++ window.__timelines = window.__timelines || {};+ window.__timelines["curtain-reveal"] = tl;+ })();+ </script>+ </div>+ </template>+ </body>+</html>diff --git a/registry/components/curtain-reveal/demo.html b/registry/components/curtain-reveal/demo.htmlnew file mode 100644index 0000000000..55788ab77b--- /dev/null+++ b/registry/components/curtain-reveal/demo.html@@ -0,0 +1,106 @@+<!doctype html>+<!--+ curtain-reveal demo. This standalone composition mounts the primitive+ FULL-BLEED through data-composition-src, burgundy with the pelmet off to+ prove the non-default variable path, and slots a title card so the+ curtains part onto a real announcement rather than the bare token card+ the primitive falls back to.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Curtain Reveal Demo</title>+ <style>+ * {+ margin: 0;+ padding: 0;+ box-sizing: border-box;+ }+ html,+ body {+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #060607;+ }+ #root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #060607;+ }+ .mount-bleed {+ position: absolute;+ inset: 0;+ container-type: size;+ overflow: hidden;+ }+ .demo-card {+ position: absolute;+ inset: 0;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 36px;+ padding-bottom: 80px;+ background: #111318;+ font-family: Inter, system-ui, sans-serif;+ color: #f7f1e8;+ }+ .demo-eyebrow {+ font-size: 30px;+ font-weight: 500;+ letter-spacing: 0.2em;+ text-transform: uppercase;+ color: rgba(247, 232, 212, 0.7);+ }+ .demo-title {+ font-size: 232px;+ font-weight: 600;+ line-height: 0.9;+ letter-spacing: -0.04em;+ font-kerning: normal;+ }+ </style>+ </head>+ <body>+ <template data-slot="curtain-reveal-stage">+ <div class="demo-card">+ <p class="demo-eyebrow">Now announcing</p>+ <h1 class="demo-title">Aurora 2</h1>+ </div>+ </template>++ <div+ id="root"+ data-composition-id="curtain-reveal-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="2.4"+ data-fps="30"+ >+ <div+ id="curtain-reveal-mount"+ class="mount-bleed clip"+ data-composition-id="curtain-reveal"+ data-composition-src="./curtain-reveal.html"+ data-variable-values='{"tone":"burgundy","pelmet":"off","spotlight":"on"}'+ data-start="0"+ data-duration="2.4"+ data-track-index="0"+ data-width="1920"+ data-height="1080"+ ></div>+ </div>++ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <script>+ window.__timelines = window.__timelines || {};+ window.__timelines["curtain-reveal-demo"] = gsap.timeline({ paused: true });+ </script>+ </body>+</html>diff --git a/registry/components/curtain-reveal/registry-item.json b/registry/components/curtain-reveal/registry-item.jsonnew file mode 100644index 0000000000..83e9bb8d14--- /dev/null+++ b/registry/components/curtain-reveal/registry-item.json@@ -0,0 +1,55 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "curtain-reveal",+ "type": "hyperframes:component",+ "title": "Curtain Reveal",+ "description": "Two pleated stage curtains gather outward from center, the way real velvet bunches at the tieback, revealing the stage underneath. A static pelmet frames the top; a soft spotlight can bloom in as they part.",+ "tags": ["curtain", "stage reveal", "transition", "motion-primitive"],+ "files": [+ {+ "path": "curtain-reveal.html",+ "target": "compositions/components/curtain-reveal.html",+ "type": "hyperframes:snippet"+ }+ ],+ "variables": [+ {+ "id": "tone",+ "type": "enum",+ "role": "style",+ "label": "Curtain tone",+ "description": "Curtain color.",+ "default": "burgundy",+ "options": [+ { "value": "red", "label": "Red" },+ { "value": "burgundy", "label": "Burgundy" },+ { "value": "navy", "label": "Navy" },+ { "value": "forest", "label": "Forest" }+ ]+ },+ {+ "id": "pelmet",+ "type": "enum",+ "role": "style",+ "label": "Pelmet",+ "description": "Static valance framing the top of the stage.",+ "default": "on",+ "options": [+ { "value": "on", "label": "On" },+ { "value": "off", "label": "Off" }+ ]+ },+ {+ "id": "spotlight",+ "type": "enum",+ "role": "style",+ "label": "Spotlight",+ "description": "Soft glow blooming over the stage as the curtains part.",+ "default": "on",+ "options": [+ { "value": "on", "label": "On" },+ { "value": "off", "label": "Off" }+ ]+ }+ ]+}diff --git a/registry/components/dart-cursor/dart-cursor.html b/registry/components/dart-cursor/dart-cursor.htmlnew file mode 100644index 0000000000..979655bbb9--- /dev/null+++ b/registry/components/dart-cursor/dart-cursor.html@@ -0,0 +1,357 @@+<!doctype html>+<!--+ Dart Cursor (actor primitive), mountable sub-composition++ concept: a bold outlined arrowhead that dives in from camera depth, flies nose-first+ like a dart (it turns to face where it travels and relaxes upright when it parks),+ smears with motion blur along its path, squashes on each click, and whips out.++ mount contract: loaded by a host through data-composition-src; only <template> is+ cloned. #root fills the host clip (inset:0). See demo.html.++ variables:+ tone (dark|light) dark body with a white outline, or the reverse+ target_x, target_y (% of host box) where the tip lands for the first click+ target2_x, target2_y (%) where it lands for the second click+ enter_from, exit_to (left|right|top|bottom) the edge it arrives from and leaves by+ blur (0 to 1.5) motion-blur strength, 0 turns it off++ envelope (default 3.6s): entry 0-0.6s, click 0.7s, move 1.0-1.55s, click 1.7s,+ hold, exit in the last 0.55s. Shorter durations compress every beat evenly.+-->+<html+ lang="en"+ data-composition-id="dart-cursor"+ data-composition-duration="3.6"+ data-composition-variables='[+ { "id": "tone", "type": "enum", "role": "style", "label": "Tone", "default": "dark", "options": [ { "value": "dark", "label": "Dark body, white outline" }, { "value": "light", "label": "Light body, dark outline" } ] },+ { "id": "target_x", "type": "number", "role": "layout", "label": "First click X", "default": 34, "min": 5, "max": 95, "step": 1, "unit": "%" },+ { "id": "target_y", "type": "number", "role": "layout", "label": "First click Y", "default": 58, "min": 5, "max": 95, "step": 1, "unit": "%" },+ { "id": "target2_x", "type": "number", "role": "layout", "label": "Second click X", "default": 64, "min": 5, "max": 95, "step": 1, "unit": "%" },+ { "id": "target2_y", "type": "number", "role": "layout", "label": "Second click Y", "default": 46, "min": 5, "max": 95, "step": 1, "unit": "%" },+ { "id": "enter_from", "type": "enum", "role": "timing", "label": "Enter from", "default": "right", "options": [ { "value": "right", "label": "Right" }, { "value": "left", "label": "Left" }, { "value": "top", "label": "Top" }, { "value": "bottom", "label": "Bottom" } ] },+ { "id": "exit_to", "type": "enum", "role": "timing", "label": "Exit to", "default": "right", "options": [ { "value": "right", "label": "Right" }, { "value": "left", "label": "Left" }, { "value": "top", "label": "Top" }, { "value": "bottom", "label": "Bottom" } ] },+ { "id": "blur", "type": "number", "role": "style", "label": "Motion blur", "default": 1, "min": 0, "max": 1.5, "step": 0.1 }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Dart Cursor</title>+ </head>+ <body>+ <template>+ <style>+ #root {+ position: absolute;+ inset: 0;+ overflow: hidden;+ isolation: isolate;+ pointer-events: none;+ }++ .dc-cursor {+ position: absolute;+ left: 0;+ top: 0;+ width: 0;+ height: 0;+ will-change: transform, filter;+ }++ /* The tip sits at the svg origin, so the wrapper's translate places the tip. */+ .dc-svg {+ position: absolute;+ left: -120px;+ top: -120px;+ width: 240px;+ height: 240px;+ overflow: visible;+ }++ .dc-outline {+ stroke-width: 22;+ stroke-linejoin: round;+ }+ .dc-body {+ stroke-width: 3;+ stroke-linejoin: round;+ }+ .dc-cursor[data-tone="dark"] .dc-outline {+ fill: #ffffff;+ stroke: #ffffff;+ }+ .dc-cursor[data-tone="dark"] .dc-body {+ fill: #0b0b0c;+ stroke: #0b0b0c;+ }+ .dc-cursor[data-tone="light"] .dc-outline {+ fill: #111113;+ stroke: #111113;+ }+ .dc-cursor[data-tone="light"] .dc-body {+ fill: #ffffff;+ stroke: #ffffff;+ }+ </style>++ <div id="root" data-composition-id="dart-cursor" data-duration="3.6">+ <div class="dc-cursor" id="dc-cursor" data-tone="dark" aria-hidden="true">+ <svg class="dc-svg" viewBox="-120 -120 240 240" aria-hidden="true">+ <defs>+ <filter+ id="dc-smear"+ x="-100%"+ y="-100%"+ width="300%"+ height="300%"+ color-interpolation-filters="sRGB"+ >+ <feGaussianBlur id="dc-smear-fe" stdDeviation="0 0" />+ </filter>+ </defs>+ <g id="dc-spin">+ <g id="dc-heading" filter="url(#dc-smear)">+ <g id="dc-unheading">+ <g id="dc-shape">+ <polygon+ class="dc-outline"+ points="-5,1 -14,82 -11,83 6,64 20,58 34,57 53,62 49,52 0,0"+ />+ <polygon+ class="dc-body"+ points="-5,1 -14,82 -11,83 6,64 20,58 34,57 53,62 49,52 0,0"+ />+ </g>+ </g>+ </g>+ </g>+ </svg>+ </div>+ </div>++ <script>+ (function () {+ "use strict";++ var html = document.documentElement;+ var root = document.getElementById("root");+ var cursor = document.getElementById("dc-cursor");+ var svg = cursor.querySelector(".dc-svg");+ var spin = document.getElementById("dc-spin");+ var heading = document.getElementById("dc-heading");+ var unheading = document.getElementById("dc-unheading");+ var shape = document.getElementById("dc-shape");+ var smear = document.getElementById("dc-smear-fe");++ var DEFAULTS = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(+ function (variable) {+ DEFAULTS[variable.id] = variable.default;+ },+ );+ } catch (error) {+ /* malformed declaration falls back to the inline defaults below */+ }+ var scopedVariables = {};+ try {+ if (window.__hyperframes && typeof window.__hyperframes.getVariables === "function") {+ scopedVariables = window.__hyperframes.getVariables() || {};+ }+ } catch (error) {+ /* no scoped variables API in this context */+ }+ var vars = Object.assign({}, DEFAULTS, window.__hfVariables || {}, scopedVariables);++ function num(value, fallback, lo, hi) {+ var n = Number(value);+ if (!isFinite(n)) n = fallback;+ return Math.max(lo, Math.min(hi, n));+ }+ function side(value, fallback) {+ return ["left", "right", "top", "bottom"].indexOf(value) >= 0 ? value : fallback;+ }++ // Hardcoded: the compositor rewrites the wrapper's attributes on mount.+ var compositionId = "dart-cursor";+ var duration = Math.max(+ 0.001,+ parseFloat(+ root.dataset.duration || html.getAttribute("data-composition-duration") || "3.6",+ ),+ );+ var tone = vars.tone === "light" ? "light" : "dark";+ var blurAmount = num(vars.blur, 1, 0, 1.5);+ var W = root.clientWidth || 1920;+ var H = root.clientHeight || 1080;+ var unit = W / 1920;+ // The glyph is 105 units tall with its outline: 80 px at 1920 wide.+ var PX_PER_SVG_UNIT = (80 / 105) * unit;++ function stagePoint(xPercent, yPercent) {+ return { x: (xPercent / 100) * W, y: (yPercent / 100) * H };+ }+ var A = stagePoint(num(vars.target_x, 34, 0, 100), num(vars.target_y, 58, 0, 100));+ var B = stagePoint(num(vars.target2_x, 64, 0, 100), num(vars.target2_y, 46, 0, 100));+ function offStage(edge, near) {+ if (edge === "left") return { x: -0.14 * W, y: near.y - 0.18 * H };+ if (edge === "top") return { x: near.x + 0.16 * W, y: -0.2 * H };+ if (edge === "bottom") return { x: near.x - 0.12 * W, y: 1.22 * H };+ return { x: 1.14 * W, y: near.y - 0.22 * H };+ }+ var START = offStage(side(vars.enter_from, "right"), A);+ var END = offStage(side(vars.exit_to, "right"), B);++ // Beats at the default 3.6s; a shorter composition compresses them evenly.+ var FIXED_TAIL = 0.55 + 0.35;+ var squeeze = Math.min(1, duration / (1.7 + FIXED_TAIL));+ var T_LAND1 = 0.6 * squeeze;+ var T_CLICK1 = 0.7 * squeeze;+ var T_MOVE = 1.0 * squeeze;+ var T_LAND2 = 1.55 * squeeze;+ var T_CLICK2 = 1.7 * squeeze;+ var T_EXIT = Math.max(T_CLICK2 + 0.3 * squeeze, duration - 0.55 * squeeze);++ function clamp01(u) {+ return u < 0 ? 0 : u > 1 ? 1 : u;+ }+ function smooth(u) {+ u = clamp01(u);+ return u * u * (3 - 2 * u);+ }+ var easeOut = gsap.parseEase("power3.out");+ var easeInOut = gsap.parseEase("power2.inOut");+ var easeIn = gsap.parseEase("power3.in");++ // A quadratic arc bent to one side of the chord.+ function arc(p0, p1, bend, u) {+ var cx = (p0.x + p1.x) / 2 - (p1.y - p0.y) * bend;+ var cy = (p0.y + p1.y) / 2 + (p1.x - p0.x) * bend;+ var v = 1 - u;+ return {+ x: v * v * p0.x + 2 * v * u * cx + u * u * p1.x,+ y: v * v * p0.y + 2 * v * u * cy + u * u * p1.y,+ };+ }++ function positionAt(t) {+ if (t <= T_LAND1) return arc(START, A, 0.22, easeOut(clamp01(t / T_LAND1)));+ if (t <= T_MOVE) return A;+ if (t <= T_LAND2) {+ return arc(A, B, -0.18, easeInOut(clamp01((t - T_MOVE) / (T_LAND2 - T_MOVE))));+ }+ if (t <= T_EXIT) return B;+ return arc(B, END, 0.12, easeIn(clamp01((t - T_EXIT) / (duration - T_EXIT))));+ }++ function keyed(keys, u) {+ if (u <= keys[0][0]) return keys[0][1];+ for (var i = 1; i < keys.length; i++) {+ if (u <= keys[i][0]) {+ var a = keys[i - 1];+ var b = keys[i];+ return a[1] + (b[1] - a[1]) * smooth((u - a[0]) / (b[0] - a[0]));+ }+ }+ return keys[keys.length - 1][1];+ }+ var DIVE = [+ [0, 1.3],+ [0.4, 1.8],+ [0.78, 1.06],+ [1, 1],+ ];+ function press(t, at) {+ var down = 0.08 * squeeze;+ var up = 0.2 * squeeze;+ if (t < at) return 0;+ if (t < at + down) return 0.2 * gsap.parseEase("power2.in")((t - at) / down);+ return 0.2 - 0.1 * gsap.parseEase("power2.out")(clamp01((t - at - down) / up));+ }++ // Depth is scale: above 1 is lifted toward camera, below 1 is pressed into the screen.+ function depthAt(t) {+ if (t <= T_LAND1) return keyed(DIVE, t / T_LAND1);+ if (t <= T_MOVE) return 1 - press(t, T_CLICK1);+ if (t <= T_LAND2) {+ var u = (t - T_MOVE) / (T_LAND2 - T_MOVE);+ return 0.9 + 0.1 * smooth(u / 0.3) + 0.07 * Math.sin(Math.PI * u);+ }+ return 1 - press(t, T_CLICK2);+ }++ // Local-frame nose angle of the arrowhead (tip minus the shape's centroid).+ var NOSE_DEG = -106;+ var H_STEP = 1 / 120;+ function wrap(deg) {+ return ((((deg + 180) % 360) + 360) % 360) - 180;+ }++ function render(t) {+ var p = positionAt(t);+ var before = positionAt(Math.max(0, t - H_STEP));+ var after = positionAt(Math.min(duration, t + H_STEP));+ var vx = (after.x - before.x) / (2 * H_STEP);+ var vy = (after.y - before.y) / (2 * H_STEP);+ var speed = Math.hypot(vx, vy) / unit;+ var travelDeg = (Math.atan2(vy, vx) * 180) / Math.PI;+ var steer = smooth((speed - 150) / 950);+ var rotation = steer * wrap(travelDeg - NOSE_DEG);+ var depth = depthAt(t);+ var exiting = t > T_EXIT;+ var perFrame = speed / 60;+ var smearUnits =+ blurAmount * Math.min(exiting ? 36 : 12, (exiting ? 0.28 : 0.16) * perFrame);+ var lift = Math.max(0, depth - 0.9);++ cursor.style.transform = "translate(" + p.x.toFixed(2) + "px," + p.y.toFixed(2) + "px)";+ svg.style.filter =+ "drop-shadow(0 " ++ (3 + 22 * lift).toFixed(1) ++ "px " ++ (4 + 26 * lift).toFixed(1) ++ "px rgba(0,0,0," ++ (0.34 - 0.12 * Math.min(1, lift)).toFixed(3) ++ "))";+ spin.setAttribute(+ "transform",+ "rotate(" ++ rotation.toFixed(2) ++ ") scale(" ++ (depth * PX_PER_SVG_UNIT).toFixed(4) ++ ")",+ );+ // The blur's x axis is turned onto the travel direction, then the shape turned back.+ var local = wrap(travelDeg - rotation);+ heading.setAttribute("transform", "rotate(" + local.toFixed(2) + ")");+ unheading.setAttribute("transform", "rotate(" + (-local).toFixed(2) + ")");+ smear.setAttribute("stdDeviation", smearUnits.toFixed(3) + " 0");+ cursor.style.opacity = t >= duration ? "0" : "1";+ }++ cursor.setAttribute("data-tone", tone);+ shape.setAttribute("transform", "scale(1.09 1)");++ var clock = { t: 0 };+ var tl = gsap.timeline({ paused: true });+ tl.to(+ clock,+ {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ render(clock.t);+ },+ },+ 0,+ );+ render(0);+ tl.seek(0);+ window.__timelines = window.__timelines || {};+ window.__timelines[compositionId] = tl;+ })();+ </script>+ </template>+ </body>+</html>diff --git a/registry/components/dart-cursor/demo.html b/registry/components/dart-cursor/demo.htmlnew file mode 100644index 0000000000..a5060a4011--- /dev/null+++ b/registry/components/dart-cursor/demo.html@@ -0,0 +1,326 @@+<!doctype html>+<!--+ Dart Cursor, standalone demo: an export dialog the cursor works through. It mounts+ dart-cursor.html full-frame over the dialog; the dialog's reactions are keyed to the+ cursor's two click beats (0.7s and 1.7s).+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Dart Cursor, Demo</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ width: 100%;+ height: 100%;+ overflow: hidden;+ }+ #root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #111318;+ font-family: Inter, system-ui, sans-serif;+ }+ .dialog {+ position: absolute;+ left: 460px;+ top: 250px;+ width: 1000px;+ height: 580px;+ border-radius: 28px;+ background: #ffffff;+ box-shadow:+ 0 40px 120px rgba(4, 6, 20, 0.55),+ 0 0 0 1px rgba(255, 255, 255, 0.4);+ }+ .title {+ position: absolute;+ left: 48px;+ top: 40px;+ font-size: 34px;+ font-weight: 700;+ letter-spacing: -0.02em;+ color: #111320;+ }+ .thumb {+ position: absolute;+ left: 48px;+ top: 110px;+ width: 420px;+ height: 236px;+ border-radius: 16px;+ overflow: hidden;+ background: #23262d;+ }+ .thumb svg {+ display: block;+ width: 100%;+ height: 100%;+ font-family: Inter, system-ui, sans-serif;+ }+ .thumb-time {+ position: absolute;+ right: 14px;+ bottom: 12px;+ padding: 6px 10px;+ border-radius: 8px;+ background: rgba(10, 12, 24, 0.6);+ color: #ffffff;+ font-size: 18px;+ font-weight: 600;+ }+ .file {+ position: absolute;+ left: 48px;+ top: 368px;+ font-size: 22px;+ font-weight: 600;+ color: #111320;+ }+ .file-meta {+ position: absolute;+ left: 48px;+ top: 402px;+ font-size: 18px;+ color: #6b6f85;+ }+ .label {+ position: absolute;+ left: 520px;+ font-size: 18px;+ font-weight: 600;+ color: #6b6f85;+ }+ .seg {+ position: absolute;+ left: 520px;+ width: 432px;+ height: 60px;+ border-radius: 16px;+ background: #eef0f6;+ }+ .seg-thumb {+ position: absolute;+ left: 4px;+ top: 4px;+ width: 136px;+ height: 52px;+ border-radius: 12px;+ background: #ffffff;+ box-shadow: 0 2px 8px rgba(17, 19, 32, 0.14);+ }+ .seg-opt {+ position: absolute;+ top: 0;+ width: 144px;+ height: 60px;+ line-height: 60px;+ text-align: center;+ font-size: 21px;+ font-weight: 600;+ color: #6b6f85;+ }+ .seg-opt.on {+ color: #111320;+ }+ .button {+ position: absolute;+ left: 712px;+ top: 496px;+ width: 240px;+ height: 60px;+ border-radius: 16px;+ background: #18181b;+ color: #ffffff;+ font-size: 21px;+ font-weight: 700;+ overflow: hidden;+ }+ .button span {+ position: absolute;+ inset: 0;+ line-height: 60px;+ text-align: center;+ }+ .check {+ display: inline-block;+ width: 22px;+ height: 22px;+ margin-right: 8px;+ vertical-align: -4px;+ fill: none;+ stroke: #ffffff;+ stroke-width: 2.6;+ stroke-linecap: round;+ stroke-linejoin: round;+ }+ .progress {+ position: absolute;+ inset: 0;+ background: rgba(255, 255, 255, 0.22);+ transform: scaleX(0);+ transform-origin: 0 50%;+ }+ .cancel {+ position: absolute;+ left: 520px;+ top: 496px;+ width: 172px;+ height: 60px;+ line-height: 60px;+ text-align: center;+ border-radius: 16px;+ font-size: 21px;+ font-weight: 600;+ color: #111320;+ background: #eef0f6;+ }+ </style>+ </head>+ <body>+ <div+ id="root"+ data-composition-id="dart-cursor-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="3.6"+ >+ <div class="dialog clip" id="dialog" data-start="0" data-duration="3.6" data-track-index="0">+ <div class="title">Export</div>+ <div class="thumb">+ <svg viewBox="0 0 420 236" aria-hidden="true">+ <rect x="40" y="26" width="340" height="230" rx="8" fill="#f4f4f5" />+ <rect x="122" y="46" width="258" height="190" fill="#ffffff" />+ <circle cx="52" cy="36" r="3.2" fill="#ff5f57" />+ <circle cx="62" cy="36" r="3.2" fill="#febc2e" />+ <circle cx="72" cy="36" r="3.2" fill="#28c840" />+ <rect x="46" y="71" width="70" height="13" rx="3" fill="#e4e4e7" />+ <g font-size="8" fill="#52525b">+ <text x="54" y="64">Home</text>+ <text x="54" y="80" fill="#18181b" font-weight="600">Reports</text>+ <text x="54" y="96">Customers</text>+ <text x="54" y="112">Billing</text>+ <text x="54" y="128">Settings</text>+ </g>+ <text x="136" y="66" font-size="8" fill="#71717a">Monthly revenue</text>+ <text x="136" y="87" font-size="17" font-weight="700" fill="#18181b">$48,210</text>+ <text x="206" y="86" font-size="7.5" font-weight="600" fill="#16a34a">+ +12.4% vs Aug+ </text>+ <path d="M136 120H366M136 150H366M136 180H366" stroke="#f0f0f1" />+ <path+ d="M136 186L159 180L182 183L205 172L228 175L251 164L274 166L297 152L320 146L343 138L366 126V200H136Z"+ fill="#0a84ff"+ fill-opacity="0.1"+ />+ <path+ d="M136 186L159 180L182 183L205 172L228 175L251 164L274 166L297 152L320 146L343 138L366 126"+ fill="none"+ stroke="#0a84ff"+ stroke-width="1.8"+ stroke-linejoin="round"+ />+ <circle cx="210" cy="118" r="24" fill="#000000" fill-opacity="0.55" />+ <path d="M203 106L203 130L223 118Z" fill="#ffffff" />+ </svg>+ <div class="thumb-time">0:42</div>+ </div>+ <div class="file">product-tour.mp4</div>+ <div class="file-meta">42 seconds, 30 fps, stereo audio</div>++ <div class="label" style="top: 110px">Resolution</div>+ <div class="seg" style="top: 142px">+ <div class="seg-thumb" id="res-thumb" style="left: 148px"></div>+ <div class="seg-opt" style="left: 0">720p</div>+ <div class="seg-opt on" id="res-1080" style="left: 144px">1080p</div>+ <div class="seg-opt" id="res-4k" style="left: 288px">4K</div>+ </div>++ <div class="label" style="top: 236px">Format</div>+ <div class="seg" style="top: 268px">+ <div class="seg-thumb"></div>+ <div class="seg-opt on" style="left: 0">MP4</div>+ <div class="seg-opt" style="left: 144px">MOV</div>+ <div class="seg-opt" style="left: 288px">GIF</div>+ </div>++ <div class="cancel">Cancel</div>+ <div class="button" id="export">+ <span id="export-idle">Export video</span>+ <span id="export-busy" style="opacity: 0">Exporting…</span>+ <div class="progress" id="progress"></div>+ <span+ ><svg class="check" id="export-check" viewBox="0 0 24 24" style="opacity: 0">+ <path d="M5 12.5l4.5 4.5L19 7.5" /></svg+ ><b id="export-done" style="opacity: 0; display: inline-block">Exported</b></span+ >+ </div>+ </div>++ <div+ class="clip"+ id="dart-cursor"+ data-composition-id="dart-cursor"+ data-composition-src="./dart-cursor.html"+ data-variable-values='{"tone":"dark","target_x":67.9,"target_y":40.5,"target2_x":63.3,"target2_y":73.7,"enter_from":"right","exit_to":"right"}'+ data-start="0"+ data-duration="3.6"+ data-track-index="1"+ data-width="1920"+ data-height="1080"+ style="position: absolute; inset: 0; width: 1920px; height: 1080px"+ ></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};+ var tl = gsap.timeline({ paused: true });++ // First click (0.7s): the resolution thumb slides onto 4K.+ tl.to("#res-thumb", { x: 144, duration: 0.34, ease: "power3.out" }, 0.78);+ tl.to("#res-1080", { color: "#6b6f85", duration: 0.2 }, 0.78);+ tl.to("#res-4k", { color: "#111320", duration: 0.2 }, 0.78);++ // Second click (1.7s): the button presses, relabels and fills over 1s.+ tl.to("#export", { scale: 0.96, duration: 0.08, ease: "power2.in" }, 1.7);+ tl.to("#export", { scale: 1, duration: 0.22, ease: "power2.out" }, 1.78);+ tl.to("#export-idle", { opacity: 0, y: -14, duration: 0.2, ease: "power2.in" }, 1.78);+ tl.fromTo(+ "#export-busy",+ { opacity: 0, y: 14 },+ { opacity: 1, y: 0, duration: 0.26, ease: "power3.out" },+ 1.86,+ );+ tl.to("#progress", { scaleX: 1, duration: 1.0, ease: "none" }, 1.8);++ // Done (2.8s): the fill clears and a check swaps in with "Exported".+ tl.to("#export-busy", { opacity: 0, y: -14, duration: 0.12, ease: "power2.in" }, 2.8);+ tl.to("#progress", { opacity: 0, duration: 0.2, ease: "power2.out" }, 2.8);+ tl.fromTo(+ "#export-check",+ { opacity: 0, scale: 0.3, filter: "blur(3px)" },+ { opacity: 1, scale: 1, filter: "blur(0px)", duration: 0.3, ease: "power3.out" },+ 2.88,+ );+ tl.fromTo(+ "#export-done",+ { opacity: 0, y: 14 },+ { opacity: 1, y: 0, duration: 0.26, ease: "power3.out" },+ 2.88,+ );++ window.__timelines["dart-cursor-demo"] = tl;+ </script>+ </body>+</html>diff --git a/registry/components/dart-cursor/registry-item.json b/registry/components/dart-cursor/registry-item.jsonnew file mode 100644index 0000000000..aaeb62beb5--- /dev/null+++ b/registry/components/dart-cursor/registry-item.json@@ -0,0 +1,115 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "dart-cursor",+ "type": "hyperframes:component",+ "title": "Dart Cursor",+ "description": "A bold outlined arrowhead that dives in from camera depth, flies nose-first with motion blur along its path, squashes on two clicks, and whips out of frame.",+ "tags": ["cursor", "motion-primitive", "pointer", "click", "motion-blur", "depth"],+ "files": [+ {+ "path": "dart-cursor.html",+ "target": "compositions/components/dart-cursor.html",+ "type": "hyperframes:snippet"+ }+ ],+ "jobs": ["demonstrate"],+ "family": "pointers",+ "profile": "interaction",+ "syncPoints": [+ { "id": "first-click", "phase": "in", "offset": 0.7 },+ { "id": "second-click", "phase": "in", "offset": 1.7 }+ ],+ "variables": [+ {+ "id": "tone",+ "type": "enum",+ "role": "style",+ "label": "Tone",+ "default": "dark",+ "options": [+ { "value": "dark", "label": "Dark body, white outline" },+ { "value": "light", "label": "Light body, dark outline" }+ ]+ },+ {+ "id": "target_x",+ "type": "number",+ "role": "layout",+ "label": "First click X",+ "default": 34,+ "min": 5,+ "max": 95,+ "step": 1,+ "unit": "%"+ },+ {+ "id": "target_y",+ "type": "number",+ "role": "layout",+ "label": "First click Y",+ "default": 58,+ "min": 5,+ "max": 95,+ "step": 1,+ "unit": "%"+ },+ {+ "id": "target2_x",+ "type": "number",+ "role": "layout",+ "label": "Second click X",+ "default": 64,+ "min": 5,+ "max": 95,+ "step": 1,+ "unit": "%"+ },+ {+ "id": "target2_y",+ "type": "number",+ "role": "layout",+ "label": "Second click Y",+ "default": 46,+ "min": 5,+ "max": 95,+ "step": 1,+ "unit": "%"+ },+ {+ "id": "enter_from",+ "type": "enum",+ "role": "timing",+ "label": "Enter from",+ "default": "right",+ "options": [+ { "value": "right", "label": "Right" },+ { "value": "left", "label": "Left" },+ { "value": "top", "label": "Top" },+ { "value": "bottom", "label": "Bottom" }+ ]+ },+ {+ "id": "exit_to",+ "type": "enum",+ "role": "timing",+ "label": "Exit to",+ "default": "right",+ "options": [+ { "value": "right", "label": "Right" },+ { "value": "left", "label": "Left" },+ { "value": "top", "label": "Top" },+ { "value": "bottom", "label": "Bottom" }+ ]+ },+ {+ "id": "blur",+ "type": "number",+ "role": "style",+ "label": "Motion blur",+ "default": 1,+ "min": 0,+ "max": 1.5,+ "step": 0.1+ }+ ]+}diff --git a/registry/components/fade-through/registry-item.json b/registry/components/fade-through/registry-item.jsonindex 57b71aedd4..e0cfcd3355 100644--- a/registry/components/fade-through/registry-item.json+++ b/registry/components/fade-through/registry-item.json@@ -4,7 +4,7 @@"type": "hyperframes:component","title": "Fade Through","description": "A calm transition primitive that fades one layer out, passes through a wash, and reveals the next layer",- "tags": ["motion-primitive", "transition", "fade", "scene"],+ "tags": ["motion-primitive", "transition", "fade", "crossfade", "scene"],"files": [{"path": "fade-through.html",diff --git a/registry/components/magnetic-cursor/demo.html b/registry/components/magnetic-cursor/demo.htmlnew file mode 100644index 0000000000..6bbc196d39--- /dev/null+++ b/registry/components/magnetic-cursor/demo.html@@ -0,0 +1,124 @@+<!doctype html>+<!--+ Magnetic Cursor, standalone demo: a document editor with the toolbar docked above the+ selection. The pointer visits Bold, then presses Link (about 1.91s), which turns the+ selected phrase into a link.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Magnetic Cursor, Demo</title>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <style>+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ width: 100%;+ height: 100%;+ overflow: hidden;+ }+ #root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #f4f4f5;+ font-family: Inter, system-ui, sans-serif;+ }+ .page {+ position: absolute;+ inset: 96px;+ padding: 80px 96px;+ border-radius: 20px;+ background: #ffffff;+ box-shadow:+ 0 0 0 1px rgba(20, 26, 45, 0.05),+ 0 2px 4px rgba(20, 26, 45, 0.04),+ 0 24px 60px rgba(20, 26, 45, 0.08);+ color: #1f2330;+ }+ .page h1 {+ margin: 0 0 36px;+ font-size: 72px;+ letter-spacing: -0.02em;+ }+ .page p {+ margin: 0 0 36px;+ font-size: 48px;+ line-height: 1.5;+ color: #3b4152;+ }+ .sel {+ position: relative;+ border-radius: 4px;+ background: rgba(59, 130, 246, 0.2);+ }+ .sel-line {+ position: absolute;+ left: 0;+ right: 0;+ bottom: 2px;+ height: 3px;+ border-radius: 2px;+ background: #3b82f6;+ transform: scaleX(0);+ transform-origin: 0 50%;+ }+ </style>+ </head>+ <body>+ <div+ id="root"+ data-composition-id="magnetic-cursor-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="3.6"+ >+ <div class="page clip" id="page" data-start="0" data-duration="3.6" data-track-index="0">+ <h1>Launch notes, week 38</h1>+ <p>+ The new onboarding flow ships to everyone on Thursday, and the old setup wizard stays+ behind a flag for one more week. Before your first support shift, please read the+ <span class="sel" id="sel"+ >rollout checklist<span class="sel-line" id="sel-line"></span+ ></span>+ and flag anything that still reads unclear.+ </p>+ <p>Open questions go in the team thread, not in comments here.</p>+ </div>++ <div+ class="clip"+ id="magnetic-cursor"+ data-composition-id="magnetic-cursor"+ data-composition-src="./magnetic-cursor.html"+ data-variable-values='{"tone":"light","accent":"#3b82f6","visits":"0,3","press":2}'+ data-start="0"+ data-duration="3.6"+ data-track-index="1"+ data-width="1440"+ data-height="749"+ style="position: absolute; left: 545px; top: 0; width: 1440px; height: 749px"+ ></div>+ </div>++ <script>+ window.__timelines = window.__timelines || {};+ var tl = gsap.timeline({ paused: true });+ tl.to(+ "#sel",+ { color: "#2563eb", backgroundColor: "rgba(59,130,246,0.1)", duration: 0.2 },+ 1.93,+ );+ tl.to("#sel-line", { scaleX: 1, duration: 0.3, ease: "power3.out" }, 1.95);+ window.__timelines["magnetic-cursor-demo"] = tl;+ </script>+ </body>+</html>diff --git a/registry/components/magnetic-cursor/magnetic-cursor.html b/registry/components/magnetic-cursor/magnetic-cursor.htmlnew file mode 100644index 0000000000..9917ee637c--- /dev/null+++ b/registry/components/magnetic-cursor/magnetic-cursor.html@@ -0,0 +1,427 @@+<!doctype html>+<!--+ Magnetic Cursor (actor primitive), mountable sub-composition++ concept: a tablet-style pointer. A soft translucent dot glides across an editor toolbar;+ near a button it is pulled in and morphs into that button's rounded hover plate while the+ icon leans toward the finger and the plate swells slightly. It visits buttons in turn,+ presses one (the plate squashes, the icon dips and turns accent), and leaves as a dot.++ mount contract: loaded by a host through data-composition-src; only <template> is cloned.+ #root fills the host clip (inset:0) and centres its own toolbar. See demo.html.++ variables:+ accent (color) icon colour of the pressed, now active, button+ tone (light|dark) toolbar and pointer pairing+ visits (string) comma-separated button indexes 0-5 the pointer visits, in order+ press (number 1-3) which visit presses its button++ envelope (default 3.6s): enter 0-0.53s, then per visit a 0.48s glide, a morph, a hold+ (the press lands 0.23s after arrival), a release; exit in the last 0.64s. Beats scale to fit.+-->+<html+ lang="en"+ data-composition-id="magnetic-cursor"+ data-composition-duration="3.6"+ data-composition-variables='[+ { "id": "accent", "type": "color", "role": "style", "label": "Accent", "default": "#3b82f6" },+ { "id": "tone", "type": "enum", "role": "style", "label": "Tone", "default": "light", "options": [ { "value": "light", "label": "Light toolbar" }, { "value": "dark", "label": "Dark toolbar" } ] },+ { "id": "visits", "type": "string", "role": "content", "label": "Buttons visited", "description": "Comma-separated indexes 0-5: bold, italic, underline, link, list, image.", "default": "0,3" },+ { "id": "press", "type": "number", "role": "timing", "label": "Pressed visit", "default": 2, "min": 1, "max": 3, "step": 1 }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Magnetic Cursor</title>+ </head>+ <body>+ <template>+ <style>+ #root {+ position: absolute;+ inset: 0;+ overflow: hidden;+ isolation: isolate;+ container-type: size;+ display: flex;+ align-items: center;+ justify-content: center;+ font-family: var(--font-body, Inter, system-ui, sans-serif);+ --mc-bar: #ffffff;+ --mc-ink: #2b2d33;+ --mc-edge: rgba(15, 18, 30, 0.1);+ --mc-pointer: 90, 94, 106;+ }+ #root[data-tone="dark"] {+ --mc-bar: #1d1e22;+ --mc-ink: #e9eaee;+ --mc-edge: rgba(255, 255, 255, 0.1);+ --mc-pointer: 235, 237, 242;+ }++ /* No transform here: it would make a stacking context and lift the plate over the icons. */+ .mc-bar {+ position: relative;+ display: flex;+ gap: 0.6cqw;+ padding: 0.9cqw;+ border-radius: 2.5cqw;+ background: var(--mc-bar);+ box-shadow:+ 0 0 0 1px var(--mc-edge),+ 0 1.6cqw 4cqw rgba(8, 10, 20, 0.28);+ }+ .mc-btn {+ position: relative;+ width: 6.2cqw;+ height: 6.2cqw;+ z-index: 2;+ }+ .mc-sep {+ width: 1px;+ margin: 1.2cqw 0.3cqw;+ background: var(--mc-edge);+ }+ .mc-icon {+ position: absolute;+ left: 50%;+ top: 50%;+ width: 2.8cqw;+ height: 2.8cqw;+ margin: -1.4cqw 0 0 -1.4cqw;+ fill: none;+ stroke: var(--mc-ink);+ stroke-width: 2;+ stroke-linecap: round;+ stroke-linejoin: round;+ will-change: transform;+ }+ .mc-layer {+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ z-index: 1;+ overflow: visible;+ }+ </style>++ <div id="root" data-composition-id="magnetic-cursor" data-duration="3.6" data-tone="light">+ <svg class="mc-layer" id="mc-layer" aria-hidden="true">+ <rect id="mc-plate" x="0" y="0" width="0" height="0" rx="0" />+ </svg>+ <div class="mc-bar" id="mc-bar">+ <div class="mc-btn">+ <svg class="mc-icon" viewBox="0 0 24 24">+ <path d="M7 5h6a3.5 3.5 0 0 1 0 7H7zM7 12h7a3.5 3.5 0 0 1 0 7H7z" />+ </svg>+ </div>+ <div class="mc-btn">+ <svg class="mc-icon" viewBox="0 0 24 24"><path d="M10 5h8M6 19h8M14 5l-4 14" /></svg>+ </div>+ <div class="mc-btn">+ <svg class="mc-icon" viewBox="0 0 24 24">+ <path d="M7 4v7a5 5 0 0 0 10 0V4M5 20h14" />+ </svg>+ </div>+ <div class="mc-sep"></div>+ <div class="mc-btn">+ <svg class="mc-icon" viewBox="0 0 24 24">+ <path+ d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"+ />+ </svg>+ </div>+ <div class="mc-btn">+ <svg class="mc-icon" viewBox="0 0 24 24">+ <path d="M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01" />+ </svg>+ </div>+ <div class="mc-btn">+ <svg class="mc-icon" viewBox="0 0 24 24">+ <rect x="3.5" y="4.5" width="17" height="15" rx="2.5" />+ <path d="M3.5 16l5-5 4 4 3-3 5 5M15 9h.01" />+ </svg>+ </div>+ </div>+ </div>++ <script>+ (function () {+ "use strict";++ var html = document.documentElement;+ var root = document.getElementById("root");+ var plate = document.getElementById("mc-plate");+ var layer = document.getElementById("mc-layer");+ var buttons = Array.prototype.slice.call(root.querySelectorAll(".mc-btn"));+ var icons = buttons.map(function (b) {+ return b.querySelector(".mc-icon");+ });++ var DEFAULTS = {};+ try {+ JSON.parse(html.getAttribute("data-composition-variables") || "[]").forEach(+ function (variable) {+ DEFAULTS[variable.id] = variable.default;+ },+ );+ } catch (error) {+ /* malformed declaration falls back to the inline defaults below */+ }+ var scopedVariables = {};+ try {+ if (window.__hyperframes && typeof window.__hyperframes.getVariables === "function") {+ scopedVariables = window.__hyperframes.getVariables() || {};+ }+ } catch (error) {+ /* no scoped variables API in this context */+ }+ var vars = Object.assign({}, DEFAULTS, window.__hfVariables || {}, scopedVariables);++ // Hardcoded: the compositor rewrites the wrapper's attributes on mount.+ var compositionId = "magnetic-cursor";+ var duration = Math.max(+ 0.001,+ parseFloat(+ root.dataset.duration || html.getAttribute("data-composition-duration") || "3.6",+ ),+ );+ var tone = vars.tone === "dark" ? "dark" : "light";+ var accent = String(vars.accent || "#3b82f6");+ root.setAttribute("data-tone", tone);++ var visits = String(vars.visits || "0,3")+ .split(",")+ .map(function (s) {+ return Math.round(Number(s));+ })+ .filter(function (n) {+ return isFinite(n) && n >= 0 && n < buttons.length;+ })+ .slice(0, 3);+ if (visits.length === 0) visits = [0, 3];+ var pressVisit =+ Math.max(1, Math.min(visits.length, Math.round(Number(vars.press) || 2))) - 1;++ // Geometry is read once at load: fixed viewport per render, no resize mid-render.+ var W = root.clientWidth || 1920;+ var H = root.clientHeight || 1080;+ layer.setAttribute("viewBox", "0 0 " + W + " " + H);+ // Offsets, not client rects: a host that scales the stage must not skew the targets.+ var bar = document.getElementById("mc-bar");+ var boxes = buttons.map(function (b) {+ return {+ x: bar.offsetLeft + b.offsetLeft + b.offsetWidth / 2,+ y: bar.offsetTop + b.offsetTop + b.offsetHeight / 2,+ w: b.offsetWidth,+ h: b.offsetHeight,+ };+ });+ var BW = boxes[0].w;+ var DOT = BW * 0.5;+ var PLATE_R = BW * 0.26;+ var PULL_RADIUS = BW * 1.1;+ // iPadOS parallax: about 3pt of icon travel on a 44pt button.+ var ICON_SHIFT = (BW * 3) / 44;++ // Beat plan (3.4s), stretched evenly to the duration: 3.6s by default.+ var ENTER = 0.5;+ var GLIDE = 0.45;+ var HOLD = 0.45;+ var PRESS_AT = 0.22;+ var PRESS_HOLD = 0.59;+ var RELEASE = 0.18;+ var EXIT = 0.6;+ var plan = [];+ var t = ENTER;+ visits.forEach(function (index, k) {+ if (k > 0) t += GLIDE;+ var hold = HOLD + (k === pressVisit ? PRESS_HOLD : 0);+ plan.push({+ index: index,+ arrive: t,+ leave: t + hold,+ press: k === pressVisit ? t + PRESS_AT : -1,+ });+ t += hold + RELEASE;+ });+ var base = t + EXIT;+ var k0 = duration / base;+ plan.forEach(function (v) {+ v.arrive *= k0;+ v.leave *= k0;+ if (v.press >= 0) v.press *= k0;+ });+ var releaseDur = RELEASE * k0;+ var exitAt = duration - EXIT * k0;++ function clamp01(u) {+ return u < 0 ? 0 : u > 1 ? 1 : u;+ }+ function smooth(u) {+ u = clamp01(u);+ return u * u * (3 - 2 * u);+ }+ function mix(a, b, u) {+ return a + (b - a) * u;+ }+ var easeOut = gsap.parseEase("power3.out");+ var easeInOut = gsap.parseEase("power2.inOut");+ var easeIn = gsap.parseEase("power2.in");+ var snap = gsap.parseEase("back.out(1.15)");++ // The finger lands a little off-centre and drifts across the button while it hovers.+ function arrivePoint(v) {+ var b = boxes[v.index];+ return { x: b.x - b.w * 0.2, y: b.y + b.h * 0.22 };+ }+ function driftPoint(v) {+ var b = boxes[v.index];+ return { x: b.x + b.w * 0.18, y: b.y - b.h * 0.12 };+ }+ var START = { x: W * 0.58, y: H * 0.9 };+ var END = { x: W * 1.06, y: H * 0.62 };++ function glide(p0, p1, u, bend) {+ var cx = (p0.x + p1.x) / 2 - (p1.y - p0.y) * bend;+ var cy = (p0.y + p1.y) / 2 + (p1.x - p0.x) * bend;+ var w = 1 - u;+ return {+ x: w * w * p0.x + 2 * w * u * cx + u * u * p1.x,+ y: w * w * p0.y + 2 * w * u * cy + u * u * p1.y,+ };+ }++ function fingerAt(time) {+ var first = plan[0];+ if (time <= first.arrive)+ return glide(START, arrivePoint(first), easeOut(clamp01(time / first.arrive)), 0.15);+ for (var k = 0; k < plan.length; k++) {+ var v = plan[k];+ var a = arrivePoint(v);+ var d = driftPoint(v);+ if (time <= v.leave)+ return glide(a, d, easeInOut(clamp01((time - v.arrive) / (v.leave - v.arrive))), 0);+ var next = plan[k + 1];+ if (next && time <= next.arrive) {+ return glide(+ d,+ arrivePoint(next),+ easeInOut(clamp01((time - v.leave) / (next.arrive - v.leave))),+ -0.12,+ );+ }+ }+ var last = driftPoint(plan[plan.length - 1]);+ if (time <= exitAt) return last;+ return glide(last, END, easeIn(clamp01((time - exitAt) / (duration - exitAt))), 0.1);+ }++ // How far the pointer has become the plate of visit v: 0 is a dot, 1 is the plate.+ function morphOf(v, time) {+ var inDur = 0.22 * k0;+ if (time < v.arrive - inDur * 0.5) return 0;+ if (time <= v.leave) return clamp01((time - (v.arrive - inDur * 0.5)) / inDur);+ return 1 - clamp01((time - v.leave) / releaseDur);+ }++ function pressOf(v, time) {+ if (v.press < 0 || time < v.press) return 0;+ var u = (time - v.press) / (0.3 * k0);+ if (u >= 1) return 0;+ return u < 0.3 ? u / 0.3 : 1 - (u - 0.3) / 0.7;+ }++ function render(time) {+ var finger = fingerAt(time);+ var active = null;+ var m = 0;+ plan.forEach(function (v) {+ var mv = morphOf(v, time);+ if (mv > m) {+ m = mv;+ active = v;+ }+ });+ var cx = finger.x;+ var cy = finger.y;+ var w = DOT;+ var h = DOT;+ var r = DOT / 2;+ var squash = 0;+ if (!active) {+ // The magnet: within reach of a button the dot is already leaning toward its centre.+ boxes.forEach(function (b) {+ var pull =+ 0.35 * smooth(1 - Math.hypot(b.x - finger.x, b.y - finger.y) / PULL_RADIUS);+ cx = mix(cx, b.x, pull);+ cy = mix(cy, b.y, pull);+ });+ } else {+ var b = boxes[active.index];+ var ms = snap(m);+ squash = pressOf(active, time);+ cx = mix(finger.x, b.x + (finger.x - b.x) * 0.05, smooth(m));+ cy = mix(finger.y, b.y + (finger.y - b.y) * 0.05, smooth(m));+ var lift = 1 + 0.04 * smooth(m);+ w = mix(DOT, b.w, ms) * lift * (1 - 0.06 * squash);+ h = mix(DOT, b.h, ms) * lift * (1 - 0.1 * squash);+ r = mix(DOT / 2, PLATE_R, smooth(m));+ }+ var alpha = mix(0.55, tone === "dark" ? 0.14 : 0.09, smooth(m)) + 0.08 * squash;+ var visible = time < duration ? smooth(time / (0.2 * k0)) : 0;+ plate.setAttribute("x", (cx - w / 2).toFixed(2));+ plate.setAttribute("y", (cy - h / 2).toFixed(2));+ plate.setAttribute("width", Math.max(0, w).toFixed(2));+ plate.setAttribute("height", Math.max(0, h).toFixed(2));+ plate.setAttribute("rx", Math.min(r, w / 2, h / 2).toFixed(2));+ plate.style.fill = "rgba(var(--mc-pointer), " + (alpha * visible).toFixed(3) + ")";++ icons.forEach(function (icon, i) {+ var lean = active && active.index === i ? smooth(m) : 0;+ var vx = finger.x - boxes[i].x;+ var vy = finger.y - boxes[i].y;+ // Full shift once the finger is 0.3 button widths off centre.+ var shift = (ICON_SHIFT * lean) / Math.max(Math.hypot(vx, vy), BW * 0.3);+ var dx = vx * shift;+ var dy = vy * shift;+ var dip = active && active.index === i ? squash : 0;+ icon.style.transform =+ "translate(" ++ dx.toFixed(2) ++ "px," ++ dy.toFixed(2) ++ "px) scale(" ++ (1 - 0.12 * dip).toFixed(3) ++ ")";+ var pressed = plan.some(function (v) {+ return v.index === i && v.press >= 0 && time >= v.press + 0.05 * k0;+ });+ icon.style.stroke = pressed ? accent : "";+ });+ }++ var clock = { t: 0 };+ var tl = gsap.timeline({ paused: true });+ tl.to(+ clock,+ {+ t: duration,+ duration: duration,+ ease: "none",+ onUpdate: function () {+ render(clock.t);+ },+ },+ 0,+ );+ render(0);+ tl.seek(0);+ window.__timelines = window.__timelines || {};+ window.__timelines[compositionId] = tl;+ })();+ </script>+ </template>+ </body>+</html>diff --git a/registry/components/magnetic-cursor/registry-item.json b/registry/components/magnetic-cursor/registry-item.jsonnew file mode 100644index 0000000000..2ef9148b05--- /dev/null+++ b/registry/components/magnetic-cursor/registry-item.json@@ -0,0 +1,51 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "magnetic-cursor",+ "type": "hyperframes:component",+ "title": "Magnetic Cursor",+ "description": "A soft dot pointer glides across an editor toolbar, is pulled into each button and morphs into its rounded hover plate while the icon leans toward it, presses one, and leaves as a dot.",+ "tags": ["cursor", "motion-primitive", "pointer", "hover", "morph", "toolbar"],+ "files": [+ {+ "path": "magnetic-cursor.html",+ "target": "compositions/components/magnetic-cursor.html",+ "type": "hyperframes:snippet"+ }+ ],+ "jobs": ["demonstrate"],+ "family": "pointers",+ "profile": "interaction",+ "syncPoints": [{ "id": "press", "phase": "hold", "offset": 1.91 }],+ "variables": [+ { "id": "accent", "type": "color", "role": "style", "label": "Accent", "default": "#3b82f6" },+ {+ "id": "tone",+ "type": "enum",+ "role": "style",+ "label": "Tone",+ "default": "light",+ "options": [+ { "value": "light", "label": "Light toolbar" },+ { "value": "dark", "label": "Dark toolbar" }+ ]+ },+ {+ "id": "visits",+ "type": "string",+ "role": "content",+ "label": "Buttons visited",+ "description": "Comma-separated indexes 0-5: bold, italic, underline, link, list, image.",+ "default": "0,3"+ },+ {+ "id": "press",+ "type": "number",+ "role": "timing",+ "label": "Pressed visit",+ "default": 2,+ "min": 1,+ "max": 3,+ "step": 1+ }+ ]+}diff --git a/registry/components/oversized-cursor/README.md b/registry/components/oversized-cursor/README.mdindex 6456b1223a..46a9674a26 100644--- a/registry/components/oversized-cursor/README.md+++ b/registry/components/oversized-cursor/README.md@@ -1,8 +1,8 @@# oversized-cursor-An actor primitive: a deliberately oversized macOS-style pointer enters from off-screen, glides in one continuous vector to a caller-positioned target, taps it (the click visibly ignites the target), drifts aside during the dwell, then accelerates off-screen. One mechanic: a pointer-driven click that visibly causes something.+The look-here pointer for a video: the family macOS arrow at 3.5x its normal size (224px box at 1920 wide) enters from off-screen, lands its tip on a caller-positioned control, clicks it (the control switches on in the accent blue with a check), settles just below it so the result stays in view, then accelerates off-screen.-4.2s authored, elastic HOLD; the cursor's own physical off-screen exit always plays (it is the mechanic).+2.6s authored, elastic HOLD; the cursor's own physical off-screen exit always plays (it is the mechanic).## Variables@@ -11,7 +11,7 @@ An actor primitive: a deliberately oversized macOS-style pointer enters from off| `cursor_variant` | enum | `light` | `light` (white body) or `dark` (near-black body); pick per scene contrast. || `target_x` | number (%) | `55` | Tip landing point, percent of the host box (15 to 85). || `target_y` | number (%) | `55` | Tip landing point, percent of the host box (15 to 85). |-| `click_label` | string | `Generate` | Label on the clicked target pill. |+| `click_label` | string | `Generate` | Label on the clicked control. It gains a check when switched on, so a noun or state reads best. || `exit` | enum | `none` | `none` leaves the ignited target on screen until the cut; `fade`/`up` also depart the whole stage (target included) during the OUT window. |## Mount@@ -23,7 +23,7 @@ An actor primitive: a deliberately oversized macOS-style pointer enters from offdata-composition-src="./oversized-cursor.html"data-variable-values='{"target_x":62,"target_y":48,"click_label":"Render"}'data-start="0"- data-duration="4.2"+ data-duration="2.6"data-track-index="0"></div>```@@ -32,5 +32,5 @@ Elastic root: no `data-width`/`data-height`; it fills whatever box the host clip## Notes-- Invariants: cursor size floor 7cqw; motion on transforms only (never left/top); ripple and click pivot anchor to the arrow tip at (21%, 14%) of the cursor box.-- Sync point: the click lands at the end of the entry glide (a fixed offset into IN, never inside the elastic HOLD); route a soft UI click SFX there in the mix stage.+- Invariants: cursor box 11.67cqw (3.5x the family's 64u arrow); motion on transforms only (never left/top); the click pivots on the arrow tip at (5/24, 3/24) of the cursor box.+- Sync point: the click lands at 0.7s (0.5s glide plus 0.2s aim, a fixed offset into IN, never inside the elastic HOLD); route a soft UI click SFX there in the mix stage.diff --git a/registry/components/oversized-cursor/demo.html b/registry/components/oversized-cursor/demo.htmlindex 96edf3dcaa..2ac36bdf4c 100644--- a/registry/components/oversized-cursor/demo.html+++ b/registry/components/oversized-cursor/demo.html@@ -2,11 +2,9 @@<!--Oversized Cursor, standalone demo.- Mounts oversized-cursor.html as a sub-composition (data-composition-src) into a- dark host stage, instead of inlining its markup/style/script. Passing lint and- validate here, with the cursor visibly present in mid-motion snapshots, proves- the primitive satisfies the sub-composition mount contract (see- skills/hyperframes-core/references/sub-compositions.md).+ A blog editor window on a dark ground. oversized-cursor.html is mounted full frame+ (data-composition-src) and draws the Comments toggle in the toolbar slot; the big+ cursor switches it on and the host timeline shows the highlighted comment.--><html lang="en"><head>@@ -34,22 +32,217 @@width: 1920px;height: 1080px;overflow: hidden;- background: var(--bg, #05070c);- font-family: var(--font-body, Inter, system-ui, sans-serif);+ background: #111318;+ font-family: Inter, system-ui, sans-serif;+ -webkit-font-smoothing: antialiased;}.demo-frame {position: absolute;- top: 50%;- left: 50%;- transform: translate(-50%, -50%);- width: 1280px;- height: 720px;- border-radius: 24px;- border: 1px solid var(--border, rgba(148, 163, 184, 0.25));- background: var(--surface, #0b0f16);- box-shadow: 0 40px 120px rgba(2, 6, 23, 0.55);+ left: 280px;+ top: 150px;+ width: 1360px;+ height: 780px;+ border-radius: 14px;+ background: #ffffff;+ box-shadow:+ 0 0 0 1px rgba(255, 255, 255, 0.06),+ 0 2px 6px rgba(0, 0, 0, 0.3),+ 0 30px 80px rgba(0, 0, 0, 0.45);overflow: hidden;+ color: #1c1c1e;+ }+ .app-titlebar {+ display: flex;+ align-items: center;+ gap: 9px;+ height: 52px;+ padding: 0 20px;+ border-bottom: 1px solid rgba(0, 0, 0, 0.08);+ background: #f6f6f7;+ }+ .app-titlebar i {+ width: 13px;+ height: 13px;+ border-radius: 50%;+ background: #ff5f57;+ }+ .app-titlebar i:nth-child(2) {+ background: #febc2e;+ }+ .app-titlebar i:nth-child(3) {+ background: #28c840;+ }+ .app-titlebar span {+ flex: 1;+ margin-right: 57px;+ text-align: center;+ font-size: 15px;+ font-weight: 600;+ color: #6e6e73;+ }+ .app-body {+ display: flex;+ height: 728px;+ }+ .app-side {+ width: 300px;+ padding: 22px 14px;+ border-right: 1px solid rgba(0, 0, 0, 0.08);+ background: #fafafa;+ }+ .app-side h4 {+ margin: 0 10px 12px;+ font-size: 13px;+ font-weight: 600;+ letter-spacing: 0.04em;+ text-transform: uppercase;+ color: #8e8e93;+ }+ .app-post {+ padding: 12px 12px;+ border-radius: 9px;+ font-size: 17px;+ font-weight: 500;+ line-height: 1.3;+ }+ .app-post small {+ display: block;+ margin-top: 3px;+ font-size: 14px;+ font-weight: 400;+ color: #8e8e93;+ }+ .app-post.is-open {+ background: rgba(10, 132, 255, 0.1);+ }+ .app-main {+ position: relative;+ flex: 1;+ }+ .app-toolbar {+ position: relative;+ display: flex;+ align-items: center;+ height: 72px;+ padding: 0 36px;+ border-bottom: 1px solid rgba(0, 0, 0, 0.08);+ font-size: 16px;+ color: #8e8e93;+ }+ .app-toolbar b {+ margin-left: 8px;+ font-weight: 500;+ color: #1c1c1e;+ }+ /* Ends left of the Comments toggle, which the cursor mount draws. */+ .app-actions {+ position: absolute;+ right: 220px;+ top: 50%;+ display: flex;+ align-items: center;+ gap: 14px;+ transform: translateY(-50%);+ }+ .app-chip {+ display: flex;+ align-items: center;+ gap: 8px;+ height: 34px;+ padding: 0 14px;+ border-radius: 17px;+ font-size: 15px;+ font-weight: 500;+ white-space: nowrap;+ background: #f2f2f3;+ color: #6e6e73;+ }+ .app-chip::before {+ content: "";+ width: 8px;+ height: 8px;+ border-radius: 50%;+ background: #aeaeb2;+ }+ .app-ghost {+ height: 42px;+ padding: 0 18px;+ border: 1px solid rgba(0, 0, 0, 0.1);+ border-radius: 10px;+ font-size: 19px;+ font-weight: 600;+ line-height: 40px;+ color: #1c1c1e;+ }+ .app-doc {+ max-width: 680px;+ margin: 52px 0 0 84px;+ }+ .app-doc h1 {+ margin: 0;+ font-size: 44px;+ font-weight: 700;+ letter-spacing: -0.02em;+ line-height: 1.15;+ }+ .app-meta {+ margin: 14px 0 30px;+ font-size: 16px;+ color: #8e8e93;+ }+ .app-doc p {+ margin: 0 0 20px;+ font-size: 20px;+ line-height: 1.6;+ color: #3a3a3c;+ }+ .app-doc mark {+ border-radius: 3px;+ background: rgba(255, 204, 0, 0);+ color: inherit;+ }+ .app-comment {+ position: absolute;+ left: 785px;+ top: 372px;+ width: 236px;+ padding: 14px 16px;+ border: 1px solid rgba(0, 0, 0, 0.08);+ border-radius: 12px;+ background: #ffffff;+ box-shadow:+ 0 1px 2px rgba(0, 0, 0, 0.06),+ 0 8px 24px rgba(0, 0, 0, 0.08);+ font-size: 16px;+ line-height: 1.45;+ color: #3a3a3c;+ opacity: 0;+ }+ .app-comment b {+ display: flex;+ align-items: center;+ gap: 8px;+ margin-bottom: 6px;+ font-size: 15px;+ font-weight: 600;+ color: #1c1c1e;+ }+ .app-comment b i {+ width: 24px;+ height: 24px;+ border-radius: 50%;+ background: #ff9f0a;+ font-size: 11px;+ font-style: normal;+ line-height: 24px;+ text-align: center;+ color: #ffffff;+ }+ .app-comment small {+ font-size: 14px;+ font-weight: 400;+ color: #8e8e93;}</style></head>@@ -60,41 +253,84 @@data-start="0"data-width="1920"data-height="1080"- data-duration="4.2"+ data-duration="2.6"><divid="demo-frame"class="demo-frame clip"data-start="0"- data-duration="4.2"+ data-duration="2.6"data-track-index="0"- ></div>+ >+ <div class="app-titlebar"><i></i><i></i><i></i><span>Field Notes</span></div>+ <div class="app-body">+ <aside class="app-side">+ <h4>Posts</h4>+ <div class="app-post is-open">+ Offline mode, one year in<small>Draft · edited 2 min ago</small>+ </div>+ <div class="app-post">Why we rewrote sync<small>Published Aug 14</small></div>+ <div class="app-post">Designing the new inbox<small>Published Jul 30</small></div>+ <div class="app-post">What broke in the 4.2 release<small>Published Jul 2</small></div>+ <div class="app-post">+ Hiring our first support engineer<small>Published Jun 11</small>+ </div>+ </aside>+ <main class="app-main">+ <div class="app-toolbar">+ Posts /<b>Offline mode, one year in</b>+ <div class="app-actions">+ <span class="app-chip">Draft</span>+ <span class="app-ghost">Preview</span>+ </div>+ </div>+ <article class="app-doc">+ <h1>Offline mode, one year in</h1>+ <div class="app-meta">Priya Raman · 6 min read</div>+ <p>+ A year ago we shipped offline mode to every workspace. Since then, 38% of edits have+ happened on a plane, a train, or a flaky café connection.+ </p>+ <p>+ Most of that traffic lands in the first ten minutes after a device reconnects, so+ this post walks through how+ <mark id="comment-mark">the sync queue drains</mark> without locking the editor.+ </p>+ </article>+ <div class="app-comment" id="comment">+ <b><i>SK</i>Sam Kim <small>2h</small></b>+ Could this be a diagram? The drain order is the whole point.+ </div>+ </main>+ </div>+ </div><divclass="clip"id="oversized-cursor"data-composition-id="oversized-cursor"data-composition-src="./oversized-cursor.html"- data-variable-values='{"cursor_variant":"light","target_x":66,"target_y":42,"click_label":"Ship it"}'+ data-variable-values='{"cursor_variant":"light","target_x":79,"target_y":22,"click_label":"Comments"}'data-start="0"- data-duration="4.2"+ data-duration="2.6"data-track-index="1"- data-width="1280"- data-height="720"- style="- position: absolute;- top: 50%;- left: 50%;- transform: translate(-50%, -50%);- width: 1280px;- height: 720px;- "+ data-width="1920"+ data-height="1080"+ style="position: absolute; inset: 0; width: 1920px; height: 1080px"></div></div><script>window.__timelines = window.__timelines || {};var tl = gsap.timeline({ paused: true });+ // 0.8s is when the component's click releases: the click moment plus the press.+ tl.to("#comment-mark", { backgroundColor: "rgba(255, 204, 0, 0.35)", duration: 0.2 }, 0.8);+ tl.fromTo(+ "#comment",+ { opacity: 0, y: 6 },+ { opacity: 1, y: 0, duration: 0.25, ease: "power2.out" },+ 0.8,+ );window.__timelines["oversized-cursor-demo"] = tl;</script></body>diff --git a/registry/components/oversized-cursor/oversized-cursor.html b/registry/components/oversized-cursor/oversized-cursor.htmlindex c55b0e51e1..fd943663fe 100644--- a/registry/components/oversized-cursor/oversized-cursor.html+++ b/registry/components/oversized-cursor/oversized-cursor.html@@ -2,15 +2,10 @@<!--Oversized Cursor (actor primitive), mountable sub-composition- concept: a deliberately oversized macOS-style pointer that enters the frame- from off-screen, travels in one continuous glide to a target, taps it (the- click ignites a visible reaction on the target itself), drifts aside during- the dwell, then exits off-screen. One mechanic: a pointer-driven click that- visibly causes something. Family: pointers. Profile: interaction.-- compiled-from: spec ready (oversized-cursor SKILL.md, ~/Downloads/oversized-cursor);- actor file mechanics compose (size/look, entry law, tip-targeting, click-ignition,- exit law).+ concept: the "look here" pointer for a video. The family macOS arrow at 3.5x+ its normal size enters from off-screen, lands its tip on one control, clicks+ it (the control switches on), settles just below it so the result stays in+ view, then exits off-screen. Family: pointers. Profile: interaction.use-when: kicking off a UI scene, igniting a morph/transition/typing run with acausal click, or carrying the eye across a scene that would otherwise read as@@ -32,20 +27,20 @@exit (enum none|fade|up, default none) optional whole-stage departure duringOUT; the cursor's own off-screen exit always plays (it is the mechanic)- envelope (of data-composition-duration, default 4.2s):- IN 0.00s to 1.17s (fixed) off-screen entry glide (0.85s) then click tap (0.32s)- HOLD 1.17s to D-0.60s (elastic) click ignition plays, cursor drifts aside, then dwells- OUT D-0.60s to D (fixed) cursor accelerates off-screen; with exit fade|up the+ envelope (of data-composition-duration, default 2.6s):+ IN 0.00s to 1.02s (fixed) entry glide (0.5s), aim (0.2s), click tap (0.32s)+ HOLD 1.02s to D-0.40s (elastic) the control switches on, cursor settles below it, holds+ OUT D-0.40s to D (fixed) cursor accelerates off-screen; with exit fade|up thewhole stage (target included) also departssound: one click tap SFX (soft UI click) fires at the click moment, the fixed- offset into IN documented below as SYNC POINT. This file never plays audio: it+ offset into IN set by CLICK_AT below. This file never plays audio: itonly marks the cue's timing for the mix stage to pick up.--><htmllang="en"data-composition-id="oversized-cursor"- data-composition-duration="4.2"+ data-composition-duration="2.6"data-composition-variables='[{ "id": "cursor_variant", "type": "enum", "role": "style", "label": "Cursor fill", "default": "light", "options": [ { "value": "light", "label": "Light (white body)" }, { "value": "dark", "label": "Dark (near-black body)" } ] },{ "id": "target_x", "type": "number", "role": "layout", "label": "Target X", "default": 55, "min": 15, "max": 85, "step": 1, "unit": "%" },@@ -98,25 +93,33 @@position: absolute;left: 50%;top: 50%;- display: flex;- align-items: center;- gap: var(--space-1, 0.6cqw);- padding: var(--space-2, 1.5cqw) var(--space-3, 2.4cqw);- border-radius: var(--radius, 999px);- border: 1px solid var(--border, rgba(148, 163, 184, 0.35));+ padding: var(--space-2, 0.6cqw) var(--space-3, 1cqw);+ border-radius: var(--radius, 0.55cqw);+ border: 1px solid var(--border, rgba(0, 0, 0, 0.1));background: color-mix(in srgb,var(--surface, #f8fafc) calc((1 - var(--oc-ignite, 0)) * 100%),- var(--brand, #52525b) calc(var(--oc-ignite, 0) * 100%)+ var(--brand, #0a84ff) calc(var(--oc-ignite, 0) * 100%));- box-shadow: 0 1.2cqw 3.2cqw rgba(2, 6, 23, 0.24);+ box-shadow:+ 0 1px 2px rgba(0, 0, 0, 0.08),+ 0 0.3cqw 0.8cqw rgba(0, 0, 0, 0.08);--oc-ignite: 0;z-index: 10;}+ /* The check's slot is always laid out; idle, the row shifts left by half of it+ so the label sits centred, and the check slides in without a layout change. */+ .oc-target-row {+ display: flex;+ align-items: center;+ gap: 0.45cqw;+ transform: translateX(calc((var(--oc-ignite, 0) - 1) * 0.725cqw));+ }+.oc-target-check {- width: 1.8cqw;- height: 1.8cqw;+ width: 1cqw;+ height: 1cqw;min-width: 14px;min-height: 14px;flex: none;@@ -130,8 +133,8 @@}.oc-target-label {- font-size: clamp(12px, 1.7cqw, 30px);- font-weight: 650;+ font-size: clamp(12px, 1cqw, 20px);+ font-weight: 600;line-height: 1;white-space: nowrap;color: color-mix(@@ -141,20 +144,16 @@);}- /* INVARIANT: cursor size floor is 7cqw for full-frame scenes (house- convention). Never go smaller; an actual-size cursor disappears at- video scale. */+ /* 224px at 1920 wide: the family's 64u arrow at 3.5x, shadow scaled with it. */.oc-cursor {position: absolute;left: 0;top: 0;- width: 7cqw;- height: 7cqw;- min-width: 34px;- min-height: 34px;+ width: 11.67cqw;+ height: 11.67cqw;pointer-events: none;will-change: transform;- filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));+ filter: drop-shadow(0 0.52cqw 0.73cqw rgba(0, 0, 0, 0.3));z-index: 20;}@@ -178,34 +177,19 @@stroke: #ffffff;stroke-width: 1.4;}-- /* INVARIANT: ripple anchors to the arrow's tip point (21%, 14% of the- cursor box), the same point transformOrigin pivots the click tap on. */- .oc-ripple {- position: absolute;- left: 21%;- top: 14%;- width: 2.6cqw;- height: 2.6cqw;- min-width: 12px;- min-height: 12px;- border-radius: 999px;- border: 0.24cqw solid color-mix(in srgb, var(--fg, #ffffff) 45%, transparent);- transform: translate(-50%, -50%);- opacity: 0;- }</style>- <div id="root" data-composition-id="oversized-cursor" data-duration="4.2">+ <div id="root" data-composition-id="oversized-cursor" data-duration="2.6"><div class="oc-stage"><div class="oc-target" id="oc-target">- <svg class="oc-target-check" viewBox="0 0 24 24" aria-hidden="true">- <path d="M5 13l4 4L19 7" />- </svg>- <span class="oc-target-label" id="oc-target-label"></span>+ <div class="oc-target-row">+ <svg class="oc-target-check" viewBox="0 0 24 24" aria-hidden="true">+ <path d="M5 13l4 4L19 7" />+ </svg>+ <span class="oc-target-label" id="oc-target-label"></span>+ </div></div><div class="oc-cursor" id="oc-cursor" data-variant="light" aria-hidden="true">- <div class="oc-ripple"></div><svg class="oc-cursor-svg" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3 L5 19 L9 15 L12 22 L15 20.5 L11.5 14 L18 14 Z" /></svg>@@ -227,7 +211,6 @@var html = document.documentElement;var root = document.getElementById("root");var cursor = document.getElementById("oc-cursor");- var ripple = cursor.querySelector(".oc-ripple");var target = document.getElementById("oc-target");var targetLabel = document.getElementById("oc-target-label");@@ -271,7 +254,7 @@var duration = Math.max(0.001,parseFloat(- root.dataset.duration || html.getAttribute("data-composition-duration") || "4.2",+ root.dataset.duration || html.getAttribute("data-composition-duration") || "2.6",),);var variant = vars.cursor_variant === "dark" ? "dark" : "light";@@ -302,18 +285,15 @@return (percent / 100) * stageH;}- // Tip-targeting: the arrow's visual tip sits at (21%, 14%) inside the- // cursor's own box. Anchor the box by that offset once, up front, so- // every later x/y tween places the TIP (not the box corner) at the- // given stage position. Never tween xPercent/yPercent.- gsap.set(cursor, { xPercent: -21, yPercent: -14 });+ // Tip-targeting: the family arrow's tip sits at (5/24, 3/24) of its box.+ // Anchoring the box by that offset makes every x/y below place the TIP.+ gsap.set(cursor, { xPercent: -20.83, yPercent: -12.5 });gsap.set(target, { xPercent: -50, yPercent: -50, scale: 1 });- // RETIME RANGE: IN/OUT are fixed durations (house convention: entry- // glide 0.4-0.92s + click tap 0.32s). They only shrink, proportionally,- // if the composition duration is too short to hold IN + OUT at all.- var IN_BASE = 1.17; // 0.85s glide + 0.1s compress + 0.22s expand- var OUT_BASE = 0.6;+ // entry and exit keep fixed durations; both shrink proportionally only+ // when the composition is too short to fit them.+ var IN_BASE = 1.02; // 0.5s glide + 0.2s aim + 0.1s press + 0.22s release+ var OUT_BASE = 0.4;var totalBase = IN_BASE + OUT_BASE;var IN = IN_BASE;var OUT = OUT_BASE;@@ -326,21 +306,20 @@var OUT_AT = IN + HOLD;var shrinkFactor = IN / IN_BASE;- var glideDur = 0.85 * shrinkFactor;+ var glideDur = 0.5 * shrinkFactor;var clickInDur = 0.1 * shrinkFactor;var clickOutDur = 0.22 * shrinkFactor;- // SYNC POINT: click moment (entry settle), a fixed offset into IN,- // never inside the elastic HOLD.- var CLICK_AT = glideDur;+ // the click lands at a fixed offset into the entry, never in the stretchable hold.+ var CLICK_AT = (0.5 + 0.2) * shrinkFactor;+ var TIP_ORIGIN = "20.83% 12.5%";var offX = xAt(48);var offY = yAt(116); // resting pose IS off-screen, below the stagevar tl = gsap.timeline({ paused: true });- // ---- IN: off-screen entry, one continuous vector, then the tap ----+ // ---- IN: off-screen entry, one continuous vector, aim, then the tap ----tl.set(cursor, { scale: 1 });- tl.set(ripple, { opacity: 0, scale: 0.4 });tl.set(target, { "--oc-ignite": 0 });tl.fromTo(cursor,@@ -350,59 +329,46 @@);tl.to(cursor,- { scale: 0.84, duration: clickInDur, ease: "power2.in", transformOrigin: "21% 14%" },+ { scale: 0.9, duration: clickInDur, ease: "power2.in", transformOrigin: TIP_ORIGIN },CLICK_AT,);tl.to(cursor,- { scale: 1, duration: clickOutDur, ease: "power2.out", transformOrigin: "21% 14%" },+ { scale: 1, duration: clickOutDur, ease: "power2.out", transformOrigin: TIP_ORIGIN },CLICK_AT + clickInDur,);- // ---- the click ignites the target: parallel reaction, same frame ----- tl.to(target, { scale: 0.94, duration: clickInDur, ease: "power2.in" }, CLICK_AT);+ // ---- the click switches the target on, same frame as the release ----+ tl.to(target, { scale: 0.96, duration: clickInDur, ease: "power2.in" }, CLICK_AT);tl.to(target,{ scale: 1, duration: clickOutDur, ease: "power2.out" },CLICK_AT + clickInDur,);- tl.fromTo(- ripple,- { opacity: 0.85, scale: 0.4 },- { opacity: 0, scale: 2.4, duration: 0.42, ease: "power2.out" },- CLICK_AT + clickInDur,- );tl.to(target,- { "--oc-ignite": 1, duration: 0.34, ease: "back.out(2.2)" },+ { "--oc-ignite": 1, duration: 0.3, ease: "power2.out" },CLICK_AT + clickInDur,);- // ---- HOLD (elastic): drift aside once, then dwell, never wobble ----- var driftDelay = Math.min(0.22, HOLD * 0.3);- var driftDur = Math.max(0, Math.min(0.7, HOLD - driftDelay));+ // ---- HOLD (elastic): settle just below the target, still pointing at it ----+ var driftDur = Math.min(0.4, HOLD);if (driftDur > 0.05) {- var asideX = clampPercent(targetX + (targetX < 50 ? 16 : -16), targetX);- var asideY = clampPercent(targetY + 10, targetY);+ var cq = stageW / 100;tl.to(cursor,{- x: xAt(asideX),- y: yAt(asideY),+ x: xAt(targetX) + 2.5 * cq,+ y: yAt(targetY) + 2.1 * cq,duration: driftDur,- ease: "power2.out",- overwrite: "auto",+ ease: "power2.inOut",},- IN + driftDelay,+ IN,);}// ---- OUT: leave the frame, physically, never a fade-in-place ----- tl.to(- cursor,- { y: yAt(120), duration: OUT, ease: "power2.in", overwrite: "auto" },- OUT_AT,- );+ tl.to(cursor, { y: yAt(120), duration: OUT, ease: "power2.in" }, OUT_AT);// Optional whole-stage departure on top of the cursor's own exit;// exit none leaves the ignited target until the frame cuts.diff --git a/registry/components/oversized-cursor/registry-item.json b/registry/components/oversized-cursor/registry-item.jsonindex 2c6de08af1..804c2ced2c 100644--- a/registry/components/oversized-cursor/registry-item.json+++ b/registry/components/oversized-cursor/registry-item.json@@ -3,8 +3,8 @@"name": "oversized-cursor","type": "hyperframes:component","title": "Oversized Cursor",- "description": "A deliberately oversized macOS-style pointer that enters off-screen, travels to a target, clicks to ignite a visible response, then exits",- "tags": ["motion-primitive", "actor", "cursor", "pointer", "interaction"],+ "description": "The look-here pointer for a video: the macOS arrow at 3.5x its normal size lands its tip on one control, clicks it on, settles just below it so the result stays in view, then exits off-screen",+ "tags": ["cursor", "motion-primitive", "actor", "pointer", "interaction"],"files": [{"path": "oversized-cursor.html",diff --git a/registry/components/paper-collage-reveal/demo.html b/registry/components/paper-collage-reveal/demo.htmlnew file mode 100644index 0000000000..e25497db42--- /dev/null+++ b/registry/components/paper-collage-reveal/demo.html@@ -0,0 +1,197 @@+<!doctype html>+<!--+ paper-collage-reveal demo. This standalone composition mounts the+ primitive FULL-BLEED through data-composition-src, 7 scraps and scatter+ spread to prove the non-default variable path, and slots a documentary+ title card (type over a topographic contour drawing) so the reveal+ uncovers real content rather than the bare token card the primitive falls+ back to.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Paper Collage Reveal Demo</title>+ <style>+ * {+ margin: 0;+ padding: 0;+ box-sizing: border-box;+ }+ html,+ body {+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #111318;+ }+ #root {+ --bg: #111318;+ --fg: #f2ede2;+ --surface: #fffdf8;+ --accent-2: #b98a4e;+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: var(--bg);+ }+ .mount-bleed {+ position: absolute;+ inset: 0;+ container-type: size;+ overflow: hidden;+ }+ .demo-card {+ position: absolute;+ inset: 0;+ overflow: hidden;+ background: #16241d;+ color: #efe7d6;+ }+ .demo-topo {+ position: absolute;+ inset: 0;+ }+ .demo-topo path {+ fill: none;+ stroke: #c8a86b;+ stroke-opacity: 0.3;+ stroke-width: 1.5;+ }+ .demo-topo .demo-topo-index {+ stroke-opacity: 0.55;+ stroke-width: 2.25;+ }+ .demo-peak {+ position: absolute;+ left: 1402px;+ top: 412px;+ display: flex;+ align-items: center;+ gap: 14px;+ font-family: Inter, sans-serif;+ font-size: 20px;+ font-weight: 500;+ letter-spacing: 0.04em;+ color: #c8a86b;+ }+ .demo-peak::before {+ content: "";+ width: 12px;+ height: 12px;+ border: 2px solid currentColor;+ transform: rotate(45deg);+ }+ .demo-copy {+ position: absolute;+ left: 160px;+ bottom: 150px;+ }+ .demo-eyebrow {+ font-family: Inter, sans-serif;+ font-size: 24px;+ font-weight: 600;+ letter-spacing: 0.16em;+ text-transform: uppercase;+ color: #c8a86b;+ }+ .demo-title {+ margin-top: 36px;+ font-family: "EB Garamond", serif;+ font-size: 160px;+ font-weight: 500;+ line-height: 0.95;+ letter-spacing: -0.015em;+ }+ .demo-meta {+ display: flex;+ gap: 56px;+ width: 760px;+ margin-top: 52px;+ padding-top: 28px;+ border-top: 1px solid rgba(239, 231, 214, 0.28);+ font-family: Inter, sans-serif;+ font-size: 26px;+ font-weight: 500;+ color: rgba(239, 231, 214, 0.72);+ }+ </style>+ </head>+ <body>+ <template data-slot="paper-collage-reveal-content">+ <div class="demo-card">+ <div class="demo-topo" id="demo-topo"></div>+ <div class="demo-peak">Slættaratindur 880 m</div>+ <div class="demo-copy">+ <p class="demo-eyebrow">Field Notes · Episode 03</p>+ <h1 class="demo-title">Forty days<br />on the Faroes</h1>+ <p class="demo-meta"><span>A film by Maren Holm</span><span>18 min</span></p>+ </div>+ </div>+ </template>++ <div+ id="root"+ data-composition-id="paper-collage-reveal-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="2.6"+ data-fps="30"+ >+ <div+ id="paper-collage-reveal-mount"+ class="mount-bleed clip"+ data-composition-id="paper-collage-reveal"+ data-composition-src="./paper-collage-reveal.html"+ data-variable-values='{"panels":7,"tone":"mixed","spread":"scatter"}'+ data-start="0"+ data-duration="2.6"+ data-track-index="0"+ data-width="1920"+ data-height="1080"+ ></div>+ </div>++ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <script>+ (function () {+ // Contour lines of one summit: nested closed rings whose radius+ // wanders with a few fixed sines, so the drawing is deterministic.+ function contours() {+ var paths = "";+ for (var k = 0; k < 16; k += 1) {+ var d = "";+ for (var a = 0; a <= 120; a += 1) {+ var th = (a / 120) * Math.PI * 2;+ var r =+ (34 + k * 46) *+ (1 ++ 0.2 * Math.sin(2 * th + 0.6 + k * 0.09) ++ 0.1 * Math.sin(3 * th + 1.9 - k * 0.07) ++ 0.05 * Math.sin(5 * th + k * 0.35));+ d +=+ (a ? "L" : "M") ++ (1390 + r * Math.cos(th)).toFixed(1) ++ " " ++ (420 + r * 0.82 * Math.sin(th)).toFixed(1);+ }+ paths +=+ '<path d="' + d + 'Z"' + (k % 5 === 4 ? ' class="demo-topo-index"' : "") + "/>";+ }+ return '<svg width="1920" height="1080" viewBox="0 0 1920 1080">' + paths + "</svg>";+ }+ // Elements inside an inert <template> are not in the live document,+ // so they must be reached through the template's own content+ // fragment, never document.getElementById.+ document+ .querySelector('template[data-slot="paper-collage-reveal-content"]')+ .content.getElementById("demo-topo").innerHTML = contours();++ window.__timelines = window.__timelines || {};+ window.__timelines["paper-collage-reveal-demo"] = gsap.timeline({ paused: true });+ })();+ </script>+ </body>+</html>diff --git a/registry/components/paper-collage-reveal/paper-collage-reveal.html b/registry/components/paper-collage-reveal/paper-collage-reveal.htmlnew file mode 100644index 0000000000..ff4316d6ea--- /dev/null+++ b/registry/components/paper-collage-reveal/paper-collage-reveal.html@@ -0,0 +1,441 @@+<!doctype html>+<!--+ paper-collage-reveal: HyperFrames video primitive (transitions / texture).++ A patchwork of torn paper scraps covers the frame. Each scrap has its own+ torn silhouette with a deckled edge, visible grain and a crisp cast shadow.+ On cue they lift away one by one, each on a seeded arc, its shadow growing+ as it rises, uncovering one piece of content underneath. Paper stays opaque.++ The content is a SLOT. Callers supply it by placing an inert template+ anywhere in the HOST page (templates never render, and the runtime wipes+ the host clip's own children on mount, so the slot lives at document level):++ <template data-slot="paper-collage-reveal-content"> ... </template>++ Slot content may be an <img>, a muted <video>, or arbitrary HTML; direct+ img/video children are stretched to cover the stage (packages/producer+ drives a slotted <video>'s own data-start/data-duration exactly like any+ other clip -- this primitive never reads or sets currentTime itself). With+ no slot, the stage renders a flat token card so the reveal reads on its+ own.++ Variables (declared in data-composition-variables below):+ - panels (number 4-8, default 6): how many torn scraps cover the frame.+ - tone ("cream" | "kraft" | "mixed", default "mixed"): paper color per+ scrap. mixed seeds a different tone per scrap for a real scrapbook mix.+ - spread ("outward" | "scatter", default "outward"): outward sends each+ scrap away from the frame center, radially; scatter sends every scrap+ the same general direction with seeded variance, like a gust.++ Envelope, fixed IN with elastic HOLD only (never timeScale):+ IN_BASE = 1.35s first scrap lifts at 0.1s, each leaves in 0.45s, staggered+ HOLD = max(0, D - IN); the revealed content stands alone, still+ If D < IN_BASE, every IN time compresses by D / IN_BASE (no hold).++ Determinism (closed-form field law): there is NO physics state. One+ per-panel table (layout rect, torn silhouette points, tone, rotation,+ exit and arc vectors, stagger start) is computed exactly once during+ synchronous timeline construction from a fixed LCG seed 0x2c6b8f19. Every+ scrap is two GSAP tweens with explicit fromTo endpoints, so any seek order+ lands identical frames. The deckle and grain SVG filters use fixed seeds.+ No Math.random, no wall clock, no requestAnimationFrame.++ Mount contract: the runtime clones only this template. #root fills the+ host box (no data-width/data-height, container-type: size, cqmin units),+ is styled via #root only, and registers one paused timeline under the+ LITERAL "paper-collage-reveal" key.+-->+<html+ lang="en"+ data-composition-id="paper-collage-reveal"+ data-composition-duration="2.6"+ data-composition-variables='[+ { "id": "panels", "type": "number", "role": "content", "label": "Panels", "description": "How many torn paper scraps cover the frame.", "default": 6, "min": 4, "max": 8, "step": 1 },+ { "id": "tone", "type": "enum", "role": "style", "label": "Paper tone", "description": "Color per scrap. Mixed seeds a different tone per scrap for a real scrapbook mix.", "default": "mixed", "options": [{ "value": "cream", "label": "Cream" }, { "value": "kraft", "label": "Kraft" }, { "value": "mixed", "label": "Mixed" }] },+ { "id": "spread", "type": "enum", "role": "motion", "label": "Spread", "description": "Outward sends each scrap away from the frame center. Scatter sends every scrap the same general direction with seeded variance.", "default": "outward", "options": [{ "value": "outward", "label": "Outward" }, { "value": "scatter", "label": "Scatter" }] }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Paper Collage Reveal</title>+ </head>+ <body>+ <template>+ <div id="root" data-composition-id="paper-collage-reveal" data-duration="2.6" 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, #1d1b16);+ font-family: var(--font-display, "Inter", system-ui, sans-serif);+ }++ .pcr-clip {+ position: absolute;+ inset: 0;+ overflow: hidden;+ background: var(--bg, transparent);+ }++ .pcr-content {+ position: absolute;+ inset: 0;+ overflow: hidden;+ }++ .pcr-content > img,+ .pcr-content > video {+ display: block;+ width: 100%;+ height: 100%;+ object-fit: cover;+ }++ .pcr-content-default {+ position: absolute;+ inset: 0;+ display: grid;+ place-items: center;+ background: var(--bg, #111318);+ }++ .pcr-content-default-mark {+ font-size: 4.5cqmin;+ font-weight: 700;+ letter-spacing: 0.28em;+ text-transform: uppercase;+ color: var(--surface, #fffdf8);+ }++ .pcr-scraps {+ position: absolute;+ inset: 0;+ }++ /* Drop-shadow sits outside the clip-path so it is not clipped away;+ --lift (0 resting, 1 gone) grows it as the scrap rises. */+ .pcr-panel {+ --lift: 0;+ position: absolute;+ filter: drop-shadow(+ 0 calc(0.3cqmin + var(--lift) * 2.4cqmin) calc(0.4cqmin + var(--lift) * 2.8cqmin)+ rgba(20, 14, 6, calc(0.42 - var(--lift) * 0.14))+ );+ }++ .pcr-panel-arc,+ .pcr-panel-fill,+ .pcr-panel-grain {+ position: absolute;+ inset: 0;+ }++ .pcr-panel-arc {+ filter: url(#pcr-deckle-filter);+ }++ .pcr-panel-fill {+ background: var(--pcr-panel-color, #f3ecda);+ }++ .pcr-panel-grain {+ filter: url(#pcr-grain-filter);+ mix-blend-mode: multiply;+ }+ </style>++ <div+ id="paper-collage-reveal-clip"+ class="pcr-clip clip"+ data-start="0"+ data-duration="2.6"+ data-track-index="0"+ >+ <svg aria-hidden="true" width="0" height="0" style="position: absolute">+ <defs>+ <!-- Seeded static paper grain: grey noise around 0.95, multiplied+ onto the paper so every tone darkens by the same share. -->+ <filter+ id="pcr-grain-filter"+ x="0%"+ y="0%"+ width="100%"+ height="100%"+ color-interpolation-filters="sRGB"+ >+ <feTurbulence+ type="fractalNoise"+ baseFrequency="0.75"+ numOctaves="3"+ seed="41"+ stitchTiles="stitch"+ />+ <feColorMatrix+ type="matrix"+ values="0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0 0 0 0 1"+ />+ <feComponentTransfer>+ <feFuncR type="linear" slope="0.7" intercept="0.6" />+ <feFuncG type="linear" slope="0.7" intercept="0.6" />+ <feFuncB type="linear" slope="0.7" intercept="0.6" />+ </feComponentTransfer>+ </filter>+ <!-- Deckled edge: seeded noise displaces each scrap's outline+ by a few px, so the cut reads as torn fibre. -->+ <filter id="pcr-deckle-filter" x="-4%" y="-4%" width="108%" height="108%">+ <feTurbulence type="fractalNoise" baseFrequency="0.06" numOctaves="4" seed="7" />+ <feDisplacementMap+ in="SourceGraphic"+ scale="16"+ xChannelSelector="R"+ yChannelSelector="G"+ />+ </filter>+ </defs>+ </svg>++ <div class="pcr-content" id="pcr-content">+ <div class="pcr-content-default">+ <span class="pcr-content-default-mark" aria-hidden="true">Revealed</span>+ </div>+ </div>+ <div class="pcr-scraps" id="pcr-scraps"></div>+ </div>++ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <script>+ (function () {+ "use strict";++ var root = document.getElementById("root");+ var content = document.getElementById("pcr-content");+ var scrapsHost = document.getElementById("pcr-scraps");++ var vars =+ window.__hyperframes && window.__hyperframes.getVariables+ ? window.__hyperframes.getVariables()+ : {};++ var panelsValue = parseInt(vars.panels, 10);+ var PANEL_COUNT = Number.isFinite(panelsValue)+ ? Math.min(8, Math.max(4, panelsValue))+ : 6;++ var tone = vars.tone === "cream" || vars.tone === "kraft" ? vars.tone : "mixed";+ var spread = vars.spread === "scatter" ? "scatter" : "outward";++ var toneColors = {+ cream: "color-mix(in srgb, var(--surface, #fffdf8) 72%, #e8d9ae)",+ kraft: "color-mix(in srgb, var(--accent-2, #b98a4e) 55%, #7d5a34)",+ white: "var(--surface, #fffdf8)",+ };+ var toneKeys = ["cream", "kraft", "white"];++ // Slot. Caller templates live at the host document level (the+ // mount wipes host-clip children, and templates never render).+ var hostDoc = root.ownerDocument;+ var slotTemplate = null;+ try {+ slotTemplate = hostDoc.querySelector(+ 'template[data-slot="paper-collage-reveal-content"]',+ );+ } catch (error) {+ slotTemplate = null;+ }+ if (slotTemplate) {+ var defaultMark = content.querySelector(".pcr-content-default");+ if (defaultMark) defaultMark.remove();+ content.appendChild(hostDoc.importNode(slotTemplate.content, true));+ }++ // Envelope: fixed IN, elastic HOLD, never time-scaled.+ var IN_BASE = 1.35;+ var duration = Math.max(0.001, parseFloat(root.dataset.duration || "2.6"));+ var squeeze = Math.min(1, duration / IN_BASE);+ var FIRST_LIFT = 0.1 * squeeze;+ var PANEL_TRAVEL = 0.45 * squeeze;+ var LAST_START = IN_BASE * squeeze - PANEL_TRAVEL;++ // Everything a scrap needs lives in this table, computed once+ // during synchronous timeline construction from a fixed seed.+ var state = 0x2c6b8f19;+ function next() {+ state = (Math.imul(1664525, state) + 1013904223) >>> 0;+ return state / 4294967296;+ }+ function range(lo, hi) {+ return lo + next() * (hi - lo);+ }++ var COLS_BY_COUNT = { 4: 2, 5: 3, 6: 3, 7: 4, 8: 4 };+ var cols = COLS_BY_COUNT[PANEL_COUNT];+ var rows = Math.ceil(PANEL_COUNT / cols);+ var OVERSCAN = 3.2;++ var scatterBaseAngle = range(75, 105);++ // Torn silhouette: each side wanders by up to TORN_AMP % of the+ // frame at SIDE_STEPS points, so no edge runs straight.+ var TORN_AMP = 1.1;+ var SIDE_STEPS = 6;+ var SIDES = [+ [0, 0, 100, 0, 0, 1],+ [100, 0, 100, 100, -1, 0],+ [100, 100, 0, 100, 0, -1],+ [0, 100, 0, 0, 1, 0],+ ];+ function tornPolygon(w, h) {+ var pts = [];+ SIDES.forEach(function (s) {+ for (var k = 0; k < SIDE_STEPS; k += 1) {+ var t = (k === 0 ? 0 : k + range(-0.3, 0.3)) / SIDE_STEPS;+ var d = range(-TORN_AMP, TORN_AMP);+ var px = s[0] + (s[2] - s[0]) * t + (s[4] * d * 100) / w;+ var py = s[1] + (s[3] - s[1]) * t + (s[5] * d * 100) / h;+ pts.push(px.toFixed(2) + "% " + py.toFixed(2) + "%");+ }+ });+ return pts.join(", ");+ }++ var startGap = (LAST_START - FIRST_LIFT) / Math.max(1, PANEL_COUNT - 1);+ var panels = [];+ for (var i = 0; i < PANEL_COUNT; i += 1) {+ var row = Math.floor(i / cols);+ var panelsInRow = Math.min(cols, PANEL_COUNT - row * cols);+ var colInRow = i % cols;+ var cellW = 100 / panelsInRow;+ var cellH = 100 / rows;++ var jitterX = range(-1, 1);+ var jitterY = range(-1, 1);+ var x = colInRow * cellW - OVERSCAN + jitterX;+ var y = row * cellH - OVERSCAN + jitterY;+ var w = cellW + OVERSCAN * 2;+ var h = cellH + OVERSCAN * 2;++ var poly = tornPolygon(w, h);++ var panelTone =+ tone === "mixed" ? toneKeys[Math.floor(next() * toneKeys.length)] : tone;++ var cx = x + w / 2;+ var cy = y + h / 2;+ var angleDeg;+ if (spread === "outward") {+ var dx = cx - 50;+ var dy = cy - 50;+ angleDeg = (Math.atan2(dy, dx) * 180) / Math.PI;+ } else {+ angleDeg = scatterBaseAngle + range(-45, 45);+ }+ var rad = (angleDeg * Math.PI) / 180;+ var ux = Math.cos(rad);+ var uy = Math.sin(rad);+ var travelPct = 130;+ // The arc: a sideways hop perpendicular to the exit, biased+ // upward, that eases out while the exit eases in.+ var arcAmp = ux > 0 ? -9 : 9;+ var rotation = range(8, 15) * (next() < 0.5 ? -1 : 1);++ // Monotonic starts: the first scrap lifts at FIRST_LIFT, the+ // rest follow in index order with a seeded offset.+ var startAt = i === 0 ? FIRST_LIFT : FIRST_LIFT + (i - range(0, 0.4)) * startGap;++ panels.push({+ x: x,+ y: y,+ w: w,+ h: h,+ poly: poly,+ tone: panelTone,+ exitX: ux * travelPct,+ exitY: uy * travelPct,+ arcX: -uy * arcAmp,+ arcY: ux * arcAmp,+ rotation: rotation,+ startAt: startAt,+ });+ }++ // DOM per scrap: panel (exit, tilt, shadow) > arc (hop, deckle) >+ // fill (torn clip, colour) > grain. Scraps that lift first sit on top.+ var panelFrag = document.createDocumentFragment();+ var panelEls = panels.map(function (p, idx) {+ var el = document.createElement("div");+ el.className = "pcr-panel";+ el.style.left = p.x + "%";+ el.style.top = p.y + "%";+ el.style.width = p.w + "%";+ el.style.height = p.h + "%";+ el.style.zIndex = String(PANEL_COUNT - idx);++ var arc = document.createElement("div");+ arc.className = "pcr-panel-arc";+ var fill = document.createElement("div");+ fill.className = "pcr-panel-fill";+ fill.style.clipPath = "polygon(" + p.poly + ")";+ fill.style.setProperty("--pcr-panel-color", toneColors[p.tone]);+ var grain = document.createElement("div");+ grain.className = "pcr-panel-grain";+ fill.appendChild(grain);+ arc.appendChild(fill);+ el.appendChild(arc);++ panelFrag.appendChild(el);+ return el;+ });+ scrapsHost.appendChild(panelFrag);++ var tl = gsap.timeline({ paused: true });+ panels.forEach(function (p, idx) {+ tl.fromTo(+ panelEls[idx],+ { x: 0, y: 0, rotation: 0, "--lift": 0 },+ {+ x: p.exitX + "cqw",+ y: p.exitY + "cqh",+ rotation: p.rotation,+ "--lift": 1,+ duration: PANEL_TRAVEL,+ ease: "power2.in",+ // 2D transforms only: a composited layer caches the filtered+ // raster by seek history, so the same t can give different pixels.+ force3D: false,+ },+ p.startAt,+ );+ tl.fromTo(+ panelEls[idx].firstChild,+ { x: 0, y: 0 },+ {+ x: p.arcX + "cqmin",+ y: p.arcY + "cqmin",+ duration: PANEL_TRAVEL,+ ease: "power1.out",+ force3D: false,+ },+ p.startAt,+ );+ });+ tl.set({}, {}, duration);+ tl.seek(0);++ window.__timelines = window.__timelines || {};+ window.__timelines["paper-collage-reveal"] = tl;+ })();+ </script>+ </div>+ </template>+ </body>+</html>diff --git a/registry/components/paper-collage-reveal/registry-item.json b/registry/components/paper-collage-reveal/registry-item.jsonnew file mode 100644index 0000000000..174f9020da--- /dev/null+++ b/registry/components/paper-collage-reveal/registry-item.json@@ -0,0 +1,53 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "paper-collage-reveal",+ "type": "hyperframes:component",+ "title": "Paper Collage Reveal",+ "description": "A scrapbook patchwork of torn paper scraps, each with its own texture and tilt, flutters away in a staggered scatter to reveal the content underneath.",+ "tags": ["collage", "scrapbook", "torn paper", "reveal", "transition", "motion-primitive"],+ "files": [+ {+ "path": "paper-collage-reveal.html",+ "target": "compositions/components/paper-collage-reveal.html",+ "type": "hyperframes:snippet"+ }+ ],+ "variables": [+ {+ "id": "panels",+ "type": "number",+ "role": "content",+ "label": "Panels",+ "description": "How many torn paper scraps cover the frame.",+ "default": 6,+ "min": 4,+ "max": 8,+ "step": 1+ },+ {+ "id": "tone",+ "type": "enum",+ "role": "style",+ "label": "Paper tone",+ "description": "Color per scrap. Mixed seeds a different tone per scrap for a real scrapbook mix.",+ "default": "mixed",+ "options": [+ { "value": "cream", "label": "Cream" },+ { "value": "kraft", "label": "Kraft" },+ { "value": "mixed", "label": "Mixed" }+ ]+ },+ {+ "id": "spread",+ "type": "enum",+ "role": "motion",+ "label": "Spread",+ "description": "Outward sends each scrap away from the frame center. Scatter sends every scrap the same general direction with seeded variance.",+ "default": "outward",+ "options": [+ { "value": "outward", "label": "Outward" },+ { "value": "scatter", "label": "Scatter" }+ ]+ }+ ]+}diff --git a/registry/components/press-ripple/README.md b/registry/components/press-ripple/README.mdindex e66a885165..70be7b4c7d 100644--- a/registry/components/press-ripple/README.md+++ b/registry/components/press-ripple/README.md@@ -1,12 +1,12 @@# press-ripple-Product demo payoff primitive: a cursor decel-arrives from off-stage (power2.out,+Product demo payoff primitive: a cursor decel-arrives from off-stage (power3.out,it arrives, it never passes through), lands a few px off-center on a-caller-positioned target zone, target and cursor compress in lockstep, release-with two ink ripple rings, then the cursor exits off-stage the way it came. The-pressed state and the ripple aftermath hold dead-still to the end of the clip;-the cursor never occludes the label during the hold. 3s authored, elastic HOLD-(never time-scaled).+caller-positioned target zone, target and cursor compress in lockstep, two small+click rings grow from the cursor tip while the label swaps to a check plus+`done_label`, then the cursor exits off-stage the way it came. The confirmed+state holds dead-still to the end of the clip; the cursor never occludes the+label during the hold. 2.4s authored, elastic HOLD (never time-scaled).## Mounting@@ -17,28 +17,30 @@ the cursor never occludes the label during the hold. 3s authored, elastic HOLDdata-composition-src="./components/press-ripple.html"data-variable-values='{"label":"Approve run","target_x":62,"target_y":58,"accent":"blue"}'data-start="0"- data-duration="3"+ data-duration="2.4"data-track-index="0"></div>```## Variables-| id | type | default | notes |-| -------- | ------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |-| label | string | "Get started" | Text in the default pill. Ignored when the slot is replaced. |-| target_x | number | 50 | Zone center, percent of host width (8 to 92). |-| target_y | number | 50 | Zone center, percent of host height (8 to 92). |-| press_at | number | 1.4 | Seconds from mount start when the compression begins. Clamped so the press tail (release, ripple, cursor exit, ~1.05s) and any exit stay inside the clip duration. |-| cursor | enum | light | light (white pointer, dark stroke) or dark (inverse). |-| accent | enum | green | green maps to --brand, blue to --accent, violet to --accent-2. Colors the ripple ink and the pressed fill. |-| exit | enum | none | none holds the pressed state (frame roots own transitions); fade or up add a 0.45s departure. |+| id | type | default | notes |+| ---------- | ------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| label | string | "Get started" | Text in the default pill. Ignored when the slot is replaced. |+| done_label | string | "Saved" | Text beside the check once the default pill is pressed. Keep it no wider than `label`; the pill keeps the label's width. |+| target_x | number | 50 | Zone center, percent of host width (8 to 92). |+| target_y | number | 50 | Zone center, percent of host height (8 to 92). |+| press_at | number | 0.9 | Seconds from mount start when the compression begins. Clamped so the press tail (release, rings, cursor exit, 0.8s) and any exit stay inside the clip duration. |+| cursor | enum | light | light (white pointer, dark stroke) or dark (inverse). |+| accent | enum | green | green maps to --brand, blue to --accent, violet to --accent-2. Colors the click rings and the confirmation check. |+| exit | enum | none | none holds the pressed state (frame roots own transitions); fade or up add a 0.45s departure. |## Target slotThe element marked `data-slot="target"` is the press surface. Its default childis a token-styled pill (`--surface` body, `--border` edge, `--font-body` at-weight 600) carrying `label`. Replace the slot's children in your installed copy+weight 600) carrying `label`, and a check plus `done_label` layered over it.+The pill keeps its fill when pressed; only the label changes. Replace the slot's children in your installed copyto press anything else: an icon button, a card, a toggle.The slot wrapper flips `data-state="idle"` to `data-state="pressed"` at the@@ -54,17 +56,19 @@ key its own pressed look off that attribute, mirroring the default rule:## Choreography- 0.00s: target settles in (fade + short rise, power3.out).-- press_at - 0.94s: cursor departs off-stage bottom-right, decelerating the- whole way, tip landing slightly below-right of the zone center (human aim).+- press_at - 0.6s: cursor departs off-stage bottom-right (0.45s, power3.out),+ tip landing slightly below-right of the zone center (human aim), then a+ 0.15s dwell.- press_at: target and cursor compress to 0.93 in lockstep (cursor scalesabout its tip).-- press_at + 0.12s: pressed state lands; release springs back (back.out) while- two thick ink rings (accent mixed toward `--fg` for contrast) ripple out from- under the slot, 0.11s apart.-- press_at + 0.5s: the cursor exits off-stage bottom-right (power2.in,+- press_at + 0.12s: pressed state lands; release springs back (back.out). Two+ 2px accent rings grow from the cursor tip, 16px to 72px radius at 1920 wide+ (320ms, power2.out), the second 60ms behind at 60% opacity. The label swaps+ to a check plus `done_label` (scale 0.3 to 1, blur 3px to 0, 300ms).+- press_at + 0.4s: the cursor exits off-stage bottom-right (0.4s, power2.in,accelerating away), clearing the label before the hold begins.-- HOLD: dead still on the pressed state, elastic with the clip duration; the- pressed control and the ripple aftermath carry the frame, cursor gone.+- HOLD: dead still on the confirmed state, elastic with the clip duration,+ cursor gone.Sync point `press` fires the moment compression starts; align SFX or adownstream reveal to it.diff --git a/registry/components/press-ripple/demo.html b/registry/components/press-ripple/demo.htmlindex 8d33add162..642ab65aea 100644--- a/registry/components/press-ripple/demo.html+++ b/registry/components/press-ripple/demo.html@@ -2,9 +2,8 @@<!--press-ripple demo. Control-feedback story (distinct from oversized-cursor'scursor-journey beat): the press happens early (0.9s), the cursor exits the- frame right after the release, and the pressed control + the ripple- aftermath carry the remaining hold. The subject is the control's state- change, not the pointer.+ frame right after the release, and the confirmed control carries the+ remaining hold. The subject is the control's state change, not the pointer.--><html lang="en"><head>@@ -23,22 +22,22 @@width: 1920px;height: 1080px;overflow: hidden;- background: var(--bg, #f4f6f9);+ background: var(--bg, #f4f4f5);}#root {- --bg: #f4f6f9;+ --bg: #f4f4f5;--fg: #14161b;--surface: #ffffff;--border: #dfe4ec;- --brand: #1d4ed8;+ --brand: #0a84ff;--accent: #0284c7;--font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;position: relative;width: 1920px;height: 1080px;overflow: hidden;- background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, var(--bg, #f4f6f9) 70%);+ background: var(--bg);}.mount-stage {@@ -58,7 +57,7 @@data-start="0"data-width="1920"data-height="1080"- data-duration="3"+ data-duration="2.4"data-fps="30"><div@@ -66,9 +65,9 @@class="mount-stage clip"data-composition-id="press-ripple"data-composition-src="./press-ripple.html"- data-variable-values='{"label":"Save changes","target_x":50,"target_y":52,"press_at":0.9,"cursor":"dark","accent":"green"}'+ data-variable-values='{"label":"Save changes","target_x":50,"target_y":52,"press_at":0.9,"cursor":"light","accent":"green"}'data-start="0"- data-duration="3"+ data-duration="2.4"data-track-index="0"data-width="1920"data-height="1080"diff --git a/registry/components/press-ripple/press-ripple.html b/registry/components/press-ripple/press-ripple.htmlindex e4a7d8a1b6..41f2d38869 100644--- a/registry/components/press-ripple/press-ripple.html+++ b/registry/components/press-ripple/press-ripple.html@@ -2,11 +2,12 @@<!--press-ripple: HyperFrames video primitive (product demo / payoff)- A cursor decel-arrives from off-stage (power2.out, it arrives, never passes+ A cursor decel-arrives from off-stage (power3.out, it arrives, never passesthrough), lands a few px off-center on a caller-positioned target zone, the- target and cursor compress in lockstep, release with two ink ripple rings,- then the cursor exits off-stage the way it came. The pressed state and the- ripple aftermath carry the hold; the cursor never camps on the label.+ target and cursor compress in lockstep, two small click rings grow from the+ cursor tip while the label swaps to a check plus the done label, then the+ cursor exits off-stage the way it came. The confirmed state carries the hold;+ the cursor never camps on the label.The target is a slot: the element marked data-slot="target" is the presssurface. Its default content is a token-styled pill carrying the label@@ -16,10 +17,11 @@Variables:label: text inside the default pill (ignored when the slot is replaced)+ done_label: text beside the check after the press (default pill only)target_x, target_y: zone center as a percent of the host boxpress_at: seconds from mount start when the compression beginscursor: light or dark pointer- accent: green, blue, or violet ink (ripple rings + pressed pill fill)+ accent: green, blue, or violet ink (click rings + confirmation check)exit: none, fade, or up (default none; holds end films)Envelope (elastic HOLD, never time-scaled):@@ -28,7 +30,7 @@OUT = none by default; 0.45s fade or fade-up when exit is setpress_at clamps into the window that keeps the whole gesture inside D.- Sync point: the press lands at press_at (default 1.4s).+ Sync point: the press lands at press_at (default 0.9s).Mount contract: the runtime clones only this template. #root fills the hostbox, establishes the container query basis, has no data-width or data-height,@@ -37,14 +39,15 @@<htmllang="en"data-composition-id="press-ripple"- data-composition-duration="3"+ data-composition-duration="2.4"data-composition-variables='[{ "id": "label", "type": "string", "role": "content", "label": "Label", "description": "Text inside the default pill target.", "default": "Get started" },+ { "id": "done_label", "type": "string", "role": "content", "label": "Done label", "description": "Text beside the check once the default pill is pressed.", "default": "Saved" },{ "id": "target_x", "type": "number", "role": "layout", "label": "Target X", "description": "Zone center, percent of host width.", "default": 50, "min": 8, "max": 92, "step": 1, "unit": "%" },{ "id": "target_y", "type": "number", "role": "layout", "label": "Target Y", "description": "Zone center, percent of host height.", "default": 50, "min": 8, "max": 92, "step": 1, "unit": "%" },- { "id": "press_at", "type": "number", "role": "timing", "label": "Press at", "description": "Seconds from mount start when the press begins.", "default": 1.4, "min": 0.9, "max": 10, "step": 0.1, "unit": "s" },+ { "id": "press_at", "type": "number", "role": "timing", "label": "Press at", "description": "Seconds from mount start when the press begins.", "default": 0.9, "min": 0.9, "max": 10, "step": 0.1, "unit": "s" },{ "id": "cursor", "type": "enum", "role": "style", "label": "Cursor", "description": "Pointer tone.", "default": "light", "options": [{ "value": "light", "label": "Light" }, { "value": "dark", "label": "Dark" }] },- { "id": "accent", "type": "enum", "role": "style", "label": "Accent", "description": "Contract color for the ripple ink and pressed fill.", "default": "green", "options": [{ "value": "green", "label": "Green" }, { "value": "blue", "label": "Blue" }, { "value": "violet", "label": "Violet" }] },+ { "id": "accent", "type": "enum", "role": "style", "label": "Accent", "description": "Contract color for the click rings and the confirmation check.", "default": "green", "options": [{ "value": "green", "label": "Green" }, { "value": "blue", "label": "Blue" }, { "value": "violet", "label": "Violet" }] },{ "id": "exit", "type": "enum", "role": "style", "label": "Exit", "description": "How the frame leaves. None holds the pressed state.", "default": "none", "options": [{ "value": "none", "label": "None" }, { "value": "fade", "label": "Fade" }, { "value": "up", "label": "Fade up" }] }]'>@@ -54,7 +57,7 @@</head><body><template>- <div id="root" data-composition-id="press-ripple" data-duration="3" data-fps="30">+ <div id="root" data-composition-id="press-ripple" data-duration="2.4" data-fps="30"><style>*,*::before,@@ -94,22 +97,19 @@transform: translate(-50%, -50%);}- /* Ink ripple rings, centered under the slot, hidden until release.- The ink mixes the accent toward --fg so the rings carry real- weight against the host background on both light and dark- themes; thickness reads as drawn ink, not a hairline. */- .pr-ring {+ /* Click rings around the cursor tip; the script sets cx/cy/r in px. */+ .pr-rings {position: absolute;- left: 50%;- top: 50%;- width: 20cqmin;- height: 20cqmin;- margin: -10cqmin 0 0 -10cqmin;- border: 0.85cqmin solid- color-mix(in srgb, var(--pr-accent, #71f5a7) 72%, var(--fg, #f8fafc));- border-radius: 50%;+ inset: 0;+ width: 100%;+ height: 100%;+ overflow: visible;+ }++ .pr-ring {+ fill: none;+ stroke: var(--pr-accent, #71f5a7);opacity: 0;- will-change: transform, opacity;}/* GSAP owns this wrapper's opacity/y (entrance) and scale (press). */@@ -119,6 +119,7 @@}.pr-pill {+ position: relative;display: inline-flex;align-items: center;padding: var(--space-2, 2.6cqmin) calc(var(--space-2, 2.6cqmin) * 2.1);@@ -134,25 +135,40 @@white-space: nowrap;}- .pr-target-slot[data-state="pressed"] .pr-pill {- border-color: color-mix(in srgb, var(--pr-accent, #71f5a7) 72%, var(--fg, #f8fafc));- background: var(--pr-accent, #71f5a7);- color: var(--bg, #0b0c0e);+ /* The label stays in flow so the pill keeps its width; the done+ state is layered over it and cross-fades in. */+ .pr-label {+ display: inline-block;+ }++ .pr-done {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.3em;+ opacity: 0;+ }++ .pr-check {+ width: 0.9em;+ height: 0.9em;+ fill: none;+ stroke: var(--pr-accent, #71f5a7);+ stroke-width: 3;+ stroke-linecap: round;+ stroke-linejoin: round;}- /* Pointer: SVG tip sits exactly at this box's top-left corner, so- the box position places the tip itself. GSAP moves it with x/y- transforms only (never left/top: layout props snap to integer- device pixels under the seek-by-frame capture engine) and scales- it about the tip (press). */+ /* Pointer: the script sizes the box and offsets it so the arrow tip+ sits at the stage origin; GSAP x/y then place the tip itself and+ the press scales about it. */.pr-cursor {position: absolute;left: 0;top: 0;- width: 7cqmin;- height: 7cqmin;- transform-origin: 0 0;- filter: drop-shadow(0 0.4cqmin 0.9cqmin rgba(2, 6, 23, 0.45));+ filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));will-change: transform, opacity;}@@ -167,25 +183,33 @@id="press-ripple-clip"class="pr-clip clip"data-start="0"- data-duration="3"+ data-duration="2.4"data-track-index="0"><div class="pr-stage"><div class="pr-zone">- <div class="pr-ring" aria-hidden="true"></div>- <div class="pr-ring" aria-hidden="true"></div><div class="pr-actor"><div class="pr-target-slot" data-slot="target" data-state="idle">- <span class="pr-pill"></span>+ <span class="pr-pill"+ ><span class="pr-label"></span+ ><span class="pr-done"+ ><svg class="pr-check" viewBox="0 0 24 24" aria-hidden="true">+ <path d="M5 12.5 L9.5 17 L19 7.5"></path></svg+ ><span class="pr-done-text"></span></span+ ></span></div></div></div>+ <svg class="pr-rings" aria-hidden="true">+ <circle class="pr-ring"></circle>+ <circle class="pr-ring"></circle>+ </svg><div class="pr-cursor" aria-hidden="true">- <svg viewBox="0 0 20 20">+ <svg viewBox="0 0 24 24"><pathclass="pr-cursor-path"- d="M0.6 0.6 L0.6 14.6 L4.4 11.3 L6.7 16.8 L9.4 15.6 L7.1 10.2 L12.4 9.8 Z"- stroke-width="1.1"+ d="M5 3 L5 19 L9 15 L12 22 L15 20.5 L11.5 14 L18 14 Z"+ stroke-width="1.4"stroke-linejoin="round"></path></svg>@@ -200,11 +224,11 @@var root = document.getElementById("root");var stage = root.querySelector(".pr-stage");- var zone = root.querySelector(".pr-zone");var rings = root.querySelectorAll(".pr-ring");var actor = root.querySelector(".pr-actor");var slot = root.querySelector(".pr-target-slot");- var pill = root.querySelector(".pr-pill");+ var label = root.querySelector(".pr-label");+ var done = root.querySelector(".pr-done");var cursor = root.querySelector(".pr-cursor");var cursorPath = root.querySelector(".pr-cursor-path");@@ -219,8 +243,12 @@return Math.min(max, Math.max(min, n));}- var labelText =- vars.label == null ? "Get started" : String(vars.label).trim().replace(/\s+/g, " ");+ function text(value, fallback) {+ return value == null ? fallback : String(value).trim().replace(/\s+/g, " ");+ }++ var labelText = text(vars.label, "Get started");+ var doneText = text(vars.done_label, "Saved");var targetX = num(vars.target_x, 50, 8, 92);var targetY = num(vars.target_y, 50, 8, 92);var cursorTone = vars.cursor === "dark" ? "dark" : "light";@@ -248,28 +276,29 @@accentColors.blue = "#61a8ff";}- pill.textContent = labelText;+ label.textContent = labelText;+ root.querySelector(".pr-done-text").textContent = doneText;root.style.setProperty("--pr-accent", accentColors[accent]);root.style.setProperty("--pr-x", String(targetX));root.style.setProperty("--pr-y", String(targetY));if (cursorTone === "dark") {- cursorPath.setAttribute("fill", "#111827");- cursorPath.setAttribute("stroke", "#f8fafc");+ cursorPath.setAttribute("fill", "#141414");+ cursorPath.setAttribute("stroke", "#ffffff");} else {- cursorPath.setAttribute("fill", "#f8fafc");- cursorPath.setAttribute("stroke", "#0f172a");+ cursorPath.setAttribute("fill", "#ffffff");+ cursorPath.setAttribute("stroke", "#141414");}- var duration = Math.max(0.001, parseFloat(root.dataset.duration || "3"));+ var duration = Math.max(0.001, parseFloat(root.dataset.duration || "2.4"));var OUT = exit === "none" ? 0 : 0.45;- // The whole press tail (compress + release ripple + cursor exit)- // is ~1.05s; keep it inside D, then keep the OUT window after it.- var pressAt = num(vars.press_at, 1.4, 0.9, Math.max(0.9, duration - 1.05 - OUT));+ // Press to cursor gone; keep it inside D, then the OUT window after it.+ var TAIL = 0.8;+ var pressAt = num(vars.press_at, 0.9, 0.9, Math.max(0.9, duration - TAIL - OUT));// Human aim: the tip lands a few px off the zone's true center.var landX = targetX + 0.55;var landY = targetY + 0.85;- var arriveEnd = pressAt - 0.16;- var arriveStart = Math.max(0, arriveEnd - 0.78);+ var arriveEnd = pressAt - 0.15;+ var arriveStart = arriveEnd - 0.45;// Motion runs on transforms only (x/y px), never left/top: layout// props snap to integer device pixels under the seek-by-frame@@ -285,6 +314,21 @@return (percent / 100) * stageH;}+ // Sizes are authored at 1920 wide and scale with the stage.+ var u = stageW / 1920;+ var ARROW = 64 * u;+ cursor.style.width = cursor.style.height = ARROW + "px";+ cursor.style.left = (-5 / 24) * ARROW + "px";+ cursor.style.top = (-3 / 24) * ARROW + "px";+ cursor.style.transformOrigin = (5 / 24) * ARROW + "px " + (3 / 24) * ARROW + "px";++ for (var i = 0; i < rings.length; i++) {+ rings[i].setAttribute("cx", xAt(landX));+ rings[i].setAttribute("cy", yAt(landY));+ rings[i].setAttribute("r", 16 * u);+ rings[i].setAttribute("stroke-width", 2 * u);+ }+var tl = gsap.timeline({ paused: true });// IN: target settles in.@@ -295,8 +339,8 @@0,);- // Cursor decel-arrives from off-stage bottom-right. power2.out to- // an exact endpoint: it arrives, it never passes through.+ // Cursor decel-arrives from off-stage bottom-right to an exact+ // endpoint: it arrives, it never passes through.tl.fromTo(cursor,{ x: xAt(114), y: yAt(112) },@@ -304,7 +348,7 @@x: xAt(landX),y: yAt(landY),duration: arriveEnd - arriveStart,- ease: "power2.out",+ ease: "power3.out",},arriveStart,);@@ -319,44 +363,61 @@pressAt + 0.14,);- // Ink ripple rings from under the slot: real weight (thick ink,- // fg-mixed contrast, wide travel), still just two rings.+ // Click: two rings grow from the tip, the second 60ms behind and fainter.+ // Opacity fades late so the ring stays readable while it grows.+ [1, 0.6].forEach(function (peak, i) {+ var at = pressAt + 0.12 + i * 0.06;+ var ring = { duration: 0.32, immediateRender: false };+ tl.fromTo(+ rings[i],+ { attr: { r: 16 * u } },+ Object.assign({ attr: { r: 72 * u }, ease: "power2.out" }, ring),+ at,+ );+ tl.fromTo(+ rings[i],+ { opacity: peak },+ Object.assign({ opacity: 0, ease: "power1.in" }, ring),+ at,+ );+ });++ // Confirm: the label cross-fades to check + done label (icon swap).+ var swap = { duration: 0.3, ease: "power3.out", immediateRender: false };tl.fromTo(- rings,- { scale: 0.16, autoAlpha: 0.95 },- {- scale: 2.6,- autoAlpha: 0,- duration: 0.66,- ease: "power2.out",- stagger: 0.11,- immediateRender: false,- },- pressAt + 0.1,+ label,+ { scale: 1, opacity: 1, filter: "blur(0px)" },+ Object.assign({ scale: 0.3, opacity: 0, filter: "blur(3px)" }, swap),+ pressAt + 0.12,+ );+ tl.fromTo(+ done,+ { scale: 0.3, opacity: 0, filter: "blur(3px)" },+ Object.assign({ scale: 1, opacity: 1, filter: "blur(0px)" }, swap),+ pressAt + 0.12,);- // The cursor exits off-stage after the release (accelerating,- // power2.in) so it never occludes the label during the hold; the- // pressed state and the ripple aftermath carry the frame. Both- // endpoints are explicit so reverse seeks restore the landing.+ // The cursor exits off-stage (accelerating) so it never occludes the+ // label during the hold. Both endpoints are explicit so reverse+ // seeks restore the landing.tl.fromTo(cursor,{ x: xAt(landX), y: yAt(landY) },{x: xAt(112),y: yAt(110),- duration: 0.55,+ duration: 0.4,ease: "power2.in",immediateRender: false,},- pressAt + 0.5,+ pressAt + 0.4,);// HOLD: dead-still on the pressed state; elastic with D.// OUT: only when the host opts in; frame roots own transitions.if (exit !== "none") {- var outStart = Math.max(pressAt + 1.05, duration - OUT);+ var outStart = Math.max(pressAt + TAIL, duration - OUT);var outVars = { opacity: 0, duration: OUT, ease: "power2.in" };if (exit === "up") outVars.y = "-4cqh";tl.to(stage, outVars, outStart);diff --git a/registry/components/press-ripple/registry-item.json b/registry/components/press-ripple/registry-item.jsonindex 0fe7aeb80c..b26bcbee94 100644--- a/registry/components/press-ripple/registry-item.json+++ b/registry/components/press-ripple/registry-item.json@@ -3,13 +3,13 @@"name": "press-ripple","type": "hyperframes:component","title": "Press Ripple",- "description": "A cursor decel-arrives from off-stage, lands slightly off-center on a caller-positioned target, compresses with it in lockstep, releases with ink ripple rings, then exits off-stage while the pressed state holds.",- "tags": ["motion-primitive", "product-demo", "cursor", "press", "ripple", "payoff"],+ "description": "A cursor decel-arrives from off-stage, lands slightly off-center on a caller-positioned target, compresses with it in lockstep, releases with two small click rings while the label swaps to a check, then exits off-stage while the confirmed state holds.",+ "tags": ["cursor", "motion-primitive", "product-demo", "press", "ripple", "payoff"],"jobs": ["demonstrate"],"family": "product-demo","profile": "payoff","evidence": "Wave J J1-1: the recurring launch-film press mechanic (decelerating cursor arrival, lockstep compression, ink ripple release) generalized behind a target slot",- "syncPoints": [{ "id": "press", "phase": "in", "offset": 1.4 }],+ "syncPoints": [{ "id": "press", "phase": "in", "offset": 0.9 }],"files": [{"path": "press-ripple.html",@@ -26,6 +26,14 @@"description": "Text inside the default pill target.","default": "Get started"},+ {+ "id": "done_label",+ "type": "string",+ "role": "content",+ "label": "Done label",+ "description": "Text beside the check once the default pill is pressed.",+ "default": "Saved"+ },{"id": "target_x","type": "number",@@ -56,7 +64,7 @@"role": "timing","label": "Press at","description": "Seconds from mount start when the press begins.",- "default": 1.4,+ "default": 0.9,"min": 0.9,"max": 10,"step": 0.1,@@ -79,7 +87,7 @@"type": "enum","role": "style","label": "Accent",- "description": "Contract color for the ripple ink and pressed fill.",+ "description": "Contract color for the click rings and the confirmation check.","default": "green","options": [{ "value": "green", "label": "Green" },diff --git a/registry/components/simulated-cursor/demo.html b/registry/components/simulated-cursor/demo.htmldeleted file mode 100644index 0e17077584..0000000000--- a/registry/components/simulated-cursor/demo.html+++ /dev/null@@ -1,237 +0,0 @@-<!doctype html>-<html lang="en">- <head>- <meta charset="UTF-8" />- <meta name="viewport" content="width=1920, height=1080" />- <title>Simulated Cursor - Demo</title>- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>- <style>- * {- box-sizing: border-box;- }- html,- body {- margin: 0;- width: 1920px;- height: 1080px;- overflow: hidden;- }- #demo {- position: relative;- width: 1920px;- height: 1080px;- background: #ecf1f3;- font-family: Inter, system-ui, sans-serif;- display: grid;- place-items: center;- color: #152026;- }- .demo-frame {- /* ponytail: zoom on wrapper so GSAP can freely animate .card transform */- zoom: 1.5;- }- .card {- width: 880px;- padding: 72px;- background: white;- border: 1px solid #dce4e8;- border-radius: 16px;- box-shadow: 0 24px 70px rgba(37, 55, 66, 0.1);- }- .title {- font-size: 64px;- font-weight: 850;- letter-spacing: -0.03em;- }- .button {- margin-top: 48px;- display: inline-flex;- padding: 22px 36px;- background: #141a20;- color: white;- font-size: 28px;- font-weight: 760;- border-radius: 10px;- }- .hf-simulated-cursor {- --hf-cursor-x: 420px;- --hf-cursor-y: 360px;- position: absolute;- left: 0;- top: 0;- width: 44px;- height: 44px;- transform: translate3d(var(--hf-cursor-x), var(--hf-cursor-y), 0);- pointer-events: none;- z-index: 999;- filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.24));- }- .hf-simulated-cursor-pulse {- position: absolute;- left: 9px;- top: 9px;- width: 22px;- height: 22px;- border: 2px solid rgba(20, 26, 32, 0.75);- border-radius: 999px;- opacity: 0;- transform: scale(0.2);- }- </style>- </head>- <body>- <div- id="demo"- data-composition-id="simulated-cursor-demo"- data-width="1920"- data-height="1080"- data-duration="5"- >- <div class="demo-frame">- <div class="card">- <div class="title">Point at the action without screen recording.</div>- <div class="button">Generate video</div>- </div>- </div>- <div- class="hf-simulated-cursor"- aria-hidden="true"- data-composition-variables='[- {"id": "size", "type": "number", "role": "layout", "label": "Size", "description": "Height and width of the pointer in pixels. The click ring scales with it. Values outside the range clamp to the nearest end and anything that is not a number falls back to 44.", "default": 44, "min": 20, "max": 120, "step": 2, "unit": "px"},- {"id": "tone", "type": "enum", "role": "style", "label": "Tone", "description": "Pointer fill and click ring colour: light reads on dark screens, dark reads on light ones, accent rides --hf-ui-accent.", "default": "light", "options": [{"value": "light", "label": "Light"}, {"value": "dark", "label": "Dark"}, {"value": "accent", "label": "Accent"}]},- {"id": "pulse", "type": "enum", "role": "style", "label": "Click ring", "description": "Weight of the ring the click animation expands: subtle is a thin small ring, bold a thick wide one, none removes the ring entirely.", "default": "standard", "options": [{"value": "subtle", "label": "Subtle"}, {"value": "standard", "label": "Standard"}, {"value": "bold", "label": "Bold"}, {"value": "none", "label": "None"}]}- ]'- >- <div class="hf-simulated-cursor-pulse"></div>- <svg- viewBox="0 0 24 24"- width="34"- height="34"- style="filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.3))"- >- <path- d="M5.5 3.2 L5.5 19.6 L9.7 15.7 L12.5 21.9 L15.0 20.7 L12.3 14.6 L17.9 14.2 Z"- fill="#18181b"- stroke="#ffffff"- stroke-width="1.5"- stroke-linejoin="round"- />- </svg>- </div>- <script>- (function () {- "use strict";-- var vars =- window.__hyperframes && window.__hyperframes.getVariables- ? window.__hyperframes.getVariables()- : {};-- // Unrecognised or out-of-range overrides return to their declared defaults.- function pick(table, value, fallback) {- return Object.prototype.hasOwnProperty.call(table, value) ? value : fallback;- }-- var tones = {- light: {- fill: "#ffffff",- edge: "rgba(0, 0, 0, 0.45)",- ring: "rgba(255, 255, 255, 0.85)",- },- dark: {- fill: "#18181b",- edge: "rgba(255, 255, 255, 0.75)",- ring: "rgba(24, 24, 27, 0.75)",- },- accent: {- fill: "var(--hf-ui-accent, #3ce6ac)",- edge: "rgba(0, 0, 0, 0.45)",- ring: "var(--hf-ui-accent, #3ce6ac)",- },- };- var pulses = {- subtle: { size: "18px", width: "1px", display: "block" },- standard: { size: "22px", width: "2px", display: "block" },- bold: { size: "28px", width: "3px", display: "block" },- none: { size: "22px", width: "2px", display: "none" },- };-- var size = typeof vars.size === "number" ? vars.size : parseFloat(vars.size);- if (!isFinite(size)) size = 44;- size = Math.min(120, Math.max(20, size));-- var tone = tones[pick(tones, vars.tone, "light")];- var pulse = pulses[pick(pulses, vars.pulse, "standard")];-- var roots = document.querySelectorAll(".hf-simulated-cursor");- for (var i = 0; i < roots.length; i += 1) {- var root = roots[i];- root.style.setProperty("--hf-cursor-scale", String(size / 44));- root.style.setProperty("--hf-cursor-fill", tone.fill);- root.style.setProperty("--hf-cursor-edge", tone.edge);- root.style.setProperty("--hf-cursor-ring", tone.ring);- root.style.setProperty("--hf-cursor-ring-size", pulse.size);- root.style.setProperty("--hf-cursor-ring-width", pulse.width);- root.style.setProperty("--hf-cursor-ring-display", pulse.display);- }- })();- </script>- <script>- const tl = gsap.timeline({ paused: true });- tl.from(".card", { opacity: 0, y: 30, duration: 0.6, ease: "power3.out" }, 0.2);- tl.to(- ".hf-simulated-cursor",- {- "--hf-cursor-x": "1030px",- "--hf-cursor-y": "620px",- duration: 1,- ease: "power2.inOut",- },- 1.0,- );- tl.fromTo(- ".hf-simulated-cursor-pulse",- { opacity: 0.8, scale: 0.2 },- { opacity: 0, scale: 2.4, duration: 0.45, ease: "power2.out" },- 2.02,- );- window.__timelines = window.__timelines || {};- window.__timelines["simulated-cursor-demo"] = tl;- </script>- </div>- <style>- .hf-simulated-cursor {- position: absolute;- left: 0;- top: 0;- width: calc(44px * var(--hf-cursor-scale, 1));- height: calc(44px * var(--hf-cursor-scale, 1));- transform: translate3d(var(--hf-cursor-x, 0px), var(--hf-cursor-y, 0px), 0);- pointer-events: none;- z-index: 999;- filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.24));- }- .hf-simulated-cursor svg {- width: 100%;- height: 100%;- }- .hf-simulated-cursor svg path {- fill: var(--hf-cursor-fill, #ffffff);- stroke: var(--hf-cursor-edge, rgba(0, 0, 0, 0.45));- }- .hf-simulated-cursor-pulse {- display: var(--hf-cursor-ring-display, block);- position: absolute;- left: calc((20px - var(--hf-cursor-ring-size, 22px) / 2) * var(--hf-cursor-scale, 1));- top: calc((20px - var(--hf-cursor-ring-size, 22px) / 2) * var(--hf-cursor-scale, 1));- width: calc(var(--hf-cursor-ring-size, 22px) * var(--hf-cursor-scale, 1));- height: calc(var(--hf-cursor-ring-size, 22px) * var(--hf-cursor-scale, 1));- border: calc(var(--hf-cursor-ring-width, 2px) * var(--hf-cursor-scale, 1)) solid- var(--hf-cursor-ring, rgba(255, 255, 255, 0.85));- border-radius: 999px;- opacity: 0;- transform: scale(0.2);- }- </style>- </body>-</html>diff --git a/registry/components/simulated-cursor/registry-item.json b/registry/components/simulated-cursor/registry-item.jsondeleted file mode 100644index 1ff68b70fd..0000000000--- a/registry/components/simulated-cursor/registry-item.json+++ /dev/null@@ -1,80 +0,0 @@-{- "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",- "name": "simulated-cursor",- "type": "hyperframes:component",- "title": "Simulated Cursor",- "description": "A lightweight cursor pointer and click pulse for product walkthroughs and agent UI demos",- "tags": ["video-primitive", "motion-primitive", "cursor", "ui", "walkthrough"],- "files": [- {- "path": "simulated-cursor.html",- "target": "compositions/components/simulated-cursor.html",- "type": "hyperframes:snippet"- }- ],- "variables": [- {- "id": "size",- "type": "number",- "role": "layout",- "label": "Size",- "description": "Height and width of the pointer in pixels. The click ring scales with it. Values outside the range clamp to the nearest end and anything that is not a number falls back to 44.",- "default": 44,- "min": 20,- "max": 120,- "step": 2,- "unit": "px"- },- {- "id": "tone",- "type": "enum",- "role": "style",- "label": "Tone",- "description": "Pointer fill and click ring colour: light reads on dark screens, dark reads on light ones, accent rides --hf-ui-accent.",- "default": "light",- "options": [- {- "value": "light",- "label": "Light"- },- {- "value": "dark",- "label": "Dark"- },- {- "value": "accent",- "label": "Accent"- }- ]- },- {- "id": "pulse",- "type": "enum",- "role": "style",- "label": "Click ring",- "description": "Weight of the ring the click animation expands: subtle is a thin small ring, bold a thick wide one, none removes the ring entirely.",- "default": "standard",- "options": [- {- "value": "subtle",- "label": "Subtle"- },- {- "value": "standard",- "label": "Standard"- },- {- "value": "bold",- "label": "Bold"- },- {- "value": "none",- "label": "None"- }- ]- }- ],- "preview": {- "poster": "https://static.heygen.ai/hyperframes-oss/docs/images/catalog/components/simulated-cursor.png"- }-}diff --git a/registry/components/simulated-cursor/simulated-cursor.html b/registry/components/simulated-cursor/simulated-cursor.htmldeleted file mode 100644index c1c74ac877..0000000000--- a/registry/components/simulated-cursor/simulated-cursor.html+++ /dev/null@@ -1,141 +0,0 @@-<!--- Simulated Cursor - pointer and click pulse primitive.-- Paste the markup, CSS and script once, then animate .hf-simulated-cursor- with x/y values in your paused GSAP timeline. Trigger the click pulse by- scaling/fading .hf-simulated-cursor-pulse.-- Variables. The script reads each one, falls back to the declared default on- anything missing or invalid, and writes the result as a custom property the- CSS above consumes. The timeline recipe below is untouched by them: it keeps- driving the pointer position and the ring scale and fade.-- - size (number 20 to 120, step 2, unit px, default 44): height and width of- the pointer. The click ring, its offset and its border scale with it, so- the tip stays anchored at the animated x/y. Values below 20 clamp to 20,- values above 120 clamp to 120, and anything that is not a number falls- back to 44.- - tone (light | dark | accent, default light): pointer fill, outline and- ring colour. light is the white pointer with a dark outline for dark- screens, dark flips both for light screens, accent rides --hf-ui-accent.- - pulse (subtle | standard | bold | none, default standard): weight of the- click ring. subtle is thin and small, bold thick and wide, none removes- the ring entirely. The ring stays centred on the same point in every- case, and it is only on screen while the click animation runs.-- On every default the result is identical to the original: a 44px white- pointer with a 22px, 2px white ring offset 9px from the tip.--->--<div- class="hf-simulated-cursor"- aria-hidden="true"- data-composition-variables='[- {"id": "size", "type": "number", "role": "layout", "label": "Size", "description": "Height and width of the pointer in pixels. The click ring scales with it. Values outside the range clamp to the nearest end and anything that is not a number falls back to 44.", "default": 44, "min": 20, "max": 120, "step": 2, "unit": "px"},- {"id": "tone", "type": "enum", "role": "style", "label": "Tone", "description": "Pointer fill and click ring colour: light reads on dark screens, dark reads on light ones, accent rides --hf-ui-accent.", "default": "light", "options": [{"value": "light", "label": "Light"}, {"value": "dark", "label": "Dark"}, {"value": "accent", "label": "Accent"}]},- {"id": "pulse", "type": "enum", "role": "style", "label": "Click ring", "description": "Weight of the ring the click animation expands: subtle is a thin small ring, bold a thick wide one, none removes the ring entirely.", "default": "standard", "options": [{"value": "subtle", "label": "Subtle"}, {"value": "standard", "label": "Standard"}, {"value": "bold", "label": "Bold"}, {"value": "none", "label": "None"}]}- ]'->- <div class="hf-simulated-cursor-pulse"></div>- <svg viewBox="0 0 24 24" width="44" height="44">- <path- d="M3 2.8 20.6 14 12.8 15.5 9 22 3 2.8Z"- fill="white"- stroke="rgba(0,0,0,0.45)"- stroke-width="1.4"- />- </svg>-</div>--<style>- .hf-simulated-cursor {- position: absolute;- left: 0;- top: 0;- width: calc(44px * var(--hf-cursor-scale, 1));- height: calc(44px * var(--hf-cursor-scale, 1));- transform: translate3d(var(--hf-cursor-x, 0px), var(--hf-cursor-y, 0px), 0);- pointer-events: none;- z-index: 999;- filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.24));- }- .hf-simulated-cursor svg {- width: 100%;- height: 100%;- }- .hf-simulated-cursor svg path {- fill: var(--hf-cursor-fill, #ffffff);- stroke: var(--hf-cursor-edge, rgba(0, 0, 0, 0.45));- }- .hf-simulated-cursor-pulse {- display: var(--hf-cursor-ring-display, block);- position: absolute;- left: calc((20px - var(--hf-cursor-ring-size, 22px) / 2) * var(--hf-cursor-scale, 1));- top: calc((20px - var(--hf-cursor-ring-size, 22px) / 2) * var(--hf-cursor-scale, 1));- width: calc(var(--hf-cursor-ring-size, 22px) * var(--hf-cursor-scale, 1));- height: calc(var(--hf-cursor-ring-size, 22px) * var(--hf-cursor-scale, 1));- border: calc(var(--hf-cursor-ring-width, 2px) * var(--hf-cursor-scale, 1)) solid- var(--hf-cursor-ring, rgba(255, 255, 255, 0.85));- border-radius: 999px;- opacity: 0;- transform: scale(0.2);- }-</style>--<script>- (function () {- "use strict";-- var vars =- window.__hyperframes && window.__hyperframes.getVariables- ? window.__hyperframes.getVariables()- : {};-- // Unrecognised or out-of-range overrides return to their declared defaults.- function pick(table, value, fallback) {- return Object.prototype.hasOwnProperty.call(table, value) ? value : fallback;- }-- var tones = {- light: { fill: "#ffffff", edge: "rgba(0, 0, 0, 0.45)", ring: "rgba(255, 255, 255, 0.85)" },- dark: { fill: "#18181b", edge: "rgba(255, 255, 255, 0.75)", ring: "rgba(24, 24, 27, 0.75)" },- accent: {- fill: "var(--hf-ui-accent, #3ce6ac)",- edge: "rgba(0, 0, 0, 0.45)",- ring: "var(--hf-ui-accent, #3ce6ac)",- },- };- var pulses = {- subtle: { size: "18px", width: "1px", display: "block" },- standard: { size: "22px", width: "2px", display: "block" },- bold: { size: "28px", width: "3px", display: "block" },- none: { size: "22px", width: "2px", display: "none" },- };-- var size = typeof vars.size === "number" ? vars.size : parseFloat(vars.size);- if (!isFinite(size)) size = 44;- size = Math.min(120, Math.max(20, size));-- var tone = tones[pick(tones, vars.tone, "light")];- var pulse = pulses[pick(pulses, vars.pulse, "standard")];-- var roots = document.querySelectorAll(".hf-simulated-cursor");- for (var i = 0; i < roots.length; i += 1) {- var root = roots[i];- root.style.setProperty("--hf-cursor-scale", String(size / 44));- root.style.setProperty("--hf-cursor-fill", tone.fill);- root.style.setProperty("--hf-cursor-edge", tone.edge);- root.style.setProperty("--hf-cursor-ring", tone.ring);- root.style.setProperty("--hf-cursor-ring-size", pulse.size);- root.style.setProperty("--hf-cursor-ring-width", pulse.width);- root.style.setProperty("--hf-cursor-ring-display", pulse.display);- }- })();-</script>--<!--- Timeline integration:-- tl.to(".hf-simulated-cursor", { "--hf-cursor-x": "760px", "--hf-cursor-y": "420px", duration: 0.8, ease: "power2.inOut" }, startTime);- tl.fromTo(".hf-simulated-cursor-pulse", { opacity: 0.8, scale: 0.2 }, { opacity: 0, scale: 2.4, duration: 0.45, ease: "power2.out" }, startTime + 0.8);--->diff --git a/registry/components/torn-paper-rip/demo.html b/registry/components/torn-paper-rip/demo.htmlnew file mode 100644index 0000000000..753daafc81--- /dev/null+++ b/registry/components/torn-paper-rip/demo.html@@ -0,0 +1,250 @@+<!doctype html>+<!--+ torn-paper-rip demo. This standalone composition mounts the primitive+ FULL-BLEED through data-composition-src, with right-to-left travel and a+ rougher edge to prove the non-default variable path. A harbor at dusk+ (procedural SVG) tears away to reveal a chapter title card.+-->+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=1920, height=1080" />+ <title>Torn Paper Rip Demo</title>+ <style>+ * {+ margin: 0;+ padding: 0;+ box-sizing: border-box;+ }+ html,+ body {+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #111318;+ }+ #root {+ position: relative;+ width: 1920px;+ height: 1080px;+ overflow: hidden;+ background: #111318;+ }+ .mount-bleed {+ position: absolute;+ inset: 0;+ container-type: size;+ overflow: hidden;+ }+ .demo-photo {+ position: absolute;+ inset: 0;+ }+ .demo-photo img {+ display: block;+ width: 100%;+ height: 100%;+ object-fit: cover;+ }+ .demo-photo::after {+ content: "";+ position: absolute;+ inset: 0;+ box-shadow: inset 0 0 240px rgba(0, 0, 0, 0.45);+ }+ .demo-card {+ position: absolute;+ inset: 0;+ display: flex;+ flex-direction: column;+ justify-content: flex-end;+ gap: 40px;+ padding: 0 160px 168px;+ background: #c3ccd4;+ color: #111318;+ }+ .demo-card-eyebrow {+ font-family: "Inter", sans-serif;+ font-weight: 500;+ font-size: 30px;+ letter-spacing: 0.18em;+ text-transform: uppercase;+ color: #5d6570;+ }+ .demo-card-title {+ font-family: "Instrument Serif", serif;+ font-weight: 400;+ font-size: 176px;+ line-height: 0.95;+ letter-spacing: -0.01em;+ }+ </style>+ </head>+ <body>+ <template data-slot="torn-paper-rip-from">+ <div class="demo-photo">+ <img alt="" src="" id="demo-scene-from-img" />+ </div>+ </template>+ <template data-slot="torn-paper-rip-to">+ <div class="demo-card">+ <p class="demo-card-eyebrow">Chapter two</p>+ <h2 class="demo-card-title">The morning after</h2>+ </div>+ </template>++ <div+ id="root"+ data-composition-id="torn-paper-rip-demo"+ data-start="0"+ data-width="1920"+ data-height="1080"+ data-duration="2.4"+ data-fps="30"+ >+ <div+ id="torn-paper-rip-mount"+ class="mount-bleed clip"+ data-composition-id="torn-paper-rip"+ data-composition-src="./torn-paper-rip.html"+ data-variable-values='{"direction":"right-to-left","roughness":72}'+ data-start="0"+ data-duration="2.4"+ data-track-index="0"+ data-width="1920"+ data-height="1080"+ ></div>+ </div>++ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <script>+ (function () {+ // Seeded, so the scene is identical on every load.+ var seed = 7;+ function rand() {+ seed = (Math.imul(1664525, seed) + 1013904223) >>> 0;+ return seed / 4294967296;+ }+ function rect(x, y, w, h, fill, opacity) {+ return (+ '<rect x="' ++ x.toFixed(1) ++ '" y="' ++ y.toFixed(1) ++ '" width="' ++ w.toFixed(1) ++ '" height="' ++ h.toFixed(1) ++ '" fill="' ++ fill ++ '" opacity="' ++ opacity.toFixed(2) ++ '"/>'+ );+ }++ // A backlit harbor at dusk: silhouettes, a low sun and its broken+ // reflection, so it reads as a photograph rather than flat vector.+ function harborScene() {+ var town = "";+ var lights = "";+ for (var bx = 20; bx < 600; ) {+ var w = 18 + rand() * 34;+ var h = 16 + rand() * 46;+ var base = 566 + bx * 0.11;+ town += rect(bx, base - h, w, h + 30, "#2a2036", 1);+ if (rand() > 0.35) {+ var lx = bx + 4 + rand() * (w - 10);+ var ly = base - h + 5 + rand() * (h - 12);+ lights += rect(lx, ly, 4, 5, "#ffc57a", 0.9);+ lights += rect(lx, 654 + (650 - ly) * 0.2, 3, 26, "#ffc57a", 0.22);+ }+ bx += w + 2 + rand() * 6;+ }+ var posts = "";+ for (var px = 1488; px < 1920; px += 44) posts += rect(px, 736, 7, 70, "#0e0a14", 1);+ return (+ '<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080">' ++ "<defs>" ++ '<linearGradient id="sky" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="0" y2="650">' ++ '<stop offset="0" stop-color="#151c33"/><stop offset="0.35" stop-color="#2e3150"/>' ++ '<stop offset="0.6" stop-color="#6b4863"/><stop offset="0.8" stop-color="#c46d5c"/>' ++ '<stop offset="0.93" stop-color="#eea062"/><stop offset="1" stop-color="#f8c585"/></linearGradient>' ++ '<linearGradient id="sea" gradientUnits="userSpaceOnUse" x1="0" y1="650" x2="0" y2="1080">' ++ '<stop offset="0" stop-color="#d88f63"/><stop offset="0.12" stop-color="#9a5b5e"/>' ++ '<stop offset="0.45" stop-color="#3c2a44"/><stop offset="1" stop-color="#120e1b"/></linearGradient>' ++ '<filter id="b70" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="70"/></filter>' ++ '<filter id="b8" x="-20%" y="-200%" width="140%" height="500%"><feGaussianBlur stdDeviation="8"/></filter>' ++ '<filter id="b2"><feGaussianBlur stdDeviation="2"/></filter>' ++ '<filter id="b1"><feGaussianBlur stdDeviation="1"/></filter>' ++ '<linearGradient id="seaglint" gradientUnits="userSpaceOnUse" x1="0" y1="652" x2="0" y2="1080">' ++ '<stop offset="0" stop-color="#f5b680" stop-opacity="0.8"/><stop offset="1" stop-color="#f5b680" stop-opacity="0.12"/></linearGradient>' ++ '<linearGradient id="sunglint" gradientUnits="userSpaceOnUse" x1="0" y1="652" x2="0" y2="1080">' ++ '<stop offset="0" stop-color="#ffe6b8"/><stop offset="1" stop-color="#ffe6b8" stop-opacity="0.4"/></linearGradient>' ++ // Stretched noise keeps only its brightest streaks: broken water highlights.+ '<filter id="water" x="0" y="0" width="100%" height="100%">' ++ '<feTurbulence type="fractalNoise" baseFrequency="0.003 0.1" numOctaves="3" seed="11"/>' ++ '<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 -1.4" result="m"/>' ++ '<feComposite in="SourceGraphic" in2="m" operator="in"/></filter>' ++ '<filter id="sunwater" x="-20%" y="0" width="140%" height="100%">' ++ '<feGaussianBlur in="SourceGraphic" stdDeviation="36 0" result="soft"/>' ++ '<feTurbulence type="fractalNoise" baseFrequency="0.004 0.12" numOctaves="3" seed="4"/>' ++ '<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4.5 0 0 0 -1.7" result="m"/>' ++ '<feComposite in="soft" in2="m" operator="in"/></filter>' ++ '<filter id="grain" x="0" y="0" width="100%" height="100%">' ++ '<feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="2" seed="3" stitchTiles="stitch"/>' ++ '<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.22 0 0 0 -0.04"/></filter>' ++ '<g id="boat" fill="#120d19" stroke="#120d19">' ++ '<path d="M-70 0 L72 0 L58 16 L-56 16 Z" stroke="none"/><rect x="-24" y="-12" width="40" height="12" stroke="none"/>' ++ '<line x1="0" y1="0" x2="0" y2="-210" stroke-width="3.5"/><line x1="0" y1="-30" x2="60" y2="-26" stroke-width="3"/>' ++ '<line x1="0" y1="-210" x2="70" y2="0" stroke-width="1.2"/><line x1="0" y1="-210" x2="-66" y2="0" stroke-width="1.2"/></g>' ++ "</defs>" ++ '<rect width="1920" height="650" fill="url(#sky)"/>' ++ '<circle cx="1240" cy="628" r="260" fill="#ffb46a" opacity="0.55" filter="url(#b70)"/>' ++ '<g filter="url(#b8)">' ++ '<ellipse cx="520" cy="470" rx="420" ry="9" fill="#f3a372" opacity="0.45"/>' ++ '<ellipse cx="1500" cy="520" rx="360" ry="7" fill="#f7b27c" opacity="0.5"/>' ++ '<ellipse cx="900" cy="300" rx="520" ry="16" fill="#3b3050" opacity="0.6"/>' ++ '<ellipse cx="1650" cy="250" rx="300" ry="12" fill="#453656" opacity="0.5"/></g>' ++ '<circle cx="1240" cy="632" r="50" fill="#ffe2a8" opacity="0.6" filter="url(#b8)"/>' ++ '<circle cx="1240" cy="632" r="38" fill="#fff0cf"/>' ++ '<path d="M620 650 C760 628 860 612 1000 620 C1120 627 1180 640 1300 636 C1420 632 1520 606 1660 610 C1780 614 1860 628 1920 632 L1920 650 Z" fill="#6a4560" opacity="0.9" filter="url(#b2)"/>' ++ '<rect y="650" width="1920" height="430" fill="url(#sea)"/>' ++ '<rect y="647" width="1920" height="5" fill="#ffd39a" opacity="0.45" filter="url(#b2)"/>' ++ '<rect y="652" width="1920" height="428" fill="url(#seaglint)" filter="url(#water)"/>' ++ '<path d="M1222 652 L1258 652 L1400 1080 L1080 1080 Z" fill="url(#sunglint)" filter="url(#sunwater)"/>' ++ '<path d="M0 560 C120 556 220 572 320 590 C420 606 520 618 640 630 C700 636 760 644 820 650 L0 650 Z" fill="#2a2036"/>' ++ '<g filter="url(#b1)">' ++ town ++ '<rect x="296" y="512" width="22" height="100" fill="#2a2036"/><path d="M293 514 L307 470 L321 514 Z" fill="#2a2036"/></g>' ++ '<g filter="url(#b1)">' ++ lights ++ "</g>" ++ '<use href="#boat" transform="translate(820 760)"/>' ++ '<use href="#boat" transform="translate(820 792) scale(1 -1)" opacity="0.3" filter="url(#b2)"/>' ++ '<use href="#boat" transform="translate(520 712) scale(0.55)"/>' ++ '<use href="#boat" transform="translate(1080 700) scale(0.4)"/>' ++ rect(1480, 730, 440, 10, "#0e0a14", 1) ++ posts ++ '<rect x="1480" y="806" width="440" height="30" fill="#0e0a14" opacity="0.25" filter="url(#b2)"/>' ++ '<g stroke="#0e0a14" stroke-width="3"><line x1="1560" y1="730" x2="1560" y2="650"/><line x1="1740" y1="730" x2="1740" y2="650"/></g>' ++ '<g fill="#ffd08a"><circle cx="1560" cy="648" r="5"/><circle cx="1740" cy="648" r="5"/></g>' ++ '<g fill="#ffd08a" opacity="0.5" filter="url(#b8)"><circle cx="1560" cy="648" r="18"/><circle cx="1740" cy="648" r="18"/></g>' ++ '<rect width="1920" height="1080" filter="url(#grain)"/>' ++ "</svg>"+ );+ }+ // Elements inside an inert <template> are not in the live document,+ // so they must be reached through the template's own content+ // fragment, never document.getElementById.+ document+ .querySelector('template[data-slot="torn-paper-rip-from"]')+ .content.getElementById("demo-scene-from-img").src =+ "data:image/svg+xml;charset=utf-8," + encodeURIComponent(harborScene());++ window.__timelines = window.__timelines || {};+ window.__timelines["torn-paper-rip-demo"] = gsap.timeline({ paused: true });+ })();+ </script>+ </body>+</html>diff --git a/registry/components/torn-paper-rip/registry-item.json b/registry/components/torn-paper-rip/registry-item.jsonnew file mode 100644index 0000000000..b062523272--- /dev/null+++ b/registry/components/torn-paper-rip/registry-item.json@@ -0,0 +1,53 @@+{+ "$schema": "https://hyperframes.heygen.com/schema/registry-item.json",+ "name": "torn-paper-rip",+ "type": "hyperframes:component",+ "title": "Torn Paper Rip",+ "description": "A fibrous paper tear runs across the frame: the torn sheet shows its white paper core along the edge and lifts away on a soft shadow, leaving the next scene standing.",+ "tags": ["torn paper", "paper rip", "paper tear", "transition", "texture", "motion-primitive"],+ "files": [+ {+ "path": "torn-paper-rip.html",+ "target": "compositions/components/torn-paper-rip.html",+ "type": "hyperframes:snippet"+ }+ ],+ "variables": [+ {+ "id": "direction",+ "type": "enum",+ "role": "motion",+ "label": "Direction",+ "description": "Which way the tear travels across the frame.",+ "default": "left-to-right",+ "options": [+ { "value": "left-to-right", "label": "Left to right" },+ { "value": "right-to-left", "label": "Right to left" }+ ]+ },+ {+ "id": "tone",+ "type": "enum",+ "role": "style",+ "label": "Paper tone",+ "description": "Color of the exposed paper cross-section riding the tear.",+ "default": "cream",+ "options": [+ { "value": "cream", "label": "Cream" },+ { "value": "kraft", "label": "Kraft" },+ { "value": "white", "label": "White" }+ ]+ },+ {+ "id": "roughness",+ "type": "number",+ "role": "style",+ "label": "Roughness",+ "description": "How jagged and fibrous the tear edge is. Low is a clean deckle edge, high is roughly torn.",+ "default": 55,+ "min": 20,+ "max": 90,+ "step": 1+ }+ ]+}diff --git a/registry/components/torn-paper-rip/torn-paper-rip.html b/registry/components/torn-paper-rip/torn-paper-rip.htmlnew file mode 100644index 0000000000..0f9648bdfa--- /dev/null+++ b/registry/components/torn-paper-rip/torn-paper-rip.html@@ -0,0 +1,412 @@+<!doctype html>+<!--+ torn-paper-rip: HyperFrames video primitive (transitions / texture).++ A jagged, fibrous paper tear travels across the frame and splits one scene+ into the next. The "from" sheet sits on top, its torn edge showing a+ 6-14 px band of paper core in the tone color with a feathered outer edge;+ the "to" layer fills the whole stage underneath. As the tear runs, the+ "from" sheet lifts away toward the tear direction on a growing shadow.++ Both scenes are SLOTS. Callers supply content by placing inert templates+ anywhere in the HOST page (templates never render, and the runtime wipes+ the host clip's own children on mount, so slots live at document level):++ <template data-slot="torn-paper-rip-from"> ... </template>+ <template data-slot="torn-paper-rip-to"> ... </template>++ Slot content may be an <img>, a muted <video>, or arbitrary HTML; direct+ img/video children are stretched to cover the stage (packages/producer+ drives a slotted <video>'s own data-start/data-duration exactly like any+ other clip -- this primitive never reads or sets currentTime itself). With+ no slot, each side renders a plain chapter card so the tear reads on its own.++ Variables (declared in data-composition-variables below):+ - direction ("left-to-right" | "right-to-left", default "left-to-right"):+ which way the tear travels.+ - tone ("cream" | "kraft" | "white", default "cream"): color of the+ exposed paper cross-section riding the tear.+ - roughness (number 20-90, default 55): how jagged and fibrous the tear+ edge is. Low reads as a clean deckle edge, high reads as roughly torn.++ Envelope, fixed IN with elastic HOLD only (never timeScale):+ IN_BASE = 1.0s the tear sweeps fully across, taking the "from" layer:+ power2.in over the first 20% of travel (the paper resists),+ then power3.out once it gives+ HOLD = max(0, D - IN); "to" stands alone, truly still+ If D < IN_BASE, IN compresses to D (no hold).++ Determinism (closed-form field law): there is NO physics state. One edge+ table (a low-frequency wander plus a per-vertex fibre jitter) is computed+ exactly once during synchronous timeline construction from a fixed LCG seed+ 0x7a9e11cf. Every painted frame derives the tear's clip-paths, lift+ transform and shadow as a pure function of (table, timeline time) inside a+ single tween's onUpdate -- fresh strings, never an incremental mutation. No Math.random, no wall clock, no requestAnimationFrame.+ Eventful seeks land identical frames in any order and either direction.++ Mount contract: the runtime clones only this template. #root fills the+ host box (no data-width/data-height, container-type: size, cqmin units),+ is styled via #root only, and registers one paused timeline under the+ LITERAL "torn-paper-rip" key.+-->+<html+ lang="en"+ data-composition-id="torn-paper-rip"+ data-composition-duration="2.4"+ data-composition-variables='[+ { "id": "direction", "type": "enum", "role": "motion", "label": "Direction", "description": "Which way the tear travels across the frame.", "default": "left-to-right", "options": [{ "value": "left-to-right", "label": "Left to right" }, { "value": "right-to-left", "label": "Right to left" }] },+ { "id": "tone", "type": "enum", "role": "style", "label": "Paper tone", "description": "Color of the exposed paper cross-section riding the tear.", "default": "cream", "options": [{ "value": "cream", "label": "Cream" }, { "value": "kraft", "label": "Kraft" }, { "value": "white", "label": "White" }] },+ { "id": "roughness", "type": "number", "role": "style", "label": "Roughness", "description": "How jagged and fibrous the tear edge is. Low is a clean deckle edge, high is roughly torn.", "default": 55, "min": 20, "max": 90, "step": 1 }+ ]'+>+ <head>+ <meta charset="UTF-8" />+ <title>Torn Paper Rip</title>+ </head>+ <body>+ <template>+ <div id="root" data-composition-id="torn-paper-rip" data-duration="2.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, #1d1b16);+ font-family: var(--font-display, "Inter", system-ui, sans-serif);+ }++ .tpr-clip {+ position: absolute;+ inset: 0;+ overflow: hidden;+ background: var(--bg, transparent);+ }++ .tpr-stage {+ position: absolute;+ inset: 0;+ }++ .tpr-layer {+ position: absolute;+ inset: 0;+ overflow: hidden;+ }++ .tpr-layer > img,+ .tpr-layer > video {+ display: block;+ width: 100%;+ height: 100%;+ object-fit: cover;+ }++ /* .tpr-from carries the per-frame lift transform and drop-shadow.+ Filter and clip-path never share an element: CSS applies filter+ first, so a clip on the same node would clip the shadow away. */++ .tpr-from-clip {+ position: absolute;+ inset: 0;+ overflow: hidden;+ }++ .tpr-from-clip > img,+ .tpr-from-clip > video {+ display: block;+ width: 100%;+ height: 100%;+ object-fit: cover;+ }++ .tpr-rim {+ position: absolute;+ inset: 0;+ filter: blur(0.12cqmin);+ }++ .tpr-rim-shape {+ position: absolute;+ inset: 0;+ background: var(--tpr-rim-color, #f6f1e7);+ }++ .tpr-rim-grain {+ position: absolute;+ inset: 0;+ filter: url(#tpr-grain-filter);+ opacity: 0.5;+ mix-blend-mode: multiply;+ }++ .tpr-default {+ position: absolute;+ inset: 0;+ display: grid;+ place-items: center;+ }++ .tpr-default-mark {+ font-size: 5cqmin;+ font-weight: 700;+ letter-spacing: 0.3em;+ text-transform: uppercase;+ opacity: 0.5;+ }++ .tpr-from .tpr-default {+ background: #f4f4f5;+ color: #111318;+ }++ .tpr-to .tpr-default {+ background: #111318;+ color: #f4f4f5;+ }+ </style>++ <div+ id="torn-paper-rip-clip"+ class="tpr-clip clip"+ data-start="0"+ data-duration="2.4"+ data-track-index="0"+ >+ <svg aria-hidden="true" width="0" height="0" style="position: absolute">+ <defs>+ <!-- Seeded static paper grain: fixed seed, never animated, so+ it adds tooth to the exposed rim without touching+ determinism (same recipe as ink-bleed-reveal). -->+ <filter+ id="tpr-grain-filter"+ x="0%"+ y="0%"+ width="100%"+ height="100%"+ color-interpolation-filters="sRGB"+ >+ <feTurbulence+ type="fractalNoise"+ baseFrequency="0.9"+ numOctaves="2"+ seed="27"+ stitchTiles="stitch"+ result="noise"+ />+ <feColorMatrix+ in="noise"+ type="matrix"+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.18 0.18 0.18 0 0"+ />+ </filter>+ </defs>+ </svg>++ <div class="tpr-stage">+ <div class="tpr-layer tpr-to" id="tpr-to">+ <div class="tpr-default">+ <span class="tpr-default-mark" aria-hidden="true">Chapter two</span>+ </div>+ </div>+ <div class="tpr-layer tpr-from" id="tpr-from">+ <div class="tpr-rim">+ <div class="tpr-rim-shape" id="tpr-rim">+ <div class="tpr-rim-grain"></div>+ </div>+ </div>+ <div class="tpr-from-clip" id="tpr-from-clip">+ <div class="tpr-default">+ <span class="tpr-default-mark" aria-hidden="true">Chapter one</span>+ </div>+ </div>+ </div>+ </div>+ </div>++ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+ <script>+ (function () {+ "use strict";++ var root = document.getElementById("root");+ var fromLayer = document.getElementById("tpr-from");+ var fromClip = document.getElementById("tpr-from-clip");+ var toLayer = document.getElementById("tpr-to");+ var rimLayer = document.getElementById("tpr-rim");++ var vars =+ window.__hyperframes && window.__hyperframes.getVariables+ ? window.__hyperframes.getVariables()+ : {};++ var direction = vars.direction === "right-to-left" ? "right-to-left" : "left-to-right";++ var rimColors = {+ cream: "#f6f1e7",+ kraft: "#d8c29c",+ white: "#fbfaf8",+ };+ var tone = Object.prototype.hasOwnProperty.call(rimColors, vars.tone)+ ? vars.tone+ : "cream";+ root.style.setProperty("--tpr-rim-color", rimColors[tone]);++ var roughnessValue = parseFloat(vars.roughness);+ var roughness = Number.isFinite(roughnessValue)+ ? Math.min(90, Math.max(20, roughnessValue))+ : 55;+ var roughnessNorm = (roughness - 20) / 70;++ // Slots. Caller templates live at the host document level (the+ // mount wipes host-clip children, and templates never render),+ // so the lookup deliberately goes through ownerDocument.+ var hostDoc = root.ownerDocument;+ function mountSlot(slotName, layer) {+ var tpl = null;+ try {+ tpl = hostDoc.querySelector('template[data-slot="' + slotName + '"]');+ } catch (error) {+ tpl = null;+ }+ if (!tpl) return;+ var defaultMark = layer.querySelector(".tpr-default");+ if (defaultMark) defaultMark.remove();+ layer.appendChild(hostDoc.importNode(tpl.content, true));+ }+ mountSlot("torn-paper-rip-from", fromClip);+ mountSlot("torn-paper-rip-to", toLayer);++ // Envelope: fixed IN, elastic HOLD, never time-scaled.+ var IN_BASE = 1.0;+ var duration = Math.max(0.001, parseFloat(root.dataset.duration || "2.4"));+ var IN = Math.min(IN_BASE, duration);++ // Edge table, built once. Sizes are px at 1920 wide, stored as %+ // of width: a low-frequency wander (~40 px at roughness 55), a+ // 2-4 px per-vertex fibre, and a 6-14 px paper-core band.+ var PX = 100 / 1920;+ var ROWS = 180;+ var WANDER_PX = 22 + roughnessNorm * 36;+ var FIBRE_PX = 2 + roughnessNorm * 2;+ var DIAGONAL_PCT = 1 + roughnessNorm * 4;+ var RIM_MIN_PX = 6;+ var RIM_MAX_PX = 14;++ var state = 0x7a9e11cf;+ function rand() {+ state = (Math.imul(1664525, state) + 1013904223) >>> 0;+ return state / 4294967296;+ }+ // Seeded value noise over [0, 1] with smoothstep between knots.+ function valueNoise(knots) {+ var k = [];+ for (var i = 0; i <= knots; i += 1) k.push(rand() * 2 - 1);+ return function (v) {+ var f = v * knots;+ var i = Math.min(knots - 1, Math.floor(f));+ var u = f - i;+ u = u * u * (3 - 2 * u);+ return k[i] + (k[i + 1] - k[i]) * u;+ };+ }+ var wander = valueNoise(6);+ var coreWidth = valueNoise(14);+ var edge = [];+ for (var r = 0; r <= ROWS; r += 1) {+ var v = r / ROWS;+ var rimPx = RIM_MIN_PX + (RIM_MAX_PX - RIM_MIN_PX) * (coreWidth(v) * 0.5 + 0.5);+ rimPx = Math.min(+ RIM_MAX_PX,+ Math.max(RIM_MIN_PX, rimPx + (rand() * 2 - 1) * FIBRE_PX),+ );+ edge.push({+ y: (v * 100).toFixed(2) + "%",+ offset:+ (v - 0.5) * DIAGONAL_PCT ++ (wander(v) * WANDER_PX + (rand() * 2 - 1) * FIBRE_PX) * PX,+ rim: rimPx * PX,+ });+ }++ var maxOffset = edge.reduce(function (m, row) {+ return Math.max(m, Math.abs(row.offset));+ }, 0);+ // Clears the worst row plus the core band and its feather, so no+ // edge is on screen at p=0 or p=1.+ var MARGIN = maxOffset + RIM_MAX_PX * PX + 0.5;+ // side: which side of the boundary still shows "from" (ltr tears+ // from the left, so "from" lives on the right; rtl mirrors).+ var side = direction === "left-to-right" ? "right" : "left";+ var START = side === "right" ? -MARGIN : 100 + MARGIN;+ var END = side === "right" ? 100 + MARGIN : -MARGIN;+ var CORNER_X = side === "right" ? "100%" : "0%";+ var RIM_SIGN = side === "right" ? -1 : 1;+ var LIFT_SIGN = -RIM_SIGN;+ fromLayer.style.transformOrigin = CORNER_X + " 100%";++ // power2.in over the first 20% of travel in 30% of the time,+ // then power3.out; the speed jump is the paper giving way.+ var RESIST_T = 0.3;+ function tearEase(p) {+ if (p < RESIST_T) return 0.2 * Math.pow(p / RESIST_T, 2);+ return 0.2 + 0.8 * (1 - Math.pow(1 - (p - RESIST_T) / (1 - RESIST_T), 3));+ }++ function paint(p) {+ var e = tearEase(Math.max(0, Math.min(1, p)));+ var bx = START + (END - START) * e;++ var fromPts = CORNER_X + " 0%, " + CORNER_X + " 100%";+ var rimPts = fromPts;+ for (var i = ROWS; i >= 0; i -= 1) {+ var row = edge[i];+ var x = bx + row.offset;+ fromPts += ", " + x.toFixed(2) + "% " + row.y;+ rimPts += ", " + (x + RIM_SIGN * row.rim).toFixed(2) + "% " + row.y;+ }+ fromClip.style.clipPath = "polygon(" + fromPts + ")";+ rimLayer.style.clipPath = "polygon(" + rimPts + ")";++ // The sheet lifts toward the tear: up to 3% travel, 1.5deg,+ // and a shadow growing to 0 12px 24px (1080 tall).+ fromLayer.style.transform =+ "translateX(" ++ (LIFT_SIGN * 3 * e).toFixed(3) ++ "%) rotate(" ++ (LIFT_SIGN * 1.5 * e).toFixed(3) ++ "deg)";+ fromLayer.style.filter =+ "drop-shadow(0 " ++ (1.111 * e).toFixed(3) ++ "cqmin " ++ (2.222 * e).toFixed(3) ++ "cqmin rgba(0, 0, 0, 0.25))";+ }++ paint(0);++ var tl = gsap.timeline({+ paused: true,+ onUpdate: function () {+ paint(this.progress());+ },+ });+ tl.to({}, { duration: IN, ease: "none" }, 0);+ tl.seek(0);++ window.__timelines = window.__timelines || {};+ window.__timelines["torn-paper-rip"] = tl;+ })();+ </script>+ </div>+ </template>+ </body>+</html>diff --git a/registry/components/touch-indicator/demo.html b/registry/components/touch-indicator/demo.htmlindex 7d7e57fddf..defd92a4be 100644--- a/registry/components/touch-indicator/demo.html+++ b/registry/components/touch-indicator/demo.html@@ -18,15 +18,15 @@}/*- Host declares the 17-token theme contract. touch-indicator.html- consumes these via var(--token, fallback); it never redeclares them.+ Host declares the 17-token theme contract; the phone UI below reads+ these via var(--token, fallback).*/#demo {width: 1920px;height: 1080px;display: grid;place-items: center;- background: #05060a;+ background: #111318;--bg: #0b0c10;--fg: #f5f6f8;@@ -68,93 +68,157 @@color: var(--fg, #f5f6f8);}+ .phone__status {+ height: 44px;+ display: flex;+ align-items: center;+ justify-content: space-between;+ padding: 0 28px;+ font-size: 15px;+ font-weight: 600;+ font-variant-numeric: tabular-nums;+ }+ .phone__status svg {+ display: block;+ fill: currentColor;+ }+.phone__header {- height: 64px;+ height: 50px;display: flex;align-items: center;- padding: 0 var(--space-3, 24px);+ padding: 0 16px;font-family: var(--font-display, sans-serif);- font-weight: 800;- font-size: 20px;- letter-spacing: -0.01em;+ font-weight: 700;+ font-size: 22px;+ letter-spacing: -0.02em;}- .phone__media {- height: 380px;- margin: 0 var(--space-2, 16px);- border-radius: var(--radius, 20px);- /* Placeholder media: an L3 plate with a hairline, finely hatched so it- reads as a surface with content on it rather than an empty box. */- border: 1px solid color-mix(in srgb, var(--fg, #f5f6f8) 14%, transparent);- background:- repeating-linear-gradient(- 0deg,- color-mix(in srgb, var(--fg, #f5f6f8) 5%, transparent) 0 1px,- transparent 1px 3px- ),- color-mix(in srgb, var(--fg, #f5f6f8) 18%, transparent);- }-- .phone__row {- height: 64px;+ .post__head {+ height: 54px;display: flex;align-items: center;- gap: var(--space-2, 16px);- padding: 0 var(--space-3, 24px);+ gap: 10px;+ padding: 0 14px;+ font-size: 13px;+ line-height: 16px;}-- .like-btn {- position: relative;- width: 44px;- height: 44px;+ .avatar {+ width: 32px;+ height: 32px;border-radius: 50%;- border: 0;display: grid;place-items: center;- background: color-mix(in srgb, var(--surface, #16181d) 100%, transparent);+ font-size: 12px;+ font-weight: 600;+ color: #fff;+ flex: none;+ }+ .post__user {+ font-weight: 600;+ }+ .post__place {color: var(--muted, #8b8f9a);- padding: 0;+ font-size: 12px;+ }+ .post__more {+ margin-left: auto;+ color: var(--fg, #f5f6f8);+ font-size: 16px;+ letter-spacing: 1px;+ }++ .post__photo {+ display: block;+ width: 380px;+ height: 380px;}- .like-btn__icon {- width: 22px;- height: 22px;+ .post__actions {+ height: 46px;+ display: flex;+ align-items: center;+ padding: 0 8px 0 16px;+ font-size: 14px;+ font-weight: 600;+ font-variant-numeric: tabular-nums;+ }+ .icon {+ width: 26px;+ height: 26px;fill: none;stroke: currentColor;- stroke-width: 2;+ stroke-width: 1.8;stroke-linecap: round;stroke-linejoin: round;+ flex: none;+ }+ .like-btn {+ position: relative;+ width: 44px;+ height: 44px;+ margin-left: -9px;+ border: 0;+ padding: 0;+ display: grid;+ place-items: center;+ background: none;+ color: var(--fg, #f5f6f8);+ }+ .like-btn .icon {+ grid-area: 1 / 1;+ }+ .like-btn__filled {+ fill: #ff3b5c;+ stroke: #ff3b5c;+ opacity: 0;+ }+ .post__stat {+ margin: 0 18px 0 2px;+ }+ .post__save {+ margin-left: auto;+ margin-right: 8px;}- .like-count {- font-family: var(--font-mono, monospace);- font-size: 15px;+ .post__caption {+ padding: 2px 16px 0;+ font-size: 14px;+ line-height: 19px;+ text-wrap: pretty;+ }+ .post__meta {+ margin-top: 4px;color: var(--muted, #8b8f9a);+ font-size: 13px;+ }++ .post--next {+ margin-top: 14px;}- .phone__list {+ .phone__tabs {position: absolute;left: 0;right: 0;- top: 508px;bottom: 0;- padding: var(--space-2, 16px);+ height: 56px;display: flex;- flex-direction: column;- gap: var(--space-1, 8px);+ align-items: center;+ justify-content: space-around;+ padding-bottom: 6px;+ background: var(--bg, #0b0c10);+ border-top: 1px solid var(--border, #262931);}- .phone__list-row {- height: 56px;- border-radius: calc(var(--radius, 20px) * 0.6);- background: var(--surface, #16181d);- border: 1px solid var(--border, #262931);+ .phone__tabs .avatar {+ width: 26px;+ height: 26px;+ font-size: 10px;}/*Mount slot: fills the whole phone screen, so touch-indicator.html's- own container-query sizing resolves against a narrow (380px) host- box, not a full 1920-wide frame -- this is what proves the spec's- 46px floor engages instead of the raw 5cqw target (19px here).+ 18cqw disc resolves against the 380px screen (68px), not the frame.*/.touch-indicator-mount {position: absolute;@@ -169,28 +233,163 @@data-start="0"data-width="1920"data-height="1080"- data-duration="3"+ data-duration="1.5"><div class="demo-frame"><div class="phone">+ <div class="phone__status">+ <span>9:41</span>+ <svg width="44" height="12" viewBox="0 0 44 12" aria-hidden="true">+ <rect x="0" y="8" width="3" height="4" rx="1" />+ <rect x="5" y="6" width="3" height="6" rx="1" />+ <rect x="10" y="3" width="3" height="9" rx="1" />+ <rect x="15" y="0" width="3" height="12" rx="1" />+ <rect+ x="23.5"+ y="0.5"+ width="18"+ height="11"+ rx="3"+ fill="none"+ stroke="currentColor"+ opacity="0.45"+ />+ <rect x="25.5" y="2.5" width="12" height="7" rx="1.5" />+ <rect x="42.5" y="4" width="1.5" height="4" rx="0.75" opacity="0.45" />+ </svg>+ </div><div class="phone__header">Feed</div>- <div class="phone__media"></div>- <div class="phone__row">++ <div class="post__head">+ <div class="avatar" style="background: #b8643f">ML</div>+ <div>+ <div class="post__user">maya.lin</div>+ <div class="post__place">Lago di Braies, Italy</div>+ </div>+ <span class="post__more">···</span>+ </div>++ <svg class="post__photo" viewBox="0 0 380 380" aria-label="Dawn over a mountain lake">+ <defs>+ <linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">+ <stop offset="0" stop-color="#1d2640" />+ <stop offset="0.5" stop-color="#5d4f73" />+ <stop offset="0.82" stop-color="#d98e6e" />+ <stop offset="1" stop-color="#f4c794" />+ </linearGradient>+ <linearGradient id="lake" x1="0" y1="0" x2="0" y2="1">+ <stop offset="0" stop-color="#d99a7c" />+ <stop offset="0.3" stop-color="#6e5470" />+ <stop offset="1" stop-color="#141827" />+ </linearGradient>+ <filter id="soft" x="-1" y="-1" width="3" height="3">+ <feGaussianBlur stdDeviation="8" />+ </filter>+ <filter id="grain">+ <feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="2" seed="7" />+ <feColorMatrix values="0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.9 0" />+ </filter>+ <g id="range">+ <path+ d="M0 196 L22 184 L40 190 L66 162 L80 170 L96 148 L112 164 L128 158 L150 182 L176 172 L198 186 L222 178 L244 198 L262 207 L284 192 L300 172 L316 154 L332 164 L350 142 L366 158 L380 152 L380 240 L0 240 Z"+ fill="#8e6a80"+ />+ <path+ d="M0 214 L30 201 L54 208 L90 187 L118 204 L150 197 L180 213 L230 223 L272 227 L310 211 L340 197 L362 205 L380 199 L380 240 L0 240 Z"+ fill="#473a56"+ />+ <path+ d="M0 240 L0 224 L6 214 L11 226 L17 206 L24 227 L31 216 L37 229 L46 212 L53 231 L62 222 L70 234 L300 235 L309 222 L316 232 L324 208 L332 230 L340 216 L347 231 L356 204 L364 229 L372 214 L380 226 L380 240 Z"+ fill="#151826"+ />+ </g>+ </defs>+ <rect width="380" height="240" fill="url(#sky)" />+ <circle cx="262" cy="200" r="34" fill="#ffd9ad" opacity="0.6" filter="url(#soft)" />+ <circle cx="262" cy="200" r="12" fill="#fff2d9" />+ <use href="#range" />+ <rect y="240" width="380" height="140" fill="url(#lake)" />+ <use href="#range" transform="matrix(1 0 0 -1 0 480)" opacity="0.35" />+ <ellipse+ cx="262"+ cy="268"+ rx="9"+ ry="30"+ fill="#ffd9ad"+ opacity="0.55"+ filter="url(#soft)"+ />+ <path+ d="M0 380 L0 334 C60 324 108 338 150 346 C188 354 214 366 236 380 Z"+ fill="#0f111b"+ />+ <rect width="380" height="380" filter="url(#grain)" opacity="0.07" />+ </svg>++ <div class="post__actions"><button class="like-btn" type="button" aria-label="Like">- <svg class="like-btn__icon" viewBox="0 0 24 24" aria-hidden="true">+ <svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><path- d="M12 21s-7.5-4.6-10-9.1C.6 8.6 2 5 5.6 5c2 0 3.4 1 4.4 2.6C11 6 12.4 5 14.4 5 18 5 19.4 8.6 22 11.9 19.5 16.4 12 21 12 21z"+ d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"+ />+ </svg>+ <svg class="icon like-btn__filled" viewBox="0 0 24 24" aria-hidden="true">+ <path+ d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg></button>- <span class="like-count">128</span>+ <span class="post__stat like-count">128</span>+ <svg class="icon" viewBox="0 0 24 24" aria-hidden="true">+ <path+ d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"+ />+ </svg>+ <span class="post__stat">14</span>+ <svg class="icon" viewBox="0 0 24 24" aria-hidden="true">+ <path d="M22 2 11 13M22 2l-7 20-4-9-9-4z" />+ </svg>+ <svg class="icon post__save" viewBox="0 0 24 24" aria-hidden="true">+ <path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" />+ </svg>+ </div>++ <div class="post__caption">+ <span class="post__user">maya.lin</span> First light over the lake. Worth the+ 4 a.m. alarm.+ <div class="post__meta">View all 14 comments</div>+ <div class="post__meta">2 hours ago</div>+ </div>++ <div class="post__head post--next">+ <div class="avatar" style="background: #3f6b58">NC</div>+ <div>+ <div class="post__user">northside.coffee</div>+ <div class="post__place">Portland, Oregon</div>+ </div>+ <span class="post__more">···</span></div>- <div class="phone__list">- <div class="phone__list-row"></div>- <div class="phone__list-row"></div>- <div class="phone__list-row"></div>- <div class="phone__list-row"></div>- <div class="phone__list-row"></div>++ <div class="phone__tabs">+ <svg class="icon" viewBox="0 0 24 24" aria-hidden="true">+ <path+ d="M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z"+ fill="currentColor"+ />+ </svg>+ <svg class="icon" viewBox="0 0 24 24" aria-hidden="true">+ <circle cx="11" cy="11" r="7" />+ <path d="m20 20-3.5-3.5" />+ </svg>+ <svg class="icon" viewBox="0 0 24 24" aria-hidden="true">+ <rect x="3" y="3" width="18" height="18" rx="5" />+ <path d="M12 8v8M8 12h8" />+ </svg>+ <svg class="icon" viewBox="0 0 24 24" aria-hidden="true">+ <rect x="3" y="3" width="18" height="18" rx="5" />+ <path d="M10 9v6l5-3z" />+ </svg>+ <div class="avatar" style="background: #5a5f8a">JR</div></div><!--@@ -199,19 +398,17 @@internal data-composition-id inside touch-indicator.html (andthe window.__timelines key it registers under) -- seesub-compositions.md, Pitfall 2. targetX/Y re-aim the primitive's- own default landing point (50/55) at this card's like button- (12%, 63% of the mount box) via a per-instance variable- override, the documented way a host customizes a mounted- primitive instead of forking its file.+ own default landing point (50/55) at the like button's center+ (29px, 551px = 7.63%, 72.5% of the 380x760 mount box).--><divid="touch-indicator-mount"class="clip touch-indicator-mount"data-composition-id="touch-indicator"data-composition-src="./touch-indicator.html"- data-variable-values='{"targetX":12,"targetY":63}'+ data-variable-values='{"targetX":7.63,"targetY":72.5}'data-start="0.4"- data-duration="2.6"+ data-duration="1.1"data-track-index="1"data-width="380"data-height="760"@@ -221,10 +418,22 @@</div><script>- // Host timeline: no chrome motion needed to prove the mount contract,- // just registration under the host's own data-composition-id.window.__timelines = window.__timelines || {};- window.__timelines["touch-indicator-demo"] = gsap.timeline({ paused: true });+ var tl = gsap.timeline({ paused: true });++ // Touch-down: the mount's data-start (0.4) + the disc's 4-frame appear.+ var TAP = 0.4 + 4 / 60;+ tl.set(".like-btn__filled", { opacity: 1 }, TAP);+ tl.set(".like-count", { textContent: "129" }, TAP);+ tl.fromTo(+ ".like-btn",+ { scale: 1 },+ { scale: 1.2, duration: 0.1, ease: "power2.out", immediateRender: false },+ TAP,+ );+ tl.to(".like-btn", { scale: 1, duration: 0.15, ease: "power2.out" }, TAP + 0.1);++ window.__timelines["touch-indicator-demo"] = tl;</script></body></html>diff --git a/registry/components/touch-indicator/registry-item.json b/registry/components/touch-indicator/registry-item.jsonindex 56e79ac14f..22e6933673 100644--- a/registry/components/touch-indicator/registry-item.json+++ b/registry/components/touch-indicator/registry-item.json@@ -3,8 +3,8 @@"name": "touch-indicator","type": "hyperframes:component","title": "Touch Indicator",- "description": "A translucent contact-circle gesture actor for mobile UI scenes: it touches the glass, causes a same-frame response, and lifts. Tap or swipe, picked by variable.",- "tags": ["motion-primitive", "mobile", "gesture", "touch", "pointer"],+ "description": "A translucent contact-circle gesture actor for mobile UI scenes: it touches the glass on the frame the host target responds, then lifts. Tap or swipe, picked by variable.",+ "tags": ["cursor", "motion-primitive", "mobile", "gesture", "touch", "pointer"],"variables": [{"id": "gesture",diff --git a/registry/components/touch-indicator/touch-indicator.html b/registry/components/touch-indicator/touch-indicator.htmlindex dd68dce38e..288eb9f062 100644--- a/registry/components/touch-indicator/touch-indicator.html+++ b/registry/components/touch-indicator/touch-indicator.html@@ -36,32 +36,27 @@- targetX number 0-100 (percent of host width), default 50- targetY number 0-100 (percent of host height), default 55+ LOOK: the iOS "Show Touches" disc. A filled translucent disc with a 1px+ edge, 18cqw of the host box (68px in a 380px-wide phone screen), fully+ on in 0.067s, gone 0.2s after lift.+ENVELOPE (seconds, 60fps frame-quantized, gesture = "tap"):- IN 0.000 - 0.167 approach (0.083) + touch-down compress (0.083)- HOLD 0.167 - 0.183 elastic dwell at compressed scale (stretch here only)- OUT 0.183 - 0.467 release (0.167) + lift (0.117), lift starts the- instant release ends (0s gap, within the spec's- <=0.04s allowance)+ IN 0.000 - 0.067 disc appears on contact (touch-down at 0.067)+ HOLD 0.067 - 0.183 elastic contact dwell (stretch here only)+ OUT 0.183 - 0.383 lift: the disc fades in placeENVELOPE (seconds, 60fps frame-quantized, gesture = "swipe"):- IN 0.000 - 0.167 approach (0.083) + touch-down compress (0.083)- HOLD 0.167 - 0.500 elastic travel: accelerate 41% / decelerate 59% of+ IN 0.000 - 0.067 disc appears on contact (touch-down at 0.067)+ HOLD 0.067 - 0.400 elastic travel: accelerate 41% / decelerate 59% ofthe stretchable swipe duration (default 0.333)- OUT 0.500 - 0.617 lift only (0.117); a swiping finger does not settle- back to rest scale, it leaves mid-motion+ OUT 0.400 - 0.600 lift: the disc fades where the swipe endedSOUND CUES (fixed offsets, never inside the elastic HOLD):- touch-down IN + 0.083s -> soft fingertip contact- lift-off tap: OUT + 0.167s -> physical release tick- swipe: OUT + 0s -> physical release tick (no bounce)+ touch-down IN + 0.067s -> soft fingertip contact+ lift-off OUT + 0s -> physical release tick- BUILT-IN RESPONSE: the primitive has to read standalone in a slot with no- host UI to react to it, so touch-down also drives its own contact-blur- ripple (EDIT ZONE: .hf-touch-indicator__contact, unchanged from the- original spec) plus a quiet radial pulse centered on the root- (.hf-touch-indicator__pulse, new). Both are token-painted and low-opacity- so they read as a same-frame acknowledgement, not a second effect- competing with a host's own reaction wiring.+ TARGET RESPONSE: the host owns it. Put the target's reaction on the host+ timeline at the mount's data-start + 0.067s (see demo.html).--><htmllang="en"@@ -103,35 +98,10 @@pointer-events: none;}- .hf-touch-indicator__pulse {- /* Root-level built-in response: a quiet radial flash centered on- the touch point, so the gesture reads even with no host UI to- react to it. Token-painted, low peak opacity -- see BUILT-IN- RESPONSE above. */- position: absolute;- left: 0;- top: 0;- width: clamp(120px, 30cqw, 320px);- height: clamp(120px, 30cqw, 320px);- border-radius: 50%;- background: radial-gradient(- circle,- color-mix(in srgb, var(--fg, #14181f) 30%, transparent) 0%,- transparent 72%- );- opacity: 0;- pointer-events: none;- will-change: transform, opacity;- }-.hf-touch-indicator__actor {- /* EDIT ZONE: sizing law from the spec, full-frame law (contact- circle target 5cqw of the host box). RETIME RANGE: floor- clamped to 46px (the spec's absolute floor, never smaller at- delivery scale) since cqw now resolves against whatever box a- host slot gives this mountable primitive, which can be much- narrower than a full 1920-wide frame. */- --hf-gesture-size: clamp(46px, 5cqw, 111px);+ /* sized to 18cqw of the host box, meant to be the phone screen,+ with a 46px floor and a 111px cap for wide hosts. */+ --hf-gesture-size: clamp(46px, 18cqw, 111px);position: absolute;left: 0;top: 0;@@ -151,35 +121,15 @@that token is for rectangular UI corners, not this actor'sfixed disc. */border-radius: 50%;- background: color-mix(in srgb, var(--bg, #ffffff) 68%, transparent);- border: 2px solid color-mix(in srgb, var(--fg, #14181f) 72%, transparent);- box-shadow: 0 4px 12px color-mix(in srgb, var(--fg, #14181f) 22%, transparent);+ background: rgba(255, 255, 255, 0.35);+ border: 1px solid rgba(255, 255, 255, 0.6);transform-origin: 50% 50%;will-change: transform;}.hf-touch-indicator__actor--dark .hf-touch-indicator__core {- background: color-mix(in srgb, var(--fg, #14181f) 64%, transparent);- border-color: color-mix(in srgb, var(--bg, #ffffff) 86%, transparent);- }-- .hf-touch-indicator__contact {- position: absolute;- left: 50%;- top: 54%;- width: 62%;- height: 22%;- border-radius: 50%;- background: color-mix(in srgb, var(--fg, #14181f) 32%, transparent);- filter: blur(5px);- opacity: 0;- /* INVARIANT: centering (xPercent/yPercent -50) and scaleX are set- by the FIRST GSAP tween below, not here - GSAP overwrites the- whole transform, so a static translate()+scaleX() here would be- discarded the instant the timeline renders- (gsap_css_transform_conflict). */- transform-origin: 50% 50%;- will-change: transform, opacity;+ background: rgba(0, 0, 0, 0.22);+ border-color: rgba(0, 0, 0, 0.45);}</style>@@ -193,9 +143,7 @@{"id":"targetY","type":"number","label":"Target Y","default":55,"min":0,"max":100,"unit":"%"}]'>- <div class="hf-touch-indicator__pulse"></div><div class="hf-touch-indicator__actor">- <div class="hf-touch-indicator__contact"></div><div class="hf-touch-indicator__core"></div></div></div>@@ -206,11 +154,7 @@const q = (s) => Math.max(1, Math.round(s * FPS)) / FPS;const clamp = (v, lo, hi) => Math.min(hi, Math.max(lo, v));- // Coordinate law from the spec: the actor wrapper owns x/y- // (absolute position), the core owns press scale and the- // depth/lift offset, the contact shadow owns only its own opacity- // and scaleX, the root pulse owns only its own position/opacity/- // scale. Never tween two meanings on one transform channel.+ // The actor owns x/y and opacity, the core owns scale.function buildTouchIndicator(tl, root, { at = 0, elasticity = 1 } = {}) {const defaults = { gesture: "tap", polarity: "light", targetX: 50, targetY: 55 };// Per-instance overrides (a host's data-variable-values) land in@@ -224,10 +168,8 @@? window.__hyperframes.getVariables(): window.__hfVariables || {};const vars = Object.assign({}, defaults, resolved);- const pulse = root.querySelector(".hf-touch-indicator__pulse");const actor = root.querySelector(".hf-touch-indicator__actor");const core = root.querySelector(".hf-touch-indicator__core");- const contact = root.querySelector(".hf-touch-indicator__contact");if (vars.polarity === "dark") actor.classList.add("hf-touch-indicator__actor--dark");// Compute layout geometry once at setup, never inside an ease/callback.@@ -235,11 +177,9 @@const hostH = root.clientHeight || 1;const x0 = (vars.targetX / 100) * hostW;const y0 = (vars.targetY / 100) * hostH;- tl.set(pulse, { x: x0, y: y0, xPercent: -50, yPercent: -50 }, at);// --- IN: fixed, never stretched. ---- const approach = q(0.09);- const down = q(0.08);+ const appear = q(0.06);tl.fromTo(actor,{ x: x0, y: y0, xPercent: -50, yPercent: -50, autoAlpha: 0 },@@ -249,7 +189,7 @@xPercent: -50,yPercent: -50,autoAlpha: 1,- duration: approach,+ duration: appear,ease: "power2.out",immediateRender: false,},@@ -257,59 +197,16 @@);tl.fromTo(core,- { y: -10, scale: 0.72 },- { y: 0, scale: 1, duration: approach, ease: "power2.out", immediateRender: false },+ { scale: 0.9 },+ { scale: 1, duration: appear, ease: "power2.out", immediateRender: false },at,);-- const touchDown = at + approach; // sync point: fixed +0.083s into IN- const coreDownScale = vars.gesture === "swipe" ? 0.86 : 0.82;- tl.fromTo(- core,- { scale: 1 },- { scale: coreDownScale, duration: down, ease: "power2.in", immediateRender: false },- touchDown,- );- tl.fromTo(- contact,- { autoAlpha: 0, scaleX: 0.62, xPercent: -50, yPercent: -50 },- {- autoAlpha: 0.34,- scaleX: 1,- xPercent: -50,- yPercent: -50,- duration: down,- ease: "power2.in",- immediateRender: false,- },- touchDown,- );- // Built-in root pulse: same-frame acknowledgement so the- // gesture reads even with no host UI wired to react to it.- tl.fromTo(- pulse,- { autoAlpha: 0, scale: 0.4 },- {- autoAlpha: 0.35,- scale: 1,- duration: down,- ease: "power2.out",- immediateRender: false,- },- touchDown,- );- tl.to(- pulse,- { autoAlpha: 0, scale: 1.4, duration: q(0.24), ease: "power2.out" },- touchDown + down,- );-- const inEnd = at + approach + down;+ const touchDown = at + appear;// --- HOLD: the only elastic phase. Stretch it, never gsap.timeScale(). ---let holdEnd;if (vars.gesture === "swipe") {- // RETIME RANGE: 0.28s - 0.52s per the swipe law. elasticity scales pacing.+ // a swipe lasts 0.28s to 0.52s; elasticity scales its pacing.const swipeDuration = q(clamp(0.34 * elasticity, 0.28, 0.52));const travel = hostH * 0.4; // vertical scroll, 40% of host height (32-68% allowed)const accel = q(swipeDuration * 0.41);@@ -320,47 +217,22 @@actor,{ x: x0, y: y0 },{ x: x0, y: bendY, duration: accel, ease: "power2.in", immediateRender: false },- inEnd,+ touchDown,);- tl.to(actor, { x: x0, y: endY, duration: decel, ease: "power3.out" }, inEnd + accel);- holdEnd = inEnd + swipeDuration;- } else {- // RETIME RANGE: 0.02s - 0.10s. A brief contact dwell, never a- // long-press (long-press is a distinct gesture with its own- // progress-ring recognizer).- const holdDuration = q(clamp(0.02 * elasticity, 0.02, 0.1));- holdEnd = inEnd + holdDuration;- }-- // --- OUT: fixed, never stretched. ---- if (vars.gesture === "swipe") {- const liftDuration = q(0.12);- tl.to(contact, { autoAlpha: 0, duration: q(0.08), ease: "power2.out" }, holdEnd);tl.to(- core,- { y: -10, scale: 0.74, duration: liftDuration, ease: "power2.in" },- holdEnd,+ actor,+ { x: x0, y: endY, duration: decel, ease: "power3.out" },+ touchDown + accel,);- tl.to(actor, { autoAlpha: 0, duration: liftDuration, ease: "power2.in" }, holdEnd);- return { touchDown, holdStart: inEnd, holdEnd, settle: holdEnd + liftDuration };+ holdEnd = touchDown + swipeDuration;+ } else {+ // a tap touches for 0.08s to 0.2s; any longer reads as a long-press.+ holdEnd = touchDown + q(clamp(0.12 * elasticity, 0.08, 0.2));}- const release = q(0.16);- tl.to(core, { scale: 1, duration: release, ease: "power2.out" }, holdEnd);- tl.to(- contact,- { autoAlpha: 0, scaleX: 0.72, duration: q(0.12), ease: "power2.out" },- holdEnd,- );- const liftStart = holdEnd + release; // 0s gap, within the spec's <=0.04s allowance- const liftDuration = q(0.12);- tl.to(- core,- { y: -10, scale: 0.74, duration: liftDuration, ease: "power2.in" },- liftStart,- );- tl.to(actor, { autoAlpha: 0, duration: liftDuration, ease: "power2.in" }, liftStart);- return { touchDown, holdStart: inEnd, holdEnd, settle: liftStart + liftDuration };+ // --- OUT: fixed, never stretched. ---+ const lift = q(0.2);+ tl.to(actor, { autoAlpha: 0, duration: lift, ease: "power1.in" }, holdEnd);}// Self-driving mount: build the paused timeline and register itdiff --git a/registry/registry.json b/registry/registry.jsonindex c7047d2905..c8c99b1640 100644--- a/registry/registry.json+++ b/registry/registry.json@@ -1279,10 +1279,6 @@"name": "signup-flow","type": "hyperframes:component"},- {- "name": "simulated-cursor",- "type": "hyperframes:component"- },{"name": "skeleton-reveal","type": "hyperframes:component"diff --git a/scripts/check-no-main-deletions.mjs b/scripts/check-no-main-deletions.mjsindex eb60193418..815441ce6f 100644--- a/scripts/check-no-main-deletions.mjs+++ b/scripts/check-no-main-deletions.mjs@@ -39,6 +39,9 @@ const BASE_FLAG = "--base";const STORYBOARD_VIEW_REASON ="owner-directed removal of the Studio storyboard view; its only readers were deleted with it";+const SIMULATED_CURSOR_REASON =+ "owner-directed removal of simulated-cursor; the Cursors section's new pointer animations replace it";+export const ALLOWED_DELETIONS = new Map([["packages/studio/src/player/components/automationGestureKeys.ts",@@ -1083,6 +1086,9 @@ export const ALLOWED_DELETIONS = new Map(["registry/examples/vscode-theme-visualizer/scripts/build-theme-registry.mjs","removed in the 2026-09 low-use catalog cut, see the PR",],+ ["registry/components/simulated-cursor/demo.html", SIMULATED_CURSOR_REASON],+ ["registry/components/simulated-cursor/registry-item.json", SIMULATED_CURSOR_REASON],+ ["registry/components/simulated-cursor/simulated-cursor.html", SIMULATED_CURSOR_REASON],["packages/studio-server/src/helpers/previewWatchIgnore.ts","preview.watchIgnore is replaced by reloading only when a file the preview loaded changes",diff --git a/scripts/generate-catalog-pages.test.ts b/scripts/generate-catalog-pages.test.tsindex 2ce2ceef3c..864a1218a0 100644--- a/scripts/generate-catalog-pages.test.ts+++ b/scripts/generate-catalog-pages.test.ts@@ -23,7 +23,9 @@ import { fileURLToPath } from "node:url";import { runInNewContext } from "node:vm";import { prepareSrcForElement } from "../packages/player/src/shader-options.ts";import {+ groupForItem,mdxStringAttribute,+ sectionEntry,stageProps,variableBootstrap,variablePreviewWrapper,@@ -361,3 +363,58 @@ describe("tile poster priority", () => {assert.doesNotMatch(source, /\.map\(card\)/);});});++describe("3D shelves", () => {+ const block = (tags: string[]) => groupForItem({ name: "x", type: "block", tags });++ it("shelves 3d-object and 3d-motion items apart, each on its first tag", () => {+ assert.equal(block(["3d-object", "three-js", "glass", "title-card"]), "3D objects");+ assert.equal(block(["3d-motion", "cards", "orbit"]), "3D motion");+ assert.equal(block(["three-js", "3d-object"]), "Blocks");+ });++ it("names the camera-move shelf Camera, since 3D items live under 3D", () => {+ assert.equal(block(["camera", "motion-primitive", "zoom"]), "Camera");+ });+});++describe("sectionEntry", () => {+ it("flattens a section that wraps exactly one shelf of its own name", () => {+ const entry = sectionEntry("3D motion", [{ group: "3D motion", pages: ["a", "b"] }]);+ assert.deepEqual(entry, { group: "3D motion", pages: ["a", "b"] });+ });++ it("nests a section that wraps one differently-named shelf", () => {+ const entry = sectionEntry("Data & charts", [{ group: "Data", pages: ["a"] }]);+ assert.deepEqual(entry, {+ group: "Data & charts",+ pages: [{ group: "Data", pages: ["a"] }],+ });+ });++ it("nests every shelf when a section wraps more than one", () => {+ const children = [+ { group: "Captions", pages: ["a"] },+ { group: "Typography & Text", pages: ["b"] },+ ];+ const entry = sectionEntry("Text & captions", children);+ assert.deepEqual(entry, { group: "Text & captions", pages: children });+ });+});++describe("Cursors shelf", () => {+ const component = (tags: string[]) => groupForItem({ name: "x", type: "component", tags });++ it("shelves an item whose first tag is cursor, even when it is also a video primitive", () => {+ assert.equal(component(["cursor", "video-primitive", "motion-primitive"]), "Cursors");+ assert.equal(component(["cursor", "motion-primitive", "product-demo"]), "Cursors");+ });++ it("leaves an item that only mentions cursor later in its tags on its own shelf", () => {+ assert.equal(+ groupForItem({ name: "x", type: "block", tags: ["html-in-canvas", "text", "cursor"] }),+ "HTML-in-Canvas",+ );+ assert.equal(component(["video-primitive", "cursor"]), "Motion Primitives");+ });+});diff --git a/scripts/generate-catalog-pages.ts b/scripts/generate-catalog-pages.tsindex bf435eb0af..177f0966c2 100644--- a/scripts/generate-catalog-pages.ts+++ b/scripts/generate-catalog-pages.ts@@ -795,10 +795,30 @@ function tunableVariables(kind: ItemKind, manifest: RegistryItem): ItemVariable[return file ? (declaredVariables(file.source) as ItemVariable[]) : [];}+// One section's sidebar entry. A section wrapping exactly one identically-named+// shelf (e.g. "3D motion") flattens to that shelf's own pages, or the accordion+// header and its one child read the same word twice; a differently-named single+// child (e.g. "Data & charts" wrapping "Data") keeps its nested shelf.+export function sectionEntry(+ section: string,+ children: { group: string; pages: unknown[] }[],+): { group: string; pages: unknown[] } {+ if (children.length === 1 && children[0]!.group === section) {+ return { group: section, pages: children[0]!.pages };+ }+ // A nested shelf is an entry in the parent's `pages`, beside the page+ // strings. A sibling `groups` key parses without complaint and renders+ // nothing, which took the whole catalog out of the sidebar.+ return { group: section, pages: children };+}+/** The catalog shelf an item sits on, one function for the nav and the page's category. */// fallow-ignore-next-line complexity-function groupForItem(entry: Pick<CatalogEntry, "name" | "type" | "tags">): string {+export function groupForItem(entry: Pick<CatalogEntry, "name" | "type" | "tags">): string {const tags = entry.tags;+ // `cursor` as the first tag declares the Cursors shelf. It is checked before+ // `video-primitive` so a pointer that is also a primitive shelves with the cursors.+ if (tags[0] === "cursor") return "Cursors";// Declared membership beats every inferred rule below: `video-primitive` is// the tag a human puts on an item to put it on the primitives shelf, and it// must not be overridden by whatever else the item happens to be tagged.@@ -806,6 +826,7 @@ function groupForItem(entry: Pick<CatalogEntry, "name" | "type" | "tags">): stri// Same precedence rule: `3d-motion` is a declared shelf, checked before any// inferred tag (e.g. `transition`, `carousel`) that a 3D-motion piece also carries.if (tags[0] === "3d-motion") return "3D motion";+ if (tags[0] === "3d-object") return "3D objects";// Two-tag combos for specific groupingif (tags.includes("transition") && tags.includes("shader")) return "Shader Transitions";if (tags.includes("transition") && tags.includes("showcase")) return "CSS Transitions";@@ -831,7 +852,7 @@ function groupForItem(entry: Pick<CatalogEntry, "name" | "type" | "tags">): stri// first: an item tagged both `camera` and `motion-primitive` is a camera// move, which is the narrower and more useful shelf to find it on.if (tags.includes("texture")) return "Texture";- if (tags.includes("camera") || tags.includes("3d")) return "Camera & 3D";+ if (tags.includes("camera")) return "Camera";if (tags.includes("product-demo") || tags.includes("demonstrate") || tags.includes("pointers")) {return "Product Demo";}@@ -1209,6 +1230,7 @@ function main(): void {// go into an "Other" group. Groups are sorted with a priority order.const GROUP_ORDER: Record<string, number> = {"3D motion": -1,+ "3D objects": -0.5,"Code Animations": 0,Captions: 1,"HTML-in-Canvas": 2,@@ -1223,7 +1245,8 @@ function main(): void {"Motion Primitives": 9,"Motion Scenes": 11,"Typography & Text": 10,- "Camera & 3D": 12,+ Camera: 12,+ Cursors: 12.5,"Product Demo": 13,Texture: 14,Effects: 15,@@ -1247,7 +1270,7 @@ function main(): void {// Collapsing them under what a reader came here to make turns it into eight// openable sections, and keeps every existing shelf name intact underneath.const SECTIONS: { section: string; groups: string[] }[] = [- { section: "3D motion", groups: ["3D motion"] },+ { section: "3D", groups: ["3D motion", "3D objects"] },{ section: "Text & captions", groups: ["Captions", "Typography & Text", "Lower Thirds"] },{ section: "Code", groups: ["Code Animations", "Code Snippets"] },{ section: "Transitions", groups: ["Shader Transitions", "CSS Transitions"] },@@ -1256,12 +1279,13 @@ function main(): void {section: "Scenes & demos",groups: ["Showcases", "Product Demo", "Social Overlays", "Motion Scenes"],},+ { section: "Cursors", groups: ["Cursors"] },// Its own section rather than a shelf inside Scenes & demos. At 25 items it// is larger than Data & charts (17) and Blocks (13), which are both// sections on their own, and pulling it out takes the largest section in// the catalog from 120 items down to 95.{ section: "Carousels", groups: ["Carousels"] },- { section: "Motion & effects", groups: ["Motion Primitives", "Effects", "Camera & 3D"] },+ { section: "Motion & effects", groups: ["Motion Primitives", "Effects", "Camera"] },{ section: "Surfaces", groups: ["Texture", "HTML-in-Canvas"] },{ section: "Blocks", groups: ["Blocks"] },];@@ -1276,10 +1300,7 @@ function main(): void {.filter((g): g is { group: string; pages: string[] } => g !== undefined);if (children.length === 0) continue;for (const child of children) placed.add(child.group);- // A nested shelf is an entry in the parent's `pages`, beside the page- // strings. A sibling `groups` key parses without complaint and renders- // nothing, which took the whole catalog out of the sidebar.- catalogGroups.push({ group: section, pages: children });+ catalogGroups.push(sectionEntry(section, children));}// A shelf nobody assigned a section still has to appear, or a new tag woulddiff --git a/scripts/player-cdn-pin.test.ts b/scripts/player-cdn-pin.test.tsindex 412ebb73fe..4d3680818a 100644--- a/scripts/player-cdn-pin.test.ts+++ b/scripts/player-cdn-pin.test.ts@@ -1,7 +1,8 @@import { test } from "node:test";import assert from "node:assert/strict";import { execFileSync } from "node:child_process";-import { readFileSync } from "node:fs";+import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";+import { tmpdir } from "node:os";import { join, resolve } from "node:path";/**@@ -26,23 +27,25 @@ const TEXT_FILE = /\.(mdx?|[jt]sx?|html|json)$/;* Tracked files only, via git rather than a directory walk: it is one call, and* it skips `node_modules` and build output for free because they are ignored.*/-function trackedTextFiles(): string[] {+function trackedTextFiles(root = ROOT): string[] {const listing = execFileSync("git",["ls-files", "-z", "docs", "scripts", "packages", "registry"],{- cwd: ROOT,+ cwd: root,encoding: "utf-8",maxBuffer: 64 * 1024 * 1024,},);- return listing.split("\0").filter((file) => TEXT_FILE.test(file));+ // A tracked file can be gone from disk: catalog regeneration removes a deleted+ // item's pages before the publish PR untracks them.+ return listing.split("\0").filter((file) => TEXT_FILE.test(file) && existsSync(join(root, file)));}-function pinnedReferences(): { file: string; version: string }[] {+function pinnedReferences(root = ROOT): { file: string; version: string }[] {const found: { file: string; version: string }[] = [];- for (const file of trackedTextFiles()) {- const text = readFileSync(join(ROOT, file), "utf-8");+ for (const file of trackedTextFiles(root)) {+ const text = readFileSync(join(root, file), "utf-8");for (const match of text.matchAll(PLAYER_CDN)) {found.push({ file, version: match[1] as string });}@@ -68,3 +71,17 @@ test("every player CDN reference asks for latest", () => {.join("\n")}`,);});++test("a tracked file missing from disk is skipped, not read", () => {+ const dir = mkdtempSync(join(tmpdir(), "player-cdn-pin-"));+ try {+ execFileSync("git", ["init", "-q"], { cwd: dir });+ mkdirSync(join(dir, "docs"));+ writeFileSync(join(dir, "docs", "gone.mdx"), "removed page");+ execFileSync("git", ["add", "docs"], { cwd: dir });+ rmSync(join(dir, "docs", "gone.mdx"));+ assert.deepEqual(pinnedReferences(dir), []);+ } finally {+ rmSync(dir, { recursive: true, force: true });+ }+});diff --git a/scripts/sync-docs-catalog.mjs b/scripts/sync-docs-catalog.mjsindex d0234de65e..a97fce07fb 100644--- a/scripts/sync-docs-catalog.mjs+++ b/scripts/sync-docs-catalog.mjs@@ -121,16 +121,15 @@ function walk(node, pathLabels) {}for (const g of tab.groups) walk(g, []);-// Landing order: 3D motion first (once it exists — a separate initiative brings the-// items in), Carousels second, everything else keeping the order the hand-authored nav-// already had. Only "3d-motion" is pinned (two rows on the landing instead of one), matching+// Landing order: 3D first, Carousels second, everything else keeping the order the+// hand-authored nav already had. Only "3d" is pinned (two rows on the landing instead of one), matching// the reference gallery's own convention — it pins the one group, not every group.-const PRIORITY = ["3d-motion", "carousels"];+const PRIORITY = ["3d", "carousels"];const groups = groupsOrder.map((id) => ({id,label: groupLabels.get(id),- pinned: id === "3d-motion",+ pinned: id === "3d",count: items.filter((i) => i.group === id).length,})).filter((g) => g.count > 0)