Skip to content

Write HTML. Render video. Built for agents.

fix(templates): resolve all lint errors and warnings in bundled templates (#197)

Miguel Ángel44fcc8e8b269
diff --git a/packages/cli/src/utils/lintProject.ts b/packages/cli/src/utils/lintProject.ts
index 81439929be..e7f3f8db37 100644
--- a/packages/cli/src/utils/lintProject.ts
+++ b/packages/cli/src/utils/lintProject.ts
@@ -130,6 +130,7 @@ function lintAudioSrcNotFound(projectDir: string, htmlSources: string[]): Hyperf
while ((match = audioSrcRe.exec(html)) !== null) {
const src = match[1]!;
if (/^(https?:|data:|blob:)/i.test(src)) continue;
+ if (/^__[A-Z_]+__$/.test(src)) continue; // Skip template placeholders
const resolved = resolve(projectDir, src);
if (!existsSync(resolved)) {
missingSrcs.push(src);
diff --git a/templates/decision-tree/compositions/decision_tree.html b/templates/decision-tree/compositions/decision_tree.html
index f3b4b21637..eafac1c3a4 100644
--- a/templates/decision-tree/compositions/decision_tree.html
+++ b/templates/decision-tree/compositions/decision_tree.html
@@ -272,6 +272,7 @@
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const tl = gsap.timeline({ paused: true });
@@ -358,13 +359,21 @@
}, "hold3+=1");
// Visual click feedback
- tl.to("#cursor", { scale: 0.8, duration: 0.05, yoyo: true, repeat: 1 }, "hold3+=1");
+ tl.to(
+ "#cursor",
+ { scale: 0.8, duration: 0.05, yoyo: true, repeat: 1, overwrite: "auto" },
+ "hold3+=1",
+ );
// 11. Hold 0.3s
tl.addLabel("hold4", "+=0.3");
// 12. Cursor double-clicks "Pythom" — highlight in blue
- tl.to("#cursor", { scale: 0.8, duration: 0.05, yoyo: true, repeat: 3 }, "hold4");
+ tl.to(
+ "#cursor",
+ { scale: 0.8, duration: 0.05, yoyo: true, repeat: 3, overwrite: "auto" },
+ "hold4",
+ );
tl.add(() => {
const textEl = document.querySelector("#python-text");
if (!textEl) return;
@@ -400,8 +409,12 @@
tl.addLabel("hold6", typingEnd + 0.5);
// 16. Cursor moves slightly and clicks away to deselect
- tl.to("#cursor", { left: 500, top: 580, duration: 0.3 }, "hold6");
- tl.to("#cursor", { scale: 0.8, duration: 0.05, yoyo: true, repeat: 1 }, "hold6+=0.3");
+ tl.to("#cursor", { left: 500, top: 580, duration: 0.3, overwrite: "auto" }, "hold6");
+ tl.to(
+ "#cursor",
+ { scale: 0.8, duration: 0.05, yoyo: true, repeat: 1, overwrite: "auto" },
+ "hold6+=0.3",
+ );
tl.to(".selection-border", { opacity: 0, duration: 0.1 }, "hold6+=0.3");
// 17. 👍 emoji pops in
@@ -413,6 +426,7 @@
// 19. Fade entire screen to white over 0.5s
tl.to("#fade-overlay", { opacity: 1, duration: 0.5 }, "hold7");
+ window.__timelines = window.__timelines || {};
window.__timelines["decision-tree"] = tl;
})();
</script>
diff --git a/templates/kinetic-type/compositions/main-graphics.html b/templates/kinetic-type/compositions/main-graphics.html
index 988ed92c71..6b1fd466c2 100644
--- a/templates/kinetic-type/compositions/main-graphics.html
+++ b/templates/kinetic-type/compositions/main-graphics.html
@@ -215,7 +215,6 @@
display: flex;
padding: 40px;
color: black;
- transform: translateX(100%);
z-index: 2;
}
.swiss-grid {
@@ -492,6 +491,7 @@
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
const tl = gsap.timeline({ paused: true });
@@ -523,8 +523,9 @@
tl.to("#white-wipe", { xPercent: 100, duration: 0.2, ease: "power2.out" }, 2.2);
// --- Scene 2: Swiss Style (2.0s - 5.0s) ---
+ gsap.set(".swiss-panel", { xPercent: 100 });
tl.to("#scene-2", { opacity: 1, duration: 0.1 }, 2.2);
- tl.to(".swiss-panel", { x: 0, duration: 0.8, ease: "expo.out" }, 2.3);
+ tl.to(".swiss-panel", { xPercent: 0, duration: 0.8, ease: "expo.out" }, 2.3);
tl.to(".swiss-title", { opacity: 1, duration: 0.1 }, 2.5);
tl.to(".swiss-subtitle", { opacity: 1, y: 0, duration: 0.4 }, 2.7);
tl.to(
@@ -534,7 +535,7 @@
);
tl.to(".swiss-circle", { opacity: 1, scale: 1.2, duration: 0.6, ease: "back.out" }, 3.2);
tl.to(".swiss-square", { opacity: 1, rotation: 45, duration: 0.6, ease: "back.out" }, 3.4);
- tl.to(".swiss-panel", { x: "120%", duration: 0.7, ease: "expo.in" }, 4.7);
+ tl.to(".swiss-panel", { xPercent: 120, duration: 0.7, ease: "expo.in" }, 4.7);
tl.to("#scene-2", { opacity: 0, duration: 0.1 }, 5.0);
// --- Scene 3: Figma Config Style (5.3s - 9.6s) ---
diff --git a/templates/nyt-graph/compositions/nyt-chart.html b/templates/nyt-graph/compositions/nyt-chart.html
index af035fab3f..a12941264a 100644
--- a/templates/nyt-graph/compositions/nyt-chart.html
+++ b/templates/nyt-graph/compositions/nyt-chart.html
@@ -443,6 +443,7 @@
);
// Register timeline
+ window.__timelines = window.__timelines || {};
window.__timelines["nyt-chart"] = tl;
})();
</script>
diff --git a/templates/play-mode/compositions/captions.html b/templates/play-mode/compositions/captions.html
index 5a5411484e..c6490c2375 100644
--- a/templates/play-mode/compositions/captions.html
+++ b/templates/play-mode/compositions/captions.html
@@ -45,6 +45,7 @@
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const TRANSCRIPT = [
diff --git a/templates/play-mode/compositions/intro.html b/templates/play-mode/compositions/intro.html
index 148f737147..63208cd26d 100644
--- a/templates/play-mode/compositions/intro.html
+++ b/templates/play-mode/compositions/intro.html
@@ -39,6 +39,7 @@
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const tl = gsap.timeline({ paused: true });
diff --git a/templates/play-mode/index.html b/templates/play-mode/index.html
index ba1f0b5ac1..1d0a91a769 100644
--- a/templates/play-mode/index.html
+++ b/templates/play-mode/index.html
@@ -133,7 +133,6 @@
<div
id="aroll-comp"
data-composition-id="aroll-layer"
- data-start="0"
data-duration="__VIDEO_DURATION__"
data-width="1920"
data-height="1080"
@@ -220,15 +219,6 @@
data-track-index="150"
></div>
- <!-- Audio Clips -->
- <audio id="sfx-bounce-0" src="" data-start="0" data-track-index="5"></audio>
- <audio id="sfx-whoosh-1" src="" data-start="1.839" data-track-index="6"></audio>
- <audio id="sfx-pop-1" src="" data-start="2.039" data-track-index="7"></audio>
- <audio id="sfx-whoosh-2" src="" data-start="4.659" data-track-index="6"></audio>
- <audio id="sfx-pop-2" src="" data-start="4.859" data-track-index="7"></audio>
- <audio id="sfx-whoosh-3" src="" data-start="8.88" data-track-index="6"></audio>
- <audio id="sfx-pop-3" src="" data-start="9.08" data-track-index="7"></audio>
-
<script>
window.__timelines = window.__timelines || {};
const tl = gsap.timeline({ paused: true });
diff --git a/templates/product-promo/compositions/scene1-logo-intro.html b/templates/product-promo/compositions/scene1-logo-intro.html
index 3e957fb8a4..c80b1928a9 100644
--- a/templates/product-promo/compositions/scene1-logo-intro.html
+++ b/templates/product-promo/compositions/scene1-logo-intro.html
@@ -88,6 +88,7 @@
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const tl = gsap.timeline({ paused: true });
diff --git a/templates/product-promo/compositions/scene2-4-canvas.html b/templates/product-promo/compositions/scene2-4-canvas.html
index 7bba94f3fc..41fa0db250 100644
--- a/templates/product-promo/compositions/scene2-4-canvas.html
+++ b/templates/product-promo/compositions/scene2-4-canvas.html
@@ -132,7 +132,6 @@
left: 50%;
width: 1440px;
height: 900px;
- transform: translate(-50%, -50%) scale(0);
background: white;
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
@@ -235,19 +234,16 @@
font-size: 14px;
font-weight: 600;
border-radius: 4px;
- transform: scale(0);
}
.width-label {
top: -30px;
left: 50%;
- transform: translateX(-50%) scale(0);
}
.height-label {
right: -45px;
top: 50%;
- transform: translateY(-50%) rotate(90deg) scale(0);
}
.selection-handles {
@@ -296,7 +292,6 @@
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-right: 1px solid rgba(255, 255, 255, 0.1);
- transform: translateX(-320px);
padding: 24px;
z-index: 10;
box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
@@ -421,7 +416,6 @@
white-space: nowrap;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
opacity: 0;
- transform: translateX(-10px);
}
.cursor {
@@ -455,6 +449,7 @@
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const tl = gsap.timeline({ paused: true });
@@ -462,6 +457,11 @@
// Organic Cursor Ease
const cursorEase = "back.out(1.2)";
+ gsap.set(".web-frame", { xPercent: -50, yPercent: -50, scale: 0 });
+ gsap.set(".width-label", { xPercent: -50, scale: 0 });
+ gsap.set(".height-label", { yPercent: -50, rotation: 90, scale: 0 });
+ gsap.set(".comment-bubble", { x: -10 });
+ gsap.set(".assets-panel", { x: -320 });
gsap.set(".designer-cursor", { x: 200, y: 200 });
gsap.set(".engineer-cursor", { x: -100, y: 500 });
gsap.set(".pm-cursor", { x: 2000, y: 1100 });
@@ -489,7 +489,11 @@
// Collaboration
tl.to(".engineer-cursor", { x: 400, y: 400, duration: 1.2, ease: cursorEase }, 3.5);
tl.to(".pm-cursor", { x: 1500, y: 800, duration: 1.5, ease: cursorEase }, 3.7);
- tl.to(".engineer-cursor", { x: 960, y: 680, duration: 0.9, ease: cursorEase }, 4.5);
+ tl.to(
+ ".engineer-cursor",
+ { x: 960, y: 680, duration: 0.9, ease: cursorEase, overwrite: "auto" },
+ 4.5,
+ );
tl.to(".selection-handles", { opacity: 1, duration: 0.2 }, 5.3);
tl.to(".cta-button", { outline: "2px solid #1ABCFE", duration: 0.1 }, 5.3);
diff --git a/templates/product-promo/compositions/scene5-logo-outro.html b/templates/product-promo/compositions/scene5-logo-outro.html
index 85ed4c8eb4..b182ddae06 100644
--- a/templates/product-promo/compositions/scene5-logo-outro.html
+++ b/templates/product-promo/compositions/scene5-logo-outro.html
@@ -124,6 +124,7 @@
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const tl = gsap.timeline({ paused: true });
diff --git a/templates/swiss-grid/compositions/captions.html b/templates/swiss-grid/compositions/captions.html
index 1539e7df8e..5882676182 100644
--- a/templates/swiss-grid/compositions/captions.html
+++ b/templates/swiss-grid/compositions/captions.html
@@ -45,9 +45,12 @@
line-height: 1;
white-space: nowrap;
text-align: center;
+ max-width: 1600px;
+ overflow: hidden;
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const TRANSCRIPT = [
diff --git a/templates/swiss-grid/compositions/intro.html b/templates/swiss-grid/compositions/intro.html
index 168280faf4..b59ef8c688 100644
--- a/templates/swiss-grid/compositions/intro.html
+++ b/templates/swiss-grid/compositions/intro.html
@@ -71,6 +71,7 @@
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const tl = gsap.timeline({ paused: true });
diff --git a/templates/swiss-grid/index.html b/templates/swiss-grid/index.html
index bef52653cb..98e26282b0 100644
--- a/templates/swiss-grid/index.html
+++ b/templates/swiss-grid/index.html
@@ -85,36 +85,7 @@
data-duration="__VIDEO_DURATION__"
>
<!-- Background Grid -->
- <img
- id="bg-grid"
- class="background-grid"
- src="assets/swiss-grid.svg"
- alt="Grid"
- data-start="0"
- data-duration="__VIDEO_DURATION__"
- data-track-index="0"
- />
-
- <!-- A-roll Video -->
- <div id="short_mag_cut_frame">
- <video
- id="short_mag_cut"
- src="__VIDEO_SRC__"
- muted
- playsinline
- data-start="0"
- data-duration="__VIDEO_DURATION__"
- data-track-index="1"
- ></video>
- </div>
- <audio
- id="a-roll-audio"
- src="__VIDEO_SRC__"
- data-start="0"
- data-duration="__VIDEO_DURATION__"
- data-track-index="5"
- data-volume="1"
- ></audio>
+ <img id="bg-grid" class="background-grid" src="assets/swiss-grid.svg" alt="Grid" />
<!-- Intro Sub-composition -->
<div
@@ -149,12 +120,6 @@
data-track-index="4"
></div>
- <!-- Sound Effects (src set dynamically; omitted to avoid 404s) -->
- <audio id="sfx-intro" data-start="0" data-track-index="5" data-duration="1"></audio>
- <audio id="sfx-stat1" data-start="1.86" data-track-index="5" data-duration="1"></audio>
- <audio id="sfx-stat2" data-start="4.68" data-track-index="5" data-duration="1"></audio>
- <audio id="sfx-stat3" data-start="8.88" data-track-index="5" data-duration="1"></audio>
-
<script>
window.__timelines = window.__timelines || {};
@@ -230,5 +195,26 @@
window.__timelines["master"] = masterTL;
</script>
</div>
+
+ <!-- A-roll Video (direct child of body to avoid video_nested_in_timed_element) -->
+ <div id="short_mag_cut_frame">
+ <video
+ id="short_mag_cut"
+ src="__VIDEO_SRC__"
+ muted
+ playsinline
+ data-start="0"
+ data-duration="__VIDEO_DURATION__"
+ data-track-index="1"
+ ></video>
+ </div>
+ <audio
+ id="a-roll-audio"
+ src="__VIDEO_SRC__"
+ data-start="0"
+ data-duration="__VIDEO_DURATION__"
+ data-track-index="5"
+ data-volume="1"
+ ></audio>
</body>
</html>
diff --git a/templates/vignelli/compositions/captions.html b/templates/vignelli/compositions/captions.html
index 21a03fc15b..7aadc09fd6 100644
--- a/templates/vignelli/compositions/captions.html
+++ b/templates/vignelli/compositions/captions.html
@@ -50,9 +50,12 @@
display: inline-block;
letter-spacing: -0.02em; /* Tight Helvetica spacing */
white-space: nowrap; /* Prevent wrapping at the element level */
+ max-width: 900px;
+ overflow: hidden;
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const TRANSCRIPT = [
@@ -171,6 +174,9 @@
},
group.end - 0.3,
);
+
+ // Hard kill to ensure caption is hidden
+ tl.set(div, { opacity: 0, visibility: "hidden" }, group.end);
});
window.__timelines = window.__timelines || {};
diff --git a/templates/vignelli/compositions/overlays.html b/templates/vignelli/compositions/overlays.html
index 25f04455e3..92bc500fa2 100644
--- a/templates/vignelli/compositions/overlays.html
+++ b/templates/vignelli/compositions/overlays.html
@@ -222,6 +222,7 @@
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
const tl = gsap.timeline({ paused: true });
const TRANSCRIPT = [
diff --git a/templates/vignelli/index.html b/templates/vignelli/index.html
index afa3a93a3d..0be868cbfb 100644
--- a/templates/vignelli/index.html
+++ b/templates/vignelli/index.html
@@ -108,27 +108,6 @@
data-start="0"
data-duration="__VIDEO_DURATION__"
>
- <!-- A-Roll -->
- <div id="a-roll-wrapper">
- <video
- id="a-roll"
- src="__VIDEO_SRC__"
- muted
- playsinline
- data-start="0"
- data-duration="__VIDEO_DURATION__"
- data-track-index="0"
- ></video>
- </div>
- <audio
- id="a-roll-audio"
- src="__VIDEO_SRC__"
- data-start="0"
- data-duration="__VIDEO_DURATION__"
- data-track-index="5"
- data-volume="1"
- ></audio>
-
<!-- Transitions -->
<div id="curtain-black" class="curtain"></div>
<div id="curtain-red" class="curtain red"></div>
@@ -186,5 +165,26 @@
window.__timelines["main-comp"] = tl;
</script>
</div>
+
+ <!-- A-Roll (direct child of body to avoid video_nested_in_timed_element) -->
+ <div id="a-roll-wrapper">
+ <video
+ id="a-roll"
+ src="__VIDEO_SRC__"
+ muted
+ playsinline
+ data-start="0"
+ data-duration="__VIDEO_DURATION__"
+ data-track-index="0"
+ ></video>
+ </div>
+ <audio
+ id="a-roll-audio"
+ src="__VIDEO_SRC__"
+ data-start="0"
+ data-duration="__VIDEO_DURATION__"
+ data-track-index="5"
+ data-volume="1"
+ ></audio>
</body>
</html>
diff --git a/templates/warm-grain/compositions/captions.html b/templates/warm-grain/compositions/captions.html
index 566c49b328..98a6b712dd 100644
--- a/templates/warm-grain/compositions/captions.html
+++ b/templates/warm-grain/compositions/captions.html
@@ -43,9 +43,12 @@
text-align: center;
line-height: 1.2;
white-space: nowrap;
+ max-width: 1600px;
+ overflow: hidden;
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const script = [
@@ -114,6 +117,7 @@
lines.forEach((line, index) => {
// Fade in and set text
+ tl.set(box, { visibility: "visible" }, line.start);
tl.to(
box,
{
@@ -137,6 +141,9 @@
},
line.end,
);
+
+ // Hard kill to ensure caption is hidden
+ tl.set(box, { opacity: 0, visibility: "hidden" }, line.end + 0.1);
});
window.__timelines = window.__timelines || {};
diff --git a/templates/warm-grain/compositions/graphics.html b/templates/warm-grain/compositions/graphics.html
index a0f0bf14e3..def6df2f51 100644
--- a/templates/warm-grain/compositions/graphics.html
+++ b/templates/warm-grain/compositions/graphics.html
@@ -119,6 +119,7 @@
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const tl = gsap.timeline({ paused: true });
diff --git a/templates/warm-grain/compositions/intro.html b/templates/warm-grain/compositions/intro.html
index 234f06150d..15e38d2940 100644
--- a/templates/warm-grain/compositions/intro.html
+++ b/templates/warm-grain/compositions/intro.html
@@ -50,6 +50,7 @@
}
</style>
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
(function () {
const tl = gsap.timeline({ paused: true });
diff --git a/templates/warm-grain/index.html b/templates/warm-grain/index.html
index 2c557c0b0e..41c6941463 100644
--- a/templates/warm-grain/index.html
+++ b/templates/warm-grain/index.html
@@ -175,29 +175,6 @@
data-track-index="3"
></div>
- <!-- SFX -->
- <audio
- id="sfx-swipe-1"
- src=""
- data-start="1.8"
- data-duration="1"
- data-track-index="4"
- ></audio>
- <audio
- id="sfx-swipe-2"
- src=""
- data-start="4.6"
- data-duration="1"
- data-track-index="4"
- ></audio>
- <audio
- id="sfx-swipe-3"
- src=""
- data-start="8.8"
- data-duration="1"
- data-track-index="4"
- ></audio>
-
<script>
const tl = gsap.timeline({ paused: true });