Files
hyperframes/registry/blocks/orbit-card/orbit-card.html
Miguel Ángel 53e2e20a15 fix(registry): six blocks load their own files and variables when mounted (#4452)
* feat(core): a composition's script can load its own files with __hyperframes.assetUrl

* test(core): a template composition inside a mounted file resolves assets from that file

* docs: assetUrl is for paths beside the composition, not project-root paths

* docs: say assetUrl misses a project-root path

* fix(core): a mounted composition's import map and module scripts run as such

* refactor(core): scope a mounted module script under the same condition as a classic one

* fix(core): a mounted module script loaded by src stays a module

* fix(core): a mounted import map keeps the trailing slash of a prefix address

* fix(registry): six blocks load their own files and variables when mounted

* fix(registry): keep frost's variable declarations on its html element

* fix(registry): orbit-card uses its own variables; frost font and catalog maps follow

* chore(core): keep the module-script helpers' comment share at the base

* fix(catalog): frost's payload runs its driving script, not the asset-base one

* test(catalog): check import-map keys by membership, not a built regex
2026-09-25 04:43:43 +00:00

110 lines
3.5 KiB
HTML
Vendored
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html
lang="en"
data-composition-variables='[{"id":"feature1Title","type":"string","label":"Card title","default":"Always in sync","maxLength":28},{"id":"feature1Desc","type":"string","label":"Card description","default":"Changes reach every screen the moment they happen.","maxLength":110},{"id":"feature1Accent","type":"color","label":"Card accent","default":"#4cc9ff"},{"id":"cardOrbitDegrees","type":"number","label":"Card orbit degrees","description":"Total card-only vertical orbit during Blender frames 150–180 (4.9667–5.9667 seconds). Enter 180, 360, 720, or any angle. The sphere keeps its independent spin. The final angle holds after frame 180.","default":360,"min":-36000,"max":36000,"step":1}]'
>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1920, height=1080" />
<title>Orbit Card — approved Blender motion</title>
<script src="assets/gsap-3.14.2.min.js"></script>
<style>
@font-face {
font-family: Archivo;
font-weight: 400;
src: url("assets/archivo-regular.ttf");
}
@font-face {
font-family: Archivo;
font-weight: 600;
src: url("assets/archivo-semibold.ttf");
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html,
body {
width: 1920px;
height: 1080px;
overflow: hidden;
background: #161718;
}
#oc-root {
position: relative;
width: 1920px;
height: 1080px;
overflow: hidden;
font-family: Archivo, sans-serif;
}
#oc-stage {
position: absolute;
inset: 0;
}
#oc-stage canvas {
width: 1920px;
height: 1080px;
display: block;
}
#oc-fontload {
position: absolute;
opacity: 0;
pointer-events: none;
}
</style>
</head>
<body>
<div
id="oc-root"
data-composition-id="orbit-card"
data-start="0"
data-duration="10"
data-width="1920"
data-height="1080"
>
<section
id="oc-stage"
class="clip"
data-start="0"
data-duration="10"
data-track-index="1"
></section>
<div id="oc-fontload" aria-hidden="true">
<span style="font-weight: 400">Aa</span><span style="font-weight: 600">Aa</span>
</div>
</div>
<script type="importmap">
{ "imports": { "orbit-card/scene": "./assets/orbit-scene.js" } }
</script>
<script type="module">
import { createOrbitScene } from "orbit-card/scene";
// Bare __hyperframes is this composition's own in a module.
const renderAt = createOrbitScene(
(typeof __hyperframes !== "undefined" && __hyperframes.getVariables?.()) || {},
);
const state = { time: 0 };
const timeline = gsap.timeline({ paused: true });
timeline.to(state, {
time: 10,
duration: 10,
ease: "none",
onUpdate: () => renderAt(state.time),
});
window.addEventListener("hf-seek", (event) => {
if (typeof event.detail?.time === "number") {
timeline.totalTime(Math.max(0, Math.min(10, event.detail.time)), true);
renderAt(event.detail.time);
}
});
window.__timelines = window.__timelines || {};
window.__timelines["orbit-card"] = timeline;
const query = new URLSearchParams(location.search);
if (query.has("play")) {
timeline.repeat(query.has("loop") ? 999 : 0);
timeline.play(0);
}
</script>
</body>
</html>