hyperframes 0.2.5 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/cli.js +7152 -6407
  2. package/dist/docs/{templates.md → examples.md} +2 -2
  3. package/dist/skills/gsap/SKILL.md +5 -16
  4. package/dist/skills/gsap/references/effects.md +7 -14
  5. package/dist/skills/hyperframes/SKILL.md +124 -43
  6. package/dist/skills/hyperframes/house-style.md +34 -93
  7. package/dist/skills/hyperframes/references/captions.md +2 -2
  8. package/dist/skills/hyperframes/references/css-patterns.md +36 -34
  9. package/dist/skills/hyperframes/references/transitions/catalog.md +4 -19
  10. package/dist/skills/hyperframes/references/transitions/css-other.md +0 -11
  11. package/dist/skills/hyperframes/references/transitions.md +53 -37
  12. package/dist/skills/hyperframes/references/{fonts.md → typography.md} +73 -32
  13. package/dist/skills/hyperframes/scripts/animation-map.mjs +596 -0
  14. package/dist/skills/hyperframes/scripts/contrast-report.mjs +335 -0
  15. package/dist/skills/hyperframes-cli/SKILL.md +1 -1
  16. package/dist/studio/assets/hyperframes-player-eEkqo7g7.js +198 -0
  17. package/dist/studio/assets/index-DZEa45DQ.css +1 -0
  18. package/dist/studio/assets/{index-BkSXiHxK.js → index-Pn53dCTs.js} +27 -224
  19. package/dist/studio/index.html +2 -2
  20. package/dist/templates/_shared/AGENTS.md +59 -0
  21. package/dist/templates/_shared/CLAUDE.md +7 -7
  22. package/package.json +1 -1
  23. package/dist/skills/gsap/references/frameworks.md +0 -56
  24. package/dist/skills/gsap/references/plugins.md +0 -194
  25. package/dist/skills/gsap/references/react.md +0 -80
  26. package/dist/skills/gsap/references/scrolltrigger.md +0 -147
  27. package/dist/skills/gsap/references/utils.md +0 -91
  28. package/dist/skills/hyperframes/references/examples.md +0 -146
  29. package/dist/skills/hyperframes/references/marker-highlight.md +0 -158
  30. package/dist/skills/hyperframes/references/transitions/shader-setup.md +0 -463
  31. package/dist/skills/hyperframes/references/transitions/shader-transitions.md +0 -329
  32. package/dist/studio/assets/index-DHr9yo58.css +0 -1
@@ -1,146 +0,0 @@
1
- # Marker Highlight Examples
2
-
3
- ## Recipes
4
-
5
- ### Underline
6
-
7
- ```html
8
- <mark
9
- data-height="0.15"
10
- data-offset="0.8"
11
- data-padding="0"
12
- data-highlight='{"amplitude":0.2,"wavelength":5,"roughEnds":0}'
13
- data-color="rgba(30, 136, 229, 0.6)"
14
- >important</mark
15
- >
16
- ```
17
-
18
- ### Strikethrough
19
-
20
- ```html
21
- <mark
22
- data-drawing-mode="highlight"
23
- data-height="0.1"
24
- data-offset="0"
25
- data-highlight='{"amplitude":0.1,"wavelength":3}'
26
- data-color="rgba(229, 57, 53, 0.8)"
27
- >wrong answer</mark
28
- >
29
- ```
30
-
31
- ### Circled Annotation
32
-
33
- ```html
34
- <mark
35
- data-drawing-mode="circle"
36
- data-circle='{"curve":0.8,"wobble":0.4,"loops":2,"thickness":3}'
37
- data-animation-speed="1200"
38
- data-color="rgba(229, 57, 53, 0.6)"
39
- >this one</mark
40
- >
41
- ```
42
-
43
- ## Full Example in a Composition
44
-
45
- ```html
46
- <div data-composition-id="highlight-demo" data-width="1920" data-height="1080">
47
- <div
48
- id="content"
49
- style="
50
- position: absolute; inset: 0;
51
- display: flex; align-items: center; justify-content: center;
52
- font-family: 'Bricolage Grotesque', sans-serif; font-size: 72px; color: #fff;
53
- background: #111;
54
- "
55
- >
56
- <p id="hero">
57
- The <mark id="m1" data-color="rgba(255, 220, 50, 0.5)">fastest</mark> way to
58
- <mark
59
- id="m2"
60
- data-drawing-mode="circle"
61
- data-circle='{"curve":0.8,"wobble":0.3,"loops":2,"thickness":3}'
62
- data-color="rgba(229, 57, 53, 0.6)"
63
- >ship</mark
64
- >
65
- </p>
66
- </div>
67
-
68
- <style>
69
- [data-composition-id="highlight-demo"] mark {
70
- background-color: transparent;
71
- color: inherit;
72
- }
73
- </style>
74
-
75
- <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
76
- <script src="marker-highlight.global.js"></script>
77
- <script>
78
- window.__timelines = window.__timelines || {};
79
- var tl = gsap.timeline({ paused: true });
80
-
81
- // Set colors via data attribute (no visible flash)
82
- document.querySelectorAll("mark[data-color]").forEach(function (m) {
83
- m.setAttribute("data-original-bgcolor", m.getAttribute("data-color"));
84
- });
85
-
86
- // Init once after fonts, then hide all canvases
87
- var hl;
88
- document.fonts.ready.then(function () {
89
- setTimeout(function () {
90
- hl = new MarkerHighlighter(document.getElementById("hero"), {
91
- animate: false,
92
- animationSpeed: 800,
93
- padding: 0.3,
94
- highlight: { amplitude: 0.3, wavelength: 5 },
95
- });
96
- setTimeout(function () {
97
- document.querySelectorAll(".highlight").forEach(function (d) {
98
- d.style.opacity = "0";
99
- });
100
- }, 100);
101
- }, 50);
102
- });
103
-
104
- function addHighlight(markId, time) {
105
- tl.to(
106
- {},
107
- {
108
- duration: 0.001,
109
- onStart: function () {
110
- var mark = document.getElementById(markId);
111
- var ref = mark.getAttribute("data-mark-ref");
112
- if (!ref || !hl) return;
113
- mark.parentElement
114
- .querySelectorAll('.highlight[data-mark-id="' + ref + '"]')
115
- .forEach(function (div) {
116
- var c = div.querySelector("canvas");
117
- if (c) c.getContext("2d").clearRect(0, 0, c.width, c.height);
118
- div.style.opacity = "1";
119
- });
120
- hl.reanimateMark(mark);
121
- },
122
- onReverseComplete: function () {
123
- var mark = document.getElementById(markId);
124
- var ref = mark.getAttribute("data-mark-ref");
125
- if (!ref) return;
126
- mark.parentElement
127
- .querySelectorAll('.highlight[data-mark-id="' + ref + '"]')
128
- .forEach(function (div) {
129
- div.style.opacity = "0";
130
- });
131
- },
132
- },
133
- time,
134
- );
135
- }
136
-
137
- gsap.set("#hero", { opacity: 0 });
138
- tl.to("#hero", { opacity: 1, duration: 0.6 }, 0);
139
-
140
- addHighlight("m1", 0.8);
141
- addHighlight("m2", 1.6);
142
-
143
- window.__timelines["highlight-demo"] = tl;
144
- </script>
145
- </div>
146
- ```
@@ -1,158 +0,0 @@
1
- # Marker Highlight
2
-
3
- Animated canvas-based text highlighting using MarkerHighlight.js. Wraps text in `<mark>` tags and renders effects (marker pen, circle, burst, scribble, sketchout) on a canvas overlay without modifying text DOM.
4
-
5
- The library runs its own requestAnimationFrame loop — **not** GSAP-driven. Use `tl.call()` to trigger at specific timeline points.
6
-
7
- ## Required Script
8
-
9
- Download and convert to global script:
10
-
11
- ```bash
12
- curl -sL "https://cdn.jsdelivr.net/gh/Robincodes-Sandbox/marker-highlight@main/dist/marker-highlight.min.js" \
13
- | sed 's/export{[^}]*};$/window.MarkerHighlighter=W;/' > marker-highlight.global.js
14
- ```
15
-
16
- ```html
17
- <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
18
- <script src="marker-highlight.global.js"></script>
19
- ```
20
-
21
- ## Color Setup
22
-
23
- Set via `data-color`, copy to `data-original-bgcolor` before constructing. Never set `background-color` in CSS.
24
-
25
- ```css
26
- mark {
27
- color: inherit;
28
- background-color: transparent;
29
- }
30
- ```
31
-
32
- ```html
33
- <mark id="m1" data-color="rgba(255, 220, 50, 0.5)">highlighted</mark>
34
- ```
35
-
36
- ```js
37
- document
38
- .querySelectorAll("mark[data-color]")
39
- .forEach((m) => m.setAttribute("data-original-bgcolor", m.getAttribute("data-color")));
40
- ```
41
-
42
- ## GSAP Integration Pattern
43
-
44
- ONE MarkerHighlighter per container with `animate: false`, hide all canvases, then clear+show+reanimate per mark at trigger time.
45
-
46
- ```js
47
- var hl = new MarkerHighlighter(document.getElementById("text-container"), {
48
- animate: false,
49
- animationSpeed: 800,
50
- padding: 0.3,
51
- highlight: { amplitude: 0.3, wavelength: 5 },
52
- });
53
-
54
- setTimeout(function () {
55
- document.querySelectorAll(".highlight").forEach((div) => (div.style.opacity = "0"));
56
- }, 100);
57
-
58
- function addHighlight(highlighter, markId, time) {
59
- tl.to(
60
- {},
61
- {
62
- duration: 0.001,
63
- onStart: function () {
64
- var mark = document.getElementById(markId);
65
- var ref = mark.getAttribute("data-mark-ref");
66
- var divs = mark.parentElement.querySelectorAll('.highlight[data-mark-id="' + ref + '"]');
67
- divs.forEach(function (div) {
68
- var canvas = div.querySelector("canvas");
69
- if (canvas) canvas.getContext("2d").clearRect(0, 0, canvas.width, canvas.height);
70
- div.style.opacity = "1";
71
- });
72
- highlighter.reanimateMark(mark);
73
- },
74
- onReverseComplete: function () {
75
- var mark = document.getElementById(markId);
76
- var ref = mark.getAttribute("data-mark-ref");
77
- mark.parentElement
78
- .querySelectorAll('.highlight[data-mark-id="' + ref + '"]')
79
- .forEach((div) => (div.style.opacity = "0"));
80
- },
81
- },
82
- time,
83
- );
84
- }
85
-
86
- addHighlight(hl, "m1", 1.0);
87
- ```
88
-
89
- ## Drawing Modes
90
-
91
- | Mode | Effect | Best for |
92
- | ----------- | ---------------------------- | -------------------------- |
93
- | `highlight` | Wavy marker stroke (default) | Phrases, key terms |
94
- | `circle` | Hand-drawn ellipse | Single words, annotations |
95
- | `burst` | Radiating lines/curves/puffs | Excitement, energy |
96
- | `scribble` | Chaotic scribble | Crossing out, messy energy |
97
- | `sketchout` | Rough rectangle outline | Boxed callouts, blueprint |
98
-
99
- ```html
100
- <mark data-drawing-mode="circle" data-color="rgba(229, 57, 53, 0.6)">critical</mark>
101
- <mark
102
- data-drawing-mode="burst"
103
- data-burst='{"style":"cloud","count":20}'
104
- data-color="rgba(255, 220, 50, 0.5)"
105
- >amazing</mark
106
- >
107
- ```
108
-
109
- ## Configuration
110
-
111
- ### Global (constructor)
112
-
113
- | Option | Default | Description |
114
- | ---------------- | ------------- | ------------------------- |
115
- | `animate` | `true` | `false` to defer for GSAP |
116
- | `animationSpeed` | `5000` | Duration in ms |
117
- | `drawingMode` | `"highlight"` | Default mode |
118
- | `height` | `1` | Relative to line height |
119
- | `offset` | `0` | Vertical shift |
120
- | `padding` | `0` | Horizontal padding |
121
-
122
- ### Per-Mode
123
-
124
- **highlight**: `amplitude` (0.25), `wavelength` (1), `roughEnds` (5), `jitter` (0.1)
125
- **circle**: `curve` (0.5), `wobble` (0.3), `loops` (3), `thickness` (5)
126
- **burst**: `style` ("lines"/"curve"/"cloud"), `count` (10), `power` (1), `randomness` (0.5)
127
-
128
- ### Named Styles
129
-
130
- ```js
131
- MarkerHighlighter.defineStyle("underline", {
132
- animationSpeed: 400,
133
- height: 0.15,
134
- offset: 0.8,
135
- padding: 0,
136
- highlight: { amplitude: 0.2, wavelength: 5, roughEnds: 0 },
137
- });
138
- ```
139
-
140
- ## Mode-to-Caption Energy Mapping
141
-
142
- | Energy | Mode | Use for |
143
- | ----------- | --------------------- | ------------------- |
144
- | High | `burst` + `highlight` | Launches, hype |
145
- | Medium-high | `circle` | Key stats, terms |
146
- | Medium | `highlight` | Standard emphasis |
147
- | Medium-low | `scribble` | Subtle, tutorials |
148
- | Low | `sketchout` | Contrast, blueprint |
149
-
150
- ## Notes
151
-
152
- - One highlighter per container (clears all `.highlight` divs on init)
153
- - Canvas pre-draw + clear pattern for clean reveals
154
- - rAF-based — not seekable mid-stroke
155
- - Use `onReverseComplete` for rewind support
156
-
157
- For CSS+GSAP fallback (no library, fully seekable), see [css-patterns.md](css-patterns.md).
158
- For full examples, see [examples.md](examples.md).