Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

docs: open the site at the quickstart, in the reader's language (#86)

rponeawa62a01c98a2b6
diff --git a/README.md b/README.md
index 857d4585..1348da07 100644
--- a/README.md
+++ b/README.md
@@ -9,11 +9,11 @@
<p align="center">1 command, 100 variants, 100M views.</p>
<p align="center">
- <a href="https://narratage.hypit.ai/"><strong>Demo</strong></a>
+ <a href="https://hypit.ai"><strong>Demo</strong></a>
&nbsp;&bull;&nbsp;
- <a href="https://narratage.hypit.ai/quickstart"><strong>Quickstart</strong></a>
+ <a href="https://docs.hypit.ai/quickstart"><strong>Quickstart</strong></a>
&nbsp;&bull;&nbsp;
- <a href="https://narratage.hypit.ai/guide/develop"><strong>Develop</strong></a>
+ <a href="https://docs.hypit.ai/guide/develop"><strong>Develop</strong></a>
&nbsp;&bull;&nbsp;
<a href="./README.zh-CN.md"><strong>简体中文</strong></a>
</p>
@@ -27,7 +27,7 @@
</p>
<p align="center">
- <a href="https://narratage.hypit.ai/"><img alt="Visit our website" src="https://img.shields.io/badge/Visit%20our%20website-DF3C68?style=for-the-badge&logo=data:image/svg%2Bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjI1Ny4wMyAyODcuNDggNDg2Ljk0IDQyNi4wNCI%2BPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTczMy4wMDEsNDYyLjU5MmMtMTEuNDQtMTYuNTEtMzAuMjg1LTI2LjM0NC01MC4zNTMtMjYuMzQ0aC0xNzguNzA1Yy0yMy40OTMsMC00Ny42NzUsMTQuMjM0LTU2LjYyOCwzNS45NjdsLTU0LjA2NSwxNDUuMDUzYy04LjgsMjEuNTIzLTguNjg2LDQ2LjAxMSw0LjI0Nyw2NS4zNTIsMTIuOTksMTkuNDE4LDM3LjAzOCwzMC44OTcsNjAuMzk3LDMwLjg5N2gxNjQuNDljMjcuMDEzLDAsNTEuNDYzLTE2Ljk4OSw2MC45MTQtNDIuMjhsNTYuODAxLTE1Mi4yMjdjNy4wMjEtMTguODI1LDQuMzgxLTM5LjkwOC03LjA1OS01Ni4zOTl2LS4wMzhoLS4wMzh2LjAxOVpNNjMzLjk3OCw2NTIuODEzYy0xLjc5OCw0LjgyMS02LjQ4NSw4LjA3My0xMS42MzIsOC4wNzNoLTE1OS42NWMtOC4zMDMsMC0xMi43OC01LjM1Ny0xNC4zMjktNy42MzNzLTQuNzgzLTguNDc1LTEuNjA3LTE2LjE0N2w0NS42MjgtMTI2LjcyNWM0LjM4MS0xMi4xNDgsMTUuNDU4LTIwLjc5NiwyOC4zNTItMjEuNDY1LjYzMS0uMDM4LDEuMjgyLS4wMzgsMS45NTEtLjAzOGgxNDQuMjY5czIzLjkzMywyLjcxNywxNy43NzMsMjcuOTUxbC01MC43NTUsMTM2LjAwNGgwdi0uMDE5Wk0zNTYuMjUsNjIzLjEyMnMtNDIuNzc3LTIyLjE3My0zMy43ODYtNjIuNDgzbDU2Ljc2Mi0xNTcuMzE2YzkuMTQ1LTI1LjM0OSwzMy4yMTItNDIuMjYxLDYwLjE2OC00Mi4yNjFoMTgxLjc4NWMxMS45NTcsMCwyMy4xNDksNS43OTcsMzAuMDU1LDE1LjU3M2wyNi41NzMsMzcuNjVoLTIxNi4xMjVjLTE2LjY0NCwwLTMxLjU0NywxMC4zNS0zNy4zNDQsMjUuOTYxbC02OC4wODgsMTgyLjg5NWgwdi0uMDE5Wk0yOTIuMDY0LDU0OS41NDNzLTQyLjc5Ny0yMi4xNzMtMzMuNzg2LTYyLjQ4M2w1Ni43NjItMTU3LjMxNmM5LjE2NC0yNS4zNDksMzMuMjMxLTQyLjI2MSw2MC4xNjgtNDIuMjYxaDE3Mi4wMDljMTEuOTU3LDAsMjMuMTQ5LDUuNzk3LDMwLjA1NSwxNS41NzNsMjYuNTczLDM3LjY1aC0yMDYuMzExYy0xNi42NDQsMC0zMS41NDcsMTAuMzUtMzcuMzQ0LDI1Ljk2MWwtNjguMDg4LDE4Mi44OTVoLS4wMzh2LS4wMTlaIi8%2BPC9zdmc%2B"></a>
+ <a href="https://hypit.ai"><img alt="Visit our website" src="https://img.shields.io/badge/Visit%20our%20website-DF3C68?style=for-the-badge&logo=data:image/svg%2Bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjI1Ny4wMyAyODcuNDggNDg2Ljk0IDQyNi4wNCI%2BPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTczMy4wMDEsNDYyLjU5MmMtMTEuNDQtMTYuNTEtMzAuMjg1LTI2LjM0NC01MC4zNTMtMjYuMzQ0aC0xNzguNzA1Yy0yMy40OTMsMC00Ny42NzUsMTQuMjM0LTU2LjYyOCwzNS45NjdsLTU0LjA2NSwxNDUuMDUzYy04LjgsMjEuNTIzLTguNjg2LDQ2LjAxMSw0LjI0Nyw2NS4zNTIsMTIuOTksMTkuNDE4LDM3LjAzOCwzMC44OTcsNjAuMzk3LDMwLjg5N2gxNjQuNDljMjcuMDEzLDAsNTEuNDYzLTE2Ljk4OSw2MC45MTQtNDIuMjhsNTYuODAxLTE1Mi4yMjdjNy4wMjEtMTguODI1LDQuMzgxLTM5LjkwOC03LjA1OS01Ni4zOTl2LS4wMzhoLS4wMzh2LjAxOVpNNjMzLjk3OCw2NTIuODEzYy0xLjc5OCw0LjgyMS02LjQ4NSw4LjA3My0xMS42MzIsOC4wNzNoLTE1OS42NWMtOC4zMDMsMC0xMi43OC01LjM1Ny0xNC4zMjktNy42MzNzLTQuNzgzLTguNDc1LTEuNjA3LTE2LjE0N2w0NS42MjgtMTI2LjcyNWM0LjM4MS0xMi4xNDgsMTUuNDU4LTIwLjc5NiwyOC4zNTItMjEuNDY1LjYzMS0uMDM4LDEuMjgyLS4wMzgsMS45NTEtLjAzOGgxNDQuMjY5czIzLjkzMywyLjcxNywxNy43NzMsMjcuOTUxbC01MC43NTUsMTM2LjAwNGgwdi0uMDE5Wk0zNTYuMjUsNjIzLjEyMnMtNDIuNzc3LTIyLjE3My0zMy43ODYtNjIuNDgzbDU2Ljc2Mi0xNTcuMzE2YzkuMTQ1LTI1LjM0OSwzMy4yMTItNDIuMjYxLDYwLjE2OC00Mi4yNjFoMTgxLjc4NWMxMS45NTcsMCwyMy4xNDksNS43OTcsMzAuMDU1LDE1LjU3M2wyNi41NzMsMzcuNjVoLTIxNi4xMjVjLTE2LjY0NCwwLTMxLjU0NywxMC4zNS0zNy4zNDQsMjUuOTYxbC02OC4wODgsMTgyLjg5NWgwdi0uMDE5Wk0yOTIuMDY0LDU0OS41NDNzLTQyLjc5Ny0yMi4xNzMtMzMuNzg2LTYyLjQ4M2w1Ni43NjItMTU3LjMxNmM5LjE2NC0yNS4zNDksMzMuMjMxLTQyLjI2MSw2MC4xNjgtNDIuMjYxaDE3Mi4wMDljMTEuOTU3LDAsMjMuMTQ5LDUuNzk3LDMwLjA1NSwxNS41NzNsMjYuNTczLDM3LjY1aC0yMDYuMzExYy0xNi42NDQsMC0zMS41NDcsMTAuMzUtMzcuMzQ0LDI1Ljk2MWwtNjguMDg4LDE4Mi44OTVoLS4wMzh2LS4wMTlaIi8%2BPC9zdmc%2B"></a>
<a href="https://discord.gg/85hnyQnxpn"><img alt="Join our Discord" src="https://img.shields.io/badge/Join%20our%20Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white"></a>
<a href="https://t.me/hypit"><img alt="Join our Telegram" src="https://img.shields.io/badge/Join%20our%20Telegram-26A5E4?style=for-the-badge&logo=telegram&logoColor=white"></a>
<a href="https://x.com/hypitai"><img alt="Follow @hypitai on X" src="https://img.shields.io/badge/Follow%20%40hypitai-000000?style=for-the-badge&logo=x&logoColor=white"></a>
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 7cae593b..40237a79 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -9,11 +9,11 @@
<p align="center">一条命令,100 个变体,1 亿播放量。</p>
<p align="center">
- <a href="https://narratage.hypit.ai/zh/"><strong>Demo</strong></a>
+ <a href="https://hypit.ai"><strong>Demo</strong></a>
&nbsp;&bull;&nbsp;
- <a href="https://narratage.hypit.ai/zh/quickstart"><strong>快速开始</strong></a>
+ <a href="https://docs.hypit.ai/zh/quickstart"><strong>快速开始</strong></a>
&nbsp;&bull;&nbsp;
- <a href="https://narratage.hypit.ai/zh/guide/develop"><strong>开发指南</strong></a>
+ <a href="https://docs.hypit.ai/zh/guide/develop"><strong>开发指南</strong></a>
&nbsp;&bull;&nbsp;
<a href="./README.md"><strong>English</strong></a>
</p>
@@ -27,7 +27,7 @@
</p>
<p align="center">
- <a href="https://narratage.hypit.ai/zh/"><img alt="Visit our website" src="https://img.shields.io/badge/Visit%20our%20website-DF3C68?style=for-the-badge&logo=data:image/svg%2Bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjI1Ny4wMyAyODcuNDggNDg2Ljk0IDQyNi4wNCI%2BPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTczMy4wMDEsNDYyLjU5MmMtMTEuNDQtMTYuNTEtMzAuMjg1LTI2LjM0NC01MC4zNTMtMjYuMzQ0aC0xNzguNzA1Yy0yMy40OTMsMC00Ny42NzUsMTQuMjM0LTU2LjYyOCwzNS45NjdsLTU0LjA2NSwxNDUuMDUzYy04LjgsMjEuNTIzLTguNjg2LDQ2LjAxMSw0LjI0Nyw2NS4zNTIsMTIuOTksMTkuNDE4LDM3LjAzOCwzMC44OTcsNjAuMzk3LDMwLjg5N2gxNjQuNDljMjcuMDEzLDAsNTEuNDYzLTE2Ljk4OSw2MC45MTQtNDIuMjhsNTYuODAxLTE1Mi4yMjdjNy4wMjEtMTguODI1LDQuMzgxLTM5LjkwOC03LjA1OS01Ni4zOTl2LS4wMzhoLS4wMzh2LjAxOVpNNjMzLjk3OCw2NTIuODEzYy0xLjc5OCw0LjgyMS02LjQ4NSw4LjA3My0xMS42MzIsOC4wNzNoLTE1OS42NWMtOC4zMDMsMC0xMi43OC01LjM1Ny0xNC4zMjktNy42MzNzLTQuNzgzLTguNDc1LTEuNjA3LTE2LjE0N2w0NS42MjgtMTI2LjcyNWM0LjM4MS0xMi4xNDgsMTUuNDU4LTIwLjc5NiwyOC4zNTItMjEuNDY1LjYzMS0uMDM4LDEuMjgyLS4wMzgsMS45NTEtLjAzOGgxNDQuMjY5czIzLjkzMywyLjcxNywxNy43NzMsMjcuOTUxbC01MC43NTUsMTM2LjAwNGgwdi0uMDE5Wk0zNTYuMjUsNjIzLjEyMnMtNDIuNzc3LTIyLjE3My0zMy43ODYtNjIuNDgzbDU2Ljc2Mi0xNTcuMzE2YzkuMTQ1LTI1LjM0OSwzMy4yMTItNDIuMjYxLDYwLjE2OC00Mi4yNjFoMTgxLjc4NWMxMS45NTcsMCwyMy4xNDksNS43OTcsMzAuMDU1LDE1LjU3M2wyNi41NzMsMzcuNjVoLTIxNi4xMjVjLTE2LjY0NCwwLTMxLjU0NywxMC4zNS0zNy4zNDQsMjUuOTYxbC02OC4wODgsMTgyLjg5NWgwdi0uMDE5Wk0yOTIuMDY0LDU0OS41NDNzLTQyLjc5Ny0yMi4xNzMtMzMuNzg2LTYyLjQ4M2w1Ni43NjItMTU3LjMxNmM5LjE2NC0yNS4zNDksMzMuMjMxLTQyLjI2MSw2MC4xNjgtNDIuMjYxaDE3Mi4wMDljMTEuOTU3LDAsMjMuMTQ5LDUuNzk3LDMwLjA1NSwxNS41NzNsMjYuNTczLDM3LjY1aC0yMDYuMzExYy0xNi42NDQsMC0zMS41NDcsMTAuMzUtMzcuMzQ0LDI1Ljk2MWwtNjguMDg4LDE4Mi44OTVoLS4wMzh2LS4wMTlaIi8%2BPC9zdmc%2B"></a>
+ <a href="https://hypit.ai"><img alt="Visit our website" src="https://img.shields.io/badge/Visit%20our%20website-DF3C68?style=for-the-badge&logo=data:image/svg%2Bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjI1Ny4wMyAyODcuNDggNDg2Ljk0IDQyNi4wNCI%2BPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTczMy4wMDEsNDYyLjU5MmMtMTEuNDQtMTYuNTEtMzAuMjg1LTI2LjM0NC01MC4zNTMtMjYuMzQ0aC0xNzguNzA1Yy0yMy40OTMsMC00Ny42NzUsMTQuMjM0LTU2LjYyOCwzNS45NjdsLTU0LjA2NSwxNDUuMDUzYy04LjgsMjEuNTIzLTguNjg2LDQ2LjAxMSw0LjI0Nyw2NS4zNTIsMTIuOTksMTkuNDE4LDM3LjAzOCwzMC44OTcsNjAuMzk3LDMwLjg5N2gxNjQuNDljMjcuMDEzLDAsNTEuNDYzLTE2Ljk4OSw2MC45MTQtNDIuMjhsNTYuODAxLTE1Mi4yMjdjNy4wMjEtMTguODI1LDQuMzgxLTM5LjkwOC03LjA1OS01Ni4zOTl2LS4wMzhoLS4wMzh2LjAxOVpNNjMzLjk3OCw2NTIuODEzYy0xLjc5OCw0LjgyMS02LjQ4NSw4LjA3My0xMS42MzIsOC4wNzNoLTE1OS42NWMtOC4zMDMsMC0xMi43OC01LjM1Ny0xNC4zMjktNy42MzNzLTQuNzgzLTguNDc1LTEuNjA3LTE2LjE0N2w0NS42MjgtMTI2LjcyNWM0LjM4MS0xMi4xNDgsMTUuNDU4LTIwLjc5NiwyOC4zNTItMjEuNDY1LjYzMS0uMDM4LDEuMjgyLS4wMzgsMS45NTEtLjAzOGgxNDQuMjY5czIzLjkzMywyLjcxNywxNy43NzMsMjcuOTUxbC01MC43NTUsMTM2LjAwNGgwdi0uMDE5Wk0zNTYuMjUsNjIzLjEyMnMtNDIuNzc3LTIyLjE3My0zMy43ODYtNjIuNDgzbDU2Ljc2Mi0xNTcuMzE2YzkuMTQ1LTI1LjM0OSwzMy4yMTItNDIuMjYxLDYwLjE2OC00Mi4yNjFoMTgxLjc4NWMxMS45NTcsMCwyMy4xNDksNS43OTcsMzAuMDU1LDE1LjU3M2wyNi41NzMsMzcuNjVoLTIxNi4xMjVjLTE2LjY0NCwwLTMxLjU0NywxMC4zNS0zNy4zNDQsMjUuOTYxbC02OC4wODgsMTgyLjg5NWgwdi0uMDE5Wk0yOTIuMDY0LDU0OS41NDNzLTQyLjc5Ny0yMi4xNzMtMzMuNzg2LTYyLjQ4M2w1Ni43NjItMTU3LjMxNmM5LjE2NC0yNS4zNDksMzMuMjMxLTQyLjI2MSw2MC4xNjgtNDIuMjYxaDE3Mi4wMDljMTEuOTU3LDAsMjMuMTQ5LDUuNzk3LDMwLjA1NSwxNS41NzNsMjYuNTczLDM3LjY1aC0yMDYuMzExYy0xNi42NDQsMC0zMS41NDcsMTAuMzUtMzcuMzQ0LDI1Ljk2MWwtNjguMDg4LDE4Mi44OTVoLS4wMzh2LS4wMTlaIi8%2BPC9zdmc%2B"></a>
<a href="https://discord.gg/85hnyQnxpn"><img alt="Join our Discord" src="https://img.shields.io/badge/Join%20our%20Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white"></a>
<a href="https://t.me/hypit"><img alt="Join our Telegram" src="https://img.shields.io/badge/Join%20our%20Telegram-26A5E4?style=for-the-badge&logo=telegram&logoColor=white"></a>
<a href="https://x.com/hypitai"><img alt="Follow @hypitai on X" src="https://img.shields.io/badge/Follow%20%40hypitai-000000?style=for-the-badge&logo=x&logoColor=white"></a>
diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts
index 2db30748..b39af327 100644
--- a/docs/.vitepress/config.ts
+++ b/docs/.vitepress/config.ts
@@ -2,8 +2,7 @@ import { defineConfig } from "vitepress";
import type { ShikiTransformer } from "shiki";
// Keep the server deployment at /docs/ while allowing the custom-domain
-// GitHub Pages workflow to publish the same site at the domain root. The
-// pre-paint script below has to agree with this, so both read the one value.
+// GitHub Pages workflow to publish the same site at the domain root.
const base = process.env.VITEPRESS_BASE || "/docs/";
function svmlSelectionHighlighter(): ShikiTransformer {
@@ -244,27 +243,35 @@ export default defineConfig({
codeTransformers: [svmlSelectionHighlighter()],
},
head: [
- ["meta", { name: "theme-color", content: "#f3f0e8", media: "(prefers-color-scheme: light)" }],
- ["meta", { name: "theme-color", content: "#131211", media: "(prefers-color-scheme: dark)" }],
- // Runs before first paint: marks the home page so the branded palette paints
- // without a flash, and sends zh-preferring visitors to the Chinese home.
+ // Paints the selection tokens `svmlSelectionHighlighter` marks up inside every
+ // SVML, SVS and SVRun code block. It is the one rule the stock theme needs.
[
- "script",
+ "style",
{},
- `(function(){var p=location.pathname,b=${JSON.stringify(base)},k="hypit-locale",d=document.documentElement,l;try{l=localStorage.getItem(k)}catch(e){}if(!l)l=(navigator.language||"").toLowerCase().indexOf("zh")===0?"zh":"en";var en=p===b||(b.length>1&&p===b.slice(0,-1)),zh=p===b+"zh/"||p===b+"zh";if(en||zh)d.classList.add("home-page");if(en&&l==="zh")location.replace(b+"zh/"+location.search+location.hash)})()`,
+ ".svml-selection{--shiki-light:#8250DF !important;--shiki-dark:#D2A8FF !important;font-weight:600}",
],
- ["link", { rel: "preconnect", href: "https://fonts.googleapis.com" }],
- ["link", { rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: "" }],
- // The only webfont the site still needs: the demo players' audio toggle.
- // Everything else is the system monospace stack.
- [
- "link",
+ ],
+ vite: {
+ plugins: [
{
- rel: "stylesheet",
- href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20,400,0,0",
+ name: "section-root-redirect",
+ // The two section roots are static pages in public/, which the build copies
+ // into the output and the deploy serves directly. The dev server routes the
+ // same paths through VitePress, which has no page there, so it would answer
+ // with its 404. Redirect them here to keep dev and the deploy in agreement.
+ configureServer(server) {
+ server.middlewares.use((request, response, next) => {
+ const path = request.url?.split("?")[0];
+ const target =
+ path === base ? `${base}quickstart` : path === `${base}zh/` ? `${base}zh/quickstart` : null;
+ if (!target) return next();
+ response.writeHead(302, { Location: target });
+ response.end();
+ });
+ },
},
],
- ],
+ },
locales: {
root: { label: "English", lang: "en-US", themeConfig: enTheme },
zh: { label: "简体中文", lang: "zh-CN", link: "/zh/", themeConfig: zhTheme },
diff --git a/docs/.vitepress/theme/HomeThemeScope.ts b/docs/.vitepress/theme/HomeThemeScope.ts
deleted file mode 100644
index 8804f85f..00000000
--- a/docs/.vitepress/theme/HomeThemeScope.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { watchEffect, type Ref } from "vue";
-
-const HOME_CLASS = "home-page";
-
-/**
- * The home page keeps the branded always-dark design; documentation pages use the
- * stock VitePress theme with the light/dark toggle. All branded styling is scoped to
- * `html.home-page`, so the flag has to live on the document element — `html` and `body`
- * backgrounds sit outside the theme's `.Layout` root and cannot be scoped from inside it.
- *
- * The matching inline script in `config.ts` sets the same class before first paint;
- * this keeps it in sync across client-side navigation.
- */
-export function useHomeThemeScope(isHome: Ref<boolean>): void {
- if (typeof document === "undefined") return;
- watchEffect(() => {
- document.documentElement.classList.toggle(HOME_CLASS, isHome.value);
- });
-}
diff --git a/docs/.vitepress/theme/Layout.vue b/docs/.vitepress/theme/Layout.vue
index d74938b0..2c37f203 100644
--- a/docs/.vitepress/theme/Layout.vue
+++ b/docs/.vitepress/theme/Layout.vue
@@ -1,29 +1,12 @@
<script setup lang="ts">
import DefaultTheme from "vitepress/theme";
-import { useData } from "vitepress";
-import { computed } from "vue";
-import HeroMasthead from "./components/HeroMasthead.vue";
import LocalePreference from "./components/LocalePreference.vue";
-import NarratageLogo from "./components/NarratageLogo.vue";
-import PaperFooter from "./components/PaperFooter.vue";
-import { useHomeThemeScope } from "./HomeThemeScope";
const DefaultLayout = DefaultTheme.Layout;
-
-const { frontmatter } = useData();
-const isHome = computed(() => frontmatter.value.layout === "home");
-
-useHomeThemeScope(isHome);
</script>
<template>
<DefaultLayout>
- <template #nav-bar-title-before><NarratageLogo v-if="isHome" class="nav-narratage-logo" /></template>
<template #layout-top><LocalePreference /></template>
- <template #home-hero-info><HeroMasthead /></template>
- <template #layout-bottom><PaperFooter v-if="isHome" /></template>
</DefaultLayout>
- <!-- Kept outside the layout: a blended overlay must not sit inside a container
- that establishes its own stacking or filter context. -->
- <div v-if="isHome" class="np-grain" aria-hidden="true"></div>
</template>
diff --git a/docs/.vitepress/theme/components/HeroMasthead.vue b/docs/.vitepress/theme/components/HeroMasthead.vue
deleted file mode 100644
index 4c58f917..00000000
--- a/docs/.vitepress/theme/components/HeroMasthead.vue
+++ /dev/null
@@ -1,53 +0,0 @@
-<script setup lang="ts">
-import { computed } from "vue";
-import { useData, withBase } from "vitepress";
-
-const { lang } = useData();
-const isChinese = computed(() => lang.value.toLowerCase().startsWith("zh"));
-</script>
-
-<template>
- <div class="np-masthead">
- <div class="np-masthead-meta">
- <span class="np-masthead-label">{{ isChinese ? "开源项目" : "Open source" }}</span>
- <span class="np-rule tick-r np-masthead-rule"></span>
- </div>
-
- <div class="np-masthead-wrap">
- <svg
- class="np-masthead-wordmark"
- viewBox="0 0 1200 268"
- role="img"
- aria-label="Narratage"
- >
- <text
- x="0"
- y="252"
- font-family="Impact, Haettenschweiler, 'Arial Narrow Bold', 'Arial Black', sans-serif"
- font-size="268"
- textLength="1200"
- lengthAdjust="spacingAndGlyphs"
- >
- <tspan class="np-masthead-ink">NARRA</tspan><tspan class="np-masthead-red">TAGE</tspan>
- </text>
- </svg>
-
- <!-- Outside the wordmark, or the intro wipe would clip it too. -->
- <img
- class="np-masthead-stamp"
- :src="withBase('/hero-landscape.png')"
- alt=""
- width="77"
- height="50"
- />
-
- <p class="np-masthead-tagline">
- {{
- isChinese
- ? "世界首个 AI agent 视频编程语言与系统。"
- : "World's #1 video programming language and system for AI agents."
- }}
- </p>
- </div>
- </div>
-</template>
diff --git a/docs/.vitepress/theme/components/NarratageLogo.vue b/docs/.vitepress/theme/components/NarratageLogo.vue
deleted file mode 100644
index f38b1a73..00000000
--- a/docs/.vitepress/theme/components/NarratageLogo.vue
+++ /dev/null
@@ -1,20 +0,0 @@
-<script setup lang="ts">
-withDefaults(defineProps<{ label?: string }>(), { label: "Narratage" });
-</script>
-
-<template>
- <span class="narratage-logo">
- <svg viewBox="182 444 1063 541" fill="currentColor" role="img" :aria-label="label">
- <path d="M265.7,726.2c-7.2-9.9-14.8-18.5-20.4-28.2-31.4-54-31.5-109-1.5-163.1,29.5-53.3,77.3-78.3,137.3-80.2,41.8-1.4,78.8,12,109.9,40.2,38.1,34.6,52.6,78.7,49.5,129.1-1.4,22.8-7.2,44.6-17.5,65.2-4.1,8.1-9.7,11.8-19,11.6-16.5-.5-33-.4-49.5-.1-11.3.2-20.9-3.7-29.1-11.2-2.8-2.6-4.8-2.6-8.2-1-41.6,19.7-104.5,1.7-113.5-61.1-5.1-35.7,11.1-67.8,41.2-83.5,43.9-23,102.2-2.8,114.1,51.1,4.5,20.5,1.4,40.2-10.5,57.8-2.4,3.6-1.7,5.9,1.2,7.9,2.4,1.6,5.3,3.2,8.1,3.3,9.3.5,18.7.9,27.9.3,2.7-.2,6.3-3.5,7.5-6.3,3.3-7.9,6.8-16.1,8.1-24.5,6.8-43-5.3-80-38.2-108.9-24.4-21.4-53.9-30-86.1-28.7-41,1.7-73.7,19.4-96.4,53.8-48.8,74.1-3.8,172.7,84.1,183.6,17.9,2.2,36.2,1.1,54.3.9,53.6-.7,107.3-1.9,160.9-2.7,10.7-.2,18.3,7.6,18.3,18.3.1,68.3.1,136.7,0,205,0,12.3-8.2,20.2-20.5,20.2-122.5,0-245,0-367.5.1-15.5,0-22.5-7.1-22.5-22.7v-202.5c0-16,7.4-23.5,23.5-23.6,15.7-.1,31.3,0,47,0,2.4-.1,4.7-.1,7.5-.1ZM286.5,935.4h216.9v-162.7h-3.9c-28.3,1.4-56.6,2.1-84.8,4.3-26.1,2-51.3,7.8-74.2,21.3-27.2,16-45.6,38.9-51.5,70.2-2.5,13.1-1.9,26.8-2.4,40.3-.4,8.6-.1,17.4-.1,26.6ZM382.9,574.5c-21.8-.1-40.1,17.5-40.3,38.8-.2,22.3,17.2,39.9,39.4,39.9s39.1-17.9,39.1-39.8c.1-21.1-17.3-38.8-38.2-38.9ZM254.5,928.9v-33.6h-32.6v33.6h32.6ZM221.8,829.9v33.6h32.7v-33.6h-32.7ZM565.7,865.3v-33h-32.4v33h32.4ZM254.6,798.9v-32.8h-32.6v32.8h32.6ZM533.4,896.3v33.1h32.3v-33.1h-32.3ZM565.7,802.1v-31.9h-32.3v31.9h32.3Z" />
- <path d="M675.54,613.37v99.1h-38.2v-216.7h38.2c9.9,34,19.9,68.2,30.2,103.2v-103.1h38.7v216.8h-10c-7,0-14-.4-21,.2-5.8.5-8.3-1.2-9.9-7.1-8.4-30.1-17.2-60.1-26-90.1-.3-.9-.7-1.8-1.1-2.6-.3.1-.6.2-.9.3Z" />
- <path d="M997.05,975.04h-40.8v-58.17h-25.46v58.07h-41.44c-.11-1.63-.21-3.27-.21-4.9,0-61.54,0-123.08.11-184.61,0-7.86.96-15.61,6.07-22.25,5.22-6.84,12.36-10.1,20.99-10.21,17.79-.2,35.48-.31,53.27-.1,14.28.2,23.65,7.86,26.42,21.33.75,3.67,1.07,7.45,1.07,11.12.11,61.33.11,122.77.11,184.1-.11,1.73-.11,3.57-.11,5.61ZM955.71,877.97c.11-1.3.32-2,.32-2.6,0-27,.11-53.9.11-80.9,0-5.4-2.24-7.4-8.2-7.5h-7.99c-8.1.1-9.59,1.5-9.59,9.1v76.9c0,1.6.21,3.2.21,5h25.14Z" />
- <path d="M1166.8,712.34h-38.6c-.1-1.3-.3-2.4-.3-3.5,0-61.3-.1-122.6,0-183.9,0-15.5,6.6-25.2,19.1-28.7,2-.6,4.3-.8,6.4-.8,16.5-.1,33-.1,49.5,0,13.1,0,21.8,6.9,24.7,19.6.9,3.9,1.4,7.9,1.4,11.9.1,60.5,0,120.9,0,181.4,0,1.2-.1,2.3-.2,4h-38.6v-65.4h-23.3c-.1,21.5-.1,43.2-.1,65.4ZM1189.3,611.14c.3-.8.5-1.1.5-1.4,0-24.9.1-49.9,0-74.8,0-3.8-2.1-5.7-6-5.7-2.8.1-5.7,0-8.5,0-7.6,0-8.8,1.1-8.8,8.6v68.3c0,1.6.2,3.2.3,5,7.8,0,15,0,22.5,0Z" />
- <path d="M804.1,711.89h-39.1v-5.6c0-60,0-120,.1-180,0-4.8.8-9.7,2.2-14.2,3.2-10.3,12.5-17.1,23.3-17.2,16.8-.2,33.7-.2,50.5,0,14.4.2,23.8,10.3,24.7,26.1.3,5.8.1,11.7.1,17.5v173.3h-38.8c-.1-1.7-.2-3.5-.2-5.2,0-18.5-.1-37,.1-55.5.1-4.2-1.2-5.6-5.3-5.3-5.6.3-11.3.1-17.6.1v66ZM827,610.69v-68.1c0-14.8.2-13.8-13.5-13.7-8.4,0-9.6,1-9.6,9.4,0,22.8,0,45.6.1,68.4,0,1.3.3,2.5.4,4h22.6Z" />
- <path d="M1106.4,712.87h-38.7v-61.6c0-8.4-2.2-10.5-10.7-10.5h-11.8v71.8h-38.4v-216.8h73c15.4,0,25.1,8.3,26,23.7.9,16.1.6,32.3.7,48.4.1,9.5-.1,19,.1,28.5.2,12.5-4.2,22.1-17.9,26.8,1.7.6,2.5.9,3.3,1.2,8,2.4,12.5,7.9,13.8,16,.4,2.8.6,5.6.6,8.5.1,19,.1,38,.1,57-.1,2.1-.1,4.3-.1,7ZM1045.3,604.87c5.7,0,11.2.2,16.6-.1,3.2-.2,5.7-2.3,5.7-5.8.1-21.1.1-42.2.1-63.4,0-3.3-1.8-5.5-5.1-5.6-5.6-.2-11.2-.1-17.2-.1-.1,25.2-.1,49.9-.1,75Z" />
- <path d="M925.7,711.74h-38v-217h71.5c16.7,0,26.4,8.7,27.2,25.4.7,16,.3,32,.4,48,0,8.7-.2,17.3.1,26,.5,13.1-3.2,23.4-17.4,27.8.9.7,1.2,1,1.5,1.1,10.8,3.4,15.4,9,15.6,20.4.3,12.5.2,25,.2,37.5v30.8h-39v-62.3c0-7.4-2.2-9.5-9.5-9.7-4-.1-7.9,0-12.6,0v72ZM926,603.74c5.6,0,10.9.3,16.1-.1,3.5-.2,5.7-2.5,5.7-6.3,0-21,.1-42-.2-63,0-1.9-2.4-5.1-4-5.3-5.8-.6-11.8-.3-17.7-.3.1,25.4.1,50,.1,75Z" />
- <path d="M1071.22,851.6h53.05c.11,1.83.21,3.46.21,5.1,0,30.06.21,60.12-.21,90.18-.11,5.6-1.49,11.62-3.94,16.61-4.26,8.46-12.68,11.51-22.16,11.51-17.26.1-34.41,0-51.67,0s-27.06-8.56-28.66-25.17c-.32-3.57-.21-7.13-.21-10.7,0-51.05-.11-102.21.11-153.26,0-5.81,1.07-11.92,2.88-17.43,3.09-9.58,10.76-14.98,21.09-15.29,19.81-.51,39.74-.51,59.66-.1,10.97.2,20.03,8.25,21.84,19.06,1.17,6.83,1.07,13.86,1.17,20.79.21,12.33,0,24.76,0,37.5h-40.27v-22.32c0-4.28.11-8.46,0-12.74-.11-5.81-2.13-7.64-7.99-7.64-3.2,0-6.39,0-9.59.1-6.18.1-8.2,2.04-8.2,8.05-.11,20.38,0,40.76,0,61.14v72.86c0,8.05,1.7,9.68,9.8,9.58,3.2,0,6.39,0,9.59-.1,3.94-.1,6.5-2.04,6.5-5.91.11-15.59,0-31.18,0-47.38-4.47-.2-8.63-.41-13-.51v-33.93Z" />
- <path d="M1186.46,787.27v59.32h39.63v35.12h-39.52v57.27h42.93c0,11.74.11,22.77-.21,33.69,0,.82-3.09,2.25-4.79,2.25-19.92.2-39.74.1-59.66.1h-19.5v-222.25h83.84v34.4c-14.17.1-28.23.1-42.72.1Z" />
- <path d="M846.62,975.04h-40.8v-187.34h-31.43v-34.94h104.29v34.53h-32.07c0,62.82,0,125.03,0,187.75Z" />
- </svg>
- </span>
-</template>
diff --git a/docs/.vitepress/theme/components/PaperFooter.vue b/docs/.vitepress/theme/components/PaperFooter.vue
deleted file mode 100644
index 79766b19..00000000
--- a/docs/.vitepress/theme/components/PaperFooter.vue
+++ /dev/null
@@ -1,92 +0,0 @@
-<script setup lang="ts">
-import { computed } from "vue";
-import { useData, withBase } from "vitepress";
-
-const REPO = "https://github.com/hypit-ai/hypit";
-
-const { lang } = useData();
-const isChinese = computed(() => lang.value.toLowerCase().startsWith("zh"));
-const docsRoot = computed(() => (isChinese.value ? "/zh" : ""));
-
-const t = (en: string, zh: string) => (isChinese.value ? zh : en);
-</script>
-
-<template>
- <footer class="np-footer">
- <div class="np-footer-grid">
- <section>
- <h2>{{ t("Docs", "文档") }}</h2>
- <ul>
- <li>
- <a :href="withBase(`${docsRoot}/quickstart`)">{{ t("Quickstart", "快速开始") }}</a>
- </li>
- <li>
- <a :href="withBase(`${docsRoot}/guide/develop`)">{{ t("Develop", "开发指南") }}</a>
- </li>
- </ul>
- </section>
-
- <section>
- <h2>{{ t("Project", "项目") }}</h2>
- <ul>
- <li><a :href="REPO" target="_blank" rel="noreferrer">{{ t("Repository", "代码仓库") }}</a></li>
- <li>
- <a :href="`${REPO}/releases`" target="_blank" rel="noreferrer">
- {{ t("Changelog", "更新日志") }}
- </a>
- </li>
- <li>
- <a :href="`${REPO}/blob/main/LICENSE`" target="_blank" rel="noreferrer">
- {{ t("Licence", "开源协议") }}
- </a>
- </li>
- </ul>
- </section>
-
- <section>
- <h2>{{ t("Community", "社区") }}</h2>
- <ul>
- <li><a href="https://discord.gg/85hnyQnxpn" target="_blank" rel="noreferrer">Discord</a></li>
- <li><a href="https://t.me/hypit" target="_blank" rel="noreferrer">Telegram</a></li>
- </ul>
- </section>
-
- <section class="np-footer-about">
- <h2>Hypit</h2>
- <p>
- {{
- t(
- "World's #1 video programming language and system for AI agents.",
- "世界首个 AI agent 视频编程语言与系统。"
- )
- }}
- </p>
-
- <div class="np-footer-social">
- <a :href="REPO" target="_blank" rel="noreferrer" aria-label="GitHub">
- <svg width="21" height="21" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
- <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.4 7.4 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z" />
- </svg>
- </a>
- <a href="https://x.com/hypitai" target="_blank" rel="noreferrer" aria-label="X">
- <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
- <path d="M18.9 1.15h3.68l-8.04 9.19L24 22.85h-7.41l-5.8-7.58-6.64 7.58H.46l8.6-9.83L0 1.15h7.6l5.24 6.93 6.06-6.93Zm-1.29 19.5h2.04L6.49 3.24H4.3l13.31 17.41Z" />
- </svg>
- </a>
- <a href="https://www.instagram.com/hypit_ai" target="_blank" rel="noreferrer" aria-label="Instagram">
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true">
- <rect x="2.5" y="2.5" width="19" height="19" rx="5.4" stroke="currentColor" stroke-width="1.9" />
- <circle cx="12" cy="12" r="4.4" stroke="currentColor" stroke-width="1.9" />
- <circle cx="17.6" cy="6.4" r="1.25" fill="currentColor" />
- </svg>
- </a>
- </div>
- </section>
- </div>
-
- <div class="np-footer-bottom">
- <span>{{ t("© 2026 Hypit. All rights reserved.", "© 2026 Hypit. 保留所有权利。") }}</span>
- <a href="mailto:[email protected]">{{ t("Email us", "联系我们") }}</a>
- </div>
- </footer>
-</template>
diff --git a/docs/.vitepress/theme/components/SemanticVideoDemo.vue b/docs/.vitepress/theme/components/SemanticVideoDemo.vue
deleted file mode 100644
index c62a00a9..00000000
--- a/docs/.vitepress/theme/components/SemanticVideoDemo.vue
+++ /dev/null
@@ -1,903 +0,0 @@
-<script setup lang="ts">
-import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue";
-import {
- demoAudioEnabled as audioEnabled,
- demoAudioPlaybackEnabled as audioPlaybackEnabled,
- enableDemoAudioAfterInteraction,
- initializeDemoAudio,
- toggleDemoAudio,
-} from "./demo-audio";
-import { goodBetterBestMedia, resolveDemoMedia } from "./demo-media";
-import { demoPointerIsInside } from "./demo-pointer";
-import { wordAtTime } from "./demo-word-timing";
-import { useSourcePanelInteraction } from "./source-panel-interaction";
-import { useData } from "vitepress";
-import {
- semanticVideoDemos,
- type DemoId,
- type DemoSelection,
- type DemoSourceLine,
- type WordCue,
-} from "./semantic-video-demos";
-import {
- buildFoldedSourceView,
- buildFullSourceView,
- type SourceDisplayEntry,
-} from "./source-display";
-
-const props = withDefaults(defineProps<{ demo: DemoId; active?: boolean; showHeading?: boolean }>(), {
- active: true,
- showHeading: true,
-});
-const emit = defineEmits<{ ended: [] }>();
-const { lang } = useData();
-const isChinese = computed(() => lang.value.toLowerCase().startsWith("zh"));
-const config = semanticVideoDemos[props.demo];
-const sourceLines = config.lines;
-const sceneSelections = config.selections.filter((selection) => selection.layer === "scene");
-const overlaySelections = config.selections.filter((selection) => selection.layer === "overlay");
-
-type Point = { line: number; column: number };
-
-type RangeBounds = {
- id: string;
- start: number;
- end: number;
- opensAt: Point;
- closesAt: Point;
- depth: number;
-};
-
-type DisplayLine = SourceDisplayEntry<DemoSourceLine>;
-
-/**
- * Containment is measured at (line, column), not by line number alone. Two
- * markers can share a line — one closing exactly where the next opens — and
- * comparing only line numbers counts those siblings as nested, colouring one of
- * them a level deeper than the items beside it.
- */
-function atOrBefore(a: { line: number; column: number }, b: { line: number; column: number }) {
- return a.line !== b.line ? a.line < b.line : a.column <= b.column;
-}
-
-const rawBounds = config.selections.map((selection) => {
- const open = `>@${selection.id}</span>`;
- const close = `>@/${selection.id}</span>`;
- const start = sourceLines.findIndex((line) => line.html.includes(open));
- const end = sourceLines.findIndex((line) => line.html.includes(close));
- return {
- id: selection.id,
- start,
- end,
- opensAt: { line: start, column: start < 0 ? -1 : sourceLines[start].html.indexOf(open) },
- closesAt: { line: end, column: end < 0 ? -1 : sourceLines[end].html.indexOf(close) },
- };
-}).filter((range) => range.start >= 0 && range.end >= range.start);
-
-const rangeBounds: RangeBounds[] = rawBounds.map((range) => ({
- ...range,
- depth: rawBounds.filter((candidate) => (
- candidate.id !== range.id
- && atOrBefore(candidate.opensAt, range.opensAt)
- && atOrBefore(range.closesAt, candidate.closesAt)
- )).length,
-}));
-
-function decorateLine(line: DemoSourceLine) {
- if (!line.tokens) return line.html;
- let cueIndex = line.tokens[0];
- const end = line.tokens[1];
- return line.html.split(/(<span\b[^>]*>.*?<\/span>)/giu).map((part) => {
- if (part.startsWith("<span")) return part;
- let output = "";
- let cursor = 0;
- while (cueIndex < end) {
- const cue = config.words[cueIndex];
- const position = part.toLocaleLowerCase().indexOf(cue.text.toLocaleLowerCase(), cursor);
- if (position === -1) break;
- output += part.slice(cursor, position);
- output += `<span class="script-word" data-word-index="${cue.index}">${part.slice(position, position + cue.text.length)}</span>`;
- cursor = position + cue.text.length;
- cueIndex += 1;
- }
- return output + part.slice(cursor);
- }).join("");
-}
-
-const decoratedLines = sourceLines.map(decorateLine);
-const sourceFollowEnabled = ref(true);
-const pinnedSelection = ref<string | null>(null);
-const pinnedLoopSelection = ref<string | null>(null);
-const activeWord = ref<WordCue | null>(null);
-const currentSceneIndex = ref(0);
-const activeSceneSelection = ref(sceneSelections[0]);
-const activeOverlaySelection = ref<DemoSelection | null>(null);
-const visibleLogoCount = ref(0);
-const sourceViewportRows = ref(27);
-const sourceLineRows = ref<number[]>(sourceLines.map(() => 1));
-const sourcePanelElement = ref<HTMLElement | null>(null);
-const codeScrollElement = ref<HTMLElement | null>(null);
-const sourceMeasureElement = ref<HTMLElement | null>(null);
-const playheadElement = ref<HTMLElement | null>(null);
-const rangeCanvas = ref({ width: 0, height: 0 });
-const rangeGeometry = ref<Record<string, { path: string; depth: number }>>({});
-const baseVideos: HTMLVideoElement[] = [];
-const overlayVideos: HTMLVideoElement[] = [];
-let resizeObserver: ResizeObserver | null = null;
-let rangeMutationObserver: MutationObserver | null = null;
-let animationFrame = 0;
-let previousTimestamp = 0;
-let programTime = 0;
-let playbackSceneIndex = -1;
-let playbackOverlayId: string | null = null;
-let completedPass = false;
-
-function setBaseVideo(element: unknown, index: number) {
- if (element && typeof element === "object" && "currentTime" in element) {
- baseVideos[index] = element as HTMLVideoElement;
- }
-}
-
-function setOverlayVideo(element: unknown, index: number) {
- if (element && typeof element === "object" && "currentTime" in element) {
- overlayVideos[index] = element as HTMLVideoElement;
- }
-}
-
-function wordAt(time: number) {
- return wordAtTime(config.words, time);
-}
-
-const activeCaptionWords = computed(() => {
- const word = activeWord.value;
- if (!word) return [];
- const start = Math.floor(word.index / 3) * 3;
- return config.words.slice(start, start + 3);
-});
-
-const automaticSelections = computed(() => [
- activeSceneSelection.value,
- ...(activeOverlaySelection.value ? [activeOverlaySelection.value] : []),
-]);
-
-const sourceSelections = computed(() => {
- if (!pinnedSelection.value) return automaticSelections.value;
- const pinned = config.selections.find((selection) => selection.id === pinnedSelection.value);
- if (!pinned) return automaticSelections.value;
- const bounds = rangeBounds.find((range) => range.id === pinned.id);
- const outer = bounds
- ? rangeBounds
- .filter((candidate) => candidate.start <= bounds.start && candidate.end >= bounds.end)
- .sort((left, right) => left.depth - right.depth)[0]
- : undefined;
- const outerSelection = config.selections.find((selection) => selection.id === outer?.id);
- const pinnedSelections = outerSelection && outerSelection.id !== pinned.id
- ? [outerSelection, pinned]
- : [pinned];
- const activeNestedOverlay = pinned.layer === "scene"
- && activeOverlaySelection.value
- && activeOverlaySelection.value.start >= pinned.start
- && activeOverlaySelection.value.end <= pinned.end
- ? activeOverlaySelection.value
- : null;
- return activeNestedOverlay ? [...pinnedSelections, activeNestedOverlay] : pinnedSelections;
-});
-
-const sourceWordLine = computed(() => {
- const wordIndex = activeWord.value?.index;
- if (wordIndex === undefined) return rangeBounds.find((range) => range.id === activeSceneSelection.value.id)?.start ?? 0;
- const lineIndex = sourceLines.findIndex((line) => line.tokens && wordIndex >= line.tokens[0] && wordIndex < line.tokens[1]);
- return lineIndex >= 0 ? lineIndex : 0;
-});
-
-const bindingLine = computed(() => {
- const id = activeOverlaySelection.value?.id ?? activeSceneSelection.value.id;
- const index = sourceLines.findIndex((line, lineIndex) => line.selection === id && lineIndex > 24);
- if (index >= 0) return index;
- const scriptEnd = sourceLines.findIndex((line) => line.html.includes("&lt;/script&gt;"));
- return Math.min(sourceLines.length - 1, scriptEnd + 2);
-});
-
-const displayedLines = computed<DisplayLine[]>(() => {
- if (!sourceFollowEnabled.value) {
- return buildFullSourceView(sourceLines);
- }
-
- const sideRows = Math.max(3, Math.floor((sourceViewportRows.value - 1) / 2));
- const activeRanges = sourceSelections.value
- .map((selection) => rangeBounds.find((range) => range.id === selection.id))
- .filter((range): range is RangeBounds => range !== undefined)
- .sort((left, right) => left.depth - right.depth);
-
- return buildFoldedSourceView({
- lines: sourceLines,
- rowSpans: sourceLineRows.value,
- rowBudget: sideRows,
- topRanges: activeRanges,
- topFocus: sourceWordLine.value,
- bottomLine: bindingLine.value,
- });
-});
-
-function renderedLineHtml(index: number) {
- let html = decoratedLines[index];
- if (activeWord.value) {
- html = html.replace(
- `class="script-word" data-word-index="${activeWord.value.index}"`,
- `class="script-word active" data-word-index="${activeWord.value.index}"`,
- );
- }
- for (const selection of sourceSelections.value) {
- const depth = rangeBounds.find((range) => range.id === selection.id)?.depth ?? 0;
- html = html.replaceAll(
- `semantic-token" data-selection="${selection.id}"`,
- `semantic-token semantic-active semantic-depth-${depth}" data-selection="${selection.id}"`,
- );
- }
- return html;
-}
-
-function bindingDepth(line: DemoSourceLine) {
- if (!line.selection || !sourceSelections.value.some((selection) => selection.id === line.selection)) return -1;
- return rangeBounds.find((range) => range.id === line.selection)?.depth ?? 0;
-}
-
-function roundedRangePath(points: Array<{ x: number; y: number }>, radius = 6) {
- return points.map((point, index) => {
- const previous = points[(index - 1 + points.length) % points.length];
- const next = points[(index + 1) % points.length];
- const previousLength = Math.hypot(previous.x - point.x, previous.y - point.y) || 1;
- const nextLength = Math.hypot(next.x - point.x, next.y - point.y) || 1;
- const cornerRadius = Math.min(radius, previousLength / 2, nextLength / 2);
- const before = {
- x: point.x + (previous.x - point.x) * cornerRadius / previousLength,
- y: point.y + (previous.y - point.y) * cornerRadius / previousLength,
- };
- const after = {
- x: point.x + (next.x - point.x) * cornerRadius / nextLength,
- y: point.y + (next.y - point.y) * cornerRadius / nextLength,
- };
- return `${index === 0 ? "M" : "L"} ${before.x} ${before.y} Q ${point.x} ${point.y} ${after.x} ${after.y}`;
- }).join(" ") + " Z";
-}
-
-function updateRangeGeometry() {
- const container = codeScrollElement.value;
- if (!container) return;
- const containerRect = container.getBoundingClientRect();
- const width = container.clientWidth;
- const scaleX = container.offsetWidth ? containerRect.width / container.offsetWidth : 1;
- const scaleY = container.offsetHeight ? containerRect.height / container.offsetHeight : 1;
- const renderedLines = Array.from(container.querySelectorAll<HTMLElement>(":scope > .code-line"));
- const lastLine = renderedLines.at(-1);
- const height = Math.max(container.clientHeight, lastLine ? lastLine.offsetTop + lastLine.offsetHeight : container.clientHeight);
- const markers = Array.from(container.querySelectorAll<HTMLElement>(".syn-marker[data-selection]"));
- const geometry: Record<string, { path: string; depth: number }> = {};
-
- // The folded source view keeps whichever active range fits the row budget, so
- // an enclosing range routinely has one of its markers folded away. Drawing
- // nothing in that case reads as "not selected"; the outline instead runs to
- // the fold and stops there, showing that the range carries on past it.
- const foldRows = Array.from(container.querySelectorAll<HTMLElement>(":scope > .code-fold"));
- const foldEdgeAfter = (line: HTMLElement) => foldRows.find((fold) => fold.offsetTop > line.offsetTop)?.offsetTop;
- const foldEdgeBefore = (line: HTMLElement) => {
- const fold = foldRows.filter((candidate) => candidate.offsetTop < line.offsetTop).at(-1);
- return fold ? fold.offsetTop + fold.offsetHeight : undefined;
- };
-
- for (const range of rangeBounds) {
- const startMarker = markers.find((marker) => marker.dataset.selection === range.id && marker.textContent?.trim() === `@${range.id}`);
- const endMarker = markers.find((marker) => marker.dataset.selection === range.id && marker.textContent?.trim() === `@/${range.id}`);
- const startLine = startMarker?.closest<HTMLElement>(".code-line");
- const endLine = endMarker?.closest<HTMLElement>(".code-line");
- if ((!startMarker || !startLine) && (!endMarker || !endLine)) continue;
-
- const inlinePadding = 3;
- const edgeOverhang = 3;
- const left = 44 - edgeOverhang;
- const right = width - 12 + edgeOverhang;
- const lineHeight = Number.parseFloat(getComputedStyle((startLine ?? endLine) as HTMLElement).lineHeight) || 26;
- const centerOf = (rect: DOMRect) => ((rect.top + rect.bottom) / 2 - containerRect.top) / scaleY + container.scrollTop;
- const leftEdgeOf = (rect: DOMRect) => Math.max(3, Math.min(width - 3, (rect.left - containerRect.left) / scaleX + container.scrollLeft - inlinePadding));
- const rightEdgeOf = (rect: DOMRect) => Math.max(3, Math.min(width - 3, (rect.right - containerRect.left) / scaleX + container.scrollLeft + inlinePadding));
- const firstRectOf = (marker: HTMLElement) => Array.from(marker.getClientRects())[0] ?? marker.getBoundingClientRect();
- const lastRectOf = (marker: HTMLElement) => Array.from(marker.getClientRects()).at(-1) ?? marker.getBoundingClientRect();
-
- let points: Array<{ x: number; y: number }>;
- if (startMarker && startLine && endMarker && endLine) {
- const startRect = firstRectOf(startMarker);
- const endRect = lastRectOf(endMarker);
- const startX = leftEdgeOf(startRect);
- const endX = rightEdgeOf(endRect);
- const startCenter = centerOf(startRect);
- const endCenter = centerOf(endRect);
- const top = startCenter - lineHeight / 2;
- const startBottom = startCenter + lineHeight / 2;
- const endTop = endCenter - lineHeight / 2;
- const bottom = endCenter + lineHeight / 2;
- points = Math.abs(startCenter - endCenter) < lineHeight / 2
- ? [
- { x: startX, y: top },
- { x: endX, y: top },
- { x: endX, y: bottom },
- { x: startX, y: bottom },
- ]
- : [
- { x: startX, y: top },
- { x: right, y: top },
- { x: right, y: endTop },
- { x: endX, y: endTop },
- { x: endX, y: bottom },
- { x: left, y: bottom },
- { x: left, y: startBottom },
- { x: startX, y: startBottom },
- ];
- } else if (startMarker && startLine) {
- const startRect = firstRectOf(startMarker);
- const startX = leftEdgeOf(startRect);
- const startCenter = centerOf(startRect);
- const startBottom = startCenter + lineHeight / 2;
- const cut = foldEdgeAfter(startLine) ?? height;
- if (cut <= startBottom) continue;
- points = [
- { x: startX, y: startCenter - lineHeight / 2 },
- { x: right, y: startCenter - lineHeight / 2 },
- { x: right, y: cut },
- { x: left, y: cut },
- { x: left, y: startBottom },
- { x: startX, y: startBottom },
- ];
- } else {
- const endRect = lastRectOf(endMarker as HTMLElement);
- const endX = rightEdgeOf(endRect);
- const endCenter = centerOf(endRect);
- const endTop = endCenter - lineHeight / 2;
- const cut = foldEdgeBefore(endLine as HTMLElement) ?? 0;
- if (cut >= endTop) continue;
- points = [
- { x: left, y: cut },
- { x: right, y: cut },
- { x: right, y: endTop },
- { x: endX, y: endTop },
- { x: endX, y: endCenter + lineHeight / 2 },
- { x: left, y: endCenter + lineHeight / 2 },
- ];
- }
- geometry[range.id] = { path: roundedRangePath(points), depth: range.depth };
- }
-
- rangeCanvas.value = { width, height };
- rangeGeometry.value = geometry;
-}
-
-function sceneIndexAt(time: number) {
- const index = config.scenes.findIndex((scene) => time >= scene.start && time < scene.end);
- return index === -1 ? config.scenes.length - 1 : index;
-}
-
-function syncState(time: number, force = false) {
- const nextSceneIndex = sceneIndexAt(time);
- const sceneChanged = force || nextSceneIndex !== currentSceneIndex.value;
- if (sceneChanged) currentSceneIndex.value = nextSceneIndex;
- const nextSceneSelection = sceneSelections.find((selection) => time >= selection.start && time < selection.end)
- ?? sceneSelections.find((selection) => time < selection.start)
- ?? sceneSelections.at(-1)!;
- if (force || nextSceneSelection.id !== activeSceneSelection.value.id) activeSceneSelection.value = nextSceneSelection;
- const nextOverlay = overlaySelections.find((selection) => time >= selection.start && time < selection.end) ?? null;
- if (force || nextOverlay?.id !== activeOverlaySelection.value?.id) activeOverlaySelection.value = nextOverlay;
- const nextWord = wordAt(time);
- if (force || nextWord?.index !== activeWord.value?.index) activeWord.value = nextWord;
- if (config.id === "good-better-best") {
- const nextLogoCount = time >= 23.12 ? 3 : time >= 14.12 ? 2 : time >= 4.01 ? 1 : 0;
- if (force || nextLogoCount !== visibleLogoCount.value) visibleLogoCount.value = nextLogoCount;
- }
- return sceneChanged;
-}
-
-function syncBaseVideos(force = false) {
- const activeIndex = sceneIndexAt(programTime);
- const scene = config.scenes[activeIndex];
- const localTime = scene.sourceStart + Math.max(0, programTime - scene.start);
- const sceneChanged = playbackSceneIndex !== activeIndex;
- baseVideos.forEach((video, index) => {
- if (!video) return;
- video.muted = !audioPlaybackEnabled.value || index !== activeIndex;
- if (index !== activeIndex) {
- video.pause();
- return;
- }
- if (force || sceneChanged || Math.abs(video.currentTime - localTime) > .2) video.currentTime = localTime;
- if (props.active && video.paused) void video.play().catch(() => undefined);
- });
- playbackSceneIndex = activeIndex;
-}
-
-function syncOverlayVideos(force = false) {
- if (config.id !== "street") return;
- overlayVideos.forEach((video, index) => {
- const selection = overlaySelections[index];
- const active = selection.id === activeOverlaySelection.value?.id;
- video.muted = true;
- if (!active) {
- video.pause();
- return;
- }
- const requestedTime = Math.max(0, programTime - selection.start);
- const sourceEnd = Number.isFinite(video.duration)
- ? Math.max(0, video.duration)
- : requestedTime;
- const localTime = Math.min(requestedTime, sourceEnd);
- if (force || playbackOverlayId !== selection.id || Math.abs(video.currentTime - localTime) > .2) video.currentTime = localTime;
- if (requestedTime >= sourceEnd) {
- video.pause();
- return;
- }
- if (props.active && video.paused) void video.play().catch(() => undefined);
- });
- playbackOverlayId = activeOverlaySelection.value?.id ?? null;
-}
-
-function enableAudio(event?: Event) {
- if (event?.target instanceof Element && event.target.closest(".live-audio-toggle")) return;
- if (!enableDemoAudioAfterInteraction()) return;
- syncBaseVideos();
-}
-
-function toggleAudio() {
- toggleDemoAudio();
- syncBaseVideos();
-}
-
-function seekTo(selection: DemoSelection, lineIndex: number | null = null) {
- pinnedSelection.value = selection.id;
- const bounds = rangeBounds.find((range) => range.id === selection.id);
- const outer = bounds
- ? rangeBounds
- .filter((candidate) => candidate.start <= bounds.start && candidate.end >= bounds.end)
- .sort((left, right) => left.depth - right.depth)[0]
- : undefined;
- pinnedLoopSelection.value = outer?.id ?? selection.id;
- programTime = selection.start;
- previousTimestamp = 0;
- syncState(programTime, true);
- syncBaseVideos(true);
- syncOverlayVideos(true);
- if (lineIndex !== null) void lineIndex;
-}
-
-function inspectLine(line: DemoSourceLine, index: number) {
- const id = line.range ?? line.selection;
- if (!id) {
- clearInspection();
- return;
- }
- const selection = config.selections.find((candidate) => candidate.id === id);
- if (selection && pinnedSelection.value !== selection.id) seekTo(selection, index);
-}
-
-function inspectToken(event: Event, index: number) {
- const target = event.target instanceof Element ? event.target.closest<HTMLElement>("[data-selection]") : null;
- const selection = config.selections.find((candidate) => candidate.id === target?.dataset.selection);
- if (selection && pinnedSelection.value !== selection.id) seekTo(selection, index);
-}
-
-function clearInspection() {
- pinnedSelection.value = null;
- pinnedLoopSelection.value = null;
-}
-
-function stopSourceFollow(event?: MouseEvent) {
- if (!sourceFollowEnabled.value) return;
- const container = codeScrollElement.value;
- const hoveredLine = event?.target instanceof Element && container
- ? event.target.closest<HTMLElement>("[data-source-line]")
- : null;
- const lineIndex = Number(hoveredLine?.dataset.sourceLine);
- const lineOffset = event && hoveredLine ? event.clientY - hoveredLine.getBoundingClientRect().top : 0;
- const targetTop = event && hoveredLine ? event.clientY - lineOffset : null;
- sourceFollowEnabled.value = false;
- if (!container || !Number.isInteger(lineIndex) || targetTop === null) return;
- void nextTick().then(() => {
- const expandedLine = container.querySelector<HTMLElement>(`[data-source-line="${lineIndex}"]`);
- if (!expandedLine) return;
- const previousBehavior = container.style.scrollBehavior;
- container.style.scrollBehavior = "auto";
- container.scrollTop += expandedLine.getBoundingClientRect().top - targetTop;
- container.style.scrollBehavior = previousBehavior;
- updateRangeGeometry();
- });
-}
-
-function resumeSourceFollow() {
- clearInspection();
- sourceFollowEnabled.value = true;
-}
-
-function updateSourceViewportRows() {
- const container = codeScrollElement.value;
- if (!container) return;
- let rows = Math.max(7, Math.floor(container.clientHeight / 26));
- if (rows % 2 === 0) rows -= 1;
- if (sourceViewportRows.value !== rows) sourceViewportRows.value = rows;
- const padding = Math.max(0, (container.clientHeight - rows * 26) / 2);
- container.style.setProperty("--source-vertical-padding", `${padding}px`);
-
- const measuredRows = Array.from(
- sourceMeasureElement.value?.querySelectorAll<HTMLElement>("[data-measure-line]") ?? [],
- ).map((line) => Math.max(1, Math.ceil(line.getBoundingClientRect().height / 26)));
- const measurementChanged = measuredRows.length === sourceLines.length && measuredRows.some(
- (rowSpan, index) => rowSpan !== sourceLineRows.value[index],
- );
- if (measurementChanged) sourceLineRows.value = measuredRows;
-}
-
-function updateLayoutGeometry() {
- updateSourceViewportRows();
- updateRangeGeometry();
-}
-
-function renderFrame(timestamp: number) {
- if (!props.active) {
- animationFrame = 0;
- return;
- }
- if (!previousTimestamp) previousTimestamp = timestamp;
- const delta = Math.min(.05, (timestamp - previousTimestamp) / 1000);
- previousTimestamp = timestamp;
- const scene = config.scenes[currentSceneIndex.value];
- const video = baseVideos[currentSceneIndex.value];
- let nextTime = video && !video.paused && video.readyState >= 2
- ? scene.start + video.currentTime - scene.sourceStart
- : programTime + delta;
- let looped = false;
- if (pinnedLoopSelection.value) {
- const loopSelection = config.selections.find((selection) => selection.id === pinnedLoopSelection.value);
- if (loopSelection && nextTime >= loopSelection.end) {
- nextTime = loopSelection.start;
- looped = true;
- }
- } else if (nextTime >= config.duration) {
- if (!completedPass) {
- completedPass = true;
- emit("ended");
- }
- nextTime = 0;
- looped = true;
- }
- programTime = nextTime;
- const sceneChanged = syncState(programTime, looped);
- if (looped || sceneChanged) syncBaseVideos(true);
- syncOverlayVideos(looped);
- if (playheadElement.value) playheadElement.value.style.left = `${Math.max(0, Math.min(100, programTime / config.duration * 100))}%`;
- animationFrame = requestAnimationFrame(renderFrame);
-}
-
-function stopPlayback() {
- cancelAnimationFrame(animationFrame);
- animationFrame = 0;
- previousTimestamp = 0;
- baseVideos.forEach((video) => video?.pause());
- overlayVideos.forEach((video) => video?.pause());
-}
-
-function startPlayback() {
- stopPlayback();
- programTime = 0;
- playbackSceneIndex = -1;
- playbackOverlayId = null;
- completedPass = false;
- pinnedSelection.value = null;
- pinnedLoopSelection.value = null;
- syncState(programTime, true);
- syncBaseVideos(true);
- syncOverlayVideos(true);
- syncSourceHoverState();
- animationFrame = requestAnimationFrame(renderFrame);
-}
-
-function syncSourceHoverState() {
- if (!sourceUsesHover.value) {
- resumeSourceFollow();
- return;
- }
- const sourceHovered = demoPointerIsInside(sourcePanelElement.value);
- if (!sourceHovered) clearInspection();
- sourceFollowEnabled.value = !sourceHovered;
-}
-
-const {
- sourceUsesHover,
- handleSourcePointerMove,
- handleSourcePointerDown,
- handleSourceClick,
- handleSourceWheel,
- handleSourcePointerLeave,
-} = useSourcePanelInteraction(sourcePanelElement, {
- active: () => props.active,
- expand: stopSourceFollow,
- collapse: resumeSourceFollow,
-});
-
-watch(
- [() => displayedLines.value.map((entry) => entry.key).join("|"), sourceFollowEnabled, sourceSelections],
- () => void nextTick().then(() => {
- updateSourceViewportRows();
- void nextTick().then(() => {
- updateLayoutGeometry();
- requestAnimationFrame(updateLayoutGeometry);
- });
- }),
- { flush: "post" },
-);
-
-watch(
- () => props.active,
- (active) => {
- if (active) void nextTick().then(startPlayback);
- else stopPlayback();
- },
- { flush: "post" },
-);
-
-onMounted(() => {
- initializeDemoAudio();
- window.addEventListener("pointerdown", enableAudio, { capture: true, once: true });
- window.addEventListener("keydown", enableAudio, { capture: true, once: true });
- window.addEventListener("resize", updateLayoutGeometry);
- if (navigator.userActivation?.hasBeenActive) enableAudio();
- void nextTick().then(() => {
- syncState(0, true);
- if (props.active) startPlayback();
- updateLayoutGeometry();
- if (codeScrollElement.value) {
- resizeObserver = new ResizeObserver(updateLayoutGeometry);
- resizeObserver.observe(codeScrollElement.value);
- rangeMutationObserver = new MutationObserver(() => requestAnimationFrame(updateRangeGeometry));
- rangeMutationObserver.observe(codeScrollElement.value, { childList: true, subtree: true });
- }
- });
-});
-
-onBeforeUnmount(() => {
- stopPlayback();
- window.removeEventListener("pointerdown", enableAudio, true);
- window.removeEventListener("keydown", enableAudio, true);
- window.removeEventListener("resize", updateLayoutGeometry);
- resizeObserver?.disconnect();
- rangeMutationObserver?.disconnect();
-});
-</script>
-
-<template>
- <section class="svml-demo semantic-video-demo" :aria-label="isChinese ? 'SVML 交互式实时渲染预览' : 'Interactive SVML live-render preview'">
- <header v-if="props.showHeading" class="demo-heading">
- <h2><span class="hover-interaction-copy">{{ isChinese ? "悬停标记范围,查看对应画面" : "Hover a marked range to see the corresponding frame" }}</span><span class="touch-interaction-copy">{{ isChinese ? "点击标记范围,查看对应画面" : "Tap a marked range to see the corresponding frame" }}</span></h2>
- </header>
-
- <div class="demo-shell real-demo-shell">
- <div
- ref="sourcePanelElement"
- class="source-panel"
- :class="{ 'source-following': sourceFollowEnabled }"
- @pointermove="handleSourcePointerMove"
- @pointerdown="handleSourcePointerDown"
- @click="handleSourceClick"
- @wheel="handleSourceWheel"
- @pointerleave="handleSourcePointerLeave"
- >
- <div ref="sourceMeasureElement" class="source-measure" aria-hidden="true">
- <div
- v-for="(html, index) in decoratedLines"
- :key="index"
- class="code-line"
- :data-measure-line="index"
- >
- <span class="line-number">{{ index + 1 }}</span>
- <code v-html="html || '&nbsp;'" />
- </div>
- </div>
- <div class="source-follow-hint">
- {{ isChinese
- ? (sourceUsesHover
- ? (sourceFollowEnabled ? "移入查看所有源码" : "移出查看精简视图")
- : (sourceFollowEnabled ? "点击代码查看所有源码" : "点击空白处返回精简视图"))
- : (sourceUsesHover
- ? (sourceFollowEnabled ? "Move in to view all source" : "Move out for the compact view")
- : (sourceFollowEnabled ? "Tap the code to view all source" : "Tap outside for the compact view")) }}
- </div>
- <div ref="codeScrollElement" class="code-scroll" aria-label="SVML source code" @scroll="updateRangeGeometry">
- <svg
- v-if="rangeCanvas.width && rangeCanvas.height"
- class="semantic-range-canvas"
- :width="rangeCanvas.width"
- :height="rangeCanvas.height"
- :viewBox="`0 0 ${rangeCanvas.width} ${rangeCanvas.height}`"
- aria-hidden="true"
- >
- <path
- v-for="selection in sourceSelections"
- :key="selection.id"
- :class="`depth-${rangeGeometry[selection.id]?.depth ?? 0}`"
- :d="rangeGeometry[selection.id]?.path"
- />
- </svg>
- <template v-for="entry in displayedLines" :key="entry.key">
- <div
- v-if="entry.kind === 'fold'"
- class="code-line code-fold"
- :data-source-line="entry.index"
- aria-hidden="true"
- ><code>···</code></div>
- <div
- v-else-if="entry.line"
- class="code-line"
- :data-source-line="entry.index"
- :class="{
- 'binding-active': bindingDepth(entry.line) >= 0,
- 'binding-depth-1': bindingDepth(entry.line) === 1,
- 'binding-depth-2': bindingDepth(entry.line) === 2,
- }"
- @mouseover="inspectLine(entry.line, entry.index!)"
- >
- <span class="line-number">{{ entry.index! + 1 }}</span>
- <code
- v-html="renderedLineHtml(entry.index!) || '&nbsp;'"
- @mouseover="inspectToken($event, entry.index!)"
- @focusin="inspectToken($event, entry.index!)"
- @click="inspectToken($event, entry.index!)"
- />
- </div>
- </template>
- </div>
- </div>
-
- <div class="preview-panel">
- <div class="real-preview-body">
- <div class="semantic-live-stage" :class="`stage-${config.id}`">
- <div class="live-base-layer">
- <video
- v-for="(scene, index) in config.scenes"
- :key="scene.src"
- :ref="(element) => setBaseVideo(element, index)"
- :class="{ active: currentSceneIndex === index }"
- :src="resolveDemoMedia(scene.src)"
- :muted="!audioPlaybackEnabled || currentSceneIndex !== index"
- playsinline
- preload="auto"
- @loadedmetadata="syncBaseVideos(true)"
- />
- </div>
-
- <template v-if="config.id === 'street'">
- <video
- v-for="(selection, index) in overlaySelections"
- :key="selection.id"
- :ref="(element) => setOverlayVideo(element, index)"
- class="street-broll"
- :class="{ active: activeOverlaySelection?.id === selection.id }"
- :src="resolveDemoMedia(selection.asset!)"
- muted
- playsinline
- preload="auto"
- />
- <div class="visual-outline street-scene-outline"></div>
- <div v-if="activeOverlaySelection" class="visual-outline street-broll-outline"></div>
- </template>
-
- <template v-else>
- <div class="gbb-header">
- <div
- v-for="(item, index) in [
- { id: 'good', label: 'GOOD', src: goodBetterBestMedia.logos[0] },
- { id: 'better', label: 'BETTER', src: goodBetterBestMedia.logos[1] },
- { id: 'best', label: 'BEST', src: goodBetterBestMedia.logos[2] },
- ]"
- :key="item.id"
- class="gbb-slot"
- :class="[{ visible: visibleLogoCount > index, selected: sourceSelections.some((selection) => selection.id === item.id) }, `slot-${item.id}`]"
- >
- <img :src="resolveDemoMedia(item.src)" alt="">
- <strong>{{ item.label }}</strong>
- </div>
- </div>
- <img
- v-if="activeOverlaySelection"
- class="gbb-deck"
- :class="{ selected: sourceSelections.some((selection) => selection.id === activeOverlaySelection?.id) }"
- :src="resolveDemoMedia(activeOverlaySelection.asset!)"
- alt=""
- >
- </template>
-
- <div v-if="activeCaptionWords.length" class="demo-caption" :class="`caption-${config.id}`" aria-hidden="true">
- <span
- v-for="word in activeCaptionWords"
- :key="word.index"
- :class="{ active: activeWord?.index === word.index }"
- >{{ word.text }}</span>
- </div>
-
- <button
- class="live-audio-toggle"
- type="button"
- :aria-label="audioEnabled ? '静音' : '取消静音'"
- :title="audioEnabled ? '静音' : '取消静音'"
- @click.stop="toggleAudio"
- >
- <span class="material-symbols-rounded" aria-hidden="true">{{ audioEnabled ? "volume_up" : "volume_off" }}</span>
- </button>
- </div>
- </div>
-
- <div class="real-semantic-controls">
- <div class="semantic-timeline">
- <div class="timeline-labels ranking-labels demo-progress-labels">
- <button
- v-for="selection in sceneSelections"
- :key="selection.id"
- type="button"
- :class="{ current: activeSceneSelection.id === selection.id }"
- :style="{ flexGrow: selection.end - selection.start }"
- @click="seekTo(selection)"
- >@{{ selection.id }}</button>
- </div>
- <div class="timeline-track demo-progress-track">
- <span
- v-for="selection in sceneSelections"
- :key="selection.id"
- class="segment"
- :class="{ active: activeSceneSelection.id === selection.id }"
- :style="{ flexGrow: selection.end - selection.start }"
- ></span>
- <i ref="playheadElement" class="playhead"></i>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
-</template>
-
-<style scoped>
-.semantic-video-demo .code-scroll { overflow-y: auto; }
-.source-following .code-scroll { overflow-y: hidden; }
-.semantic-live-stage { position: relative; height: 540px; aspect-ratio: 9 / 16; overflow: hidden; background: #000; isolation: isolate; container-type: inline-size; }
-.street-broll { position: absolute; inset: 0; z-index: 10; display: none; width: 100%; height: 100%; object-fit: cover; }
-.street-broll.active { display: block; }
-.visual-outline { position: absolute; z-index: 24; pointer-events: none; }
-.street-scene-outline { inset: 4px; border: 1px solid var(--crimson); }
-.street-broll-outline { inset: 9px; border: 1px solid #b09257; }
-.gbb-header { position: absolute; z-index: 8; top: 8.9%; left: 5.8%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7.2%; width: 88.4%; }
-.gbb-slot { position: relative; display: grid; justify-items: center; opacity: 1; }
-.gbb-slot img { width: 80%; aspect-ratio: 1; object-fit: cover; border-radius: 20%; opacity: 0; transform: translateY(-6px) scale(.94); transition: opacity .28s ease, transform .38s cubic-bezier(.2,.8,.2,1); }
-.gbb-slot.visible img { opacity: 1; transform: translateY(0) scale(1); }
-.gbb-slot strong { margin-top: 8%; font-family: Arial Black, Poppins, Inter, sans-serif; font-size: 5.6cqw; font-weight: 950; line-height: 1; text-shadow: 0 1px 3px rgba(0,0,0,.25); }
-.slot-good strong { color: #ff1749; }
-.slot-better strong { color: #ffb300; }
-.slot-best strong { color: #00b96b; }
-.gbb-slot.selected::after { content: ""; position: absolute; inset: -4px -2px -5px; border: 1px solid var(--crimson); pointer-events: none; }
-.gbb-deck { position: absolute; z-index: 12; top: 61.7%; left: 11%; width: 78%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; box-shadow: 0 9px 28px rgba(0,0,0,.28); }
-.gbb-deck.selected { outline: 1px solid #b09257; outline-offset: 3px; }
-.demo-caption { position: absolute; z-index: 30; left: 5%; display: flex; align-items: baseline; justify-content: center; width: 90%; column-gap: 4px; color: #fff; font-family: Arial Black, Poppins, Inter, sans-serif; font-size: 5.3cqw; font-weight: 900; line-height: 1.08; text-align: center; white-space: nowrap; pointer-events: none; -webkit-text-stroke: .75px #000; paint-order: stroke fill; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
-.caption-street { top: 50%; }
-.caption-good-better-best { top: 65%; }
-.demo-caption span { display: inline-block; transition: color .08s linear, transform .08s linear; }
-.demo-caption span.active { color: #ffd34d; transform: scale(1.08); }
-.demo-progress-track { display: flex; grid-template-columns: none; gap: 0; background: transparent; }
-.demo-progress-labels { gap: 2px; }
-.demo-progress-track .segment { min-width: 0; height: 100%; flex-basis: 0; border-radius: 0; box-shadow: inset -1px 0 var(--paper-2); }
-.demo-progress-track .segment:first-child { border-radius: 3px 0 0 3px; }
-.demo-progress-track .segment:nth-child(4) { border-radius: 0 3px 3px 0; box-shadow: none; }
-.demo-progress-track .segment:nth-child(1) { background: var(--demo-segment-cyan); }
-.demo-progress-track .segment:nth-child(2) { background: var(--demo-segment-green); }
-.demo-progress-track .segment:nth-child(3) { background: var(--demo-segment-gold); }
-.demo-progress-track .segment:nth-child(4) { background: var(--demo-segment-pink); }
-
-@media (max-width: 900px) {
- .semantic-live-stage { height: 520px; }
-}
-
-@media (max-width: 520px) {
- .semantic-live-stage { height: min(520px, 145vw); }
-}
-</style>
diff --git a/docs/.vitepress/theme/components/SvmlDemoCarousel.vue b/docs/.vitepress/theme/components/SvmlDemoCarousel.vue
deleted file mode 100644
index c87e3463..00000000
--- a/docs/.vitepress/theme/components/SvmlDemoCarousel.vue
+++ /dev/null
@@ -1,354 +0,0 @@
-<script setup lang="ts">
-import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue";
-import {
- demoMediaVersion,
- demoMediaManifests,
- preloadDemoMedia,
- type DemoMediaManifest,
-} from "./demo-media";
-import { clearDemoPointer, updateDemoPointer } from "./demo-pointer";
-import { useData } from "vitepress";
-import SemanticVideoDemo from "./SemanticVideoDemo.vue";
-import SvmlPlayground from "./SvmlPlayground.vue";
-
-/** Track gap, in px. The slide-placement maths needs it as a number. */
-const GAP = 26;
-
-const cards = [
- { component: SvmlPlayground, props: undefined, labelZh: "AI 图片应用排名", labelEn: "AI photo app ranking" },
- { component: SemanticVideoDemo, props: { demo: "street" as const }, labelZh: "街头采访", labelEn: "Street interview" },
- { component: SemanticVideoDemo, props: { demo: "good-better-best" as const }, labelZh: "Good Better Best", labelEn: "Good Better Best" },
-];
-
-/**
- * A clone of the last card leads and a clone of the first trails, so a card is
- * always peeking at both edges and the wrap-around has somewhere to land. A
- * clone shares its original's active state, so the two are identical when the
- * track silently swaps between them.
- */
-const rendered = [cards[cards.length - 1], ...cards, cards[0]];
-const realIndexOf = (slot: number) => (slot - 1 + cards.length) % cards.length;
-
-const { lang } = useData();
-const isChinese = computed(() => lang.value.toLowerCase().startsWith("zh"));
-const cardLabel = (card: (typeof cards)[number]) => (isChinese.value ? card.labelZh : card.labelEn);
-
-const index = ref(0);
-const animating = ref(true);
-const offset = ref(0);
-const viewport = ref<HTMLElement | null>(null);
-const track = ref<HTMLElement | null>(null);
-
-/** `index` runs past both ends during a wrap; this is the card it settles on. */
-const active = computed(() => ((index.value % cards.length) + cards.length) % cards.length);
-
-const loadedIndices = ref<Set<number>>(new Set());
-const manifestPromises = new Map<number, Promise<void>>();
-const mediaCacheVersionKey = "svml-demo-media-version";
-
-function loadManifest(manifest: DemoMediaManifest) {
- const assets = [
- ...manifest.images.map((source) => preloadDemoMedia(source, "image")),
- ...manifest.videos.map((source) => preloadDemoMedia(source, "video")),
- ];
-
- return Promise.allSettled(assets).then((results) => {
- const failures = results.filter((result) => result.status === "rejected");
- if (failures.length) {
- console.warn(`SVML demo mounted with ${failures.length} media preload failure(s).`, failures);
- }
- });
-}
-
-/**
- * Media loads for the card being shown, not for all three: a demo is only
- * mounted once its own media is in, so the off-screen cards stay cheap. Once a
- * card has loaded it stays mounted, paused, as a side card.
- */
-function preloadDemo(index: number) {
- if (loadedIndices.value.has(index)) return Promise.resolve();
-
- const existing = manifestPromises.get(index);
- if (existing) return existing;
-
- const promise = loadManifest(demoMediaManifests[index]).then(() => {
- loadedIndices.value = new Set([...loadedIndices.value, index]);
- if (loadedIndices.value.size === cards.length) {
- try {
- window.localStorage.setItem(mediaCacheVersionKey, demoMediaVersion);
- } catch {
- // Storage can be unavailable in private or restricted browser contexts.
- }
- }
- });
- manifestPromises.set(index, promise);
- return promise;
-}
-
-/**
- * Current card first, then the rest in the order they will be shown. Sequential
- * on purpose: the card being watched should not be competing for bandwidth with
- * the ones behind it. A newer call supersedes an older one, so changing card
- * mid-chain re-prioritises rather than queueing behind the old order.
- */
-let preloadGeneration = 0;
-async function preloadFromCurrent() {
- const generation = ++preloadGeneration;
- for (let offset = 0; offset < cards.length; offset += 1) {
- if (generation !== preloadGeneration) return;
- await preloadDemo((active.value + offset) % cards.length);
- }
-}
-
-function restoreCachedDemos() {
- try {
- if (window.localStorage.getItem(mediaCacheVersionKey) !== demoMediaVersion) return false;
- } catch {
- return false;
- }
-
- loadedIndices.value = new Set(cards.map((_, i) => i));
- return true;
-}
-
-/** Centres the slide at `index`, with its neighbours bleeding off both edges. */
-function place() {
- const vp = viewport.value;
- const tr = track.value;
- if (!vp || !tr) return;
- const slide = tr.querySelector<HTMLElement>(".demo-slide");
- if (!slide) return;
- const slideWidth = slide.getBoundingClientRect().width;
- offset.value = (index.value + 1) * (slideWidth + GAP) - (vp.clientWidth - slideWidth) / 2;
-}
-
-/**
- * Landing on a clone, the track is repositioned onto the matching real card
- * with the transition switched off, so the wrap is invisible: the clone is
- * identical to what replaces it and nothing appears to move.
- *
- * The guard matters. `transitionend` bubbles, and each slide runs its own .4s
- * opacity fade — a tenth of a second shorter than the track's .5s slide. Acting
- * on those would reposition the track while it was still travelling, which
- * reads as the carousel rewinding just before it reaches the last card.
- */
-function onTransitionEnd(event: TransitionEvent) {
- if (event.target !== track.value || event.propertyName !== "transform") return;
- if (index.value < 0 || index.value >= cards.length) {
- animating.value = false;
- index.value = active.value;
- }
-}
-
-watch(index, () => {
- place();
- void preloadFromCurrent();
-});
-
-/*
- * Re-enable the transition only once the repositioned frame has actually been
- * painted. One frame is not enough: a callback scheduled from the same tick
- * still runs before that frame paints, so restoring the transition there lets
- * the browser animate the reposition it was supposed to hide.
- */
-watch(animating, (on) => {
- if (on) return;
- void nextTick(() =>
- requestAnimationFrame(() => requestAnimationFrame(() => (animating.value = true))),
- );
-});
-
-/**
- * There are only five slides on the track, so `index` may never leave
- * [-1, cards.length]. A press that arrives while the track is still travelling
- * to a clone would otherwise aim past the last one, sending the carousel into
- * blank paper and then snapping it back. Land the pending wrap first, without
- * animating, and take the step from the real card it settles on.
- */
-function step(delta: number) {
- if (index.value >= 0 && index.value < cards.length) {
- index.value += delta;
- return;
- }
- animating.value = false;
- index.value = active.value;
- void nextTick(() =>
- requestAnimationFrame(() =>
- requestAnimationFrame(() => {
- index.value += delta;
- }),
- ),
- );
-}
-
-/**
- * Each demo reports the end of its first pass and then loops, which is the cue
- * to move on — except while someone is pointing at the card. Hovering a marked
- * range is the whole point of these demos, and pulling the card away mid-read
- * would be rude, so the move waits for the pointer to leave that card.
- *
- * The question is "is the pointer on this card", so `:hover` asks it directly
- * rather than tracking enter and leave over a full-bleed section that reaches
- * well beyond the card itself.
- */
-let advanceOnLeave = false;
-
-function activeSlide() {
- return viewport.value?.querySelector<HTMLElement>(".demo-slide[data-active]") ?? null;
-}
-
-function onEnded(slot: number) {
- // Clones carry their original's active state, so both report the same pass.
- const isClone = slot < 1 || slot > cards.length;
- if (isClone || realIndexOf(slot) !== active.value) return;
- if (activeSlide()?.matches(":hover")) {
- advanceOnLeave = true;
- return;
- }
- step(1);
-}
-
-function onSlideLeave(slot: number) {
- if (!advanceOnLeave || realIndexOf(slot) !== active.value) return;
- advanceOnLeave = false;
- step(1);
-}
-
-function onResize() {
- animating.value = false;
- place();
-}
-
-onMounted(() => {
- restoreCachedDemos();
- void preloadFromCurrent();
- void nextTick(place);
- window.addEventListener("resize", onResize);
-});
-onBeforeUnmount(() => window.removeEventListener("resize", onResize));
-</script>
-
-<template>
- <section
- class="demo-carousel"
- @pointermove="updateDemoPointer"
- @pointerleave="clearDemoPointer"
- >
- <div class="demo-carousel-head">
- <div class="np-rule"></div>
- <header class="demo-heading carousel-heading">
- <h2>
- <span class="hover-interaction-copy">{{ isChinese ? "悬停任意标记区间,即可预览对应的画面。" : "Hover over a marked range to preview the corresponding scene." }}</span>
- <span class="touch-interaction-copy">{{ isChinese ? "点按任意标记区间,即可预览对应的画面。" : "Tap a marked range to preview the corresponding scene." }}</span>
- </h2>
- </header>
- </div>
-
- <div class="demo-viewport" ref="viewport">
- <div
- class="demo-track"
- ref="track"
- :style="{ transform: `translateX(${-offset}px)`, transition: animating ? undefined : 'none' }"
- @transitionend="onTransitionEnd"
- >
- <article
- v-for="(card, slot) in rendered"
- :key="slot"
- class="demo-slide"
- :data-active="realIndexOf(slot) === active ? '' : undefined"
- :aria-hidden="realIndexOf(slot) === active ? undefined : 'true'"
- :aria-label="cardLabel(card)"
- @pointerleave="onSlideLeave(slot)"
- >
- <div v-if="!loadedIndices.has(realIndexOf(slot))" class="demo-loading" role="status" aria-live="polite">
- <span class="demo-loading-spinner" aria-hidden="true"></span>
- <span>{{ isChinese ? "加载演示素材…" : "Loading demo media…" }}</span>
- </div>
- <div v-else class="demo-card-content">
- <component
- :is="card.component"
- v-bind="card.props"
- :active="realIndexOf(slot) === active"
- :show-heading="false"
- @ended="onEnded(slot)"
- />
- </div>
- </article>
- </div>
-
- <button class="demo-nav demo-prev" :aria-label="isChinese ? '上一张' : 'Previous slide'" @click="step(-1)">
- <svg width="26" height="26" viewBox="0 0 24 24" fill="none" aria-hidden="true">
- <path d="M15 4 7 12l8 8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" />
- </svg>
- </button>
- <button class="demo-nav demo-next" :aria-label="isChinese ? '下一张' : 'Next slide'" @click="step(1)">
- <svg width="26" height="26" viewBox="0 0 24 24" fill="none" aria-hidden="true">
- <path d="M9 4l8 8-8 8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" />
- </svg>
- </button>
- </div>
-
- <div class="demo-dots">
- <button
- v-for="(card, n) in cards"
- :key="card.labelEn"
- class="demo-dot"
- :aria-current="n === active"
- :aria-label="cardLabel(card)"
- @click="step(n - active)"
- ></button>
- </div>
- </section>
-</template>
-
-<style scoped>
-.demo-carousel { padding-block: 0 60px; }
-.demo-carousel-head { max-width: 1280px; margin: 0 auto; padding-inline: var(--pad); box-sizing: border-box; }
-.carousel-heading { width: 100%; margin: 26px 0 20px; }
-
-/* Full-bleed, so the neighbouring cards bleed off both edges of the viewport. */
-.demo-viewport { position: relative; overflow: hidden; }
-.demo-track { display: flex; align-items: center; gap: 26px; transition: transform .5s cubic-bezier(.3,.8,.35,1); will-change: transform; }
-.demo-slide { flex: 0 0 66.5%; min-width: 0; min-height: 505px; overflow: hidden; border-radius: 2px; background: var(--paper-2); opacity: .4; transition: opacity .4s ease; }
-.demo-slide[data-active] { opacity: 1; }
-
-.demo-card-content { min-width: 0; overflow: hidden; border-radius: 2px; background: var(--paper-2); }
-.demo-card-content :deep(.svml-demo) { margin-top: 0; }
-.demo-card-content :deep(.demo-shell),
-.demo-card-content :deep(.real-demo-shell) { min-height: 660px; box-shadow: none; border: 0; }
-.demo-card-content :deep(.real-demo-shell .code-scroll) { height: 660px; }
-.demo-card-content :deep(.real-preview-body) { padding: 18px 16px 10px; }
-/* Both stages, or the ranking demo keeps its taller default and its
- container-scaled type comes out larger than the other card's. */
-.demo-card-content :deep(.semantic-live-stage),
-.demo-card-content :deep(.live-ranking-stage) { height: 500px; }
-.demo-card-content :deep(.real-semantic-controls) { margin: 0 20px 18px; }
-
-.demo-loading { display: grid; place-content: center; justify-items: center; gap: 14px; min-height: 660px; border-radius: 2px; background: var(--paper-2); color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }
-.demo-loading-spinner { width: 30px; height: 30px; border: 2px solid var(--crimson-soft); border-top-color: var(--crimson); border-radius: 50%; animation: demo-loading-spin .7s linear infinite; }
-@keyframes demo-loading-spin { to { transform: rotate(360deg); } }
-
-/* Centred in the gap between the side card and the main one. */
-.demo-nav { position: absolute; top: 50%; z-index: 5; display: grid; place-items: center; width: 50px; height: 50px; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; transform: translateY(-50%); }
-.demo-nav:hover { color: var(--crimson); }
-.demo-nav svg { display: block; }
-.demo-prev { left: calc(16.75% - 38px); }
-.demo-next { right: calc(16.75% - 38px); }
-
-.demo-dots { display: flex; justify-content: center; gap: 8px; margin-top: 26px; }
-.demo-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: var(--crimson); opacity: .32; cursor: pointer; transition: opacity .2s ease; }
-.demo-dot:hover { opacity: .7; }
-.demo-dot[aria-current="true"] { opacity: 1; }
-
-@media (max-width: 900px) {
- .demo-slide { flex-basis: 86%; min-height: 0; }
- /* `max()` only bites below ~540px, where the source's offset would otherwise
- hang the arrow off the edge of the viewport. */
- .demo-prev { left: max(4px, calc(7% - 38px)); }
- .demo-next { right: max(4px, calc(7% - 38px)); }
-}
-
-@media (prefers-reduced-motion: reduce) {
- .demo-track { transition: none !important; }
-}
-</style>
diff --git a/docs/.vitepress/theme/components/SvmlPlayground.vue b/docs/.vitepress/theme/components/SvmlPlayground.vue
deleted file mode 100644
index 6653bc64..00000000
--- a/docs/.vitepress/theme/components/SvmlPlayground.vue
+++ /dev/null
@@ -1,1113 +0,0 @@
-<script setup lang="ts">
-import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue";
-import {
- demoAudioEnabled as audioEnabled,
- demoAudioPlaybackEnabled as audioPlaybackEnabled,
- enableDemoAudioAfterInteraction,
- initializeDemoAudio,
- toggleDemoAudio,
-} from "./demo-audio";
-import { rankingMedia, resolveDemoMedia } from "./demo-media";
-import { demoPointerIsInside } from "./demo-pointer";
-import { createDemoTimeline } from "./demo-timeline";
-import { wordAtTime } from "./demo-word-timing";
-import { wordCues as rawWordCues, type WordCue } from "./regen-ranking-cues";
-import { useSourcePanelInteraction } from "./source-panel-interaction";
-import { useData } from "vitepress";
-import {
- buildFoldedSourceView,
- buildFullSourceView,
- type SourceDisplayEntry,
-} from "./source-display";
-
-const props = withDefaults(defineProps<{ active?: boolean; showHeading?: boolean }>(), {
- active: true,
- showHeading: true,
-});
-const emit = defineEmits<{ ended: [] }>();
-const { lang } = useData();
-const isChinese = computed(() => lang.value.toLowerCase().startsWith("zh"));
-
-type RankingSelectionId = "photoshop" | "facetune" | "remini" | "chatgpt" | "regen";
-type BrollSelectionId = "handsome-1" | "handsome-2" | "dating-photo" | "linkedin-headshot" | "instagram-post";
-type SelectionId = RankingSelectionId | BrollSelectionId;
-
-type TimelineSelection = {
- id: SelectionId;
- start: number;
- end: number;
-};
-
-type RankingSelection = {
- id: RankingSelectionId;
- label: string;
- rank: number;
- start: number;
- end: number;
- color: string;
- icon: string;
-};
-
-type BaseScene = {
- src: string;
- start: number;
- end: number;
- sourceStart: number;
-};
-
-type BrollItem = {
- id: BrollSelectionId;
- src: string;
- start: number;
- end: number;
- zoom: number;
-};
-
-type SourceLine = {
- html: string;
- selection?: SelectionId;
- range?: SelectionId;
- ranges?: SelectionId[];
- edge?: "start" | "end";
- tokens?: readonly [number, number];
-};
-
-type DisplayedSourceLine = SourceDisplayEntry<SourceLine>;
-
-const ENTER_DURATION = .45;
-const MOVE_DURATION = .55;
-
-const rankingTimeline = createDemoTimeline([
- { src: rankingMedia.avatars[0], start: 0, end: 12.033333333333333 },
- { src: rankingMedia.avatars[1], start: 12.033333333333333, end: 24.066666666666666 },
- { src: rankingMedia.avatars[2], start: 24.066666666666666, end: 36.1 },
-]);
-const TOTAL_DURATION = rankingTimeline.duration;
-const baseScenes: BaseScene[] = rankingTimeline.scenes;
-const wordCues = rawWordCues.map((cue) => rankingTimeline.mapRange(cue));
-
-const selections: RankingSelection[] = [
- { id: "photoshop", label: "Photoshop", rank: 5, start: .08, end: 6.4, color: "#31add0", icon: rankingMedia.icons[4] },
- { id: "facetune", label: "Facetune", rank: 4, start: 6.4, end: 12, color: "rgb(132, 198, 84)", icon: rankingMedia.icons[3] },
- { id: "remini", label: "Remini", rank: 3, start: 12.043333333333333, end: 18.184444444444445, color: "rgb(234, 220, 42)", icon: rankingMedia.icons[2] },
- { id: "chatgpt", label: "ChatGPT", rank: 2, start: 18.184444444444445, end: 24.066666666666666, color: "rgb(255, 167, 45)", icon: rankingMedia.icons[1] },
- { id: "regen", label: "ReGen", rank: 1, start: 24.076666666666668, end: 36.06666666666666, color: "#ff3f56", icon: rankingMedia.icons[0] },
-].map((selection) => rankingTimeline.mapRange(selection));
-
-const brollItems: BrollItem[] = [
- { id: "handsome-1", src: rankingMedia.broll[4], start: 791 / 30, end: 831 / 30, zoom: 1.02 },
- { id: "handsome-2", src: rankingMedia.broll[3], start: 831 / 30, end: 888 / 30, zoom: 1.03 },
- { id: "dating-photo", src: rankingMedia.broll[2], start: 925 / 30, end: 952 / 30, zoom: 1.02 },
- { id: "linkedin-headshot", src: rankingMedia.broll[1], start: 952 / 30, end: 977 / 30, zoom: 1.03 },
- { id: "instagram-post", src: rankingMedia.broll[0], start: 977 / 30, end: 1009 / 30, zoom: 1.02 },
-].map((selection) => rankingTimeline.mapRange(selection));
-
-const semanticSelections: TimelineSelection[] = [...selections, ...brollItems];
-
-const lines: SourceLine[] = [
- { html: '<span class="syn-tag">&lt;script&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;segment</span> <span class="syn-attr">id</span>=<span class="syn-string">"scene-1"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;NARRATOR&gt;</span> <span class="syn-marker semantic-token" data-selection="photoshop" tabindex="0">@photoshop</span> Photoshop.', selection: "photoshop", range: "photoshop", edge: "start", tokens: [0, 1] },
- { html: ' <span class="syn-tag">&lt;SPEAKER&gt;</span> Powerful, but only if you know how to use it. Otherwise, your new profile', range: "photoshop", tokens: [1, 15] },
- { html: ' picture becomes a three-hour design project <span class="syn-marker semantic-token" data-selection="photoshop" tabindex="0">@/photoshop</span>.', selection: "photoshop", range: "photoshop", edge: "end", tokens: [15, 21] },
- { html: ' <span class="syn-tag">&lt;NARRATOR&gt;</span> <span class="syn-marker semantic-token" data-selection="facetune" tabindex="0">@facetune</span> Facetune.', selection: "facetune", range: "facetune", edge: "start", tokens: [21, 22] },
- { html: ' <span class="syn-tag">&lt;SPEAKER&gt;</span> Fast and great for touch-ups. But it still leaves you with the same awkward pose and the same dorm-room background <span class="syn-marker semantic-token" data-selection="facetune" tabindex="0">@/facetune</span>.', selection: "facetune", range: "facetune", edge: "end", tokens: [22, 42] },
- { html: ' <span class="syn-tag">&lt;/segment&gt;</span>' },
- { html: "" },
- { html: ' <span class="syn-tag">&lt;segment</span> <span class="syn-attr">id</span>=<span class="syn-string">"scene-2"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;NARRATOR&gt;</span> <span class="syn-marker semantic-token" data-selection="remini" tabindex="0">@remini</span> Remini.' , selection: "remini", range: "remini", edge: "start", tokens: [42, 43] },
- { html: ' <span class="syn-tag">&lt;SPEAKER&gt;</span> Great for blurry photos. It restores detail, but it can\'t fix the pose, outfit, or background. You get the same bad photo in HD <span class="syn-marker semantic-token" data-selection="remini" tabindex="0">@/remini</span>.', selection: "remini", range: "remini", edge: "end", tokens: [43, 67] },
- { html: ' <span class="syn-tag">&lt;NARRATOR&gt;</span> <span class="syn-marker semantic-token" data-selection="chatgpt" tabindex="0">@chatgpt</span> ChatGPT.', selection: "chatgpt", range: "chatgpt", edge: "start", tokens: [67, 68] },
- { html: ' <span class="syn-tag">&lt;SPEAKER&gt;</span> More flexible. It can create a new shot, but getting your face and the details right becomes a prompt-writing group project <span class="syn-marker semantic-token" data-selection="chatgpt" tabindex="0">@/chatgpt</span>.', selection: "chatgpt", range: "chatgpt", edge: "end", tokens: [68, 89] },
- { html: ' <span class="syn-tag">&lt;/segment&gt;</span>' },
- { html: "" },
- { html: ' <span class="syn-tag">&lt;segment</span> <span class="syn-attr">id</span>=<span class="syn-string">"scene-3"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;NARRATOR&gt;</span> <span class="syn-marker semantic-token" data-selection="regen" tabindex="0">@regen</span> ReGen.', selection: "regen", range: "regen", edge: "start", tokens: [89, 90] },
- { html: ' <span class="syn-tag">&lt;SPEAKER&gt;</span> Pick a photo you love, and the app <span class="syn-marker semantic-token" data-selection="handsome-1" tabindex="0">@handsome-1</span> rebuilds it around you with a', selection: "handsome-1", range: "handsome-1", edge: "start", tokens: [90, 104] },
- { html: ' <span class="syn-marker semantic-token" data-selection="handsome-1" tabindex="0">@/handsome-1~</span> <span class="syn-marker semantic-token" data-selection="handsome-2" tabindex="0">@handsome-2</span> better pose, outfit, and setting. <span class="syn-marker semantic-token" data-selection="handsome-2" tabindex="0">@/handsome-2</span>', selection: "handsome-2", ranges: ["handsome-1", "handsome-2"], edge: "end", tokens: [104, 109] },
- { html: ' From one selfie, you can make <span class="syn-marker semantic-token" data-selection="dating-photo" tabindex="0">@dating-photo</span> a dating photo, <span class="syn-marker semantic-token" data-selection="dating-photo" tabindex="0">@/dating-photo~</span>', selection: "dating-photo", range: "dating-photo", edge: "end", tokens: [109, 118] },
- { html: ' <span class="syn-marker semantic-token" data-selection="linkedin-headshot" tabindex="0">@linkedin-headshot</span> LinkedIn headshot, <span class="syn-marker semantic-token" data-selection="linkedin-headshot" tabindex="0">@/linkedin-headshot~</span>', selection: "linkedin-headshot", range: "linkedin-headshot", edge: "end", tokens: [118, 120] },
- { html: ' <span class="syn-marker semantic-token" data-selection="instagram-post" tabindex="0">@instagram-post</span> or Instagram post, <span class="syn-marker semantic-token" data-selection="instagram-post" tabindex="0">@/instagram-post</span>', selection: "instagram-post", range: "instagram-post", edge: "end", tokens: [120, 123] },
- { html: ' so you get what you wanted instead of fixing a bad shot <span class="syn-marker semantic-token" data-selection="regen" tabindex="0">@/regen</span>.', selection: "regen", range: "regen", edge: "end", tokens: [123, 135] },
- { html: ' <span class="syn-tag">&lt;/segment&gt;</span>' },
- { html: '<span class="syn-tag">&lt;/script&gt;</span>' },
- { html: "" },
- { html: '<span class="syn-tag">&lt;ranking-column</span> <span class="syn-attr">id</span>=<span class="syn-string">"ranking"</span> <span class="syn-attr">z</span>=<span class="syn-string">"42"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">rank</span>=<span class="syn-string">"5"</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="photoshop" tabindex="0">{script.selection.photoshop}</span> <span class="syn-tag">/&gt;</span>', selection: "photoshop" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">rank</span>=<span class="syn-string">"4"</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="facetune" tabindex="0">{script.selection.facetune}</span> <span class="syn-tag">/&gt;</span>', selection: "facetune" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">rank</span>=<span class="syn-string">"3"</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="remini" tabindex="0">{script.selection.remini}</span> <span class="syn-tag">/&gt;</span>', selection: "remini" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">rank</span>=<span class="syn-string">"2"</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="chatgpt" tabindex="0">{script.selection.chatgpt}</span> <span class="syn-tag">/&gt;</span>', selection: "chatgpt" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">rank</span>=<span class="syn-string">"1"</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="regen" tabindex="0">{script.selection.regen}</span> <span class="syn-tag">/&gt;</span>', selection: "regen" },
- { html: '<span class="syn-tag">&lt;/ranking-column&gt;</span>' },
- { html: "" },
- { html: '<span class="syn-tag">&lt;broll-track</span> <span class="syn-attr">id</span>=<span class="syn-string">"broll"</span> <span class="syn-attr">z</span>=<span class="syn-string">"700"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">source</span>=<span class="syn-expr">{broll-5}</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="handsome-1" tabindex="0">{script.selection.handsome-1}</span> <span class="syn-tag">/&gt;</span>', selection: "handsome-1" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">source</span>=<span class="syn-expr">{broll-4}</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="handsome-2" tabindex="0">{script.selection.handsome-2}</span> <span class="syn-tag">/&gt;</span>', selection: "handsome-2" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">source</span>=<span class="syn-expr">{broll-3}</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="dating-photo" tabindex="0">{script.selection.dating-photo}</span> <span class="syn-tag">/&gt;</span>', selection: "dating-photo" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">source</span>=<span class="syn-expr">{broll-2}</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="linkedin-headshot" tabindex="0">{script.selection.linkedin-headshot}</span> <span class="syn-tag">/&gt;</span>', selection: "linkedin-headshot" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">source</span>=<span class="syn-expr">{broll-1}</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="instagram-post" tabindex="0">{script.selection.instagram-post}</span> <span class="syn-tag">/&gt;</span>', selection: "instagram-post" },
- { html: '<span class="syn-tag">&lt;/broll-track&gt;</span>' },
-];
-
-type Point = { line: number; column: number };
-
-type SemanticRangeBounds = {
- id: SelectionId;
- start: number;
- end: number;
- opensAt: Point;
- closesAt: Point;
- depth: number;
-};
-
-/**
- * Containment is measured at (line, column), not by line number alone. Two
- * markers can share a line — one closing exactly where the next opens — and
- * comparing only line numbers counts those siblings as nested, colouring one of
- * them a level deeper than the items beside it.
- */
-function atOrBefore(a: { line: number; column: number }, b: { line: number; column: number }) {
- return a.line !== b.line ? a.line < b.line : a.column <= b.column;
-}
-
-const rawRangeBounds = semanticSelections.map((selection) => {
- const open = `>@${selection.id}</span>`;
- const close = `>@/${selection.id}`;
- const start = lines.findIndex((line) => line.html.includes(open));
- const end = lines.findIndex((line) => line.html.includes(close));
- return {
- id: selection.id,
- start,
- end,
- opensAt: { line: start, column: start < 0 ? -1 : lines[start].html.indexOf(open) },
- closesAt: { line: end, column: end < 0 ? -1 : lines[end].html.indexOf(close) },
- };
-}).filter((range) => range.start >= 0 && range.end >= range.start);
-
-const semanticRangeBounds: SemanticRangeBounds[] = rawRangeBounds.map((range) => ({
- ...range,
- depth: rawRangeBounds.filter((candidate) => (
- candidate.id !== range.id
- && atOrBefore(candidate.opensAt, range.opensAt)
- && atOrBefore(range.closesAt, candidate.closesAt)
- )).length,
-}));
-
-const rankingBlock = {
- start: lines.findIndex((line) => line.html.includes("&lt;ranking-column")),
- end: lines.findIndex((line) => line.html.includes("&lt;/ranking-column")),
-};
-const brollBlock = {
- start: lines.findIndex((line) => line.html.includes("&lt;broll-track")),
- end: lines.findIndex((line) => line.html.includes("&lt;/broll-track")),
-};
-
-function decorateLine(line: SourceLine) {
- if (!line.tokens) return line.html;
- let cueIndex = line.tokens[0];
- const end = line.tokens[1];
- return line.html.split(/(<span\b[^>]*>.*?<\/span>)/giu).map((part) => {
- if (part.startsWith("<span")) return part;
- let output = "";
- let cursor = 0;
- while (cueIndex < end) {
- const cue = wordCues[cueIndex];
- const position = part.toLocaleLowerCase().indexOf(cue.text.toLocaleLowerCase(), cursor);
- if (position === -1) break;
- output += part.slice(cursor, position);
- output += `<span class="script-word" data-word-index="${cue.index}">${part.slice(position, position + cue.text.length)}</span>`;
- cursor = position + cue.text.length;
- cueIndex += 1;
- }
- return output + part.slice(cursor);
- }).join("");
-}
-
-const decoratedLines = lines.map(decorateLine);
-
-const activeLine = ref<number | null>(null);
-const pinnedSelection = ref<SelectionId | null>(null);
-const pinnedLoopSelection = ref<SelectionId | null>(null);
-const sourceFollowEnabled = ref(true);
-const sourceViewportRows = ref(27);
-const sourceLineRows = ref<number[]>(lines.map(() => 1));
-const stageElement = ref<HTMLElement | null>(null);
-const sourcePanelElement = ref<HTMLElement | null>(null);
-const codeScrollElement = ref<HTMLElement | null>(null);
-const sourceMeasureElement = ref<HTMLElement | null>(null);
-const activeIconElement = ref<HTMLElement | null>(null);
-const playheadElement = ref<HTMLElement | null>(null);
-const rankCells: Array<HTMLElement | undefined> = [];
-const rankTargets: Array<{ x: number; y: number; size: number } | undefined> = [];
-const rangeGeometry = ref<Record<string, { path: string; depth: number }>>({});
-const rangeCanvas = ref({ width: 0, height: 0 });
-const activeWord = ref<WordCue | null>(null);
-const currentSceneIndex = ref(0);
-const activeBroll = ref<BrollItem | null>(null);
-const activeRankingSelection = ref<RankingSelection>(selections[0]);
-const automaticSourceSelections = ref<TimelineSelection[]>([selections[0]]);
-const activeRuntimeItem = ref<RankingSelection | null>(null);
-const settledIds = ref<Set<RankingSelectionId>>(new Set());
-let rangeResizeObserver: ResizeObserver | null = null;
-let rangeMutationObserver: MutationObserver | null = null;
-let animationFrame = 0;
-let previousTimestamp = 0;
-let programTime = 0;
-let playbackSceneIndex = -1;
-let completedPass = false;
-
-const automaticScriptLineIndex = computed(() => {
- const wordIndex = activeWord.value?.index;
- if (wordIndex !== undefined) {
- const lineIndex = lines.findIndex((line) => (
- line.tokens && wordIndex >= line.tokens[0] && wordIndex < line.tokens[1]
- ));
- if (lineIndex >= 0) return lineIndex;
- }
- return semanticRangeBounds.find((range) => range.id === activeRankingSelection.value.id)?.start ?? 0;
-});
-
-const automaticTargetBlock = computed(() => activeBroll.value ? brollBlock : rankingBlock);
-
-const automaticBindingLineIndex = computed(() => {
- const selectionId = activeBroll.value?.id ?? activeRankingSelection.value.id;
- const block = automaticTargetBlock.value;
- const lineIndex = lines.findIndex((line, index) => (
- index >= block.start && index <= block.end && line.selection === selectionId
- ));
- return lineIndex >= 0 ? lineIndex : block.start;
-});
-
-const displayedLines = computed<DisplayedSourceLine[]>(() => {
- if (!sourceFollowEnabled.value) {
- return buildFullSourceView(lines);
- }
-
- const sideRows = Math.max(3, Math.floor((sourceViewportRows.value - 1) / 2));
- const activeRanges = activeSourceSelections.value
- .map((selection) => semanticRangeBounds.find((range) => range.id === selection.id))
- .filter((range): range is SemanticRangeBounds => range !== undefined)
- .sort((left, right) => left.depth - right.depth);
-
- return buildFoldedSourceView({
- lines,
- rowSpans: sourceLineRows.value,
- rowBudget: sideRows,
- topRanges: activeRanges,
- topFocus: automaticScriptLineIndex.value,
- bottomLine: automaticBindingLineIndex.value,
- });
-});
-
-function wordAt(time: number): WordCue | null {
- return wordAtTime(wordCues, time);
-}
-
-const activeCaptionWords = computed(() => {
- const word = activeWord.value;
- if (!word) return [];
- const segmentStart = word.index < 42 ? 0 : word.index < 89 ? 42 : 89;
- const segmentEnd = word.index < 42 ? 42 : word.index < 89 ? 89 : 135;
- const cueStart = segmentStart + Math.floor((word.index - segmentStart) / 3) * 3;
- return wordCues.slice(cueStart, Math.min(cueStart + 3, segmentEnd));
-});
-
-function renderedLineHtml(index: number) {
- let html = decoratedLines[index];
- const word = activeWord.value;
- if (word) {
- html = html.replace(
- `class="script-word" data-word-index="${word.index}"`,
- `class="script-word active" data-word-index="${word.index}"`,
- );
- }
- for (const selection of activeSourceSelections.value) {
- const depth = semanticRangeBounds.find((range) => range.id === selection.id)?.depth ?? 0;
- html = html.replaceAll(
- `semantic-token" data-selection="${selection.id}"`,
- `semantic-token semantic-active semantic-depth-${depth}" data-selection="${selection.id}"`,
- );
- }
- return html;
-}
-
-function bindingDepth(line: SourceLine) {
- if (!line.selection || !activeSourceSelections.value.some((selection) => selection.id === line.selection)) {
- return -1;
- }
- return semanticRangeBounds.find((range) => range.id === line.selection)?.depth ?? 0;
-}
-
-function roundedRangePath(points: Array<{ x: number; y: number }>, radius = 6) {
- return points.map((point, index) => {
- const previous = points[(index - 1 + points.length) % points.length];
- const next = points[(index + 1) % points.length];
- const previousLength = Math.hypot(previous.x - point.x, previous.y - point.y) || 1;
- const nextLength = Math.hypot(next.x - point.x, next.y - point.y) || 1;
- const cornerRadius = Math.min(radius, previousLength / 2, nextLength / 2);
- const before = {
- x: point.x + (previous.x - point.x) * cornerRadius / previousLength,
- y: point.y + (previous.y - point.y) * cornerRadius / previousLength,
- };
- const after = {
- x: point.x + (next.x - point.x) * cornerRadius / nextLength,
- y: point.y + (next.y - point.y) * cornerRadius / nextLength,
- };
- return `${index === 0 ? "M" : "L"} ${before.x} ${before.y} Q ${point.x} ${point.y} ${after.x} ${after.y}`;
- }).join(" ") + " Z";
-}
-
-function updateRangeGeometry() {
- const container = codeScrollElement.value;
- if (!container) return;
- const containerRect = container.getBoundingClientRect();
- const width = container.clientWidth;
- const scaleX = container.offsetWidth ? containerRect.width / container.offsetWidth : 1;
- const scaleY = container.offsetHeight ? containerRect.height / container.offsetHeight : 1;
- const renderedLines = Array.from(container.querySelectorAll<HTMLElement>(":scope > .code-line"));
- const lastRenderedLine = renderedLines.at(-1);
- const paddingBottom = Number.parseFloat(getComputedStyle(container).paddingBottom) || 0;
- const contentHeight = lastRenderedLine
- ? lastRenderedLine.offsetTop + lastRenderedLine.offsetHeight + paddingBottom
- : container.clientHeight;
- const height = Math.max(container.clientHeight, contentHeight);
- const geometry: Record<string, { path: string; depth: number }> = {};
- const markers = Array.from(container.querySelectorAll<HTMLElement>(".syn-marker[data-selection]"));
-
- // The folded source view keeps whichever active range fits the row budget, so
- // an enclosing range routinely has one of its markers folded away. Drawing
- // nothing in that case reads as "not selected"; the outline instead runs to
- // the fold and stops there, showing that the range carries on past it.
- const foldRows = Array.from(container.querySelectorAll<HTMLElement>(":scope > .code-fold"));
- const foldEdgeAfter = (line: HTMLElement) => foldRows.find((fold) => fold.offsetTop > line.offsetTop)?.offsetTop;
- const foldEdgeBefore = (line: HTMLElement) => {
- const fold = foldRows.filter((candidate) => candidate.offsetTop < line.offsetTop).at(-1);
- return fold ? fold.offsetTop + fold.offsetHeight : undefined;
- };
-
- for (const range of semanticRangeBounds) {
- const startMarker = markers.find((marker) => (
- marker.dataset.selection === range.id && marker.textContent?.trim() === `@${range.id}`
- ));
- const endMarker = markers.find((marker) => (
- marker.dataset.selection === range.id && marker.textContent?.trim().startsWith(`@/${range.id}`)
- ));
- const startLine = startMarker?.closest<HTMLElement>(".code-line");
- const endLine = endMarker?.closest<HTMLElement>(".code-line");
- if ((!startMarker || !startLine) && (!endMarker || !endLine)) continue;
-
- const inlinePadding = 3;
- const edgeOverhang = 3;
- const left = 44 - edgeOverhang;
- const right = width - 12 + edgeOverhang;
- const lineHeight = Number.parseFloat(getComputedStyle((startLine ?? endLine) as HTMLElement).lineHeight) || 26;
- const centerOf = (rect: DOMRect) => ((rect.top + rect.bottom) / 2 - containerRect.top) / scaleY + container.scrollTop;
- const leftEdgeOf = (rect: DOMRect) => Math.max(3, Math.min(width - 3, (rect.left - containerRect.left) / scaleX + container.scrollLeft - inlinePadding));
- const rightEdgeOf = (rect: DOMRect) => Math.max(3, Math.min(width - 3, (rect.right - containerRect.left) / scaleX + container.scrollLeft + inlinePadding));
- const firstRectOf = (marker: HTMLElement) => Array.from(marker.getClientRects())[0] ?? marker.getBoundingClientRect();
- const lastRectOf = (marker: HTMLElement) => Array.from(marker.getClientRects()).at(-1) ?? marker.getBoundingClientRect();
-
- let points: Array<{ x: number; y: number }>;
- if (startMarker && startLine && endMarker && endLine) {
- const startRect = firstRectOf(startMarker);
- const endRect = lastRectOf(endMarker);
- const startX = leftEdgeOf(startRect);
- const endX = rightEdgeOf(endRect);
- const startCenter = centerOf(startRect);
- const endCenter = centerOf(endRect);
- const top = startCenter - lineHeight / 2;
- const startBottom = startCenter + lineHeight / 2;
- const endTop = endCenter - lineHeight / 2;
- const bottom = endCenter + lineHeight / 2;
- points = Math.abs(startCenter - endCenter) < lineHeight / 2
- ? [
- { x: startX, y: top },
- { x: endX, y: top },
- { x: endX, y: bottom },
- { x: startX, y: bottom },
- ]
- : [
- { x: startX, y: top },
- { x: right, y: top },
- { x: right, y: endTop },
- { x: endX, y: endTop },
- { x: endX, y: bottom },
- { x: left, y: bottom },
- { x: left, y: startBottom },
- { x: startX, y: startBottom },
- ];
- } else if (startMarker && startLine) {
- const startRect = firstRectOf(startMarker);
- const startX = leftEdgeOf(startRect);
- const startCenter = centerOf(startRect);
- const startBottom = startCenter + lineHeight / 2;
- const cut = foldEdgeAfter(startLine) ?? height;
- if (cut <= startBottom) continue;
- points = [
- { x: startX, y: startCenter - lineHeight / 2 },
- { x: right, y: startCenter - lineHeight / 2 },
- { x: right, y: cut },
- { x: left, y: cut },
- { x: left, y: startBottom },
- { x: startX, y: startBottom },
- ];
- } else {
- const endRect = lastRectOf(endMarker as HTMLElement);
- const endX = rightEdgeOf(endRect);
- const endCenter = centerOf(endRect);
- const endTop = endCenter - lineHeight / 2;
- const cut = foldEdgeBefore(endLine as HTMLElement) ?? 0;
- if (cut >= endTop) continue;
- points = [
- { x: left, y: cut },
- { x: right, y: cut },
- { x: right, y: endTop },
- { x: endX, y: endTop },
- { x: endX, y: endCenter + lineHeight / 2 },
- { x: left, y: endCenter + lineHeight / 2 },
- ];
- }
- geometry[range.id] = { path: roundedRangePath(points), depth: range.depth };
- }
-
- rangeCanvas.value = { width, height };
- rangeGeometry.value = geometry;
-}
-
-const clamp01 = (value: number) => Math.max(0, Math.min(1, value));
-const lerp = (from: number, to: number, progress: number) => from + (to - from) * progress;
-const easeInOutCubic = (value: number) => value < .5
- ? 4 * value * value * value
- : 1 - Math.pow(-2 * value + 2, 3) / 2;
-const outBack = (value: number) => {
- const c1 = 1.70158;
- const c3 = c1 + 1;
- return 1 + c3 * Math.pow(value - 1, 3) + c1 * Math.pow(value - 1, 2);
-};
-
-const runtimeItems = selections.map((selection) => ({
- ...selection,
- start: selection.start + .1,
- end: selection.end - .3,
-}));
-
-const baseVideos: HTMLVideoElement[] = [];
-
-function setBaseVideo(element: unknown, index: number) {
- if (element && typeof element === "object" && "currentTime" in element) {
- baseVideos[index] = element as HTMLVideoElement;
- }
-}
-
-function setRankCell(element: unknown, rank: number) {
- if (element instanceof HTMLElement) rankCells[rank] = element;
-}
-
-const resolvedSelection = computed<RankingSelection>(() => {
- if (pinnedSelection.value) {
- const pinnedRanking = selections.find((item) => item.id === pinnedSelection.value);
- if (pinnedRanking) return pinnedRanking;
- }
- return activeRankingSelection.value;
-});
-
-const resolvedBrollSelection = computed<BrollItem | null>(() => {
- if (pinnedSelection.value) {
- const pinned = brollItems.find((item) => item.id === pinnedSelection.value);
- if (pinned) return pinned;
- }
- return activeBroll.value;
-});
-
-const activeSourceSelections = computed<TimelineSelection[]>(() => {
- if (!pinnedSelection.value) return automaticSourceSelections.value;
- return [
- resolvedSelection.value,
- ...(resolvedBrollSelection.value ? [resolvedBrollSelection.value] : []),
- ];
-});
-
-function sceneIndexAt(time: number) {
- const index = baseScenes.findIndex((scene) => time >= scene.start && time < scene.end);
- return index === -1 ? baseScenes.length - 1 : index;
-}
-
-function syncDiscreteState(time: number, force = false) {
- const nextSceneIndex = sceneIndexAt(time);
- const sceneChanged = force || currentSceneIndex.value !== nextSceneIndex;
- if (sceneChanged) currentSceneIndex.value = nextSceneIndex;
-
- const nextBroll = brollItems.find((item) => time >= item.start && time < item.end) ?? null;
- if (force || activeBroll.value?.id !== nextBroll?.id) activeBroll.value = nextBroll;
-
- const nextRanking = selections.find((item) => time >= item.start && time < item.end)
- ?? selections.find((item) => time < item.start)
- ?? selections[selections.length - 1];
- if (force || activeRankingSelection.value.id !== nextRanking.id) {
- activeRankingSelection.value = nextRanking;
- }
-
- const nextSourceSelections = semanticSelections.filter((item) => time >= item.start && time < item.end);
- const sourceSelectionsChanged = nextSourceSelections.length !== automaticSourceSelections.value.length
- || nextSourceSelections.some((item, index) => item.id !== automaticSourceSelections.value[index]?.id);
- if (force || sourceSelectionsChanged) automaticSourceSelections.value = nextSourceSelections;
-
- const nextRuntimeItem = runtimeItems.find((item) => time >= item.start && time < item.end) ?? null;
- if (force || activeRuntimeItem.value?.id !== nextRuntimeItem?.id) {
- activeRuntimeItem.value = nextRuntimeItem;
- void nextTick().then(() => updateContinuousVisuals(programTime));
- }
-
- const nextSettledIds = new Set(runtimeItems.filter((item) => time >= item.end).map((item) => item.id));
- const settledChanged = nextSettledIds.size !== settledIds.value.size
- || [...nextSettledIds].some((id) => !settledIds.value.has(id));
- if (force || settledChanged) settledIds.value = nextSettledIds;
-
- const nextWord = wordAt(time);
- if (force || activeWord.value?.index !== nextWord?.index) activeWord.value = nextWord;
- return sceneChanged;
-}
-
-function updateRankTargets() {
- const stageRect = stageElement.value?.getBoundingClientRect();
- if (!stageRect) return;
- for (let rank = 1; rank <= 5; rank += 1) {
- const cellRect = rankCells[rank]?.getBoundingClientRect();
- if (!cellRect) continue;
- rankTargets[rank] = {
- x: (cellRect.left - stageRect.left + cellRect.width / 2) / stageRect.width * 100,
- y: (cellRect.top - stageRect.top + cellRect.height / 2) / stageRect.height * 100,
- size: cellRect.width / stageRect.width * 100,
- };
- }
-}
-
-function updateContinuousVisuals(time: number) {
- if (playheadElement.value) {
- playheadElement.value.style.left = `${Math.min(100, Math.max(0, time / TOTAL_DURATION * 100))}%`;
- }
- const item = activeRuntimeItem.value;
- const icon = activeIconElement.value;
- if (!item || !icon) return;
- const duration = item.end - item.start;
- const elapsed = time - item.start;
- const moveStart = Math.max(ENTER_DURATION, duration - MOVE_DURATION);
- let centerX = 66.0185;
- let centerY = 73.0208;
- let size = 33;
- let opacity = 1;
- let scale = 1;
- let rotate = 0;
-
- if (elapsed < ENTER_DURATION) {
- const phase = outBack(clamp01(elapsed / ENTER_DURATION));
- centerY = lerp(104.6406, 73.0208, phase);
- opacity = Math.min(1, phase * 2.2);
- scale = .96 + .04 * phase;
- } else if (elapsed < moveStart) {
- const idle = (elapsed - ENTER_DURATION) / Math.max(.001, moveStart - ENTER_DURATION);
- const wave = Math.sin(idle * Math.PI * 2);
- const wave2 = Math.sin(idle * Math.PI * 2 + Math.PI / 2);
- centerY = 73.0208 - .09375 * wave;
- centerX = 66.0185 + .0741 * wave2;
- scale = 1.004 + .003 * wave2;
- rotate = .12 * wave;
- } else {
- const phase = easeInOutCubic(clamp01((elapsed - moveStart) / MOVE_DURATION));
- const rankIndex = item.rank - 1;
- const target = rankTargets[item.rank];
- const targetX = target?.x ?? 20.55;
- const targetY = target?.y ?? 23.23 + rankIndex * 7.29;
- const targetSize = target?.size ?? 8.89;
- centerX = lerp(66.0185, targetX, phase);
- centerY = lerp(73.0208, targetY, phase);
- size = lerp(33, targetSize, phase);
- scale = 1 - .02 * Math.sin(phase * Math.PI);
- }
-
- icon.style.left = `${centerX - size / 2}%`;
- icon.style.top = `${centerY - size * .5625 / 2}%`;
- icon.style.width = `${size}%`;
- icon.style.opacity = `${opacity}`;
- icon.style.transform = `scale(${scale}) rotate(${rotate}deg)`;
-}
-
-function syncBaseVideos(force = false) {
- const activeIndex = sceneIndexAt(programTime);
- const scene = baseScenes[activeIndex];
- const localTime = scene.sourceStart + Math.max(0, programTime - scene.start);
- const sceneChanged = playbackSceneIndex !== activeIndex;
-
- baseVideos.forEach((video, index) => {
- if (!video) return;
- video.muted = !audioPlaybackEnabled.value || index !== activeIndex;
- if (index !== activeIndex) {
- video.pause();
- return;
- }
- if (force || sceneChanged) video.currentTime = localTime;
- if (props.active && video.paused) void video.play().catch(() => undefined);
- });
- playbackSceneIndex = activeIndex;
-}
-
-function enableAudio(event?: Event) {
- if (event?.target instanceof Element && event.target.closest(".live-audio-toggle")) return;
- if (!enableDemoAudioAfterInteraction()) return;
- syncBaseVideos();
-}
-
-function toggleAudio() {
- toggleDemoAudio();
- syncBaseVideos();
-}
-
-async function seekTo(selection: TimelineSelection, lineIndex: number | null = null) {
- pinnedSelection.value = selection.id;
- const selectedBounds = semanticRangeBounds.find((range) => range.id === selection.id);
- const outermostBounds = selectedBounds
- ? semanticRangeBounds
- .filter((range) => range.start <= selectedBounds.start && range.end >= selectedBounds.end)
- .sort((left, right) => left.depth - right.depth)[0]
- : undefined;
- pinnedLoopSelection.value = outermostBounds?.id ?? selection.id;
- activeLine.value = lineIndex;
- programTime = selection.start;
- previousTimestamp = 0;
- syncDiscreteState(programTime, true);
- syncBaseVideos(true);
- updateContinuousVisuals(programTime);
-}
-
-function selectRange(selection: TimelineSelection, index: number) {
- if (pinnedSelection.value === selection.id) {
- activeLine.value = index;
- return;
- }
- void seekTo(selection, index);
-}
-
-function inspectToken(event: Event, index: number) {
- const element = event.target instanceof Element
- ? event.target.closest<HTMLElement>("[data-selection]")
- : null;
- const id = element?.dataset.selection as SelectionId | undefined;
- if (!id) return;
- const selection = semanticSelections.find((item) => item.id === id);
- if (selection) selectRange(selection, index);
-}
-
-function inspectLine(line: SourceLine, index: number) {
- const id = line.range ?? line.selection;
- if (!id) {
- clearInspection();
- return;
- }
- const selection = semanticSelections.find((item) => item.id === id);
- if (selection) selectRange(selection, index);
-}
-
-function clearInspection() {
- activeLine.value = null;
- pinnedSelection.value = null;
- pinnedLoopSelection.value = null;
-}
-
-function stopSourceFollow(event?: MouseEvent) {
- if (!sourceFollowEnabled.value) return;
- const container = codeScrollElement.value;
- const hoveredLine = event?.target instanceof Element && container
- ? event.target.closest<HTMLElement>("[data-source-line]")
- : null;
- const lineIndex = Number(hoveredLine?.dataset.sourceLine);
- const lineOffset = event && hoveredLine ? event.clientY - hoveredLine.getBoundingClientRect().top : 0;
- const targetTop = event && hoveredLine ? event.clientY - lineOffset : null;
- sourceFollowEnabled.value = false;
- if (!container || !Number.isInteger(lineIndex) || targetTop === null) return;
- void nextTick().then(() => {
- const expandedLine = container.querySelector<HTMLElement>(`[data-source-line="${lineIndex}"]`);
- if (!expandedLine) return;
- const previousBehavior = container.style.scrollBehavior;
- container.style.scrollBehavior = "auto";
- container.scrollTop += expandedLine.getBoundingClientRect().top - targetTop;
- container.style.scrollBehavior = previousBehavior;
- updateRangeGeometry();
- });
-}
-
-function resumeSourceFollow() {
- clearInspection();
- sourceFollowEnabled.value = true;
-}
-
-function handleDemoPointerMove(event: PointerEvent) {
- if (!sourceUsesHover.value) return;
- const target = event.target instanceof Element ? event.target : null;
- if (!target?.closest(".source-panel")) resumeSourceFollow();
-}
-
-function handleDemoPointerLeave() {
- if (sourceUsesHover.value) clearInspection();
-}
-
-function renderFrame(timestamp: number) {
- if (!props.active) {
- animationFrame = 0;
- return;
- }
- if (!previousTimestamp) previousTimestamp = timestamp;
- const delta = Math.min(.05, (timestamp - previousTimestamp) / 1000);
- previousTimestamp = timestamp;
- const scene = baseScenes[currentSceneIndex.value];
- const video = baseVideos[currentSceneIndex.value];
- let nextTime = video && !video.paused && video.readyState >= 2
- ? scene.start + video.currentTime - scene.sourceStart
- : programTime + delta;
- let looped = false;
- if (pinnedLoopSelection.value) {
- const selection = semanticSelections.find((candidate) => candidate.id === pinnedLoopSelection.value);
- if (selection && nextTime >= selection.end) {
- nextTime = selection.start;
- looped = true;
- }
- } else if (nextTime >= TOTAL_DURATION) {
- if (!completedPass) {
- completedPass = true;
- emit("ended");
- }
- nextTime = 0;
- looped = true;
- }
- programTime = nextTime;
- const sceneChanged = syncDiscreteState(programTime, looped);
- if (looped || sceneChanged) syncBaseVideos(true);
- updateContinuousVisuals(programTime);
- animationFrame = requestAnimationFrame(renderFrame);
-}
-
-function stopPlayback() {
- cancelAnimationFrame(animationFrame);
- animationFrame = 0;
- previousTimestamp = 0;
- baseVideos.forEach((video) => video?.pause());
-}
-
-function startPlayback() {
- stopPlayback();
- programTime = 0;
- playbackSceneIndex = -1;
- completedPass = false;
- pinnedSelection.value = null;
- pinnedLoopSelection.value = null;
- syncDiscreteState(programTime, true);
- syncBaseVideos(true);
- updateContinuousVisuals(programTime);
- syncSourceHoverState();
- animationFrame = requestAnimationFrame(renderFrame);
-}
-
-function syncSourceHoverState() {
- if (!sourceUsesHover.value) {
- resumeSourceFollow();
- return;
- }
- const sourceHovered = demoPointerIsInside(sourcePanelElement.value);
- if (!sourceHovered) clearInspection();
- sourceFollowEnabled.value = !sourceHovered;
-}
-
-const {
- sourceUsesHover,
- handleSourcePointerMove,
- handleSourcePointerDown,
- handleSourceClick,
- handleSourceWheel,
- handleSourcePointerLeave,
-} = useSourcePanelInteraction(sourcePanelElement, {
- active: () => props.active,
- expand: stopSourceFollow,
- collapse: resumeSourceFollow,
-});
-
-function updateSourceViewportRows() {
- const container = codeScrollElement.value;
- if (!container) return;
- let rows = Math.max(7, Math.floor(container.clientHeight / 26));
- if (rows % 2 === 0) rows -= 1;
- if (sourceViewportRows.value !== rows) sourceViewportRows.value = rows;
- const padding = Math.max(0, (container.clientHeight - rows * 26) / 2);
- container.style.setProperty("--source-vertical-padding", `${padding}px`);
-
- const measuredRows = Array.from(
- sourceMeasureElement.value?.querySelectorAll<HTMLElement>("[data-measure-line]") ?? [],
- ).map((line) => Math.max(1, Math.ceil(line.getBoundingClientRect().height / 26)));
- const measurementChanged = measuredRows.length === lines.length && measuredRows.some(
- (rowSpan, index) => rowSpan !== sourceLineRows.value[index],
- );
- if (measurementChanged) sourceLineRows.value = measuredRows;
-}
-
-function updateLayoutGeometry() {
- updateSourceViewportRows();
- updateRangeGeometry();
- updateRankTargets();
- updateContinuousVisuals(programTime);
-}
-
-watch(
- [() => displayedLines.value.map((entry) => entry.key).join("|"), sourceFollowEnabled],
- () => {
- void nextTick().then(() => {
- updateSourceViewportRows();
- void nextTick().then(() => {
- updateLayoutGeometry();
- requestAnimationFrame(updateLayoutGeometry);
- });
- });
- },
- { flush: "post" },
-);
-
-watch(
- () => props.active,
- (active) => {
- if (active) void nextTick().then(startPlayback);
- else stopPlayback();
- },
- { flush: "post" },
-);
-
-onMounted(() => {
- initializeDemoAudio();
- window.addEventListener("pointerdown", enableAudio, { capture: true, once: true });
- window.addEventListener("keydown", enableAudio, { capture: true, once: true });
- if (navigator.userActivation?.hasBeenActive) enableAudio();
- void nextTick().then(() => {
- updateLayoutGeometry();
- syncDiscreteState(programTime, true);
- if (props.active) startPlayback();
- if (codeScrollElement.value) {
- rangeResizeObserver = new ResizeObserver(updateLayoutGeometry);
- rangeResizeObserver.observe(codeScrollElement.value);
- rangeMutationObserver = new MutationObserver(() => requestAnimationFrame(updateRangeGeometry));
- rangeMutationObserver.observe(codeScrollElement.value, { childList: true, subtree: true });
- }
- });
- window.addEventListener("resize", updateLayoutGeometry);
-});
-onBeforeUnmount(() => {
- stopPlayback();
- window.removeEventListener("pointerdown", enableAudio, true);
- window.removeEventListener("keydown", enableAudio, true);
- window.removeEventListener("resize", updateLayoutGeometry);
- rangeResizeObserver?.disconnect();
- rangeMutationObserver?.disconnect();
-});
-</script>
-
-<template>
- <section class="svml-demo" :aria-label="isChinese ? 'SVML 交互式实时渲染预览' : 'Interactive SVML live-render preview'">
- <header v-if="props.showHeading" class="demo-heading">
- <h2><span class="hover-interaction-copy">{{ isChinese ? "悬停标记范围,查看对应画面" : "Hover a marked range to see the corresponding frame" }}</span><span class="touch-interaction-copy">{{ isChinese ? "点击标记范围,查看对应画面" : "Tap a marked range to see the corresponding frame" }}</span></h2>
- </header>
-
- <div
- class="demo-shell real-demo-shell"
- @pointermove="handleDemoPointerMove"
- @mouseleave="handleDemoPointerLeave"
- >
- <div
- ref="sourcePanelElement"
- class="source-panel"
- :class="{ 'source-following': sourceFollowEnabled }"
- @pointermove="handleSourcePointerMove"
- @pointerdown="handleSourcePointerDown"
- @click="handleSourceClick"
- @wheel="handleSourceWheel"
- @pointerleave="handleSourcePointerLeave"
- >
- <div ref="sourceMeasureElement" class="source-measure" aria-hidden="true">
- <div
- v-for="(html, index) in decoratedLines"
- :key="index"
- class="code-line"
- :data-measure-line="index"
- >
- <span class="line-number">{{ index + 1 }}</span>
- <code v-html="html || '&nbsp;'" />
- </div>
- </div>
- <div class="source-follow-hint">
- {{ isChinese
- ? (sourceUsesHover
- ? (sourceFollowEnabled ? "移入查看所有源码" : "移出查看精简视图")
- : (sourceFollowEnabled ? "点击代码查看所有源码" : "点击空白处返回精简视图"))
- : (sourceUsesHover
- ? (sourceFollowEnabled ? "Move in to view all source" : "Move out for the compact view")
- : (sourceFollowEnabled ? "Tap the code to view all source" : "Tap outside for the compact view")) }}
- </div>
- <div ref="codeScrollElement" class="code-scroll" aria-label="SVML source code" @scroll="updateRangeGeometry">
- <svg
- v-if="rangeCanvas.width && rangeCanvas.height"
- class="semantic-range-canvas"
- :width="rangeCanvas.width"
- :height="rangeCanvas.height"
- :viewBox="`0 0 ${rangeCanvas.width} ${rangeCanvas.height}`"
- aria-hidden="true"
- >
- <path
- v-for="selection in activeSourceSelections"
- :key="selection.id"
- :class="`depth-${rangeGeometry[selection.id]?.depth ?? 0}`"
- :d="rangeGeometry[selection.id]?.path"
- />
- </svg>
- <template v-for="entry in displayedLines" :key="entry.key">
- <div
- v-if="entry.kind === 'fold'"
- class="code-line code-fold"
- :data-source-line="entry.index"
- aria-hidden="true"
- >
- <code>···</code>
- </div>
- <div
- v-else-if="entry.line"
- class="code-line"
- :data-source-line="entry.index"
- :class="{
- 'binding-active': bindingDepth(entry.line) >= 0,
- 'binding-depth-1': bindingDepth(entry.line) === 1,
- 'binding-depth-2': bindingDepth(entry.line) === 2,
- }"
- @mouseover="inspectLine(entry.line, entry.index)"
- >
- <span class="line-number">{{ entry.index + 1 }}</span>
- <code
- v-html="renderedLineHtml(entry.index) || '&nbsp;'"
- @mouseover="inspectToken($event, entry.index)"
- @focusin="inspectToken($event, entry.index)"
- @click="inspectToken($event, entry.index)"
- @keydown.enter.prevent="inspectToken($event, entry.index)"
- @keydown.space.prevent="inspectToken($event, entry.index)"
- />
- </div>
- </template>
- </div>
- </div>
-
- <div class="preview-panel">
- <div class="real-preview-body">
- <div ref="stageElement" class="live-ranking-stage" aria-label="Ranking Track 实时渲染画面">
- <div class="live-base-layer">
- <video
- v-for="(scene, index) in baseScenes"
- :key="scene.src"
- :ref="(element) => setBaseVideo(element, index)"
- :class="{ active: currentSceneIndex === index }"
- :src="resolveDemoMedia(scene.src)"
- :muted="!audioPlaybackEnabled || currentSceneIndex !== index"
- playsinline
- preload="auto"
- @loadedmetadata="syncBaseVideos(true)"
- />
- </div>
-
- <div class="live-title">RANKING AI PHOTO APPS FOR GUYS<br>WITH NO GOOD PICS</div>
-
- <div class="live-ranking-board">
- <div v-for="rank in 5" :key="rank" class="live-rank-row">
- <strong :style="{ background: runtimeItems[5 - rank].color }">{{ rank }}</strong>
- <span
- :ref="(element) => setRankCell(element, rank)"
- class="live-rank-cell"
- :class="{ 'semantic-selected': !activeRuntimeItem && resolvedSelection.id === runtimeItems[5 - rank].id }"
- >
- <img
- v-if="settledIds.has(runtimeItems[5 - rank].id)"
- :src="resolveDemoMedia(runtimeItems[5 - rank].icon)"
- :alt="runtimeItems[5 - rank].label"
- >
- </span>
- </div>
- </div>
-
- <div
- v-if="activeRuntimeItem"
- ref="activeIconElement"
- class="live-active-icon"
- :class="{ 'semantic-selected': resolvedSelection.id === activeRuntimeItem.id }"
- >
- <img :src="resolveDemoMedia(activeRuntimeItem.icon)" :alt="activeRuntimeItem.label">
- <i></i>
- </div>
-
- <img
- v-if="activeBroll"
- class="live-broll"
- :class="{ 'semantic-selected': activeSourceSelections.some((selection) => selection.id === activeBroll.id) }"
- :src="resolveDemoMedia(activeBroll.src)"
- alt=""
- :style="{ transform: `scale(${activeBroll.zoom})` }"
- >
-
- <div v-if="activeCaptionWords.length" class="live-caption" aria-hidden="true">
- <span
- v-for="word in activeCaptionWords"
- :key="word.index"
- :class="{ active: activeWord?.index === word.index }"
- >{{ word.text }}</span>
- </div>
-
- <button
- class="live-audio-toggle"
- type="button"
- :aria-label="audioEnabled ? '静音' : '取消静音'"
- :title="audioEnabled ? '静音' : '取消静音'"
- @click.stop="toggleAudio"
- >
- <span class="material-symbols-rounded" aria-hidden="true">{{ audioEnabled ? "volume_up" : "volume_off" }}</span>
- </button>
- </div>
- </div>
-
- <div class="real-semantic-controls">
- <div class="semantic-timeline">
- <div class="timeline-labels ranking-labels">
- <button
- v-for="selection in selections"
- :key="selection.id"
- type="button"
- :class="{ current: resolvedSelection.id === selection.id }"
- :style="{ flexGrow: selection.end - selection.start }"
- @click="seekTo(selection)"
- >@{{ selection.id }}</button>
- </div>
- <div class="timeline-track ranking-track">
- <span
- v-for="selection in selections"
- :key="selection.id"
- class="segment"
- :style="{ flexGrow: selection.end - selection.start }"
- ></span>
- <i ref="playheadElement" class="playhead"></i>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
-</template>
-
-<style scoped>
-.live-active-icon.semantic-selected,
-.live-rank-cell.semantic-selected {
- outline: 1px solid var(--crimson);
- outline-offset: 3px;
-}
-
-.live-broll.semantic-selected {
- outline: 1px solid #b09257;
- outline-offset: -5px;
-}
-</style>
diff --git a/docs/.vitepress/theme/components/demo-audio.ts b/docs/.vitepress/theme/components/demo-audio.ts
deleted file mode 100644
index 8c3be054..00000000
--- a/docs/.vitepress/theme/components/demo-audio.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { ref } from "vue";
-
-const STORAGE_KEY = "svml-demo-audio-enabled";
-
-export const demoAudioEnabled = ref(false);
-export const demoAudioPlaybackEnabled = ref(false);
-
-let initialized = false;
-
-function savePreference(value: boolean) {
- try {
- window.localStorage.setItem(STORAGE_KEY, value ? "true" : "false");
- } catch {
- // Audio still persists for the current page when storage is unavailable.
- }
-}
-
-export function initializeDemoAudio() {
- if (initialized || typeof window === "undefined") return;
- initialized = true;
-
- let storedPreference = false;
- try {
- const storedValue = window.localStorage.getItem(STORAGE_KEY);
- if (storedValue === "true" || storedValue === "false") {
- storedPreference = storedValue === "true";
- }
- } catch {}
-
- demoAudioEnabled.value = storedPreference;
- demoAudioPlaybackEnabled.value = storedPreference && Boolean(navigator.userActivation?.hasBeenActive);
-}
-
-export function enableDemoAudioAfterInteraction() {
- initializeDemoAudio();
- if (!demoAudioEnabled.value || demoAudioPlaybackEnabled.value) return false;
-
- demoAudioPlaybackEnabled.value = true;
- return true;
-}
-
-export function toggleDemoAudio() {
- initializeDemoAudio();
- const nextValue = !demoAudioEnabled.value;
- demoAudioEnabled.value = nextValue;
- demoAudioPlaybackEnabled.value = nextValue;
- savePreference(nextValue);
- return nextValue;
-}
diff --git a/docs/.vitepress/theme/components/demo-media.ts b/docs/.vitepress/theme/components/demo-media.ts
deleted file mode 100644
index 2b313aff..00000000
--- a/docs/.vitepress/theme/components/demo-media.ts
+++ /dev/null
@@ -1,158 +0,0 @@
-export type DemoMediaManifest = {
- images: readonly string[];
- videos: readonly string[];
-};
-
-type DemoMediaKind = "image" | "video";
-
-export const demoMediaVersion = "20260805-lowbitrate";
-const resolvedMedia = new Map<string, string>();
-const preloadPromises = new Map<string, Promise<void>>();
-
-export function publicAsset(relativePath: string) {
- return `${import.meta.env.BASE_URL}${relativePath.replace(/^\/+/, "")}?v=${demoMediaVersion}`;
-}
-
-export function resolveDemoMedia(source: string) {
- return resolvedMedia.get(source) ?? source;
-}
-
-function decodeImage(source: string) {
- return new Promise<void>((resolve, reject) => {
- const image = new Image();
- image.onload = async () => {
- try {
- await image.decode();
- resolve();
- } catch (error) {
- reject(error);
- }
- };
- image.onerror = () => reject(new Error(`Unable to decode image: ${source}`));
- image.src = source;
- });
-}
-
-function decodeVideo(source: string) {
- return new Promise<void>((resolve, reject) => {
- const video = document.createElement("video");
- const finish = (error?: Error) => {
- video.onloadeddata = null;
- video.onerror = null;
- video.removeAttribute("src");
- video.load();
- error ? reject(error) : resolve();
- };
-
- video.preload = "auto";
- video.muted = true;
- video.playsInline = true;
- video.onloadeddata = () => finish();
- video.onerror = () => finish(new Error(`Unable to decode video: ${source}`));
- video.src = source;
- video.load();
- });
-}
-
-export function preloadDemoMedia(source: string, kind: DemoMediaKind) {
- if (resolvedMedia.has(source)) return Promise.resolve();
-
- const existing = preloadPromises.get(source);
- if (existing) return existing;
-
- const promise = fetch(source, { cache: "force-cache" })
- .then((response) => {
- if (!response.ok) throw new Error(`Unable to preload ${source}: ${response.status}`);
- return response.blob();
- })
- .then(async (blob) => {
- const objectUrl = URL.createObjectURL(blob);
- try {
- await (kind === "image" ? decodeImage(objectUrl) : decodeVideo(objectUrl));
- resolvedMedia.set(source, objectUrl);
- } catch (error) {
- URL.revokeObjectURL(objectUrl);
- throw error;
- }
- })
- .catch((error) => {
- preloadPromises.delete(source);
- throw error;
- });
-
- preloadPromises.set(source, promise);
- return promise;
-}
-
-export const rankingMedia = {
- avatars: [
- publicAsset("regen-ranking/avatar-1.mp4"),
- publicAsset("regen-ranking/avatar-2.mp4"),
- publicAsset("regen-ranking/avatar-3.mp4"),
- ],
- icons: [
- publicAsset("regen-ranking/ranking-icon-1.webp"),
- publicAsset("regen-ranking/ranking-icon-2.webp"),
- publicAsset("regen-ranking/ranking-icon-3.webp"),
- publicAsset("regen-ranking/ranking-icon-4.webp"),
- publicAsset("regen-ranking/ranking-icon-5.webp"),
- ],
- broll: [
- publicAsset("regen-ranking/broll-1.webp"),
- publicAsset("regen-ranking/broll-2.webp"),
- publicAsset("regen-ranking/broll-3.webp"),
- publicAsset("regen-ranking/broll-4.webp"),
- publicAsset("regen-ranking/broll-5.webp"),
- ],
-} as const;
-
-export const streetMedia = {
- scenes: [
- publicAsset("street-interview/scene-1.mp4"),
- publicAsset("street-interview/scene-2.mp4"),
- publicAsset("street-interview/scene-3.mp4"),
- publicAsset("street-interview/scene-4.mp4"),
- ],
- broll: [
- publicAsset("street-interview/broll-2.mp4"),
- publicAsset("street-interview/broll-3.mp4"),
- publicAsset("street-interview/broll-4.mp4"),
- ],
-} as const;
-
-export const goodBetterBestMedia = {
- speakers: [
- publicAsset("good-better-best/speaker-hook.mp4"),
- publicAsset("good-better-best/speaker-1.mp4"),
- publicAsset("good-better-best/speaker-good.mp4"),
- publicAsset("good-better-best/speaker-2.mp4"),
- publicAsset("good-better-best/speaker-better.mp4"),
- publicAsset("good-better-best/speaker-3.mp4"),
- publicAsset("good-better-best/speaker-best.mp4"),
- ],
- decks: [
- publicAsset("good-better-best/deck-votes.webp"),
- publicAsset("good-better-best/deck-attract.webp"),
- publicAsset("good-better-best/deck-features.webp"),
- ],
- logos: [
- publicAsset("good-better-best/logo-chatgpt.webp"),
- publicAsset("good-better-best/logo-looksmax.webp"),
- publicAsset("good-better-best/logo-areum.webp"),
- ],
-} as const;
-
-export const demoMediaManifests = [
- {
- images: [...rankingMedia.icons, ...rankingMedia.broll],
- videos: rankingMedia.avatars,
- },
- {
- images: [],
- videos: [...streetMedia.scenes, ...streetMedia.broll],
- },
- {
- images: [...goodBetterBestMedia.decks, ...goodBetterBestMedia.logos],
- videos: goodBetterBestMedia.speakers,
- },
-] as const satisfies readonly DemoMediaManifest[];
diff --git a/docs/.vitepress/theme/components/demo-pointer.ts b/docs/.vitepress/theme/components/demo-pointer.ts
deleted file mode 100644
index bf99f740..00000000
--- a/docs/.vitepress/theme/components/demo-pointer.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-let pointerX: number | null = null;
-let pointerY: number | null = null;
-
-export function updateDemoPointer(event: PointerEvent) {
- pointerX = event.clientX;
- pointerY = event.clientY;
-}
-
-export function clearDemoPointer() {
- pointerX = null;
- pointerY = null;
-}
-
-export function demoPointerIsInside(element: HTMLElement | null) {
- if (!element) return false;
- if (pointerX !== null && pointerY !== null) {
- return element.contains(document.elementFromPoint(pointerX, pointerY));
- }
- return element.matches(":hover");
-}
diff --git a/docs/.vitepress/theme/components/demo-timeline.ts b/docs/.vitepress/theme/components/demo-timeline.ts
deleted file mode 100644
index d919b784..00000000
--- a/docs/.vitepress/theme/components/demo-timeline.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-type TimelineRange = {
- start: number;
- end: number;
-};
-
-export function createDemoTimeline<T extends TimelineRange>(sourceScenes: readonly T[]) {
- const scenes = sourceScenes.map((scene) => ({
- ...scene,
- sourceStart: 0,
- }));
-
- function mapRange<R extends TimelineRange>(range: R) {
- return { ...range };
- }
-
- return {
- duration: scenes.at(-1)?.end ?? 0,
- mapRange,
- scenes,
- };
-}
diff --git a/docs/.vitepress/theme/components/demo-word-timing.ts b/docs/.vitepress/theme/components/demo-word-timing.ts
deleted file mode 100644
index b17b1b63..00000000
--- a/docs/.vitepress/theme/components/demo-word-timing.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-export type TimedWordCue = {
- start: number;
- end: number;
-};
-
-export const MAX_WORD_GAP_FILL = .5;
-
-export function wordAtTime<T extends TimedWordCue>(words: readonly T[], time: number): T | null {
- for (const [index, cue] of words.entries()) {
- const nextStart = words[index + 1]?.start;
- const effectiveEnd = nextStart !== undefined && nextStart > cue.end
- ? Math.min(nextStart, cue.end + MAX_WORD_GAP_FILL)
- : cue.end;
-
- if (time >= cue.start && time < effectiveEnd) return cue;
- }
-
- return null;
-}
diff --git a/docs/.vitepress/theme/components/regen-ranking-cues.ts b/docs/.vitepress/theme/components/regen-ranking-cues.ts
deleted file mode 100644
index 39307fed..00000000
--- a/docs/.vitepress/theme/components/regen-ranking-cues.ts
+++ /dev/null
@@ -1,819 +0,0 @@
-export type WordCue = {
- index: number;
- text: string;
- start: number;
- end: number;
-};
-
-export const wordCues: WordCue[] = [
- {
- "index": 0,
- "text": "Photoshop",
- "start": 0.06666666666666667,
- "end": 1
- },
- {
- "index": 1,
- "text": "Powerful",
- "start": 1,
- "end": 1.4666666666666666
- },
- {
- "index": 2,
- "text": "but",
- "start": 1.4666666666666666,
- "end": 1.6333333333333333
- },
- {
- "index": 3,
- "text": "only",
- "start": 1.6333333333333333,
- "end": 1.8666666666666667
- },
- {
- "index": 4,
- "text": "if",
- "start": 1.8666666666666667,
- "end": 2
- },
- {
- "index": 5,
- "text": "you",
- "start": 2,
- "end": 2.2333333333333334
- },
- {
- "index": 6,
- "text": "know",
- "start": 2.2333333333333334,
- "end": 2.3666666666666667
- },
- {
- "index": 7,
- "text": "how",
- "start": 2.3666666666666667,
- "end": 2.566666666666667
- },
- {
- "index": 8,
- "text": "to",
- "start": 2.566666666666667,
- "end": 2.6333333333333333
- },
- {
- "index": 9,
- "text": "use",
- "start": 2.6333333333333333,
- "end": 2.8
- },
- {
- "index": 10,
- "text": "it",
- "start": 2.8,
- "end": 3.1333333333333333
- },
- {
- "index": 11,
- "text": "Otherwise",
- "start": 3.1333333333333333,
- "end": 3.6
- },
- {
- "index": 12,
- "text": "your",
- "start": 3.6,
- "end": 3.7666666666666666
- },
- {
- "index": 13,
- "text": "new",
- "start": 3.7666666666666666,
- "end": 4.066666666666666
- },
- {
- "index": 14,
- "text": "profile",
- "start": 4.066666666666666,
- "end": 4.233333333333333
- },
- {
- "index": 15,
- "text": "picture",
- "start": 4.233333333333333,
- "end": 4.666666666666667
- },
- {
- "index": 16,
- "text": "becomes",
- "start": 4.666666666666667,
- "end": 4.833333333333333
- },
- {
- "index": 17,
- "text": "a",
- "start": 4.833333333333333,
- "end": 4.9
- },
- {
- "index": 18,
- "text": "three-hour",
- "start": 4.9,
- "end": 5.433333333333334
- },
- {
- "index": 19,
- "text": "design",
- "start": 5.433333333333334,
- "end": 5.833333333333333
- },
- {
- "index": 20,
- "text": "project",
- "start": 5.833333333333333,
- "end": 6.4
- },
- {
- "index": 21,
- "text": "Facetune",
- "start": 6.4,
- "end": 7.4
- },
- {
- "index": 22,
- "text": "Fast",
- "start": 7.4,
- "end": 7.6
- },
- {
- "index": 23,
- "text": "and",
- "start": 7.6,
- "end": 7.7
- },
- {
- "index": 24,
- "text": "great",
- "start": 7.7,
- "end": 8
- },
- {
- "index": 25,
- "text": "for",
- "start": 8,
- "end": 8.333333333333334
- },
- {
- "index": 26,
- "text": "touch-ups",
- "start": 8.333333333333334,
- "end": 8.633333333333333
- },
- {
- "index": 27,
- "text": "But",
- "start": 8.633333333333333,
- "end": 8.766666666666667
- },
- {
- "index": 28,
- "text": "it",
- "start": 8.766666666666667,
- "end": 8.966666666666667
- },
- {
- "index": 29,
- "text": "still",
- "start": 8.966666666666667,
- "end": 9.033333333333333
- },
- {
- "index": 30,
- "text": "leaves",
- "start": 9.033333333333333,
- "end": 9.3
- },
- {
- "index": 31,
- "text": "you",
- "start": 9.3,
- "end": 9.466666666666667
- },
- {
- "index": 32,
- "text": "with",
- "start": 9.466666666666667,
- "end": 9.566666666666666
- },
- {
- "index": 33,
- "text": "the",
- "start": 9.566666666666666,
- "end": 9.7
- },
- {
- "index": 34,
- "text": "same",
- "start": 9.7,
- "end": 9.866666666666667
- },
- {
- "index": 35,
- "text": "awkward",
- "start": 9.866666666666667,
- "end": 10.133333333333333
- },
- {
- "index": 36,
- "text": "pose",
- "start": 10.133333333333333,
- "end": 10.466666666666667
- },
- {
- "index": 37,
- "text": "and",
- "start": 10.466666666666667,
- "end": 10.533333333333333
- },
- {
- "index": 38,
- "text": "the",
- "start": 10.533333333333333,
- "end": 10.666666666666666
- },
- {
- "index": 39,
- "text": "same",
- "start": 10.666666666666666,
- "end": 10.866666666666667
- },
- {
- "index": 40,
- "text": "dorm-room",
- "start": 10.866666666666667,
- "end": 11.466666666666667
- },
- {
- "index": 41,
- "text": "background",
- "start": 11.466666666666667,
- "end": 12
- },
- {
- "index": 42,
- "text": "Remini",
- "start": 12.033333333333333,
- "end": 13.033333333333333
- },
- {
- "index": 43,
- "text": "Great",
- "start": 13.033333333333333,
- "end": 13.3
- },
- {
- "index": 44,
- "text": "for",
- "start": 13.3,
- "end": 13.566666666666666
- },
- {
- "index": 45,
- "text": "blurry",
- "start": 13.566666666666666,
- "end": 13.766666666666667
- },
- {
- "index": 46,
- "text": "photos",
- "start": 13.766666666666667,
- "end": 14.033333333333333
- },
- {
- "index": 47,
- "text": "It",
- "start": 14.033333333333333,
- "end": 14.1
- },
- {
- "index": 48,
- "text": "restores",
- "start": 14.1,
- "end": 14.4
- },
- {
- "index": 49,
- "text": "detail",
- "start": 14.4,
- "end": 14.6
- },
- {
- "index": 50,
- "text": "but",
- "start": 14.6,
- "end": 14.766666666666667
- },
- {
- "index": 51,
- "text": "it",
- "start": 14.766666666666667,
- "end": 14.8
- },
- {
- "index": 52,
- "text": "can't",
- "start": 14.8,
- "end": 14.966666666666667
- },
- {
- "index": 53,
- "text": "fix",
- "start": 14.966666666666667,
- "end": 15.066666666666666
- },
- {
- "index": 54,
- "text": "the",
- "start": 15.066666666666666,
- "end": 15.2
- },
- {
- "index": 55,
- "text": "pose",
- "start": 15.2,
- "end": 15.366666666666667
- },
- {
- "index": 56,
- "text": "outfit",
- "start": 15.366666666666667,
- "end": 15.733333333333333
- },
- {
- "index": 57,
- "text": "or",
- "start": 15.733333333333333,
- "end": 15.866666666666667
- },
- {
- "index": 58,
- "text": "background",
- "start": 15.866666666666667,
- "end": 16.633333333333333
- },
- {
- "index": 59,
- "text": "You",
- "start": 16.633333333333333,
- "end": 16.8
- },
- {
- "index": 60,
- "text": "get",
- "start": 16.8,
- "end": 16.966666666666665
- },
- {
- "index": 61,
- "text": "the",
- "start": 16.966666666666665,
- "end": 17.166666666666668
- },
- {
- "index": 62,
- "text": "same",
- "start": 17.166666666666668,
- "end": 17.366666666666667
- },
- {
- "index": 63,
- "text": "bad",
- "start": 17.366666666666667,
- "end": 17.5
- },
- {
- "index": 64,
- "text": "photo",
- "start": 17.5,
- "end": 17.8
- },
- {
- "index": 65,
- "text": "in",
- "start": 17.8,
- "end": 17.866666666666667
- },
- {
- "index": 66,
- "text": "HD",
- "start": 17.866666666666667,
- "end": 18.2
- },
- {
- "index": 67,
- "text": "ChatGPT",
- "start": 18.2,
- "end": 19.266666666666666
- },
- {
- "index": 68,
- "text": "More",
- "start": 19.266666666666666,
- "end": 19.533333333333335
- },
- {
- "index": 69,
- "text": "flexible",
- "start": 19.533333333333335,
- "end": 20
- },
- {
- "index": 70,
- "text": "It",
- "start": 20,
- "end": 20.033333333333335
- },
- {
- "index": 71,
- "text": "can",
- "start": 20.033333333333335,
- "end": 20.133333333333333
- },
- {
- "index": 72,
- "text": "create",
- "start": 20.133333333333333,
- "end": 20.433333333333334
- },
- {
- "index": 73,
- "text": "a",
- "start": 20.433333333333334,
- "end": 20.533333333333335
- },
- {
- "index": 74,
- "text": "new",
- "start": 20.533333333333335,
- "end": 20.7
- },
- {
- "index": 75,
- "text": "shot",
- "start": 20.7,
- "end": 20.966666666666665
- },
- {
- "index": 76,
- "text": "but",
- "start": 20.966666666666665,
- "end": 21.133333333333333
- },
- {
- "index": 77,
- "text": "getting",
- "start": 21.133333333333333,
- "end": 21.333333333333332
- },
- {
- "index": 78,
- "text": "your",
- "start": 21.333333333333332,
- "end": 21.5
- },
- {
- "index": 79,
- "text": "face",
- "start": 21.5,
- "end": 21.833333333333332
- },
- {
- "index": 80,
- "text": "and",
- "start": 21.833333333333332,
- "end": 21.9
- },
- {
- "index": 81,
- "text": "the",
- "start": 21.9,
- "end": 22
- },
- {
- "index": 82,
- "text": "details",
- "start": 22,
- "end": 22.433333333333334
- },
- {
- "index": 83,
- "text": "right",
- "start": 22.433333333333334,
- "end": 22.6
- },
- {
- "index": 84,
- "text": "becomes",
- "start": 22.6,
- "end": 22.933333333333334
- },
- {
- "index": 85,
- "text": "a",
- "start": 22.933333333333334,
- "end": 23.066666666666666
- },
- {
- "index": 86,
- "text": "prompt-writing",
- "start": 23.066666666666666,
- "end": 23.566666666666666
- },
- {
- "index": 87,
- "text": "group",
- "start": 23.566666666666666,
- "end": 23.733333333333334
- },
- {
- "index": 88,
- "text": "project",
- "start": 23.733333333333334,
- "end": 24.066666666666666
- },
- {
- "index": 89,
- "text": "ReGen",
- "start": 24.066666666666666,
- "end": 25.066666666666666
- },
- {
- "index": 90,
- "text": "Pick",
- "start": 25.066666666666666,
- "end": 25.266666666666666
- },
- {
- "index": 91,
- "text": "a",
- "start": 25.266666666666666,
- "end": 25.3
- },
- {
- "index": 92,
- "text": "photo",
- "start": 25.3,
- "end": 25.566666666666666
- },
- {
- "index": 93,
- "text": "you",
- "start": 25.566666666666666,
- "end": 25.733333333333334
- },
- {
- "index": 94,
- "text": "love",
- "start": 25.733333333333334,
- "end": 26
- },
- {
- "index": 95,
- "text": "and",
- "start": 26,
- "end": 26.066666666666666
- },
- {
- "index": 96,
- "text": "the",
- "start": 26.066666666666666,
- "end": 26.233333333333334
- },
- {
- "index": 97,
- "text": "app",
- "start": 26.233333333333334,
- "end": 26.366666666666667
- },
- {
- "index": 98,
- "text": "rebuilds",
- "start": 26.366666666666667,
- "end": 26.9
- },
- {
- "index": 99,
- "text": "it",
- "start": 26.9,
- "end": 26.9
- },
- {
- "index": 100,
- "text": "around",
- "start": 26.9,
- "end": 27.2
- },
- {
- "index": 101,
- "text": "you",
- "start": 27.2,
- "end": 27.333333333333332
- },
- {
- "index": 102,
- "text": "with",
- "start": 27.333333333333332,
- "end": 27.533333333333335
- },
- {
- "index": 103,
- "text": "a",
- "start": 27.533333333333335,
- "end": 27.7
- },
- {
- "index": 104,
- "text": "better",
- "start": 27.7,
- "end": 27.9
- },
- {
- "index": 105,
- "text": "pose",
- "start": 27.9,
- "end": 28.2
- },
- {
- "index": 106,
- "text": "outfit",
- "start": 28.2,
- "end": 28.7
- },
- {
- "index": 107,
- "text": "and",
- "start": 28.7,
- "end": 28.933333333333334
- },
- {
- "index": 108,
- "text": "setting",
- "start": 28.933333333333334,
- "end": 29.6
- },
- {
- "index": 109,
- "text": "From",
- "start": 29.633333333333333,
- "end": 29.866666666666667
- },
- {
- "index": 110,
- "text": "one",
- "start": 29.866666666666667,
- "end": 29.966666666666665
- },
- {
- "index": 111,
- "text": "selfie",
- "start": 29.966666666666665,
- "end": 30.4
- },
- {
- "index": 112,
- "text": "you",
- "start": 30.433333333333334,
- "end": 30.533333333333335
- },
- {
- "index": 113,
- "text": "can",
- "start": 30.533333333333335,
- "end": 30.7
- },
- {
- "index": 114,
- "text": "make",
- "start": 30.7,
- "end": 30.833333333333332
- },
- {
- "index": 115,
- "text": "a",
- "start": 30.833333333333332,
- "end": 31
- },
- {
- "index": 116,
- "text": "dating",
- "start": 31,
- "end": 31.533333333333335
- },
- {
- "index": 117,
- "text": "photo",
- "start": 31.533333333333335,
- "end": 31.733333333333334
- },
- {
- "index": 118,
- "text": "LinkedIn",
- "start": 31.733333333333334,
- "end": 32.03333333333333
- },
- {
- "index": 119,
- "text": "headshot",
- "start": 32.03333333333333,
- "end": 32.56666666666667
- },
- {
- "index": 120,
- "text": "or",
- "start": 32.56666666666667,
- "end": 32.7
- },
- {
- "index": 121,
- "text": "Instagram",
- "start": 32.7,
- "end": 33.2
- },
- {
- "index": 122,
- "text": "post",
- "start": 33.2,
- "end": 33.63333333333333
- },
- {
- "index": 123,
- "text": "so",
- "start": 33.666666666666664,
- "end": 33.766666666666666
- },
- {
- "index": 124,
- "text": "you",
- "start": 33.766666666666666,
- "end": 33.93333333333333
- },
- {
- "index": 125,
- "text": "get",
- "start": 33.93333333333333,
- "end": 34
- },
- {
- "index": 126,
- "text": "what",
- "start": 34,
- "end": 34.13333333333333
- },
- {
- "index": 127,
- "text": "you",
- "start": 34.13333333333333,
- "end": 34.266666666666666
- },
- {
- "index": 128,
- "text": "wanted",
- "start": 34.266666666666666,
- "end": 34.6
- },
- {
- "index": 129,
- "text": "instead",
- "start": 34.6,
- "end": 34.86666666666667
- },
- {
- "index": 130,
- "text": "of",
- "start": 34.86666666666667,
- "end": 35.06666666666667
- },
- {
- "index": 131,
- "text": "fixing",
- "start": 35.06666666666667,
- "end": 35.43333333333333
- },
- {
- "index": 132,
- "text": "a",
- "start": 35.43333333333333,
- "end": 35.53333333333333
- },
- {
- "index": 133,
- "text": "bad",
- "start": 35.53333333333333,
- "end": 35.766666666666666
- },
- {
- "index": 134,
- "text": "shot",
- "start": 35.766666666666666,
- "end": 36.06666666666667
- }
-];
diff --git a/docs/.vitepress/theme/components/semantic-video-demos.ts b/docs/.vitepress/theme/components/semantic-video-demos.ts
deleted file mode 100644
index f9afbc9c..00000000
--- a/docs/.vitepress/theme/components/semantic-video-demos.ts
+++ /dev/null
@@ -1,196 +0,0 @@
-import streetTranscript from "../../../public/street-interview/transcript.json";
-import goodBetterBestTranscript from "../../../public/good-better-best/transcript.json";
-import { goodBetterBestMedia, streetMedia } from "./demo-media";
-import { createDemoTimeline } from "./demo-timeline";
-
-export type DemoId = "street" | "good-better-best";
-
-export type WordCue = {
- index: number;
- text: string;
- start: number;
- end: number;
-};
-
-export type DemoSelection = {
- id: string;
- start: number;
- end: number;
- layer: "scene" | "overlay";
- asset?: string;
-};
-
-export type DemoScene = {
- src: string;
- start: number;
- end: number;
- sourceStart: number;
-};
-
-export type DemoSourceLine = {
- html: string;
- selection?: string;
- range?: string;
- ranges?: string[];
- tokens?: readonly [number, number];
-};
-
-export type SemanticVideoDemoConfig = {
- id: DemoId;
- duration: number;
- words: WordCue[];
- selections: DemoSelection[];
- scenes: DemoScene[];
- lines: DemoSourceLine[];
-};
-
-const words = (input: Array<{ text: string; start: number; end: number }>) => input.map((cue, index) => ({
- ...cue,
- index,
-}));
-
-const streetWords = words(streetTranscript);
-const goodBetterBestWords = words(goodBetterBestTranscript).map((cue) => {
- if (cue.index === 8) return { ...cue, text: "ChatGPT." };
- if (cue.index === 65) return { ...cue, text: "Areum." };
- if (cue.index === 66) return { ...cue, text: "" };
- return cue;
-});
-
-const streetLines: DemoSourceLine[] = [
- { html: '<span class="syn-tag">&lt;script&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;segment</span> <span class="syn-attr">id</span>=<span class="syn-string">"hook"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;A&gt;</span> <span class="syn-marker semantic-token" data-selection="hook">@hook</span> How much was your flight?', selection: "hook", range: "hook", tokens: [0, 5] },
- { html: ' <span class="syn-tag">&lt;B&gt;</span> $49.', range: "hook", tokens: [5, 6] },
- { html: ' <span class="syn-tag">&lt;A&gt;</span> That\'s cheap.', range: "hook", tokens: [6, 8] },
- { html: ' <span class="syn-tag">&lt;B&gt;</span> The seat was cheap. The rainbow wasn\'t. <span class="syn-marker semantic-token" data-selection="hook">@/hook</span>', selection: "hook", range: "hook", tokens: [8, 15] },
- { html: ' <span class="syn-tag">&lt;/segment&gt;</span>' },
- { html: "" },
- { html: ' <span class="syn-tag">&lt;segment</span> <span class="syn-attr">id</span>=<span class="syn-string">"rainbow"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;A&gt;</span> <span class="syn-marker semantic-token" data-selection="rainbow">@rainbow</span> They charged you for the rainbow?', selection: "rainbow", range: "rainbow", tokens: [15, 21] },
- { html: ' <span class="syn-tag">&lt;B&gt;</span> <span class="syn-marker semantic-token" data-selection="seven-bags">@seven-bags</span> They counted it as seven carry-ons.', selection: "seven-bags", range: "seven-bags", ranges: ["rainbow", "seven-bags"], tokens: [21, 27] },
- { html: ' <span class="syn-tag">&lt;A&gt;</span> Why seven?', range: "seven-bags", ranges: ["rainbow", "seven-bags"], tokens: [27, 29] },
- { html: ' <span class="syn-tag">&lt;B&gt;</span> One bag for each color. <span class="syn-marker semantic-token" data-selection="seven-bags">@/seven-bags</span> <span class="syn-marker semantic-token" data-selection="rainbow">@/rainbow</span>', selection: "seven-bags", range: "seven-bags", ranges: ["rainbow", "seven-bags"], tokens: [29, 34] },
- { html: ' <span class="syn-tag">&lt;/segment&gt;</span>' },
- { html: "" },
- { html: ' <span class="syn-tag">&lt;segment</span> <span class="syn-attr">id</span>=<span class="syn-string">"fees"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;A&gt;</span> <span class="syn-marker semantic-token" data-selection="fees">@fees</span> Couldn\'t you turn it off?', selection: "fees", range: "fees", tokens: [34, 39] },
- { html: ' <span class="syn-tag">&lt;B&gt;</span> I tried. They charged me a $35 rainbow deactivation fee.', range: "fees", tokens: [39, 49] },
- { html: ' <span class="syn-tag">&lt;A&gt;</span> What was the total?', range: "fees", tokens: [49, 53] },
- { html: ' <span class="syn-tag">&lt;B&gt;</span> $2,846.', range: "fees", tokens: [53, 54] },
- { html: ' <span class="syn-tag">&lt;A&gt;</span> <span class="syn-marker semantic-token" data-selection="receipt">@receipt</span> Do you have the receipt?', selection: "receipt", range: "receipt", ranges: ["fees", "receipt"], tokens: [54, 59] },
- { html: ' <span class="syn-tag">&lt;B&gt;</span> Yeah, but I can\'t screenshot the whole thing. It\'s still scrolling. <span class="syn-marker semantic-token" data-selection="receipt">@/receipt</span> <span class="syn-marker semantic-token" data-selection="fees">@/fees</span>', selection: "receipt", range: "receipt", ranges: ["fees", "receipt"], tokens: [59, 70] },
- { html: ' <span class="syn-tag">&lt;/segment&gt;</span>' },
- { html: "" },
- { html: ' <span class="syn-tag">&lt;segment</span> <span class="syn-attr">id</span>=<span class="syn-string">"loan"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;A&gt;</span> <span class="syn-marker semantic-token" data-selection="loan">@loan</span> How did you pay for it?', selection: "loan", range: "loan", tokens: [70, 76] },
- { html: ' <span class="syn-tag">&lt;B&gt;</span> I took out a student loan.', range: "loan", tokens: [76, 82] },
- { html: ' <span class="syn-tag">&lt;A&gt;</span> <span class="syn-marker semantic-token" data-selection="college">@college</span> But you\'re not in college.', selection: "college", range: "college", ranges: ["loan", "college"], tokens: [82, 87] },
- { html: ' <span class="syn-tag">&lt;B&gt;</span> I am now. The airline enrolled me so I could finance the baggage fees. <span class="syn-marker semantic-token" data-selection="college">@/college</span> <span class="syn-marker semantic-token" data-selection="loan">@/loan</span>', selection: "college", range: "college", ranges: ["loan", "college"], tokens: [87, 101] },
- { html: ' <span class="syn-tag">&lt;/segment&gt;</span>' },
- { html: '<span class="syn-tag">&lt;/script&gt;</span>' },
- { html: "" },
- { html: '<span class="syn-tag">&lt;street-interview&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;scene</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="hook">{script.selection.hook}</span> <span class="syn-tag">/&gt;</span>', selection: "hook" },
- { html: ' <span class="syn-tag">&lt;scene</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="rainbow">{script.selection.rainbow}</span> <span class="syn-tag">/&gt;</span>', selection: "rainbow" },
- { html: ' <span class="syn-tag">&lt;scene</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="fees">{script.selection.fees}</span> <span class="syn-tag">/&gt;</span>', selection: "fees" },
- { html: ' <span class="syn-tag">&lt;scene</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="loan">{script.selection.loan}</span> <span class="syn-tag">/&gt;</span>', selection: "loan" },
- { html: '<span class="syn-tag">&lt;/street-interview&gt;</span>' },
- { html: "" },
- { html: '<span class="syn-tag">&lt;broll-track&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="seven-bags">{script.selection.seven-bags}</span> <span class="syn-tag">/&gt;</span>', selection: "seven-bags" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="receipt">{script.selection.receipt}</span> <span class="syn-tag">/&gt;</span>', selection: "receipt" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="college">{script.selection.college}</span> <span class="syn-tag">/&gt;</span>', selection: "college" },
- { html: '<span class="syn-tag">&lt;/broll-track&gt;</span>' },
-];
-
-const goodBetterBestLines: DemoSourceLine[] = [
- { html: '<span class="syn-tag">&lt;script&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;segment</span> <span class="syn-attr">id</span>=<span class="syn-string">"hook"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;SPEAKER&gt;</span> <span class="syn-marker semantic-token" data-selection="hook">@hook</span> Good. Better. Best. Face Rating Edition. <span class="syn-marker semantic-token" data-selection="hook">@/hook</span>', selection: "hook", range: "hook", tokens: [0, 6] },
- { html: ' <span class="syn-tag">&lt;/segment&gt;</span>' },
- { html: "" },
- { html: ' <span class="syn-tag">&lt;segment</span> <span class="syn-attr">id</span>=<span class="syn-string">"good"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;SPEAKER&gt;</span> <span class="syn-marker semantic-token" data-selection="good">@good</span> Good is ChatGPT. Everyone\'s asked it to rate their selfie.', selection: "good", range: "good", tokens: [6, 16] },
- { html: ' But it\'s a chatbot, not a face scanner. It can\'t measure a jawline, so it just guesses to keep you happy. <span class="syn-marker semantic-token" data-selection="good">@/good</span>', selection: "good", range: "good", tokens: [16, 37] },
- { html: ' <span class="syn-tag">&lt;/segment&gt;</span>' },
- { html: "" },
- { html: ' <span class="syn-tag">&lt;segment</span> <span class="syn-attr">id</span>=<span class="syn-string">"better"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;SPEAKER&gt;</span> <span class="syn-marker semantic-token" data-selection="better">@better</span> Better is LooksMax AI, an app actually built to score your face.', selection: "better", range: "better", tokens: [37, 49] },
- { html: ' But it scores the photo, not you. Same guy, new lighting, totally different number. <span class="syn-marker semantic-token" data-selection="better">@/better</span>', selection: "better", range: "better", tokens: [49, 63] },
- { html: ' <span class="syn-tag">&lt;/segment&gt;</span>' },
- { html: "" },
- { html: ' <span class="syn-tag">&lt;segment</span> <span class="syn-attr">id</span>=<span class="syn-string">"best"</span><span class="syn-tag">&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;SPEAKER&gt;</span> <span class="syn-marker semantic-token" data-selection="best">@best</span> Best is Areum. It scans your face in 3D with Face ID. No angles, no lighting tricks.', selection: "best", range: "best", tokens: [63, 82] },
- { html: ' And it doesn\'t stop at a score.', range: "best", tokens: [82, 90] },
- { html: ' <span class="syn-marker semantic-token" data-selection="votes">@votes</span> It\'s built on 7 million real human votes. <span class="syn-marker semantic-token" data-selection="votes">@/votes</span>', selection: "votes", range: "votes", ranges: ["best", "votes"], tokens: [90, 98] },
- { html: ' <span class="syn-marker semantic-token" data-selection="attract">@attract</span> Shows you which type of people you attract, <span class="syn-marker semantic-token" data-selection="attract">@/attract</span>', selection: "attract", range: "attract", ranges: ["best", "attract"], tokens: [98, 106] },
- { html: ' <span class="syn-marker semantic-token" data-selection="features">@features</span> and tells you exactly which feature to fix first. <span class="syn-marker semantic-token" data-selection="features">@/features</span>', selection: "features", range: "features", ranges: ["best", "features"], tokens: [106, 114] },
- { html: ' Your glow up, finally measurable. <span class="syn-marker semantic-token" data-selection="best">@/best</span>', selection: "best", range: "best", tokens: [114, 118] },
- { html: ' <span class="syn-tag">&lt;/segment&gt;</span>' },
- { html: '<span class="syn-tag">&lt;/script&gt;</span>' },
- { html: "" },
- { html: '<span class="syn-tag">&lt;good-better-best&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">label</span>=<span class="syn-string">"GOOD"</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="good">{script.selection.good}</span> <span class="syn-tag">/&gt;</span>', selection: "good" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">label</span>=<span class="syn-string">"BETTER"</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="better">{script.selection.better}</span> <span class="syn-tag">/&gt;</span>', selection: "better" },
- { html: ' <span class="syn-tag">&lt;item</span> <span class="syn-attr">label</span>=<span class="syn-string">"BEST"</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="best">{script.selection.best}</span> <span class="syn-tag">/&gt;</span>', selection: "best" },
- { html: '<span class="syn-tag">&lt;/good-better-best&gt;</span>' },
- { html: "" },
- { html: '<span class="syn-tag">&lt;deck&gt;</span>' },
- { html: ' <span class="syn-tag">&lt;card</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="votes">{script.selection.votes}</span> <span class="syn-tag">/&gt;</span>', selection: "votes" },
- { html: ' <span class="syn-tag">&lt;card</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="attract">{script.selection.attract}</span> <span class="syn-tag">/&gt;</span>', selection: "attract" },
- { html: ' <span class="syn-tag">&lt;card</span> <span class="syn-attr">during</span>=<span class="syn-expr semantic-token" data-selection="features">{script.selection.features}</span> <span class="syn-tag">/&gt;</span>', selection: "features" },
- { html: '<span class="syn-tag">&lt;/deck&gt;</span>' },
-];
-
-const streetTimeline = createDemoTimeline([
- { src: streetMedia.scenes[0], start: 0, end: 5 },
- { src: streetMedia.scenes[1], start: 5, end: 11 },
- { src: streetMedia.scenes[2], start: 11, end: 22 },
- { src: streetMedia.scenes[3], start: 22, end: 31.1333333333 },
-]);
-
-const goodBetterBestTimeline = createDemoTimeline([
- { src: goodBetterBestMedia.speakers[0], start: 0, end: 4 },
- { src: goodBetterBestMedia.speakers[1], start: 4, end: 8 },
- { src: goodBetterBestMedia.speakers[2], start: 8, end: 14 },
- { src: goodBetterBestMedia.speakers[3], start: 14, end: 18.05 },
- { src: goodBetterBestMedia.speakers[4], start: 18.05, end: 23.05 },
- { src: goodBetterBestMedia.speakers[5], start: 23.05, end: 28.05 },
- { src: goodBetterBestMedia.speakers[6], start: 28.05, end: 42.0333333333 },
-]);
-
-export const semanticVideoDemos: Record<DemoId, SemanticVideoDemoConfig> = {
- street: {
- id: "street",
- duration: streetTimeline.duration,
- words: streetWords.map((cue) => streetTimeline.mapRange(cue)),
- scenes: streetTimeline.scenes,
- selections: [
- { id: "hook", start: .04, end: 5.12, layer: "scene" },
- { id: "rainbow", start: 5.12, end: 11.12, layer: "scene" },
- { id: "fees", start: 11.12, end: 22.2, layer: "scene" },
- { id: "loan", start: 22.2, end: 31.13, layer: "scene" },
- { id: "seven-bags", start: 7.08, end: 11.12, layer: "overlay", asset: streetMedia.broll[0] },
- { id: "receipt", start: 18.81, end: 22.2, layer: "overlay", asset: streetMedia.broll[1] },
- { id: "college", start: 26.22, end: 31.06, layer: "overlay", asset: streetMedia.broll[2] },
- ].map((selection) => streetTimeline.mapRange(selection)),
- lines: streetLines,
- },
- "good-better-best": {
- id: "good-better-best",
- duration: goodBetterBestTimeline.duration,
- words: goodBetterBestWords.map((cue) => goodBetterBestTimeline.mapRange(cue)),
- scenes: goodBetterBestTimeline.scenes,
- selections: [
- { id: "hook", start: .19, end: 4.01, layer: "scene" },
- { id: "good", start: 4.01, end: 14.12, layer: "scene" },
- { id: "better", start: 14.12, end: 23.12, layer: "scene" },
- { id: "best", start: 23.12, end: 41.34, layer: "scene" },
- { id: "votes", start: 30.24, end: 33.45, layer: "overlay", asset: goodBetterBestMedia.decks[0] },
- { id: "attract", start: 33.49, end: 36, layer: "overlay", asset: goodBetterBestMedia.decks[1] },
- { id: "features", start: 36, end: 39.28, layer: "overlay", asset: goodBetterBestMedia.decks[2] },
- ].map((selection) => goodBetterBestTimeline.mapRange(selection)),
- lines: goodBetterBestLines,
- },
-};
diff --git a/docs/.vitepress/theme/components/source-display.ts b/docs/.vitepress/theme/components/source-display.ts
deleted file mode 100644
index 0bdf2483..00000000
--- a/docs/.vitepress/theme/components/source-display.ts
+++ /dev/null
@@ -1,157 +0,0 @@
-export type SourceRange = {
- start: number;
- end: number;
-};
-
-export type SourceDisplayEntry<Line> =
- | {
- key: string;
- kind: "line";
- index: number;
- line: Line;
- }
- | {
- key: string;
- kind: "fold";
- index: number;
- line: null;
- };
-
-type SourceWindowOptions = SourceRange & {
- focus: number;
- alignment: "start" | "end";
- rowBudget: number;
- rowSpans: readonly number[];
- totalLines: number;
-};
-
-type FoldedSourceViewOptions<Line> = {
- lines: readonly Line[];
- rowSpans: readonly number[];
- rowBudget: number;
- topRanges: readonly SourceRange[];
- topFocus: number;
- bottomLine: number;
-};
-
-function sourceRowSpan(rowSpans: readonly number[], index: number) {
- return rowSpans[index] ?? 1;
-}
-
-function sourceRowsSpan(rowSpans: readonly number[], indices: readonly number[]) {
- return indices.reduce((sum, index) => sum + sourceRowSpan(rowSpans, index), 0);
-}
-
-function fitSourceWindow({
- start,
- end,
- focus,
- alignment,
- rowBudget,
- rowSpans,
- totalLines,
-}: SourceWindowOptions) {
- const spanOf = (indices: readonly number[]) => sourceRowsSpan(rowSpans, indices);
- const fillBefore = (indices: number[], minimum: number) => {
- let before = indices[0] - 1;
- while (before >= minimum && spanOf(indices) + sourceRowSpan(rowSpans, before) <= rowBudget) {
- indices.unshift(before);
- before -= 1;
- }
- };
- const fillAfter = (indices: number[], maximum: number) => {
- let after = indices[indices.length - 1] + 1;
- while (after <= maximum && spanOf(indices) + sourceRowSpan(rowSpans, after) <= rowBudget) {
- indices.push(after);
- after += 1;
- }
- };
- const fill = (indices: number[], minimum: number, maximum: number) => {
- if (alignment === "end") {
- fillBefore(indices, minimum);
- fillAfter(indices, maximum);
- } else {
- fillAfter(indices, maximum);
- fillBefore(indices, minimum);
- }
- return indices;
- };
- const fullRange = Array.from({ length: end - start + 1 }, (_, offset) => start + offset);
-
- if (spanOf(fullRange) <= rowBudget) {
- return fill(fullRange, 0, totalLines - 1);
- }
-
- const center = Math.max(start, Math.min(end, focus));
- return fill([center], start, end);
-}
-
-function pickFittingSourceRange<Range extends SourceRange>(
- ranges: readonly Range[],
- rowSpans: readonly number[],
- rowBudget: number,
-) {
- return ranges.find((range) => {
- const indices = Array.from(
- { length: range.end - range.start + 1 },
- (_, offset) => range.start + offset,
- );
- return sourceRowsSpan(rowSpans, indices) <= rowBudget;
- }) ?? ranges.at(-1);
-}
-
-export function buildFullSourceView<Line>(lines: readonly Line[]): SourceDisplayEntry<Line>[] {
- return lines.map((line, index) => ({ key: `line-${index}`, kind: "line", index, line }));
-}
-
-export function buildFoldedSourceView<Line>({
- lines,
- rowSpans,
- rowBudget,
- topRanges,
- topFocus,
- bottomLine,
-}: FoldedSourceViewOptions<Line>): SourceDisplayEntry<Line>[] {
- const selectedRange = pickFittingSourceRange(topRanges, rowSpans, rowBudget);
- const top = fitSourceWindow({
- start: selectedRange?.start ?? topFocus,
- end: selectedRange?.end ?? topFocus,
- focus: topFocus,
- alignment: "end",
- rowBudget,
- rowSpans,
- totalLines: lines.length,
- });
- const bottom = fitSourceWindow({
- start: bottomLine,
- end: bottomLine,
- focus: bottomLine,
- alignment: "start",
- rowBudget,
- rowSpans,
- totalLines: lines.length,
- });
- const lineEntry = (index: number): SourceDisplayEntry<Line> => ({
- key: `line-${index}`,
- kind: "line",
- index,
- line: lines[index],
- });
-
- const topIndices = new Set(top);
- const remainingBottom = bottom.filter((index) => !topIndices.has(index));
- const lastTop = top.at(-1) ?? -1;
- const firstBottom = remainingBottom[0] ?? lines.length;
- const hasFold = firstBottom > lastTop + 1;
-
- return [
- ...top.map(lineEntry),
- ...(hasFold ? [{
- key: `fold-${top.at(-1)}-${bottom[0]}`,
- kind: "fold" as const,
- index: Math.floor(((top.at(-1) ?? 0) + (bottom[0] ?? lines.length - 1)) / 2),
- line: null,
- }] : []),
- ...remainingBottom.map(lineEntry),
- ];
-}
diff --git a/docs/.vitepress/theme/components/source-panel-interaction.ts b/docs/.vitepress/theme/components/source-panel-interaction.ts
deleted file mode 100644
index 47495dd7..00000000
--- a/docs/.vitepress/theme/components/source-panel-interaction.ts
+++ /dev/null
@@ -1,68 +0,0 @@
-import { onBeforeUnmount, onMounted, ref, type Ref } from "vue";
-
-type SourcePanelInteractionOptions = {
- active?: () => boolean;
- expand: (event?: MouseEvent) => void;
- collapse: () => void;
-};
-
-export function useSourcePanelInteraction(
- panel: Ref<HTMLElement | null>,
- options: SourcePanelInteractionOptions,
-) {
- const sourceUsesHover = ref(true);
- let hoverQuery: MediaQueryList | null = null;
-
- function syncPointerMode() {
- sourceUsesHover.value = hoverQuery?.matches ?? true;
- if (!sourceUsesHover.value) options.collapse();
- }
-
- function handleSourcePointerMove(event: PointerEvent) {
- if (sourceUsesHover.value) options.expand(event);
- }
-
- function handleSourcePointerDown(event: PointerEvent) {
- if (sourceUsesHover.value) options.expand(event);
- }
-
- function handleSourceClick(event: MouseEvent) {
- if (!sourceUsesHover.value) options.expand(event);
- }
-
- function handleSourceWheel(event: WheelEvent) {
- if (sourceUsesHover.value) options.expand(event);
- }
-
- function handleSourcePointerLeave() {
- if (sourceUsesHover.value) options.collapse();
- }
-
- function handleOutsidePointerDown(event: PointerEvent) {
- if (sourceUsesHover.value || options.active?.() === false) return;
- const target = event.target;
- if (target instanceof Node && panel.value?.contains(target)) return;
- options.collapse();
- }
-
- onMounted(() => {
- hoverQuery = window.matchMedia("(hover: hover) and (pointer: fine)");
- syncPointerMode();
- hoverQuery.addEventListener("change", syncPointerMode);
- document.addEventListener("pointerdown", handleOutsidePointerDown, true);
- });
-
- onBeforeUnmount(() => {
- hoverQuery?.removeEventListener("change", syncPointerMode);
- document.removeEventListener("pointerdown", handleOutsidePointerDown, true);
- });
-
- return {
- sourceUsesHover,
- handleSourcePointerMove,
- handleSourcePointerDown,
- handleSourceClick,
- handleSourceWheel,
- handleSourcePointerLeave,
- };
-}
diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts
index 245f1347..795f5847 100644
--- a/docs/.vitepress/theme/index.ts
+++ b/docs/.vitepress/theme/index.ts
@@ -1,13 +1,8 @@
import DefaultTheme from "vitepress/theme";
import type { Theme } from "vitepress";
import Layout from "./Layout.vue";
-import SvmlDemoCarousel from "./components/SvmlDemoCarousel.vue";
-import "./style.css";
export default {
extends: DefaultTheme,
Layout,
- enhanceApp({ app }) {
- app.component("SvmlDemoCarousel", SvmlDemoCarousel);
- },
} satisfies Theme;
diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css
deleted file mode 100644
index c04d9305..00000000
--- a/docs/.vitepress/theme/style.css
+++ /dev/null
@@ -1,713 +0,0 @@
-/*
- * The home page has its own paper-and-crimson editorial design, in light and dark.
- * Documentation pages use the stock VitePress theme, untouched.
- *
- * Everything branded is scoped to `html.home-page`, set before first paint by the inline
- * script in config.ts and kept in sync across navigation by theme/Layout.vue. The dark
- * variant is `html.home-page.dark` — VitePress toggles `.dark` on the same element, and
- * two classes beat both `:root` and `.dark`, so none of this needs `!important`.
- */
-
-.svml-selection {
- --shiki-light: #8250DF !important;
- --shiki-dark: #D2A8FF !important;
- font-weight: 600;
-}
-
-/* ============================================================
- Tokens
- ============================================================ */
-
-html.home-page {
- --paper: #f3f0e8;
- --paper-2: #ede9df;
- --ink: #191816;
- --crimson: #a01240;
- --crimson-soft: rgba(160, 18, 64, .1);
- --rule: #c7c0b2;
- --rule-soft: #dad4c7;
- --muted: #837d72;
-
- /*
- * Monospace for Latin, with CJK families behind it — no mono face covers Han,
- * and the default fallback spaces Chinese out to the Latin advance width.
- */
- --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, "Cascadia Mono",
- "Roboto Mono", Consolas, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
- "Noto Sans SC", monospace;
- --pad: clamp(20px, 4vw, 56px);
- --vp-nav-height: 74px;
- /* One rhythm for the nav bar: between its groups, and between the icons. */
- --nav-gap: 30px;
- --nav-icon-gap: 15px;
-
- /* Paper grain. Multiplied over a light page, overlaid on a dark one. */
- --grain-op: .42;
- --grain-blend: multiply;
- --collage-blend: multiply;
-
- /* Masked, not drawn, so it inherits the button's colour on hover. */
- --github-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.4 7.4 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z'/%3E%3C/svg%3E");
-
- --arrow-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 13'%3E%3Cpath d='M0 6.5h16M11 1l5.5 5.5L11 12' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
-
- --vp-font-family-base: var(--mono);
- --vp-font-family-mono: var(--mono);
- --vp-c-brand-1: var(--crimson);
- --vp-c-brand-2: var(--crimson);
- --vp-c-brand-3: var(--crimson);
- --vp-c-brand-soft: var(--crimson-soft);
- --vp-c-bg: var(--paper);
- --vp-c-bg-alt: var(--paper-2);
- --vp-c-bg-elv: var(--paper);
- --vp-c-bg-soft: var(--paper-2);
- --vp-c-text-1: var(--ink);
- --vp-c-text-2: var(--muted);
- --vp-c-text-3: var(--muted);
- --vp-c-divider: var(--rule);
- --vp-c-gutter: var(--rule);
- --vp-nav-bg-color: rgba(243, 240, 232, .88);
- --vp-sidebar-bg-color: var(--paper-2);
- --vp-input-border-color: var(--rule);
- --vp-input-switch-bg-color: var(--paper-2);
- background: var(--paper);
-}
-
-html.home-page.dark {
- --paper: #131211;
- --paper-2: #1a1917;
- --ink: #e9e4da;
- --crimson: #dd3a63;
- --crimson-soft: rgba(221, 58, 99, .13);
- --rule: #3a3630;
- --rule-soft: #2a2724;
- --muted: #8e877b;
- --grain-op: .2;
- --grain-blend: overlay;
- --collage-blend: luminosity;
- --vp-nav-bg-color: rgba(19, 18, 17, .88);
- background: var(--paper);
-}
-
-html.home-page body {
- background: var(--paper);
- color: var(--ink);
- font-size: 14px;
- line-height: 1.65;
- letter-spacing: 0;
- font-variant-ligatures: none;
-}
-
-html.home-page * { scrollbar-width: auto; scrollbar-color: var(--rule) transparent; }
-html.home-page *::-webkit-scrollbar { width: 12px; height: 12px; }
-html.home-page *::-webkit-scrollbar-track { border-radius: 0; background: transparent; }
-html.home-page *::-webkit-scrollbar-thumb { border: 0; border-radius: 0; background: var(--rule); }
-html.home-page *::-webkit-scrollbar-thumb:hover { background: var(--muted); }
-
-html.home-page ::selection { background: var(--crimson); color: var(--paper); }
-html.home-page :focus-visible { outline: 2px solid var(--crimson); outline-offset: 3px; }
-
-/*
- * A hairline with alignment ticks at each end. Namespaced, because this stylesheet
- * loads on documentation pages too and a bare `.rule` would collide with prose.
- */
-.np-rule { position: relative; height: 1px; width: 100%; background: var(--rule); }
-.np-rule::before,
-.np-rule::after { content: ""; position: absolute; top: -4px; width: 1px; height: 9px; background: var(--rule); }
-.np-rule::before { left: 0; }
-.np-rule::after { right: 0; }
-.np-rule.tick-r::before { display: none; }
-.np-rule.tick-l::after { display: none; }
-
-/*
- * Paper grain, over the page and the nav but under the search modal (z-100),
- * the mobile sidebar (z-60) and its backdrop (z-50).
- */
-.np-grain {
- position: fixed;
- inset: 0;
- z-index: 45;
- pointer-events: none;
- opacity: var(--grain-op);
- mix-blend-mode: var(--grain-blend);
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
-}
-
-/* ============================================================
- Nav bar
- ============================================================ */
-
-/*
- * Three stock rules paint the bar opaque at >=960px once it leaves the top of the
- * page: `.VPNavBar:not(.has-sidebar):not(.home.top)`, `.VPNavBar:not(.home.top)
- * .content-body` and the matching `.divider-line`. All three are (0,5,0) and beat
- * anything scoped to `html.home-page`, so the translucent bar has to be forced.
- */
-html.home-page .VPNav { background: none; border-bottom: 0; }
-html.home-page .VPNavBar {
- border-bottom: 0;
- background-color: var(--vp-nav-bg-color) !important;
- backdrop-filter: blur(10px);
-}
-html.home-page .VPNavBar .content-body { background-color: transparent !important; }
-html.home-page .VPNavBar .divider-line { background-color: var(--rule) !important; }
-
-html.home-page .VPNavBar .wrapper { padding: 0; }
-html.home-page .VPNavBar .container { max-width: 1280px; padding-inline: var(--pad); }
-html.home-page .VPNavBarTitle { display: flex; align-items: center; height: var(--vp-nav-height); }
-html.home-page .VPNavBarTitle .title {
- display: inline-flex;
- align-items: center;
- width: auto;
- height: auto;
- padding: 0;
- border-bottom: 0;
- color: var(--ink);
- font-size: 0;
-}
-/* The configured siteTitle text; the logotype stands in for it. */
-html.home-page .VPNavBarTitle .title > span:not([class]) { display: none; }
-html.home-page .nav-narratage-logo { display: block; flex: 0 0 auto; height: 46px; color: var(--ink); }
-html.home-page .nav-narratage-logo svg { display: block; width: auto; height: 100%; }
-/* The rule that separates the brand from the rest of the bar. */
-html.home-page .VPNavBarTitle::after {
- content: "";
- flex: 0 0 auto;
- width: 1px;
- height: 44px;
- margin-left: var(--nav-gap);
- background: var(--rule);
-}
-
-html.home-page .VPNavBarMenuLink,
-html.home-page .VPNavBarMenuGroup .text,
-html.home-page .VPNavScreenMenuLink,
-html.home-page .VPNavScreenMenuGroup .button {
- position: relative;
- color: var(--ink);
- font-family: var(--mono);
- font-size: 12px;
- font-weight: 400;
- letter-spacing: .14em;
- text-transform: uppercase;
-}
-html.home-page .VPNavBarMenu .VPNavBarMenuLink { padding-inline: calc(var(--nav-gap) / 2); }
-/* Anchored inside the link's own inline padding so the rule tracks the text. */
-html.home-page .VPNavBarMenuLink::after {
- content: "";
- position: absolute;
- right: calc(var(--nav-gap) / 2);
- bottom: 20px;
- left: calc(var(--nav-gap) / 2);
- height: 1.5px;
- background: var(--crimson);
- transform: scaleX(0);
- transform-origin: left;
- transition: transform .24s cubic-bezier(.22, 1, .36, 1);
-}
-html.home-page .VPNavBarMenuLink:hover,
-html.home-page .VPNavBarMenuLink.active,
-html.home-page .VPNavScreenMenuLink:hover { color: var(--crimson); }
-html.home-page .VPNavBarMenuLink:hover::after,
-html.home-page .VPNavBarMenuLink.active::after { transform: scaleX(1); }
-
-html.home-page .VPNavBarSocialLinks .VPSocialLink,
-html.home-page .VPNavBarHamburger .container { color: var(--ink); }
-html.home-page .VPNavBarSocialLinks .VPSocialLink:hover { color: var(--crimson); }
-html.home-page .VPNavScreen { background: var(--paper); }
-
-html.home-page .VPNav .DocSearch-Button,
-html.home-page .VPNav .VPNavBarSearchButton {
- height: 38px;
- border: 1px solid var(--ink);
- border-radius: 0;
- padding: 0 10px 0 12px;
- background: transparent;
- color: var(--muted);
- font-family: var(--mono);
- font-size: 13px;
-}
-html.home-page .VPNav .DocSearch-Button:hover { border-color: var(--crimson); color: var(--ink); }
-html.home-page .VPNav .DocSearch-Button-Placeholder { color: var(--muted); font-size: 13px; }
-/*
- * Stock builds one pill out of two `<kbd>` halves — the first drops its right
- * border and rounds only its left corners, the second mirrors it. Both halves
- * are reset to a full square box here, sized and centred explicitly so neither
- * the asymmetric borders nor the line-box maths can throw the glyphs off.
- */
-html.home-page .VPNav .DocSearch-Button-Keys {
- display: flex;
- align-items: center;
- gap: 4px;
-}
-html.home-page .VPNav .DocSearch-Button-Key,
-html.home-page .VPNav .DocSearch-Button-Key + .DocSearch-Button-Key {
- display: grid;
- place-content: center;
- box-sizing: border-box;
- width: 20px;
- min-width: 0;
- height: 20px;
- margin: 0;
- border: 1px solid var(--rule);
- border-radius: 0;
- padding: 0;
- background: transparent;
- box-shadow: none;
- color: var(--muted);
- font-family: var(--mono);
- font-size: 11px;
- font-weight: 400;
- line-height: 1;
- letter-spacing: 0;
- /*
- * Optical centring. The em box is ascent 10 + descent 3, and neither glyph
- * has a descender, so centring the line box leaves the ink ~.6px high. With
- * `place-content: center` a top padding shifts the ink by half its value.
- */
- padding-top: 1.2px;
-}
-/* The command glyph is drawn by stock as `::after`, the parent's font-size
- forced to 0, so it needs its own metrics. */
-html.home-page .VPNav .DocSearch-Button-Key:first-child::after {
- display: block;
- color: inherit;
- font-size: 11px;
- line-height: 1;
-}
-
-html.home-page .VPNavBarSearch { padding-left: var(--nav-gap); }
-
-/*
- * Stock draws a `::before` separator before each of the three icon controls. The
- * React header has one rule before the group, so the first is kept and restyled
- * to match the brand divider, and the other two are dropped.
- */
-html.home-page .VPNavBarTranslations { margin-left: var(--nav-gap); }
-html.home-page .VPNavBarTranslations::before {
- height: 44px;
- margin-right: var(--nav-gap);
- background-color: var(--rule);
-}
-html.home-page .VPNavBarAppearance::before,
-html.home-page .VPNavBarSocialLinks::before { display: none; }
-html.home-page .VPNavBarAppearance { margin-left: var(--nav-icon-gap); }
-html.home-page .VPNavBarSocialLinks { margin-left: var(--nav-icon-gap); gap: var(--nav-icon-gap); }
-html.home-page .VPSocialLink { margin: 0; padding: 0; }
-/* Optical, not nominal: at a shared 20px box the Discord mark lays down 16.8%
- ink against GitHub's 13.4%, so it reads heavier. sqrt(13.4/16.8) evens them. */
-html.home-page .VPSocialLink[aria-label="Discord"] svg { width: 18px; height: 18px; }
-
-/* The appearance toggle also renders inside this flyout between 768 and 1279px. */
-html.home-page .VPMenu {
- border-radius: 0;
- border: 1px solid var(--rule);
- background: var(--paper);
- box-shadow: none;
-}
-
-/* ============================================================
- Hero masthead
- ============================================================ */
-
-html.home-page .VPHome { margin-bottom: 0; overflow-x: clip; }
-html.home-page .VPContent,
-html.home-page .VPPage { background: var(--paper); }
-
-html.home-page .VPHero { padding: calc(var(--vp-nav-height) + 20px) 0 28px; }
-html.home-page .VPHomeHero .container {
- max-width: 1280px;
- margin-inline: auto;
- padding-inline: var(--pad);
- text-align: left;
-}
-html.home-page .VPHomeHero .main { width: 100%; max-width: none; }
-
-.np-masthead-meta { display: flex; align-items: center; gap: 22px; }
-.np-masthead-label {
- flex: 0 0 auto;
- color: var(--muted);
- font-size: 11px;
- letter-spacing: .16em;
- text-transform: uppercase;
-}
-.np-masthead-rule { flex: 1; }
-
-.np-masthead-wrap { position: relative; }
-
-.np-masthead-wordmark {
- display: block;
- width: 52%;
- height: auto;
- margin: 6px 0 0;
-}
-.np-masthead-ink { fill: var(--ink); }
-.np-masthead-red { fill: var(--crimson); }
-/* Collage scrap, positioned off the wordmark. Decorative only. */
-.np-masthead-stamp {
- position: absolute;
- top: 40px;
- left: 28.4%;
- z-index: 2;
- width: 4.8%;
- height: auto;
- aspect-ratio: 77 / 50;
- mix-blend-mode: var(--collage-blend);
- pointer-events: none;
- user-select: none;
-}
-
-.np-masthead-tagline {
- margin: 18px 0 0;
- color: var(--ink);
- font-size: clamp(13px, 1.79vw, 22px);
- font-weight: 400;
- letter-spacing: -.045em;
- line-height: 1.35;
- text-wrap: balance;
-}
-
-html.home-page .VPHero .actions {
- gap: 13px;
- margin: 0;
- padding-top: 22px;
- justify-content: flex-start;
-}
-html.home-page .VPHero .action { padding: 0; }
-
-/* `.VPButton.medium` is (0,3,0) in the stock sheet — `.VPButton` alone loses to it. */
-html.home-page .VPHero .VPButton.medium {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- gap: .7em;
- height: 42px;
- border: 1px solid var(--crimson);
- border-radius: 0;
- padding: 0 20px;
- font-family: var(--mono);
- font-size: 11.5px;
- font-weight: 500;
- letter-spacing: .13em;
- line-height: 1;
- text-transform: uppercase;
- transition: background-color .16s ease, color .16s ease, border-color .16s ease;
-}
-html.home-page .VPHero .VPButton.brand {
- border-color: var(--crimson);
- background: var(--crimson);
- color: #f7f3ec;
-}
-html.home-page .VPHero .VPButton.brand::after {
- content: "";
- flex: 0 0 auto;
- width: 1.15em;
- height: .85em;
- background-color: currentColor;
- -webkit-mask: var(--arrow-glyph) center / contain no-repeat;
- mask: var(--arrow-glyph) center / contain no-repeat;
- transition: transform .2s cubic-bezier(.22, 1, .36, 1);
-}
-html.home-page .VPHero .VPButton.brand:hover,
-html.home-page .VPHero .VPButton.brand:active {
- border-color: var(--ink);
- background: var(--ink);
- color: var(--paper);
-}
-html.home-page .VPHero .VPButton.brand:hover::after { transform: translateX(4px); }
-/* The theme's hero actions carry no icon field, so the mark is masked in, the
- same way the brand button's arrow is, and picks up `color` on hover. */
-html.home-page .VPHero .VPButton[href*="github.com"]::before {
- content: "";
- flex: 0 0 auto;
- width: 1.35em;
- height: 1.35em;
- background-color: currentColor;
- -webkit-mask: var(--github-glyph) center / contain no-repeat;
- mask: var(--github-glyph) center / contain no-repeat;
-}
-
-html.home-page .VPHero .VPButton.alt {
- border-color: var(--crimson);
- background: transparent;
- color: var(--crimson);
-}
-html.home-page .VPHero .VPButton.alt:hover,
-html.home-page .VPHero .VPButton.alt:active {
- border-color: var(--crimson);
- background: var(--crimson);
- color: #f7f3ec;
-}
-
-html.home-page .VPHome .vp-doc.container {
- width: 100%;
- max-width: none;
- margin-inline: 0;
- padding: 0;
- background: var(--paper);
- box-sizing: border-box;
-}
-
-/* ============================================================
- Footer
- ============================================================ */
-
-.np-footer {
- /* A flex item in `.Layout`, so it needs an explicit width to stop shrinking
- to its columns before the cap and the auto margins can centre it. */
- width: 100%;
- max-width: 1280px;
- margin: 0 auto;
- border-top: 1px solid var(--rule);
- padding: 44px var(--pad) 52px;
- color: var(--ink);
- font-family: var(--mono);
-}
-.np-footer-grid {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- gap: clamp(28px, 6vw, 80px);
-}
-.np-footer h2 {
- margin: 0 0 14px;
- color: var(--muted);
- font-size: 10.5px;
- font-weight: 400;
- letter-spacing: .18em;
- text-transform: uppercase;
-}
-.np-footer ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
-.np-footer a { color: inherit; font-size: 13px; text-decoration: none; }
-.np-footer a:hover { color: var(--crimson); }
-.np-footer-about { max-width: 30ch; }
-.np-footer-about p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
-.np-footer-social { display: flex; align-items: center; gap: 18px; margin-top: 18px; color: var(--muted); }
-.np-footer-social a { display: grid; place-items: center; transition: color .16s ease; }
-.np-footer-social svg { display: block; }
-.np-footer-bottom {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- justify-content: space-between;
- gap: 20px;
- margin-top: 44px;
- border-top: 1px solid var(--rule-soft);
- padding-top: 20px;
- color: var(--muted);
- font-size: 11.5px;
-}
-.np-footer-bottom a { font-size: inherit; }
-
-/* ============================================================
- SVML demos
- ============================================================ */
-
-/*
- * Syntax colours are One Light on paper and One Dark on the dark variant; the
- * chrome around them derives from the site tokens so the demos follow the theme.
- */
-html.home-page .svml-demo {
- --demo-card-bg: var(--paper-2);
- --demo-code-bg: var(--paper-2);
- --demo-preview-bg: var(--paper-2);
- /*
- * JellyFish (pawelborkar/vscode-jellyfish), fitted to this paper rather than
- * transplanted onto it. The theme ships dark only, and its own values land
- * between 1.04:1 and 3.14:1 against this background — the cyan attribute and
- * yellow string are effectively invisible on cream.
- *
- * Each role keeps its hue and takes the most saturated value that still meets
- * its own contrast target, so the set has a hierarchy instead of being
- * flattened onto one threshold: ink 16.7:1, tag 5.5, attribute and string and
- * binding 5.0, line numbers 3.2 because they should stay quiet. The four
- * syntax hues sit 53 to 94 apart in CIE76, so none reads as another.
- *
- * Plain text takes the theme's own background navy as the ink; darkening its
- * near-white foreground would only have produced another teal. Line numbers
- * carry a trace of that navy for the same reason.
- *
- * Tags use the theme's markup.changed violet rather than its entity.name.tag
- * pink: that pink sits only 12.7 from this page's marker crimson in CIE76, so
- * markup and semantic markers read as one colour. The violet is 95 away.
- */
- --demo-text: #00002c;
- --demo-text-muted: var(--muted);
- --demo-line-number: #7d7dac;
- --demo-tag: #8800e2;
- --demo-attr: #006e69;
- --demo-string: #616700;
- --demo-expression: #ab3f00;
- --demo-marker: var(--crimson);
- --demo-marker-bg: var(--crimson-soft);
- --demo-marker-border: var(--crimson);
- --demo-marker-active-bg: var(--crimson);
- --demo-marker-active-text: #f7f3ec;
- --demo-segment-cyan: #6f8a80;
- --demo-segment-green: #7d8a6f;
- --demo-segment-gold: #b09257;
- --demo-segment-pink: var(--crimson);
- --demo-segment-violet: #6b6280;
- --demo-cursor: var(--crimson);
- --demo-word-tint: 8%;
- width: 100%;
- margin: 0 auto;
-}
-html.home-page.dark .svml-demo {
- /* JellyFish verbatim, except the tag: its entity.name.tag pink is 20.6 from
- the marker crimson, so tags take the theme's markup.changed violet, 61.9
- away. Everything else is the theme's own — foreground, line number,
- attribute, string, and the constant hue it gives numbers. */
- --demo-text: #eeffff;
- --demo-line-number: #8686867c;
- --demo-tag: #c792ea;
- --demo-attr: #00fff2;
- --demo-string: #eeff00;
- --demo-expression: #ff7e34;
- /* The pill carries dark text, and the crimson at its dark-theme value only
- reaches 4.33:1 behind it. Same hue, lifted until it clears 5. */
- --demo-marker-active-bg: #e15175;
- --demo-marker-active-text: #131211;
- --demo-word-tint: 20%;
-}
-
-.vp-doc .demo-heading h2 { margin: 0; border: 0; padding: 0; color: var(--ink); font-family: var(--mono); font-size: clamp(15px, 1.7vw, 19px); font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
-.touch-interaction-copy { display: none; }
-.demo-shell { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 670px; overflow: hidden; border: 1px solid var(--rule-soft); border-radius: 2px; background: var(--demo-card-bg); }
-.source-panel, .preview-panel { min-width: 0; }
-.source-panel { position: relative; border: 0; border-right: 1px solid var(--rule-soft); background: var(--demo-code-bg); }
-.preview-panel { display: flex; flex-direction: column; background: var(--demo-preview-bg); }
-.source-follow-hint { position: absolute; z-index: 10; top: 10px; right: 22px; display: block; padding: 4px 9px; border: 1px solid var(--rule-soft); border-radius: 2px; background: var(--paper); color: var(--demo-text-muted); font-family: var(--mono); font-size: 10px; line-height: 16px; pointer-events: none; }
-.source-measure { position: absolute; z-index: -1; top: 0; left: 0; visibility: hidden; width: 100%; pointer-events: none; }
-/* SvmlPlayground counts wrapped rows as ceil(height / 26) — keep this line-height. */
-.code-scroll { position: relative; height: 621px; overflow-x: hidden; overflow-y: auto; overflow-anchor: none; padding: var(--source-vertical-padding, 9px) 0; scrollbar-color: var(--rule) transparent; }
-.code-line { position: relative; display: grid; grid-template-columns: 44px minmax(0,1fr); width: 100%; min-width: 0; min-height: 26px; margin: 0; padding: 0 18px 0 0; border: 0; outline: 0; background: transparent; color: var(--demo-text); text-align: left; font-family: var(--mono); font-size: 14.5px; font-weight: 400; letter-spacing: normal; line-height: 26px; }
-.line-number { padding-right: 13px; color: var(--demo-line-number); text-align: right; font-weight: 400; user-select: none; }
-.code-line.active .line-number { color: var(--demo-text); }
-.code-line code { min-width: 0; padding: 0; color: inherit; background: none; font-family: inherit; font-size: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
-/* The home body is markdown, so `.vp-doc :not(pre) > code` (0,1,2) also matches
- here and would shrink the demo source by its .875em code ratio. */
-html.home-page .vp-doc .code-line code { font-size: inherit; }
-.svml-demo .code-line code { padding: 0 !important; border: 0 !important; border-radius: 0 !important; outline: 0 !important; background: transparent !important; box-shadow: none !important; letter-spacing: normal !important; }
-.syn-tag { color: var(--demo-tag); }.syn-attr { color: var(--demo-attr); }.syn-string { color: var(--demo-string); }.syn-expr { color: var(--demo-expression); }.syn-marker { color: var(--demo-marker); font-weight: 700; background: var(--demo-marker-bg); box-shadow: inset 0 0 0 1px var(--demo-marker-border); text-shadow: none; }
-.semantic-token { margin: -3px; padding: 3px; border-radius: 4px; cursor: pointer; }
-.semantic-token:hover, .semantic-token:focus { outline: none; background: var(--demo-marker-bg); box-shadow: 0 0 0 1px var(--demo-marker); }
-.semantic-range-canvas { position: absolute; z-index: 0; top: 0; left: 0; overflow: visible; pointer-events: none; }
-.semantic-range-canvas path { fill: var(--demo-marker-bg); stroke: var(--demo-marker); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
-.semantic-range-canvas path.depth-1 { fill: color-mix(in srgb, var(--demo-attr) 18%, transparent); stroke: var(--demo-attr); }
-.semantic-range-canvas path.depth-2 { fill: color-mix(in srgb, var(--demo-expression) 16%, transparent); stroke: var(--demo-expression); }
-.code-line code, .code-line .line-number { position: relative; z-index: 1; }
-.code-fold { display: flex; align-items: center; justify-content: center; min-height: 26px; height: 26px; padding: 0; border: 0; background: var(--demo-preview-bg); }
-.code-fold code { display: flex; align-items: center; justify-content: center; width: 100%; height: 26px; color: var(--demo-line-number) !important; text-align: center; font-size: 16px !important; font-weight: 700 !important; letter-spacing: 0 !important; line-height: 1 !important; }
-.code-spacer { height: 26px; }
-.semantic-token.semantic-active { --semantic-color: var(--demo-marker-active-bg); --semantic-ring: var(--demo-marker); background: var(--semantic-color); color: var(--demo-marker-active-text); font-weight: 700; text-shadow: none; box-shadow: 0 0 0 1.5px var(--semantic-ring); }
-/* The pill text has to follow the theme, not be assumed light. These
- backgrounds are dark on paper but bright in the dark palette, where a
- near-white label fell to 1.2:1 on the cyan and 2.3:1 on the orange. Reusing
- the marker's own per-theme label colour gives 5.5:1 either side. */
-.semantic-token.semantic-active.semantic-depth-1 { --semantic-color: var(--demo-attr); --semantic-ring: var(--demo-attr); color: var(--demo-marker-active-text); }
-.semantic-token.semantic-active.semantic-depth-2 { --semantic-color: var(--demo-expression); --semantic-ring: var(--demo-expression); color: var(--demo-marker-active-text); }
-.code-line.binding-active,
-.code-line.binding-active.binding-depth-1,
-.code-line.binding-active.binding-depth-2 { background: transparent; }
-.script-word { border-radius: 3px; transition: color .08s linear, background-color .08s linear; }
-/* Tint and text are the same hue, so every percent of tint costs contrast:
- at 20% the paper theme fell to 3.8:1. The dark theme can carry far more
- before it matters, hence the split. */
-.script-word.active { background: color-mix(in srgb, var(--demo-attr) var(--demo-word-tint), transparent); color: var(--demo-attr); box-shadow: 0 0 0 1px var(--demo-attr); }
-.semantic-timeline { min-width: 0; }
-.timeline-labels { display: grid; grid-template-columns: 31fr 44fr 25fr; margin-bottom: 5px; color: var(--muted); font-family: var(--mono); font-size: 7px; }
-.timeline-labels span:nth-child(2) { text-align: center; }.timeline-labels span:nth-child(3) { text-align: right; }
-.timeline-labels .current { color: var(--ink); }
-.timeline-track { position: relative; display: grid; grid-template-columns: 31fr 44fr 25fr; gap: 3px; height: 5px; }
-.timeline-track .segment { border-radius: 3px; background: var(--rule-soft); }.timeline-track .point { background: var(--rule); }
-.playhead { position: absolute; top: 50%; width: 2px; height: 15px; border-radius: 0; background: var(--demo-cursor); transform: translate(-1px,-50%); }
-/* Real video version of the source-to-preview demo. */
-.real-demo-shell { min-height: 720px; }
-.real-demo-shell .code-scroll { height: 720px; }
-.real-preview-body { display: grid; place-items: center; flex: 1; min-height: 0; padding: 28px 20px 18px; background: var(--demo-preview-bg); }
-.real-video-frame { position: relative; justify-self: center; height: 490px; aspect-ratio: 9/16; overflow: hidden; border: 1px solid var(--rule); border-radius: 2px; background: #161820; }
-.real-video-frame video { display: block; width: 100%; height: 100%; object-fit: cover; background: #191b22; }
-.live-ranking-stage { position: relative; justify-self: center; height: 540px; aspect-ratio: 9/16; overflow: hidden; border: 1px solid var(--rule); background: #000; isolation: isolate; container-type: inline-size; }
-.live-base-layer { position: absolute; inset: 0; z-index: 0; background: #000; }
-.live-base-layer video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
-.live-base-layer video.active { opacity: 1; }
-/*
- * Everything from here to `.live-caption` is typography inside the rendered video,
- * not site typography — the hard-coded families and colours are deliberate.
- */
-.live-title { position: absolute; top: 9.8958%; left: 0; z-index: 4; display: grid; place-items: center; width: 100%; height: 7.8125%; padding: .9cqw 2%; background: #fff; color: #050505; text-align: center; font-family: Poppins, Inter, Arial, sans-serif; font-size: 4.7cqw; font-weight: 950; line-height: .92; letter-spacing: .2px; }
-.live-ranking-board { position: absolute; top: 16.9792%; left: 0; z-index: 3; display: grid; grid-template-rows: repeat(5,minmax(0,1fr)); row-gap: 2.625%; width: 30.463%; height: 41.6667%; padding: 5.47%; border-radius: 6px; background: rgba(7,8,12,.94); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
-.live-rank-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: center; gap: 9%; min-height: 0; }
-.live-rank-row strong, .live-rank-row span { display: grid; place-items: center; width: 100%; height: auto; min-width: 0; aspect-ratio: 1; overflow: hidden; border-radius: 4px; }
-.live-rank-row strong { color: #fff; font-family: "Archivo Black", Poppins, Inter, sans-serif; font-size: 5.9cqw; font-weight: 900; line-height: 1; letter-spacing: -.04em; text-shadow: 0 1px 1px rgba(0,0,0,.12); }
-.live-rank-row span { background: rgba(0,0,0,.72); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
-.live-rank-row img { width: 100%; height: 100%; object-fit: contain; }
-.live-active-icon { position: absolute; z-index: 5; aspect-ratio: 1; overflow: hidden; border-radius: 23%; background: rgba(255,255,255,.98); box-shadow: 0 14px 34px rgba(0,0,0,.38); transform-origin: center; will-change: left,top,width,transform; }
-.live-active-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
-.live-active-icon i { position: absolute; inset: 0; background: linear-gradient(110deg,transparent 30%,rgba(255,255,255,.18) 46%,transparent 62%); }
-.live-broll { position: absolute; inset: 0; z-index: 35; display: block; width: 100%; height: 100%; object-fit: contain; background: #000; transform-origin: center; }
-.live-audio-toggle { position: absolute; top: 10px; right: 10px; z-index: 40; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; background: rgba(0,0,0,.58); color: #fff; cursor: pointer; backdrop-filter: blur(8px); }
-.live-audio-toggle:hover { background: rgba(0,0,0,.78); }
-.live-audio-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
-.live-audio-toggle .material-symbols-rounded { font-size: 18px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20; line-height: 1; }
-.live-caption { position: absolute; top: 54%; left: 37%; z-index: 30; display: flex; align-items: baseline; justify-content: center; width: 64%; column-gap: 4px; color: #fff; font-family: Poppins, Inter, Arial, sans-serif; font-size: 5.3cqw; font-weight: 900; line-height: 1.08; letter-spacing: -.3px; text-align: center; white-space: nowrap; pointer-events: none; -webkit-text-stroke: .55px rgba(0,0,0,.82); paint-order: stroke fill; text-shadow: 0 1px 4px rgba(0,0,0,.72); }
-.live-caption span { display: inline-block; transition: color .08s linear, transform .08s linear; }
-.live-caption span.active { color: #ffd34d; transform: scale(1.08); }
-.ranking-board-outline, .ranking-stage-outline { position: absolute; z-index: 3; border: 2px solid var(--crimson); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
-.ranking-board-outline.visible, .ranking-stage-outline.visible { opacity: 1; }
-.ranking-board-outline { left: .6%; top: 15.8%; width: 33.5%; height: 44.2%; border-radius: 5px; }
-.ranking-stage-outline { left: 49.3%; top: 63.4%; width: 33.5%; aspect-ratio: 1; border-radius: 12%; }
-.ranking-board-outline span, .ranking-stage-outline span { position: absolute; top: -13px; left: -1px; padding: 2px 4px; border-radius: 2px 2px 0 0; background: var(--crimson); color: #f7f3ec; font-family: var(--mono); font-size: 6px; line-height: 10px; }
-.real-semantic-controls { display: grid; grid-template-columns: minmax(0,1fr); align-items: center; margin: 0 28px 26px; padding: 12px 0 0; border-top: 0; }
-.ranking-labels { display: flex; gap: 0; }
-.ranking-labels button { min-width: 0; flex-basis: 0; overflow: hidden; padding: 4px 2px; border: 0; background: none; color: var(--muted); text-align: center; font-family: var(--mono); font-size: 11px; line-height: normal; letter-spacing: normal; text-overflow: ellipsis; cursor: pointer; }.ranking-labels button.current { color: var(--crimson); font-weight: 700; }
-.ranking-track { display: flex; gap: 0; }
-.ranking-track .segment { min-width: 0; flex-basis: 0; }
-.ranking-track .segment { border-radius: 0; box-shadow: inset -1px 0 var(--paper-2); }
-.ranking-track .segment:first-child { border-radius: 3px 0 0 3px; }
-.ranking-track .segment:nth-child(5) { border-radius: 0 3px 3px 0; box-shadow: none; }
-.ranking-track .segment:nth-child(1) { background: var(--demo-segment-cyan); }.ranking-track .segment:nth-child(2) { background: var(--demo-segment-green); }.ranking-track .segment:nth-child(3) { background: var(--demo-segment-gold); }.ranking-track .segment:nth-child(4) { background: var(--demo-segment-pink); }.ranking-track .segment:nth-child(5) { background: var(--demo-segment-violet); }
-.demo-provenance { margin: 12px 4px 0 !important; color: var(--muted); font-size: 11px; text-align: right; }.demo-provenance code { color: var(--crimson); background: transparent; }
-
-/* ============================================================
- Breakpoints
- ============================================================ */
-
-@media (max-width: 900px) {
- html.home-page .VPHero { padding-top: calc(var(--vp-nav-height) + 16px); }
- .demo-shell { grid-template-columns: 1fr; }
- .source-panel { border-right: 0; border-bottom: 1px solid var(--rule-soft); }
- .code-scroll { height: 390px; }
- .real-demo-shell .code-scroll { height: 430px; }
- .real-preview-body { min-height: 560px; }
-}
-
-@media (hover: none), (pointer: coarse) {
- .hover-interaction-copy { display: none; }
- .touch-interaction-copy { display: inline; }
-}
-
-/* Below this the wordmark stops being wide enough for the scrap to land on it. */
-@media (max-width: 960px) {
- .np-masthead-stamp { display: none; }
-}
-
-@media (max-width: 820px) {
- .np-masthead-wordmark { width: 76%; }
-}
-
-@media (max-width: 520px) {
- .np-masthead-wordmark { width: 100%; }
- .np-footer-grid { gap: 32px; }
- .code-line { font-size: 12.5px; }
- .demo-shell { margin-inline: 0; border-radius: 2px; }
- .real-preview-body { grid-template-columns: 1fr; gap: 16px; padding: 16px 12px; }
- .real-video-frame { height: 480px; }
- .real-semantic-controls { margin-inline: 12px; grid-template-columns: minmax(0,1fr); }
-}
-
-@media (prefers-reduced-motion: reduce) {
- html.home-page .VPHero .VPButton.brand::after,
- html.home-page .VPNavBarMenuLink::after { transition: none; }
-}
diff --git a/docs/index.md b/docs/index.md
deleted file mode 100644
index 2bf69630..00000000
--- a/docs/index.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-layout: home
-
-# The headline lives in HeroMasthead.vue, which replaces the default hero info
-# block; only `actions` is read from here.
-hero:
- actions:
- - theme: brand
- text: Quickstart
- link: /quickstart
- - theme: alt
- text: Develop
- link: /guide/develop
- - theme: alt
- text: GitHub
- link: https://github.com/hypit-ai/hypit
----
-
-<ClientOnly>
- <SvmlDemoCarousel />
-</ClientOnly>
diff --git a/docs/public/good-better-best/transcript.json b/docs/public/good-better-best/transcript.json
deleted file mode 100644
index ebf06a68..00000000
--- a/docs/public/good-better-best/transcript.json
+++ /dev/null
@@ -1,592 +0,0 @@
-[
- {
- "text": "Good.",
- "start": 0.19,
- "end": 1
- },
- {
- "text": "Better.",
- "start": 1,
- "end": 1.61
- },
- {
- "text": "Best.",
- "start": 1.7,
- "end": 2.26
- },
- {
- "text": "Face",
- "start": 2.26,
- "end": 2.62
- },
- {
- "text": "Rating",
- "start": 2.62,
- "end": 3.16
- },
- {
- "text": "Edition.",
- "start": 3.16,
- "end": 3.83
- },
- {
- "text": "Good",
- "start": 4.01,
- "end": 4.32
- },
- {
- "text": "is",
- "start": 4.34,
- "end": 4.57
- },
- {
- "text": "ChatGBT.",
- "start": 4.57,
- "end": 5.44
- },
- {
- "text": "Everyone's",
- "start": 5.7,
- "end": 6.35
- },
- {
- "text": "asked",
- "start": 6.38,
- "end": 6.63
- },
- {
- "text": "it",
- "start": 6.72,
- "end": 6.81
- },
- {
- "text": "to",
- "start": 6.86,
- "end": 7
- },
- {
- "text": "rate",
- "start": 7,
- "end": 7.2
- },
- {
- "text": "their",
- "start": 7.2,
- "end": 7.42
- },
- {
- "text": "selfie.",
- "start": 7.61,
- "end": 8.42
- },
- {
- "text": "But",
- "start": 8.42,
- "end": 8.56
- },
- {
- "text": "it's",
- "start": 8.68,
- "end": 8.78
- },
- {
- "text": "a",
- "start": 8.78,
- "end": 8.83
- },
- {
- "text": "chatbot,",
- "start": 8.83,
- "end": 9.24
- },
- {
- "text": "not",
- "start": 9.35,
- "end": 9.44
- },
- {
- "text": "a",
- "start": 9.44,
- "end": 9.57
- },
- {
- "text": "face",
- "start": 9.57,
- "end": 9.72
- },
- {
- "text": "scanner.",
- "start": 9.94,
- "end": 10.31
- },
- {
- "text": "It",
- "start": 10.34,
- "end": 10.41
- },
- {
- "text": "can't",
- "start": 10.42,
- "end": 10.66
- },
- {
- "text": "measure",
- "start": 10.66,
- "end": 10.99
- },
- {
- "text": "a",
- "start": 10.99,
- "end": 11.05
- },
- {
- "text": "jawline,",
- "start": 11.05,
- "end": 11.52
- },
- {
- "text": "so",
- "start": 11.52,
- "end": 12.08
- },
- {
- "text": "it",
- "start": 12.08,
- "end": 12.18
- },
- {
- "text": "just",
- "start": 12.18,
- "end": 12.38
- },
- {
- "text": "guesses",
- "start": 12.38,
- "end": 12.76
- },
- {
- "text": "to",
- "start": 12.77,
- "end": 12.78
- },
- {
- "text": "keep",
- "start": 12.95,
- "end": 13.24
- },
- {
- "text": "you",
- "start": 13.24,
- "end": 13.36
- },
- {
- "text": "happy.",
- "start": 13.6,
- "end": 14.12
- },
- {
- "text": "Better",
- "start": 14.12,
- "end": 14.56
- },
- {
- "text": "is",
- "start": 14.56,
- "end": 14.73
- },
- {
- "text": "LooksMax",
- "start": 14.73,
- "end": 15.34
- },
- {
- "text": "AI,",
- "start": 15.34,
- "end": 15.64
- },
- {
- "text": "an",
- "start": 15.68,
- "end": 15.79
- },
- {
- "text": "app",
- "start": 15.79,
- "end": 16.02
- },
- {
- "text": "actually",
- "start": 16.02,
- "end": 16.39
- },
- {
- "text": "built",
- "start": 16.77,
- "end": 17.04
- },
- {
- "text": "to",
- "start": 17.04,
- "end": 17.16
- },
- {
- "text": "score",
- "start": 17.16,
- "end": 17.49
- },
- {
- "text": "your",
- "start": 17.49,
- "end": 17.73
- },
- {
- "text": "face.",
- "start": 17.75,
- "end": 18.2
- },
- {
- "text": "But",
- "start": 18.4,
- "end": 18.43
- },
- {
- "text": "it",
- "start": 18.43,
- "end": 18.57
- },
- {
- "text": "scores",
- "start": 18.57,
- "end": 18.82
- },
- {
- "text": "the",
- "start": 19.06,
- "end": 19.2
- },
- {
- "text": "photo,",
- "start": 19.2,
- "end": 19.69
- },
- {
- "text": "not",
- "start": 19.69,
- "end": 19.83
- },
- {
- "text": "you.",
- "start": 19.92,
- "end": 20.23
- },
- {
- "text": "Same",
- "start": 20.37,
- "end": 20.54
- },
- {
- "text": "guy,",
- "start": 20.74,
- "end": 20.85
- },
- {
- "text": "new",
- "start": 20.9,
- "end": 21.04
- },
- {
- "text": "lighting,",
- "start": 21.04,
- "end": 21.6
- },
- {
- "text": "totally",
- "start": 21.6,
- "end": 21.94
- },
- {
- "text": "different",
- "start": 22.23,
- "end": 22.54
- },
- {
- "text": "number.",
- "start": 22.54,
- "end": 23.12
- },
- {
- "text": "Best",
- "start": 23.12,
- "end": 23.41
- },
- {
- "text": "is",
- "start": 23.45,
- "end": 23.46
- },
- {
- "text": "a",
- "start": 23.46,
- "end": 23.63
- },
- {
- "text": "drone.",
- "start": 23.63,
- "end": 24.03
- },
- {
- "text": "It",
- "start": 24.19,
- "end": 24.2
- },
- {
- "text": "scans",
- "start": 24.28,
- "end": 24.54
- },
- {
- "text": "your",
- "start": 24.54,
- "end": 24.79
- },
- {
- "text": "face",
- "start": 24.79,
- "end": 25.03
- },
- {
- "text": "in",
- "start": 25.03,
- "end": 25.16
- },
- {
- "text": "3D",
- "start": 25.16,
- "end": 25.4
- },
- {
- "text": "with",
- "start": 25.4,
- "end": 25.65
- },
- {
- "text": "Face",
- "start": 25.65,
- "end": 25.76
- },
- {
- "text": "ID.",
- "start": 25.96,
- "end": 26.2
- },
- {
- "text": "No",
- "start": 26.2,
- "end": 26.32
- },
- {
- "text": "angles,",
- "start": 26.36,
- "end": 26.81
- },
- {
- "text": "no",
- "start": 26.81,
- "end": 26.93
- },
- {
- "text": "lighting",
- "start": 26.93,
- "end": 27.2
- },
- {
- "text": "tricks.",
- "start": 27.45,
- "end": 27.9
- },
- {
- "text": "And",
- "start": 27.99,
- "end": 28.2
- },
- {
- "text": "it",
- "start": 28.27,
- "end": 28.28
- },
- {
- "text": "doesn't",
- "start": 28.45,
- "end": 28.87
- },
- {
- "text": "stop",
- "start": 29.1,
- "end": 29.33
- },
- {
- "text": "at",
- "start": 29.33,
- "end": 29.41
- },
- {
- "text": "a",
- "start": 29.54,
- "end": 29.57
- },
- {
- "text": "score.",
- "start": 29.57,
- "end": 30.24
- },
- {
- "text": "It's",
- "start": 30.24,
- "end": 30.56
- },
- {
- "text": "built",
- "start": 30.79,
- "end": 30.98
- },
- {
- "text": "on",
- "start": 30.98,
- "end": 31.14
- },
- {
- "text": "7",
- "start": 31.18,
- "end": 31.39
- },
- {
- "text": "million",
- "start": 31.39,
- "end": 31.87
- },
- {
- "text": "real",
- "start": 31.97,
- "end": 32.3
- },
- {
- "text": "human",
- "start": 32.3,
- "end": 32.69
- },
- {
- "text": "votes.",
- "start": 32.72,
- "end": 33.45
- },
- {
- "text": "Shows",
- "start": 33.49,
- "end": 33.73
- },
- {
- "text": "you",
- "start": 33.92,
- "end": 34.05
- },
- {
- "text": "which",
- "start": 34.06,
- "end": 34.2
- },
- {
- "text": "type",
- "start": 34.39,
- "end": 34.49
- },
- {
- "text": "of",
- "start": 34.5,
- "end": 34.65
- },
- {
- "text": "people",
- "start": 34.65,
- "end": 35.1
- },
- {
- "text": "you",
- "start": 35.1,
- "end": 35.31
- },
- {
- "text": "attract,",
- "start": 35.31,
- "end": 36
- },
- {
- "text": "and",
- "start": 36,
- "end": 36.22
- },
- {
- "text": "tells",
- "start": 36.35,
- "end": 36.52
- },
- {
- "text": "you",
- "start": 36.72,
- "end": 36.81
- },
- {
- "text": "exactly",
- "start": 36.81,
- "end": 37.34
- },
- {
- "text": "which",
- "start": 37.34,
- "end": 37.69
- },
- {
- "text": "feature",
- "start": 37.7,
- "end": 38.24
- },
- {
- "text": "to",
- "start": 38.24,
- "end": 38.39
- },
- {
- "text": "fix",
- "start": 38.39,
- "end": 38.6
- },
- {
- "text": "first.",
- "start": 38.6,
- "end": 39.28
- },
- {
- "text": "Your",
- "start": 39.28,
- "end": 39.39
- },
- {
- "text": "glow",
- "start": 39.43,
- "end": 39.52
- },
- {
- "text": "up,",
- "start": 39.53,
- "end": 39.83
- },
- {
- "text": "finally",
- "start": 39.83,
- "end": 40.39
- },
- {
- "text": "measurable.",
- "start": 40.39,
- "end": 41.34
- }
-]
\ No newline at end of file
diff --git a/docs/public/index.html b/docs/public/index.html
new file mode 100644
index 00000000..cc647363
--- /dev/null
+++ b/docs/public/index.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="robots" content="noindex" />
+ <title>Hypit documentation</title>
+ <link rel="canonical" href="quickstart" />
+ <!--
+ The site root is not a page. It sends a reader to the quickstart in the
+ language they last read, falling back to the browser's own preference.
+ `hypit-locale` is the key LocalePreference.vue writes on every doc page.
+
+ Every path here is relative, so this file works both under the dev
+ server's /docs/ base and at the domain root the Pages deploy publishes.
+ -->
+ <script>
+ (function () {
+ var locale;
+ try {
+ locale = window.localStorage.getItem("hypit-locale");
+ } catch (error) {
+ // Storage can be unavailable in private or restricted browser contexts.
+ }
+ if (!locale) {
+ locale = (navigator.language || "").toLowerCase().indexOf("zh") === 0 ? "zh" : "en";
+ }
+ var target = locale === "zh" ? "zh/quickstart" : "quickstart";
+ location.replace(target + location.search + location.hash);
+ })();
+ </script>
+ </head>
+ <body>
+ <noscript>
+ <p><a href="quickstart">Quickstart</a></p>
+ <p><a href="zh/quickstart">快速开始</a></p>
+ </noscript>
+ </body>
+</html>
diff --git a/docs/public/street-interview/transcript.json b/docs/public/street-interview/transcript.json
deleted file mode 100644
index 9593dd55..00000000
--- a/docs/public/street-interview/transcript.json
+++ /dev/null
@@ -1,507 +0,0 @@
-[
- {
- "text": "How",
- "start": 0.04,
- "end": 0.13
- },
- {
- "text": "much",
- "start": 0.19,
- "end": 0.25
- },
- {
- "text": "was",
- "start": 0.37,
- "end": 0.53
- },
- {
- "text": "your",
- "start": 0.53,
- "end": 0.61
- },
- {
- "text": "flight?",
- "start": 0.75,
- "end": 1.26
- },
- {
- "text": "$49.",
- "start": 1.3,
- "end": 2.34
- },
- {
- "text": "That's",
- "start": 2.37,
- "end": 2.59
- },
- {
- "text": "cheap.",
- "start": 2.71,
- "end": 3.16
- },
- {
- "text": "The",
- "start": 3.2,
- "end": 3.29
- },
- {
- "text": "seat",
- "start": 3.35,
- "end": 3.53
- },
- {
- "text": "was",
- "start": 3.53,
- "end": 3.7
- },
- {
- "text": "cheap.",
- "start": 3.7,
- "end": 4.12
- },
- {
- "text": "The",
- "start": 4.2,
- "end": 4.29
- },
- {
- "text": "rainbow",
- "start": 4.35,
- "end": 4.6
- },
- {
- "text": "wasn't.",
- "start": 4.68,
- "end": 5.12
- },
- {
- "text": "They",
- "start": 5.15,
- "end": 5.34
- },
- {
- "text": "charged",
- "start": 5.34,
- "end": 5.73
- },
- {
- "text": "you",
- "start": 5.87,
- "end": 5.91
- },
- {
- "text": "for",
- "start": 5.91,
- "end": 6.08
- },
- {
- "text": "the",
- "start": 6.08,
- "end": 6.09
- },
- {
- "text": "rainbow?",
- "start": 6.44,
- "end": 6.84
- },
- {
- "text": "They",
- "start": 6.87,
- "end": 7.08
- },
- {
- "text": "counted",
- "start": 7.08,
- "end": 7.46
- },
- {
- "text": "it",
- "start": 7.59,
- "end": 7.62
- },
- {
- "text": "as",
- "start": 7.62,
- "end": 7.74
- },
- {
- "text": "seven",
- "start": 7.74,
- "end": 7.81
- },
- {
- "text": "carry-ons.",
- "start": 8.16,
- "end": 8.8
- },
- {
- "text": "Why",
- "start": 8.83,
- "end": 9.05
- },
- {
- "text": "seven?",
- "start": 9.05,
- "end": 9.72
- },
- {
- "text": "One",
- "start": 9.76,
- "end": 9.92
- },
- {
- "text": "bag",
- "start": 9.92,
- "end": 10.12
- },
- {
- "text": "for",
- "start": 10.12,
- "end": 10.32
- },
- {
- "text": "each",
- "start": 10.32,
- "end": 10.58
- },
- {
- "text": "color.",
- "start": 10.58,
- "end": 11.12
- },
- {
- "text": "Couldn't",
- "start": 11.15,
- "end": 11.48
- },
- {
- "text": "you",
- "start": 11.49,
- "end": 11.56
- },
- {
- "text": "turn",
- "start": 11.64,
- "end": 11.74
- },
- {
- "text": "it",
- "start": 11.87,
- "end": 11.9
- },
- {
- "text": "off?",
- "start": 11.9,
- "end": 12.09
- },
- {
- "text": "I",
- "start": 12.26,
- "end": 12.31
- },
- {
- "text": "tried.",
- "start": 12.31,
- "end": 13.06
- },
- {
- "text": "They",
- "start": 13.09,
- "end": 13.28
- },
- {
- "text": "charged",
- "start": 13.28,
- "end": 13.67
- },
- {
- "text": "me",
- "start": 13.67,
- "end": 13.81
- },
- {
- "text": "a",
- "start": 13.81,
- "end": 13.83
- },
- {
- "text": "$35",
- "start": 13.83,
- "end": 14.03
- },
- {
- "text": "rainbow",
- "start": 14.38,
- "end": 14.6
- },
- {
- "text": "deactivation",
- "start": 14.6,
- "end": 15.18
- },
- {
- "text": "fee.",
- "start": 15.42,
- "end": 15.63
- },
- {
- "text": "What",
- "start": 15.67,
- "end": 15.85
- },
- {
- "text": "was",
- "start": 15.85,
- "end": 15.89
- },
- {
- "text": "the",
- "start": 16.01,
- "end": 16.17
- },
- {
- "text": "total?",
- "start": 16.17,
- "end": 16.6
- },
- {
- "text": "$2,846.",
- "start": 16.66,
- "end": 18.74
- },
- {
- "text": "Do",
- "start": 18.81,
- "end": 18.86
- },
- {
- "text": "you",
- "start": 18.86,
- "end": 18.98
- },
- {
- "text": "have",
- "start": 18.98,
- "end": 19.03
- },
- {
- "text": "the",
- "start": 19.15,
- "end": 19.22
- },
- {
- "text": "receipt?",
- "start": 19.31,
- "end": 19.7
- },
- {
- "text": "Yeah,",
- "start": 19.74,
- "end": 19.95
- },
- {
- "text": "but",
- "start": 19.95,
- "end": 20.08
- },
- {
- "text": "I",
- "start": 20.08,
- "end": 20.12
- },
- {
- "text": "can't",
- "start": 20.12,
- "end": 20.32
- },
- {
- "text": "screenshot",
- "start": 20.45,
- "end": 20.67
- },
- {
- "text": "the",
- "start": 20.67,
- "end": 21.02
- },
- {
- "text": "whole",
- "start": 21.02,
- "end": 21.13
- },
- {
- "text": "thing.",
- "start": 21.13,
- "end": 21.36
- },
- {
- "text": "It's",
- "start": 21.39,
- "end": 21.49
- },
- {
- "text": "still",
- "start": 21.55,
- "end": 21.61
- },
- {
- "text": "scrolling.",
- "start": 21.73,
- "end": 22.2
- },
- {
- "text": "How",
- "start": 22.23,
- "end": 22.42
- },
- {
- "text": "did",
- "start": 22.42,
- "end": 22.64
- },
- {
- "text": "you",
- "start": 22.64,
- "end": 22.82
- },
- {
- "text": "pay",
- "start": 22.95,
- "end": 23.08
- },
- {
- "text": "for",
- "start": 23.08,
- "end": 23.17
- },
- {
- "text": "it?",
- "start": 23.44,
- "end": 23.68
- },
- {
- "text": "I",
- "start": 23.71,
- "end": 23.75
- },
- {
- "text": "took",
- "start": 23.75,
- "end": 23.93
- },
- {
- "text": "out",
- "start": 24.05,
- "end": 24.28
- },
- {
- "text": "a",
- "start": 24.28,
- "end": 24.3
- },
- {
- "text": "student",
- "start": 24.42,
- "end": 24.65
- },
- {
- "text": "loan.",
- "start": 25,
- "end": 25.46
- },
- {
- "text": "But",
- "start": 25.5,
- "end": 25.59
- },
- {
- "text": "you're",
- "start": 25.65,
- "end": 26.03
- },
- {
- "text": "not",
- "start": 26.03,
- "end": 26.22
- },
- {
- "text": "in",
- "start": 26.22,
- "end": 26.35
- },
- {
- "text": "college.",
- "start": 26.35,
- "end": 27.04
- },
- {
- "text": "I",
- "start": 27.08,
- "end": 27.14
- },
- {
- "text": "am",
- "start": 27.14,
- "end": 27.29
- },
- {
- "text": "now.",
- "start": 27.41,
- "end": 27.96
- },
- {
- "text": "The",
- "start": 28,
- "end": 28.09
- },
- {
- "text": "airline",
- "start": 28.15,
- "end": 28.57
- },
- {
- "text": "enrolled",
- "start": 28.57,
- "end": 28.93
- },
- {
- "text": "me",
- "start": 28.93,
- "end": 29.28
- },
- {
- "text": "so",
- "start": 29.28,
- "end": 29.31
- },
- {
- "text": "I",
- "start": 29.31,
- "end": 29.37
- },
- {
- "text": "could",
- "start": 29.37,
- "end": 29.68
- },
- {
- "text": "finance",
- "start": 29.68,
- "end": 30.08
- },
- {
- "text": "the",
- "start": 30.11,
- "end": 30.14
- },
- {
- "text": "baggage",
- "start": 30.32,
- "end": 30.72
- },
- {
- "text": "fees.",
- "start": 30.72,
- "end": 31.06
- }
-]
\ No newline at end of file
diff --git a/docs/public/zh/index.html b/docs/public/zh/index.html
new file mode 100644
index 00000000..04ab6209
--- /dev/null
+++ b/docs/public/zh/index.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<html lang="zh-CN">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="robots" content="noindex" />
+ <title>Hypit 文档</title>
+ <link rel="canonical" href="quickstart" />
+ <!-- The Chinese section root is not a page either; it opens the quickstart. -->
+ <script>
+ location.replace("quickstart" + location.search + location.hash);
+ </script>
+ </head>
+ <body>
+ <noscript><p><a href="quickstart">快速开始</a></p></noscript>
+ </body>
+</html>
diff --git a/docs/zh/index.md b/docs/zh/index.md
deleted file mode 100644
index d58c5507..00000000
--- a/docs/zh/index.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-layout: home
-
-# 标题由 HeroMasthead.vue 渲染,它替换了默认的 hero 信息区;这里只有 actions 会被读取。
-hero:
- actions:
- - theme: brand
- text: 快速开始
- link: /zh/quickstart
- - theme: alt
- text: 开发指南
- link: /zh/guide/develop
- - theme: alt
- text: GitHub
- link: https://github.com/hypit-ai/hypit
----
-
-<ClientOnly>
- <SvmlDemoCarousel />
-</ClientOnly>
diff --git a/examples/all-components-preview/README.md b/examples/all-components-preview/README.md
deleted file mode 100644
index 57eee7dd..00000000
--- a/examples/all-components-preview/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# All components
-
-One Source that writes every kind of Track at once: speech, a ranking board, a
-media card, a screen treatment, typography and captions.
-
-It exists to exercise the vocabulary: every Track kind declared once, in one
-Source, so a change that breaks one of them breaks something a reader can see.
-`hypit check` proves it is legal, and the graph-shape tests read it.
-
-`studio.svrun` supplies two materialized Semantic Takes and the deterministic Script-owned caption
-document, so
-every Studio projection is explicit and opening it invokes no Provider:
-
-```bash
-pnpm studio -- --run examples/all-components-preview/studio.svrun --workspace .
-```
-
-Every Track, the Film composition and the HyperFrames picture use the same
-deterministic package code as a Build. `build.svrun` remains the real generation
-Run; `studio.svrun` is its explicit authoring view.
diff --git a/examples/all-components-preview/build.svrun b/examples/all-components-preview/build.svrun
deleted file mode 100644
index 0d3fea84..00000000
--- a/examples/all-components-preview/build.svrun
+++ /dev/null
@@ -1,6 +0,0 @@
-<?svml using="@hypit/run-markup@1"?>
-
-<svrun version="1">
- <author source="./main.svml"/>
- <target output="final.video"/>
-</svrun>
diff --git a/examples/all-components-preview/fixtures/card.svg b/examples/all-components-preview/fixtures/card.svg
deleted file mode 100644
index d40a5b5c..00000000
--- a/examples/all-components-preview/fixtures/card.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
- <rect width="540" height="960" rx="48" fill="#10131a"/>
- <rect x="36" y="36" width="468" height="888" rx="32" fill="#edf2ff"/>
- <circle cx="270" cy="330" r="132" fill="#725cff"/>
- <path d="M206 330h128M270 266v128" stroke="#fff" stroke-width="28" stroke-linecap="round"/>
- <rect x="96" y="540" width="348" height="36" rx="18" fill="#10131a"/>
- <rect x="136" y="608" width="268" height="24" rx="12" fill="#697386"/>
- <rect x="166" y="660" width="208" height="24" rx="12" fill="#9aa4b5"/>
-</svg>
diff --git a/examples/all-components-preview/fixtures/icon.svg b/examples/all-components-preview/fixtures/icon.svg
deleted file mode 100644
index e6498bed..00000000
--- a/examples/all-components-preview/fixtures/icon.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" viewBox="0 0 192 192">
- <rect width="192" height="192" rx="42" fill="#725cff"/>
- <circle cx="96" cy="96" r="52" fill="none" stroke="#fff" stroke-width="16"/>
- <circle cx="96" cy="96" r="13" fill="#fff"/>
-</svg>
diff --git a/examples/all-components-preview/fixtures/studio-closing-take.json b/examples/all-components-preview/fixtures/studio-closing-take.json
deleted file mode 100644
index 5690e966..00000000
--- a/examples/all-components-preview/fixtures/studio-closing-take.json
+++ /dev/null
@@ -1,179 +0,0 @@
-{
- "kind": "inline",
- "value": {
- "media": {
- "timeline": {
- "frameRate": {
- "numerator": 24,
- "denominator": 1
- },
- "frameCount": 289
- },
- "visual": {
- "artifact": {
- "kind": "blob",
- "digest": "sha256:460ebf6cf4a22f0cabd13eb1646aa221dba8938ee008a165a3ed4eeb5ac451f4",
- "size": 600761,
- "mediaType": "video/mp4"
- },
- "width": 540,
- "height": 960
- }
- },
- "segment": {
- "segmentId": "closing",
- "startAnchorId": "segment:closing:start",
- "endAnchorId": "segment:closing:end",
- "startFrame": 0,
- "endFrameExclusive": 289
- },
- "tokens": [
- {
- "tokenId": "segment:closing:token:1",
- "segmentId": "closing",
- "text": "Ranking",
- "startAnchorId": "segment:closing:token:1:start",
- "endAnchorId": "segment:closing:token:1:end",
- "startFrame": 0,
- "endFrameExclusive": 36
- },
- {
- "tokenId": "segment:closing:token:2",
- "segmentId": "closing",
- "text": "Captions",
- "startAnchorId": "segment:closing:token:2:start",
- "endAnchorId": "segment:closing:token:2:end",
- "startFrame": 36,
- "endFrameExclusive": 72
- },
- {
- "tokenId": "segment:closing:token:3",
- "segmentId": "closing",
- "text": "That",
- "startAnchorId": "segment:closing:token:3:start",
- "endAnchorId": "segment:closing:token:3:end",
- "startFrame": 72,
- "endFrameExclusive": 108
- },
- {
- "tokenId": "segment:closing:token:4",
- "segmentId": "closing",
- "text": "is",
- "startAnchorId": "segment:closing:token:4:start",
- "endAnchorId": "segment:closing:token:4:end",
- "startFrame": 108,
- "endFrameExclusive": 144
- },
- {
- "tokenId": "segment:closing:token:5",
- "segmentId": "closing",
- "text": "the",
- "startAnchorId": "segment:closing:token:5:start",
- "endAnchorId": "segment:closing:token:5:end",
- "startFrame": 144,
- "endFrameExclusive": 180
- },
- {
- "tokenId": "segment:closing:token:6",
- "segmentId": "closing",
- "text": "whole",
- "startAnchorId": "segment:closing:token:6:start",
- "endAnchorId": "segment:closing:token:6:end",
- "startFrame": 180,
- "endFrameExclusive": 216
- },
- {
- "tokenId": "segment:closing:token:7",
- "segmentId": "closing",
- "text": "of",
- "startAnchorId": "segment:closing:token:7:start",
- "endAnchorId": "segment:closing:token:7:end",
- "startFrame": 216,
- "endFrameExclusive": 252
- },
- {
- "tokenId": "segment:closing:token:8",
- "segmentId": "closing",
- "text": "it",
- "startAnchorId": "segment:closing:token:8:start",
- "endAnchorId": "segment:closing:token:8:end",
- "startFrame": 252,
- "endFrameExclusive": 289
- }
- ],
- "anchors": [
- {
- "identity": "segment:closing:start",
- "frame": 0
- },
- {
- "identity": "segment:closing:token:1:start",
- "frame": 0
- },
- {
- "identity": "segment:closing:token:1:end",
- "frame": 36
- },
- {
- "identity": "segment:closing:token:2:start",
- "frame": 36
- },
- {
- "identity": "segment:closing:token:2:end",
- "frame": 72
- },
- {
- "identity": "segment:closing:token:3:start",
- "frame": 72
- },
- {
- "identity": "segment:closing:token:3:end",
- "frame": 108
- },
- {
- "identity": "segment:closing:token:4:start",
- "frame": 108
- },
- {
- "identity": "segment:closing:token:4:end",
- "frame": 144
- },
- {
- "identity": "segment:closing:token:5:start",
- "frame": 144
- },
- {
- "identity": "segment:closing:token:5:end",
- "frame": 180
- },
- {
- "identity": "segment:closing:token:6:start",
- "frame": 180
- },
- {
- "identity": "segment:closing:token:6:end",
- "frame": 216
- },
- {
- "identity": "segment:closing:token:7:start",
- "frame": 216
- },
- {
- "identity": "segment:closing:token:7:end",
- "frame": 252
- },
- {
- "identity": "segment:closing:token:8:start",
- "frame": 252
- },
- {
- "identity": "segment:closing:token:8:end",
- "frame": 289
- },
- {
- "identity": "segment:closing:end",
- "frame": 289
- }
- ]
- }
-}
diff --git a/examples/all-components-preview/fixtures/studio-opening-take.json b/examples/all-components-preview/fixtures/studio-opening-take.json
deleted file mode 100644
index 92e06fcf..00000000
--- a/examples/all-components-preview/fixtures/studio-opening-take.json
+++ /dev/null
@@ -1,468 +0,0 @@
-{
- "kind": "inline",
- "value": {
- "media": {
- "timeline": {
- "frameRate": {
- "numerator": 24,
- "denominator": 1
- },
- "frameCount": 289
- },
- "visual": {
- "artifact": {
- "kind": "blob",
- "digest": "sha256:82367e703005d86c2f5e25f8e88ca3fa3b8057e7bda837f8fb15f6fedcb14d3c",
- "size": 581338,
- "mediaType": "video/mp4"
- },
- "width": 540,
- "height": 960
- }
- },
- "segment": {
- "segmentId": "opening",
- "startAnchorId": "segment:opening:start",
- "endAnchorId": "segment:opening:end",
- "startFrame": 0,
- "endFrameExclusive": 289
- },
- "tokens": [
- {
- "tokenId": "segment:opening:token:1",
- "segmentId": "opening",
- "text": "This",
- "startAnchorId": "segment:opening:token:1:start",
- "endAnchorId": "segment:opening:token:1:end",
- "startFrame": 0,
- "endFrameExclusive": 11
- },
- {
- "tokenId": "segment:opening:token:2",
- "segmentId": "opening",
- "text": "is",
- "startAnchorId": "segment:opening:token:2:start",
- "endAnchorId": "segment:opening:token:2:end",
- "startFrame": 11,
- "endFrameExclusive": 23
- },
- {
- "tokenId": "segment:opening:token:3",
- "segmentId": "opening",
- "text": "every",
- "startAnchorId": "segment:opening:token:3:start",
- "endAnchorId": "segment:opening:token:3:end",
- "startFrame": 23,
- "endFrameExclusive": 34
- },
- {
- "tokenId": "segment:opening:token:4",
- "segmentId": "opening",
- "text": "component",
- "startAnchorId": "segment:opening:token:4:start",
- "endAnchorId": "segment:opening:token:4:end",
- "startFrame": 34,
- "endFrameExclusive": 46
- },
- {
- "tokenId": "segment:opening:token:5",
- "segmentId": "opening",
- "text": "at",
- "startAnchorId": "segment:opening:token:5:start",
- "endAnchorId": "segment:opening:token:5:end",
- "startFrame": 46,
- "endFrameExclusive": 57
- },
- {
- "tokenId": "segment:opening:token:6",
- "segmentId": "opening",
- "text": "once",
- "startAnchorId": "segment:opening:token:6:start",
- "endAnchorId": "segment:opening:token:6:end",
- "startFrame": 57,
- "endFrameExclusive": 69
- },
- {
- "tokenId": "segment:opening:token:7",
- "segmentId": "opening",
- "text": "A",
- "startAnchorId": "segment:opening:token:7:start",
- "endAnchorId": "segment:opening:token:7:end",
- "startFrame": 69,
- "endFrameExclusive": 80
- },
- {
- "tokenId": "segment:opening:token:8",
- "segmentId": "opening",
- "text": "card",
- "startAnchorId": "segment:opening:token:8:start",
- "endAnchorId": "segment:opening:token:8:end",
- "startFrame": 80,
- "endFrameExclusive": 92
- },
- {
- "tokenId": "segment:opening:token:9",
- "segmentId": "opening",
- "text": "cuts",
- "startAnchorId": "segment:opening:token:9:start",
- "endAnchorId": "segment:opening:token:9:end",
- "startFrame": 92,
- "endFrameExclusive": 104
- },
- {
- "tokenId": "segment:opening:token:10",
- "segmentId": "opening",
- "text": "in",
- "startAnchorId": "segment:opening:token:10:start",
- "endAnchorId": "segment:opening:token:10:end",
- "startFrame": 104,
- "endFrameExclusive": 115
- },
- {
- "tokenId": "segment:opening:token:11",
- "segmentId": "opening",
- "text": "here",
- "startAnchorId": "segment:opening:token:11:start",
- "endAnchorId": "segment:opening:token:11:end",
- "startFrame": 115,
- "endFrameExclusive": 127
- },
- {
- "tokenId": "segment:opening:token:12",
- "segmentId": "opening",
- "text": "the",
- "startAnchorId": "segment:opening:token:12:start",
- "endAnchorId": "segment:opening:token:12:end",
- "startFrame": 127,
- "endFrameExclusive": 138
- },
- {
- "tokenId": "segment:opening:token:13",
- "segmentId": "opening",
- "text": "picture",
- "startAnchorId": "segment:opening:token:13:start",
- "endAnchorId": "segment:opening:token:13:end",
- "startFrame": 138,
- "endFrameExclusive": 150
- },
- {
- "tokenId": "segment:opening:token:14",
- "segmentId": "opening",
- "text": "flashes",
- "startAnchorId": "segment:opening:token:14:start",
- "endAnchorId": "segment:opening:token:14:end",
- "startFrame": 150,
- "endFrameExclusive": 161
- },
- {
- "tokenId": "segment:opening:token:15",
- "segmentId": "opening",
- "text": "and",
- "startAnchorId": "segment:opening:token:15:start",
- "endAnchorId": "segment:opening:token:15:end",
- "startFrame": 161,
- "endFrameExclusive": 173
- },
- {
- "tokenId": "segment:opening:token:16",
- "segmentId": "opening",
- "text": "the",
- "startAnchorId": "segment:opening:token:16:start",
- "endAnchorId": "segment:opening:token:16:end",
- "startFrame": 173,
- "endFrameExclusive": 184
- },
- {
- "tokenId": "segment:opening:token:17",
- "segmentId": "opening",
- "text": "board",
- "startAnchorId": "segment:opening:token:17:start",
- "endAnchorId": "segment:opening:token:17:end",
- "startFrame": 184,
- "endFrameExclusive": 196
- },
- {
- "tokenId": "segment:opening:token:18",
- "segmentId": "opening",
- "text": "fills",
- "startAnchorId": "segment:opening:token:18:start",
- "endAnchorId": "segment:opening:token:18:end",
- "startFrame": 196,
- "endFrameExclusive": 208
- },
- {
- "tokenId": "segment:opening:token:19",
- "segmentId": "opening",
- "text": "as",
- "startAnchorId": "segment:opening:token:19:start",
- "endAnchorId": "segment:opening:token:19:end",
- "startFrame": 208,
- "endFrameExclusive": 219
- },
- {
- "tokenId": "segment:opening:token:20",
- "segmentId": "opening",
- "text": "each",
- "startAnchorId": "segment:opening:token:20:start",
- "endAnchorId": "segment:opening:token:20:end",
- "startFrame": 219,
- "endFrameExclusive": 231
- },
- {
- "tokenId": "segment:opening:token:21",
- "segmentId": "opening",
- "text": "one",
- "startAnchorId": "segment:opening:token:21:start",
- "endAnchorId": "segment:opening:token:21:end",
- "startFrame": 231,
- "endFrameExclusive": 242
- },
- {
- "tokenId": "segment:opening:token:22",
- "segmentId": "opening",
- "text": "is",
- "startAnchorId": "segment:opening:token:22:start",
- "endAnchorId": "segment:opening:token:22:end",
- "startFrame": 242,
- "endFrameExclusive": 254
- },
- {
- "tokenId": "segment:opening:token:23",
- "segmentId": "opening",
- "text": "named",
- "startAnchorId": "segment:opening:token:23:start",
- "endAnchorId": "segment:opening:token:23:end",
- "startFrame": 254,
- "endFrameExclusive": 265
- },
- {
- "tokenId": "segment:opening:token:24",
- "segmentId": "opening",
- "text": "Spatial",
- "startAnchorId": "segment:opening:token:24:start",
- "endAnchorId": "segment:opening:token:24:end",
- "startFrame": 265,
- "endFrameExclusive": 277
- },
- {
- "tokenId": "segment:opening:token:25",
- "segmentId": "opening",
- "text": "Typography",
- "startAnchorId": "segment:opening:token:25:start",
- "endAnchorId": "segment:opening:token:25:end",
- "startFrame": 277,
- "endFrameExclusive": 289
- }
- ],
- "anchors": [
- {
- "identity": "segment:opening:start",
- "frame": 0
- },
- {
- "identity": "segment:opening:token:1:start",
- "frame": 0
- },
- {
- "identity": "segment:opening:token:1:end",
- "frame": 11
- },
- {
- "identity": "segment:opening:token:2:start",
- "frame": 11
- },
- {
- "identity": "segment:opening:token:2:end",
- "frame": 23
- },
- {
- "identity": "segment:opening:token:3:start",
- "frame": 23
- },
- {
- "identity": "segment:opening:token:3:end",
- "frame": 34
- },
- {
- "identity": "segment:opening:token:4:start",
- "frame": 34
- },
- {
- "identity": "segment:opening:token:4:end",
- "frame": 46
- },
- {
- "identity": "segment:opening:token:5:start",
- "frame": 46
- },
- {
- "identity": "segment:opening:token:5:end",
- "frame": 57
- },
- {
- "identity": "segment:opening:token:6:start",
- "frame": 57
- },
- {
- "identity": "segment:opening:token:6:end",
- "frame": 69
- },
- {
- "identity": "segment:opening:token:7:start",
- "frame": 69
- },
- {
- "identity": "segment:opening:token:7:end",
- "frame": 80
- },
- {
- "identity": "segment:opening:token:8:start",
- "frame": 80
- },
- {
- "identity": "segment:opening:token:8:end",
- "frame": 92
- },
- {
- "identity": "segment:opening:token:9:start",
- "frame": 92
- },
- {
- "identity": "segment:opening:token:9:end",
- "frame": 104
- },
- {
- "identity": "segment:opening:token:10:start",
- "frame": 104
- },
- {
- "identity": "segment:opening:token:10:end",
- "frame": 115
- },
- {
- "identity": "segment:opening:token:11:start",
- "frame": 115
- },
- {
- "identity": "segment:opening:token:11:end",
- "frame": 127
- },
- {
- "identity": "segment:opening:token:12:start",
- "frame": 127
- },
- {
- "identity": "segment:opening:token:12:end",
- "frame": 138
- },
- {
- "identity": "segment:opening:token:13:start",
- "frame": 138
- },
- {
- "identity": "segment:opening:token:13:end",
- "frame": 150
- },
- {
- "identity": "segment:opening:token:14:start",
- "frame": 150
- },
- {
- "identity": "segment:opening:token:14:end",
- "frame": 161
- },
- {
- "identity": "segment:opening:token:15:start",
- "frame": 161
- },
- {
- "identity": "segment:opening:token:15:end",
- "frame": 173
- },
- {
- "identity": "segment:opening:token:16:start",
- "frame": 173
- },
- {
- "identity": "segment:opening:token:16:end",
- "frame": 184
- },
- {
- "identity": "segment:opening:token:17:start",
- "frame": 184
- },
- {
- "identity": "segment:opening:token:17:end",
- "frame": 196
- },
- {
- "identity": "segment:opening:token:18:start",
- "frame": 196
- },
- {
- "identity": "segment:opening:token:18:end",
- "frame": 208
- },
- {
- "identity": "segment:opening:token:19:start",
- "frame": 208
- },
- {
- "identity": "segment:opening:token:19:end",
- "frame": 219
- },
- {
- "identity": "segment:opening:token:20:start",
- "frame": 219
- },
- {
- "identity": "segment:opening:token:20:end",
- "frame": 231
- },
- {
- "identity": "segment:opening:token:21:start",
- "frame": 231
- },
- {
- "identity": "segment:opening:token:21:end",
- "frame": 242
- },
- {
- "identity": "segment:opening:token:22:start",
- "frame": 242
- },
- {
- "identity": "segment:opening:token:22:end",
- "frame": 254
- },
- {
- "identity": "segment:opening:token:23:start",
- "frame": 254
- },
- {
- "identity": "segment:opening:token:23:end",
- "frame": 265
- },
- {
- "identity": "segment:opening:token:24:start",
- "frame": 265
- },
- {
- "identity": "segment:opening:token:24:end",
- "frame": 277
- },
- {
- "identity": "segment:opening:token:25:start",
- "frame": 277
- },
- {
- "identity": "segment:opening:token:25:end",
- "frame": 289
- },
- {
- "identity": "segment:opening:end",
- "frame": 289
- }
- ]
- }
-}
diff --git a/examples/all-components-preview/hypit.runtime.json b/examples/all-components-preview/hypit.runtime.json
deleted file mode 100644
index 427a5de6..00000000
--- a/examples/all-components-preview/hypit.runtime.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "format": "hypit.runtime-profile@1",
- "runtime": {
- "use": "@hypit/runtime-local",
- "config": {
- "dataRoot": ".hypit/runtimes/local",
- "artifacts": { "use": "@hypit/artifact-store-fs", "config": { "path": "artifacts" } },
- "credentials": {
- "environment": { "use": "@hypit/credential-store-env" }
- },
- "endpoints": {
- "kie.all-components": {
- "use": "@hypit/provider-kie",
- "pool": "generation",
- "config": {
- "apiKey": { "store": "env", "key": "KIE_API_KEY" },
- "defaultConcurrency": 2
- }
- },
- "media.all-components": {
- "use": "@hypit/provider-media-local",
- "pool": "media",
- "config": { "defaultConcurrency": 2 }
- },
- "whisperx.all-components": {
- "use": "@hypit/provider-whisperx-local",
- "pool": "alignment",
- "config": { "defaultConcurrency": 1 }
- },
- "hyperframes.all-components": {
- "use": "@hypit/provider-hyperframes-local",
- "pool": "render",
- "config": { "defaultConcurrency": 1 }
- }
- }
- }
- }
-}
diff --git a/examples/all-components-preview/image-only.svrun b/examples/all-components-preview/image-only.svrun
deleted file mode 100644
index 3d916c4e..00000000
--- a/examples/all-components-preview/image-only.svrun
+++ /dev/null
@@ -1,6 +0,0 @@
-<?svml using="@hypit/run-markup@1"?>
-
-<svrun version="1">
- <author source="./main.svml"/>
- <target output="presenter.image"/>
-</svrun>
diff --git a/examples/all-components-preview/main.svml b/examples/all-components-preview/main.svml
deleted file mode 100644
index 3898d2e3..00000000
--- a/examples/all-components-preview/main.svml
+++ /dev/null
@@ -1,155 +0,0 @@
-<?svml using="@hypit/markup@1"?>
-
-<svml>
- <import from="@hypit/script@1"/>
- <import as="wording" from="@hypit/text@1"/>
- <import as="seedance" from="@hypit/seedance@1"/>
- <import as="media" from="@hypit/media@1"/>
- <import as="pipeline" from="@hypit/media-pipeline@1"/>
- <import as="gpt" from="@hypit/gpt-image@1"/>
- <import as="speech" from="@hypit/speech-track@1"/>
- <import as="whisperx" from="@hypit/whisperx@1"/>
- <import as="media-track" from="@hypit/media-track@1"/>
- <import as="ranking" from="@hypit/ranking@1"/>
- <import as="screen" from="@hypit/screen-overlay@1"/>
- <import as="deck" from="@hypit/deck-track@1"/>
- <import as="caption" from="@hypit/caption@1"/>
- <import as="caption-fine" from="@hypit/caption-fine@1"/>
- <import as="fonts" from="@hypit/fonts-open@1"/>
- <import as="text" from="@hypit/typography-track@1"/>
- <import as="space" from="@hypit/spatial@1"/>
- <import as="program" from="@hypit/program-space@1"/>
- <import as="film" from="@hypit/film@1"/>
- <import as="render" from="@hypit/render-hyperframes@1"/>
- <import as="recipes" source="./recipes.svs"/>
-
- <!-- One Script, written so every Track below is placed by something said
- rather than by a timecode: a Segment per take, a Selection per cutaway
- and per board row, and Moments for the deck. -->
- <script id="story">
- <opening>
- <HOST>@board This is every component at once. @title A card cuts in
- here@/title, @overlay the picture flashes@/overlay, and the board fills
- as each one is named.
- <HOST>@spatial Spatial.@/spatial @deal-one! @typography Typography.@/typography @deal-two!
- </opening>
- <closing>
- <HOST>@ranking Ranking.@/ranking @deal-three! @captions Captions.@/captions @deal-four!
- <HOST>That is the whole of it@/board. @done!
- </closing>
- </script>
-
- <space:Canvas id="vertical" width="1080" height="1920"/>
- <program:Clock id="clock" frame-rate="30"/>
- <space:Frame id="full" within={vertical} left="0%" top="0%" right="100%" bottom="100%"/>
- <!-- A board fills from its bottom edge upward, so the Frame is sized to the
- rows it holds: four rows, three gaps and the Recipe's padding. A taller
- Frame would leave the rows floating at the bottom of an empty box. -->
- <space:Frame id="board-frame" within={vertical} left="4%" top="14%" right="38%" bottom="33.5%"/>
- <space:Frame id="card-frame" within={vertical} left="10%" top="60%" right="90%" bottom="86%"/>
- <space:Frame id="title-frame" within={vertical} left="0%" top="6%" right="100%" bottom="13%"/>
-
- <!-- A generated take, so the preview has something with no material behind it
- and a reference picture to stand in with. -->
- <wording:Value id="direction">A presenter talking straight to camera, plain background.</wording:Value>
- <wording:Value id="look">A friendly presenter in a plain grey studio, waist up, facing camera,
- soft even light, neutral expression.</wording:Value>
- <gpt:Image id="presenter" prompt={look} aspect-ratio="9:16" resolution="2K"/>
- <seedance:ReferenceVideo id="take-opening" model="mini" prompt={direction} duration="8"
- generate-audio="true">
- <seedance:Reference image={presenter.image}/>
- </seedance:ReferenceVideo>
- <seedance:ReferenceVideo id="take-closing" model="mini" prompt={direction} duration="8"
- generate-audio="true">
- <seedance:Reference image={presenter.image}/>
- </seedance:ReferenceVideo>
-
- <!-- Pictures on disk, so the Media Track and the board have real material. -->
- <media:Image id="card-shot" src="./fixtures/card.svg" media-type="image/svg+xml"/>
- <media:Image id="icon-spatial" src="./fixtures/icon.svg" media-type="image/svg+xml"/>
- <media:Image id="icon-type" src="./fixtures/icon.svg" media-type="image/svg+xml"/>
- <media:Image id="icon-ranking" src="./fixtures/icon.svg" media-type="image/svg+xml"/>
- <media:Image id="icon-caption" src="./fixtures/icon.svg" media-type="image/svg+xml"/>
- <space:Extent id="portrait" width="540" height="960"/>
- <space:Extent id="square" width="192" height="192"/>
-
- <pipeline:Normalize id="opening-media" source={take-opening.video}
- video="primary-moving" audio="default" span-authority="video" clock={clock}/>
- <pipeline:Normalize id="closing-media" source={take-closing.video}
- video="primary-moving" audio="default" span-authority="video" clock={clock}/>
- <whisperx:SemanticTake id="opening-semantic" narrative={story}
- segment={story.segment.opening} media={opening-media.media} language="en"/>
- <whisperx:SemanticTake id="closing-semantic" narrative={story}
- segment={story.segment.closing} media={closing-media.media} language="en"/>
-
- <speech:Track id="speech"
- visual-frame={full} visual-appearance={recipes.speech.visual} visual-z="0">
- <speech:Take source={opening-semantic.take}/>
- <speech:Take source={closing-semantic.take}/>
- </speech:Track>
-
- <fonts:Stack id="ui-font" family="inter" weight="700" style="normal"/>
-
- <!-- A board whose overall lifetime and per-row reveal windows both come
- directly from Selections in the Script. -->
- <ranking:ColumnStyle id="board-style" recipe={recipes.ranking.board} font={ui-font}/>
- <ranking:Column id="board" semantic={speech.semantic} canvas={vertical} frame={board-frame}
- during={story.selection.board} style={board-style}>
- <ranking:ColumnItem id="row-spatial" rank="1" label="Spatial" icon={icon-spatial}
- during={story.selection.spatial}/>
- <ranking:ColumnItem id="row-type" rank="2" label="Typography" icon={icon-type}
- during={story.selection.typography}/>
- <ranking:ColumnItem id="row-ranking" rank="3" label="Ranking" icon={icon-ranking}
- during={story.selection.ranking}/>
- <ranking:ColumnItem id="row-caption" rank="4" label="Captions" icon={icon-caption}
- during={story.selection.captions}/>
- </ranking:Column>
-
- <!-- A card, held for exactly as long as its Selection is spoken. -->
- <media-track:Track id="cards" semantic={speech.semantic} canvas={vertical}>
- <media-track:Item id="card" image={card-shot} extent={portrait}
- during={story.selection.title} frame={card-frame}
- appearance={recipes.media.card} motion={recipes.motion.card}/>
- </media-track:Track>
-
- <!-- A treatment over the whole picture, placed by a Selection like anything else. -->
- <screen:Track id="effects" semantic={speech.semantic} canvas={vertical}>
- <screen:Flash during={story.selection.overlay} z="80"
- color="#ffffff" intensity="0.6" attack="2" hold="2" decay="6"/>
- </screen:Track>
-
- <!-- A deck, one card per board row, stepping forward as each is named. The
- preview was never taught about this Track; it appears because the package
- produces one. -->
- <space:Frame id="deck-frame" within={vertical} left="44%" top="60%" right="98%" bottom="88%"/>
- <deck:DepthStack id="deck" semantic={speech.semantic} canvas={vertical}
- frame={deck-frame} appearance={recipes.deck.stack} until={story.moment.done}>
- <deck:Card id="card-spatial" source={icon-spatial} extent={square} at={story.moment.deal-one}/>
- <deck:Card id="card-type" source={icon-type} extent={square} at={story.moment.deal-two}/>
- <deck:Card id="card-ranking" source={icon-ranking} extent={square} at={story.moment.deal-three}/>
- <deck:Card id="card-caption" source={icon-caption} extent={square} at={story.moment.deal-four}/>
- </deck:DepthStack>
-
- <text:Style id="title-style" recipe={recipes.text.title} font={ui-font}/>
- <text:Track id="titles" semantic={speech.semantic}>
- <text:Area id="headline" placement={title-frame} style={title-style} during="program">
- EVERY COMPONENT AT ONCE
- </text:Area>
- </text:Track>
-
- <caption-fine:Style id="base-caption" recipe={recipes.caption.base} font={ui-font}/>
- <caption:Program id="caption-program" document={story.caption} narrative={story} default={base-caption}/>
- <caption-fine:Track id="captions" document={story.caption} semantic={speech.semantic} program={caption-program}/>
-
- <film:Film id="main" canvas={vertical} semantic={speech.semantic} appearance={recipes.film.vertical}>
- <film:Track source={speech.visual}/>
- <film:Track source={speech.audio}/>
- <film:Track source={board.visual}/>
- <film:Track source={cards.visual}/>
- <film:Track source={effects.track}/>
- <film:Track source={deck.track}/>
- <film:Track source={titles.track}/>
- <film:Track source={captions.track}/>
- </film:Film>
- <render:Video id="final" composition={main.composition} semantic={speech.semantic}/>
-</svml>
diff --git a/examples/all-components-preview/recipes.svs b/examples/all-components-preview/recipes.svs
deleted file mode 100644
index c8906a10..00000000
--- a/examples/all-components-preview/recipes.svs
+++ /dev/null
@@ -1,61 +0,0 @@
-<?svml using="@hypit/svs@1"?>
-
-<sheet version="1">
- film.vertical { background: #05060a; }
- speech.visual { fit: cover; }
-
- /* The board: a dark panel on the left third, one row per app, filling from the
- bottom rank upward as each name is spoken. */
- ranking.board {
- board-background: #070810EF;
- board-border-color: #FFFFFF2E; board-border-width: 1; board-radius: 6;
- board-shadow-x: 0; board-shadow-y: 6; board-shadow-blur: 18; board-shadow-spread: 0;
- board-shadow-color: #00000059;
- rank-colors: #ff3f56|#ffa72d|#eadc2a|#84c654|#31add0;
- padding: 18; row-height: 74; row-gap: 10;
- icon-size: 58; icon-radius: 13; icon-fit: contain;
- stage-x: 0.5; stage-y: 0.5; stage-size: 96;
- font-size: 34; font-weight: 900; text-color: #FFFFFF; line-height: 1.1;
- appear-frames: 11; move-frames: 13; motion-easing: ease-out;
- board-stack: 20; item-stack: 30; stage-stack: 25;
- }
-
- /* A cutaway replaces the shot, so it carries no box treatment. */
- /* A card sits inside the picture, so it keeps a box treatment. */
- /* A deck: the card being spoken about sits front, the ones before and after
- it stepping back behind it. */
- deck.stack {
- visible-previous: 2; visible-next: 2;
- current-x: 0.5; current-y: 0.5; current-scale: 1; current-opacity: 1; current-stacking: 50;
- previous-x-step: -0.16; previous-scale-step: 0.86; previous-opacity-step: 0.7;
- previous-rotation-step: -5; previous-stacking-step: -6;
- next-x-step: 0.16; next-scale-step: 0.86; next-opacity-step: 0.7;
- next-rotation-step: 5; next-stacking-step: -6;
- reflow-frames: 9; reflow-easing: ease-out;
- }
-
- media.card {
- stack-order: 60; fit: cover; clip: rounded; radius: 18; padding: 10 10;
- frame-paint: #14141c;
- }
- motion.card {
- enter: fade; enter-frames: 2; enter-easing: linear;
- exit: fade; exit-frames: 2; exit-easing: linear;
- }
-
- text.title {
- stack-order: 90;
- weight: 900; size: 62; align: center; fill: #FFFFFF; tracking: -1;
- padding: 14 22;
- }
-
- caption.base {
- stack-order: 70; x: 0.68; y: 0.56; width: 0.6; anchor-x: center; anchor-y: top;
- size: 50; line-height: 1.05; align: center;
- fill: #FFFFFF; stroke-color: #05060A; stroke-width: 2;
- shadow-color: #000000; shadow-opacity: 0.72; shadow-x: 0; shadow-y: 2; shadow-blur: 6;
- background: #00000000; border-color: #00000000; border-width: 0; padding: 0 0; radius: 0;
- karaoke: current; karaoke-transition: step; active-fill: #FFD34A;
- cue-enter: fade; cue-enter-frames: 2; cue-exit: fade; cue-exit-frames: 2;
- }
-</sheet>
diff --git a/examples/all-components-preview/reuse.svrun b/examples/all-components-preview/reuse.svrun
deleted file mode 100644
index 8eddb49f..00000000
--- a/examples/all-components-preview/reuse.svrun
+++ /dev/null
@@ -1,12 +0,0 @@
-<?svml using="@hypit/run-markup@1"?>
-
-<svrun version="1">
- <author source="./main.svml"/>
- <target output="final.video"/>
-
- <!-- The presenter frame this project generated, kept beside the Source so a
- preview shows the real shot without reaching for a Runtime. -->
- <file id="accepted-presenter" type="@hypit/artifact@1#BlobArtifact"
- from="./assets/presenter.png" media-type="image/png"/>
- <satisfy output="presenter.image" candidate="accepted-presenter"/>
-</svrun>
diff --git a/examples/all-components-preview/studio.svrun b/examples/all-components-preview/studio.svrun
deleted file mode 100644
index e526c8b6..00000000
--- a/examples/all-components-preview/studio.svrun
+++ /dev/null
@@ -1,22 +0,0 @@
-<?svml using="@hypit/run-markup@1"?>
-
-<svrun version="1">
- <author source="./main.svml"/>
- <target output="final.video"/>
-
- <!-- Studio opens only from explicit, already materialized projection inputs.
- These two files also make the exact media bytes referenced by the
- SemanticTake candidates available to HyperFrames. -->
- <file id="studio-opening-video" type="@hypit/artifact@1#BlobArtifact"
- from="../../docs/public/regen-ranking/avatar-1.mp4" media-type="video/mp4"/>
- <file id="studio-closing-video" type="@hypit/artifact@1#BlobArtifact"
- from="../../docs/public/regen-ranking/avatar-2.mp4" media-type="video/mp4"/>
-
- <value id="studio-opening-take" type="@hypit/speech@1#SemanticTake"
- from="./fixtures/studio-opening-take.json"/>
- <value id="studio-closing-take" type="@hypit/speech@1#SemanticTake"
- from="./fixtures/studio-closing-take.json"/>
-
- <satisfy output="opening-semantic.take" candidate="studio-opening-take"/>
- <satisfy output="closing-semantic.take" candidate="studio-closing-take"/>
-</svrun>