Skip to content

Commit 425b077

Browse files
committed
fix(skill): audit-found bugs in hyperframes core examples
Three concrete bugs found while auditing PR heygen-com#991: 1. html-in-canvas-patterns.md (heygen-com#1 in catalog, 3D Rotation with Bloom): The code example used `new THREE.EffectComposer(renderer)` UMD-style namespace access while the ESM imports right below pull them in as bare named imports. Three.js r150+ removed the UMD `examples/js/` globals, so as written the example throws `TypeError: THREE.EffectComposer is not a constructor`. Switched to the bare names matching the imports. THREE.Vector2 stays as-is — Vector2 is on the THREE namespace. 2. techniques.md (heygen-com#5, Lottie Animation): The CDN path `@lottiefiles/dotlottie-web/dist/dotlottie-player.js` returns 404. `@lottiefiles/dotlottie-web` is the JavaScript SDK, not a web component — its `main` is `dist/index.cjs`. The web-component package is `@lottiefiles/dotlottie-wc` and the custom element is `<dotlottie-wc>`, not `<dotlottie-player>`. Updated both. 3. techniques.md (5 occurrences across Lottie / lottie-web / Video / @font-face examples): asset paths used the `../capture/` pattern that PR heygen-com#989's `invalid_capture_path` lint rule emits an error for. Replaced all with root-relative `capture/...`. PRs heygen-com#989 and heygen-com#991 are no longer self-contradictory.
1 parent 0ba1df5 commit 425b077

2 files changed

Lines changed: 21 additions & 12 deletions

File tree

skills/hyperframes/references/html-in-canvas-patterns.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,13 @@ var mesh = new THREE.Mesh(
9898
);
9999
scene3d.add(mesh);
100100

101-
// Post-processing: bloom for cinematic glow
102-
var composer = new THREE.EffectComposer(renderer);
103-
composer.addPass(new THREE.RenderPass(scene3d, camera));
104-
composer.addPass(new THREE.UnrealBloomPass(new THREE.Vector2(1920, 1080), 0.3, 0.4, 0.85));
101+
// Post-processing: bloom for cinematic glow.
102+
// EffectComposer / RenderPass / UnrealBloomPass are ES-module named imports
103+
// (see the import block below) — they're NOT properties of THREE in modern
104+
// versions. Three.js r150+ removed the UMD `examples/js/` globals.
105+
var composer = new EffectComposer(renderer);
106+
composer.addPass(new RenderPass(scene3d, camera));
107+
composer.addPass(new UnrealBloomPass(new THREE.Vector2(1920, 1080), 0.3, 0.4, 0.85));
105108

106109
var proxy = { rotY: -0.12, zoom: 4.2 };
107110
tl.to(

skills/hyperframes/references/techniques.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,22 @@ The slide distance DECAYS per word (80→12px) — mimics a camera settling.
188188
Vector animations that play inside a composition. Use for logos, character animations, icons.
189189

190190
```html
191-
<script src="https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-web/dist/dotlottie-player.js"></script>
192-
<dotlottie-player
191+
<!-- The web-component package is `@lottiefiles/dotlottie-wc` (the SDK
192+
`@lottiefiles/dotlottie-web` does NOT expose a custom element).
193+
The element tag is <dotlottie-wc>. -->
194+
<script
195+
src="https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-wc/dist/dotlottie-wc.js"
196+
type="module"
197+
></script>
198+
<dotlottie-wc
193199
class="lottie"
194-
src="../capture/assets/lottie/animation-0.json"
200+
src="capture/assets/lottie/animation-0.json"
195201
autoplay
196202
loop
197203
speed="1.5"
198204
style="width:500px;height:500px;"
199205
>
200-
</dotlottie-player>
206+
</dotlottie-wc>
201207
<script>
202208
gsap.set(".lottie", { scale: 0.3, opacity: 0 });
203209
tl.to(".lottie", { scale: 1, opacity: 1, duration: 0.35, ease: "back.out(1.6)" }, 0.2);
@@ -212,7 +218,7 @@ var anim = lottie.loadAnimation({
212218
renderer: "svg",
213219
loop: false,
214220
autoplay: false,
215-
path: "../capture/assets/lottie/animation-0.json",
221+
path: "capture/assets/lottie/animation-0.json",
216222
});
217223
```
218224

@@ -226,7 +232,7 @@ Embed real video footage inside compositions. Videos must be `muted` with `plays
226232
<div class="video-frame" style="width:680px;height:840px;border-radius:16px;overflow:hidden;">
227233
<video
228234
id="footage"
229-
src="../capture/assets/videos/clip.mp4"
235+
src="capture/assets/videos/clip.mp4"
230236
muted
231237
playsinline
232238
style="width:100%;height:100%;object-fit:cover;"
@@ -285,10 +291,10 @@ Animate font-variation-settings to reshape glyphs in real-time. Works with varia
285291
```html
286292
<style>
287293
/* Load the captured local variable font — do NOT use Google Fonts @import.
288-
Replace this placeholder with an @font-face pointing to ../capture/assets/fonts/. */
294+
Replace this placeholder with an @font-face pointing to capture/assets/fonts/. */
289295
@font-face {
290296
font-family: "Fraunces";
291-
src: url("../capture/assets/fonts/Fraunces-Variable.woff2") format("woff2");
297+
src: url("capture/assets/fonts/Fraunces-Variable.woff2") format("woff2");
292298
font-weight: 100 900;
293299
font-style: normal;
294300
font-display: block;

0 commit comments

Comments
 (0)