dotquilt 0.0.0-stage → 0.1.0

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 (183) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -2
  3. package/dist/animations.d.ts +105 -0
  4. package/dist/animations.js +107 -0
  5. package/dist/catalog-styles.d.ts +4 -0
  6. package/dist/catalog-styles.js +12 -0
  7. package/dist/chart-animations.d.ts +36 -0
  8. package/dist/chart-animations.js +25 -0
  9. package/dist/chart-styles.d.ts +3 -0
  10. package/dist/chart-styles.js +23 -0
  11. package/dist/chart.css +4 -0
  12. package/dist/chart.d.ts +73 -0
  13. package/dist/chart.js +80 -0
  14. package/dist/circle.css +5 -0
  15. package/dist/index.d.ts +11 -0
  16. package/dist/index.js +9 -0
  17. package/dist/internal/binding.d.ts +13 -0
  18. package/dist/internal/binding.js +21 -0
  19. package/dist/internal/capture.d.ts +4 -0
  20. package/dist/internal/capture.js +13 -0
  21. package/dist/internal/chart-appearance.d.ts +12 -0
  22. package/dist/internal/chart-appearance.js +2 -0
  23. package/dist/internal/chart-definitions.d.ts +19 -0
  24. package/dist/internal/chart-definitions.js +149 -0
  25. package/dist/internal/chart-factory.d.ts +12 -0
  26. package/dist/internal/chart-factory.js +31 -0
  27. package/dist/internal/chart-field.d.ts +22 -0
  28. package/dist/internal/chart-field.js +74 -0
  29. package/dist/internal/chart-idle.d.ts +3 -0
  30. package/dist/internal/chart-idle.js +96 -0
  31. package/dist/internal/chart-math.d.ts +8 -0
  32. package/dist/internal/chart-math.js +19 -0
  33. package/dist/internal/chart-participant.d.ts +8 -0
  34. package/dist/internal/chart-participant.js +4 -0
  35. package/dist/internal/chart-projection.d.ts +11 -0
  36. package/dist/internal/chart-projection.js +69 -0
  37. package/dist/internal/content-box.d.ts +11 -0
  38. package/dist/internal/content-box.js +36 -0
  39. package/dist/internal/coordinated-handoff.d.ts +4 -0
  40. package/dist/internal/coordinated-handoff.js +158 -0
  41. package/dist/internal/count.d.ts +3 -0
  42. package/dist/internal/count.js +20 -0
  43. package/dist/internal/defaults.d.ts +11 -0
  44. package/dist/internal/defaults.js +11 -0
  45. package/dist/internal/dense/managed-painter.d.ts +4 -0
  46. package/dist/internal/dense/managed-painter.js +361 -0
  47. package/dist/internal/dense/runner.d.ts +2 -0
  48. package/dist/internal/dense/runner.js +5 -0
  49. package/dist/internal/dense-loader.d.ts +83 -0
  50. package/dist/internal/dense-loader.js +331 -0
  51. package/dist/internal/dissolve.d.ts +27 -0
  52. package/dist/internal/dissolve.js +216 -0
  53. package/dist/internal/dom.d.ts +23 -0
  54. package/dist/internal/dom.js +104 -0
  55. package/dist/internal/effect.d.ts +2 -0
  56. package/dist/internal/effect.js +17 -0
  57. package/dist/internal/element.d.ts +89 -0
  58. package/dist/internal/element.js +384 -0
  59. package/dist/internal/event-element.d.ts +8 -0
  60. package/dist/internal/event-element.js +20 -0
  61. package/dist/internal/frames.d.ts +1 -0
  62. package/dist/internal/frames.js +51 -0
  63. package/dist/internal/handoff.d.ts +56 -0
  64. package/dist/internal/handoff.js +102 -0
  65. package/dist/internal/ledger.d.ts +13 -0
  66. package/dist/internal/ledger.js +78 -0
  67. package/dist/internal/loading-controller.d.ts +62 -0
  68. package/dist/internal/loading-controller.js +694 -0
  69. package/dist/internal/marks.d.ts +153 -0
  70. package/dist/internal/marks.js +227 -0
  71. package/dist/internal/math.d.ts +2 -0
  72. package/dist/internal/math.js +2 -0
  73. package/dist/internal/morph-marks.d.ts +62 -0
  74. package/dist/internal/morph-marks.js +205 -0
  75. package/dist/internal/morph.d.ts +35 -0
  76. package/dist/internal/morph.js +488 -0
  77. package/dist/internal/paint.d.ts +29 -0
  78. package/dist/internal/paint.js +1 -0
  79. package/dist/internal/painter.d.ts +20 -0
  80. package/dist/internal/painter.js +155 -0
  81. package/dist/internal/preset-data.d.ts +12 -0
  82. package/dist/internal/preset-data.js +31 -0
  83. package/dist/internal/preset.d.ts +22 -0
  84. package/dist/internal/preset.js +86 -0
  85. package/dist/internal/pulse.d.ts +7 -0
  86. package/dist/internal/pulse.js +74 -0
  87. package/dist/internal/reveal-effect.d.ts +7 -0
  88. package/dist/internal/reveal-effect.js +24 -0
  89. package/dist/internal/reveal.d.ts +5 -0
  90. package/dist/internal/reveal.js +11 -0
  91. package/dist/internal/runner.d.ts +9 -0
  92. package/dist/internal/runner.js +70 -0
  93. package/dist/internal/services.d.ts +12 -0
  94. package/dist/internal/services.js +159 -0
  95. package/dist/internal/skeleton-handoff.d.ts +26 -0
  96. package/dist/internal/skeleton-handoff.js +6 -0
  97. package/dist/internal/skeleton-source.d.ts +5 -0
  98. package/dist/internal/skeleton-source.js +106 -0
  99. package/dist/internal/surface.d.ts +4 -0
  100. package/dist/internal/surface.js +21 -0
  101. package/dist/internal/table-definitions.d.ts +27 -0
  102. package/dist/internal/table-definitions.js +139 -0
  103. package/dist/internal/table-factory.d.ts +12 -0
  104. package/dist/internal/table-factory.js +44 -0
  105. package/dist/internal/table-field.d.ts +12 -0
  106. package/dist/internal/table-field.js +75 -0
  107. package/dist/internal/table-model.d.ts +21 -0
  108. package/dist/internal/table-model.js +117 -0
  109. package/dist/internal/table-projection.d.ts +7 -0
  110. package/dist/internal/table-projection.js +110 -0
  111. package/dist/internal/target-changes.d.ts +3 -0
  112. package/dist/internal/target-changes.js +2 -0
  113. package/dist/internal/target-tracker.d.ts +18 -0
  114. package/dist/internal/target-tracker.js +33 -0
  115. package/dist/internal/targets.d.ts +3 -0
  116. package/dist/internal/targets.js +15 -0
  117. package/dist/internal/text-definitions.d.ts +141 -0
  118. package/dist/internal/text-definitions.js +228 -0
  119. package/dist/internal/text-glyphs.d.ts +4 -0
  120. package/dist/internal/text-glyphs.js +32 -0
  121. package/dist/internal/text-morph.d.ts +32 -0
  122. package/dist/internal/text-morph.js +113 -0
  123. package/dist/internal/text-playback.d.ts +4 -0
  124. package/dist/internal/text-playback.js +119 -0
  125. package/dist/internal/text-scramble.d.ts +18 -0
  126. package/dist/internal/text-scramble.js +47 -0
  127. package/dist/internal/time.d.ts +9 -0
  128. package/dist/internal/time.js +13 -0
  129. package/dist/internal/unstyled.d.ts +8 -0
  130. package/dist/internal/unstyled.js +8 -0
  131. package/dist/line.css +5 -0
  132. package/dist/region-css.d.ts +1 -0
  133. package/dist/region-css.js +6 -0
  134. package/dist/region-styles.d.ts +3 -0
  135. package/dist/region-styles.js +15 -0
  136. package/dist/region.css +1 -0
  137. package/dist/region.d.ts +31 -0
  138. package/dist/region.js +100 -0
  139. package/dist/register-all.d.ts +2 -0
  140. package/dist/register-all.js +33 -0
  141. package/dist/server.d.ts +63 -0
  142. package/dist/server.js +141 -0
  143. package/dist/skeleton-animations.d.ts +10 -0
  144. package/dist/skeleton-animations.js +35 -0
  145. package/dist/skeleton-block.d.ts +50 -0
  146. package/dist/skeleton-block.js +260 -0
  147. package/dist/skeleton-circle.d.ts +5 -0
  148. package/dist/skeleton-circle.js +11 -0
  149. package/dist/skeleton-family.css +13 -0
  150. package/dist/skeleton-line.d.ts +5 -0
  151. package/dist/skeleton-line.js +11 -0
  152. package/dist/skeleton-text.css +5 -0
  153. package/dist/skeleton-text.d.ts +22 -0
  154. package/dist/skeleton-text.js +115 -0
  155. package/dist/skeleton.css +4 -0
  156. package/dist/skeleton.d.ts +5 -0
  157. package/dist/skeleton.js +4 -0
  158. package/dist/static-catalog-styles.d.ts +8 -0
  159. package/dist/static-catalog-styles.js +44 -0
  160. package/dist/styles.d.ts +4 -0
  161. package/dist/styles.js +18 -0
  162. package/dist/table-animations.d.ts +11 -0
  163. package/dist/table-animations.js +4 -0
  164. package/dist/table-styles.d.ts +2 -0
  165. package/dist/table-styles.js +12 -0
  166. package/dist/table.css +3 -0
  167. package/dist/table.d.ts +88 -0
  168. package/dist/table.js +126 -0
  169. package/dist/text-animations.d.ts +31 -0
  170. package/dist/text-animations.js +40 -0
  171. package/dist/text-styles.d.ts +3 -0
  172. package/dist/text-styles.js +24 -0
  173. package/dist/text.css +3 -0
  174. package/dist/text.d.ts +42 -0
  175. package/dist/text.js +402 -0
  176. package/dist/types.d.ts +56 -0
  177. package/dist/types.js +18 -0
  178. package/dist/typing-styles.d.ts +1 -0
  179. package/dist/typing-styles.js +7 -0
  180. package/dist/typing.css +4 -0
  181. package/dist/typing.d.ts +35 -0
  182. package/dist/typing.js +164 -0
  183. package/package.json +100 -4
@@ -0,0 +1,228 @@
1
+ import { brand } from './binding.js';
2
+ import { morphTiming } from './marks.js';
3
+ import { clamp } from './math.js';
4
+ import { glyph } from './text-glyphs.js';
5
+ import { textMorphDefinition } from './text-morph.js';
6
+ import { createTextHandoff, createTextRunner } from './text-playback.js';
7
+ function definition(name, phase, implementation) {
8
+ return Object.freeze({
9
+ family: 'text',
10
+ phase,
11
+ id: `dotquilt/${name}`,
12
+ runner: createTextRunner,
13
+ handoff: createTextHandoff,
14
+ ...implementation,
15
+ });
16
+ }
17
+ export function textBinding(definition, options) {
18
+ return Object.freeze({
19
+ contractVersion: 1,
20
+ family: 'text',
21
+ phase: definition.phase,
22
+ id: definition.id,
23
+ options: Object.freeze(options),
24
+ [brand]: definition,
25
+ });
26
+ }
27
+ export const noise = (seed) => Math.abs(Math.sin(seed * 127.1) * 43758.5453) % 1;
28
+ export const randomCharacter = (character, seed) => {
29
+ const pool = /[0-9]/.test(character)
30
+ ? '0123456789'
31
+ : /[a-z]/i.test(character)
32
+ ? 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
33
+ : character;
34
+ return pool[Math.floor(noise(seed) * pool.length)] ?? character;
35
+ };
36
+ function still(context) {
37
+ if (context.surface.input.precise)
38
+ for (const cell of context.surface.input.mask)
39
+ glyph(cell, cell.character, context.dot, 0.4);
40
+ }
41
+ export const scrambleDefinition = /* @__PURE__ */ Object.freeze({
42
+ family: 'text',
43
+ phase: 'idle',
44
+ id: 'dotquilt/scramble',
45
+ runner: createTextRunner,
46
+ still,
47
+ /**
48
+ * design/SPEC.md: each character changes every ~280 ms (with a small
49
+ * per-character offset, so they don't flip together) and cross-fades to
50
+ * the next over 260 ms. A teal glow drifts across every 2.8 s.
51
+ */
52
+ frame(context, options) {
53
+ const { surface } = context;
54
+ if (!surface.input.precise)
55
+ return;
56
+ const time = context.timeMs, period = 1000 / options.changesPerSecond, glowAt = -0.5 + 2 * sineInOut((time / 2800) % 1), width = Math.max(1, surface.width);
57
+ surface.input.mask.forEach((cell, i) => {
58
+ const own = period * (0.75 + ((i * 7) % 5) / 10), step = Math.floor(time / own), k = sineInOut(clamp((time - step * own) / 260));
59
+ // Merge the outgoing and incoming glyphs pixel by pixel.
60
+ const pixels = new Map();
61
+ const add = (dot, weight) => {
62
+ const key = `${dot.x},${dot.y}`, prior = pixels.get(key);
63
+ pixels.set(key, {
64
+ ...dot,
65
+ opacity: (prior?.opacity ?? 0) + dot.opacity * weight,
66
+ });
67
+ };
68
+ glyph(cell, randomCharacter(cell.character, (step - 1) * 83 + i + 1), (dot) => add(dot, 1 - k), 1, 0, 1, true);
69
+ glyph(cell, randomCharacter(cell.character, step * 83 + i + 1), (dot) => add(dot, k), 1, 0, 1, true);
70
+ for (const dot of pixels.values()) {
71
+ context.dot(dot);
72
+ const d = ((dot.x / width) * 0.8 + 0.1 - glowAt) / 0.2, glow = d < -3.2 || d > 3.2 ? 0 : Math.exp(-d * d);
73
+ if (glow * dot.opacity >= 0.02)
74
+ context.dot({
75
+ ...dot,
76
+ opacity: glow * dot.opacity,
77
+ tone: 'accent',
78
+ });
79
+ }
80
+ });
81
+ },
82
+ });
83
+ export const labelPulseDefinition = /* @__PURE__ */ definition('label-pulse', 'idle', {
84
+ still,
85
+ frame(context, options) {
86
+ if (!context.surface.input.precise)
87
+ return;
88
+ const band = (((context.timeMs * options.travelPxPerSecond) / 1000) %
89
+ (context.surface.width + 80)) -
90
+ 40;
91
+ for (const cell of context.surface.input.mask)
92
+ glyph(cell, cell.character, (dot) => {
93
+ const light = Math.max(0, 1 - Math.abs(dot.x - band) / 32);
94
+ context.dot({
95
+ ...dot,
96
+ opacity: dot.opacity * (0.25 + light * 0.75),
97
+ tone: light > 0.3 ? 'accent' : 'base',
98
+ });
99
+ });
100
+ },
101
+ });
102
+ function span(surface, options) {
103
+ // Characters lock left to right across at most 460 ms (the spec's 42%).
104
+ return Math.min(460, Math.max(0, surface.input.value.length - 1) * options.staggerMs);
105
+ }
106
+ function length(surface, options) {
107
+ return span(surface, options) + options.reelMs + options.settleMs + 100;
108
+ }
109
+ export const lockDefinition = /* @__PURE__ */ Object.freeze({
110
+ family: 'text',
111
+ phase: 'handoff',
112
+ id: 'dotquilt/lock',
113
+ handoff: createTextHandoff,
114
+ duration(surface, options) {
115
+ return surface.input.precise ? length(surface, options) : 150;
116
+ },
117
+ prepare(surface, options) {
118
+ return {
119
+ span: span(surface, options),
120
+ length: length(surface, options),
121
+ };
122
+ },
123
+ frame(context, options) {
124
+ const { surface, progress: p, prepared } = context;
125
+ if (!surface.input.precise) {
126
+ context.reveal({ opacity: p });
127
+ return;
128
+ }
129
+ // Recipe time is normalized to the captured total, including explicit duration overrides.
130
+ const time = p * prepared.length;
131
+ for (const dot of surface.source)
132
+ context.dot({
133
+ ...dot,
134
+ opacity: dot.opacity * (1 - clamp(time / 100)),
135
+ });
136
+ surface.input.value.forEach((cell, i) => {
137
+ const delay = surface.input.value.length > 1
138
+ ? (prepared.span * i) / (surface.input.value.length - 1)
139
+ : 0;
140
+ const local = time - delay;
141
+ if (local < 0)
142
+ return;
143
+ const settle = clamp((local - options.reelMs) / options.settleMs);
144
+ const alpha = clamp((prepared.length - time) / 100);
145
+ const lift = -Math.sin(settle * Math.PI) * 2 * options.pop * 5, size = 1 + Math.sin(settle * Math.PI) * options.pop;
146
+ if (local < options.reelMs) {
147
+ glyph(cell, randomCharacter(cell.character, Math.floor(local / 18) + i * 7), context.dot, alpha);
148
+ return;
149
+ }
150
+ // Lock: the last reel character eases into the real one (sine).
151
+ const k = sineInOut(settle);
152
+ if (k < 1)
153
+ glyph(cell, randomCharacter(cell.character, Math.floor(options.reelMs / 18) + i * 7), context.dot, alpha * (1 - k), lift, size);
154
+ glyph(cell, cell.character, context.dot, alpha * k, lift, size);
155
+ });
156
+ // The real text fades in while the last characters lock, from when the
157
+ // last one starts locking to the end, so glyphs and text overlap.
158
+ const from = prepared.span + options.reelMs;
159
+ context.reveal({
160
+ opacity: clamp((time - from) / Math.max(1, prepared.length - from)),
161
+ translateY: 2 * (1 - p),
162
+ });
163
+ },
164
+ });
165
+ function printHandoff() {
166
+ return definition('print-text', 'handoff', {
167
+ prepare: lockDefinition.prepare,
168
+ duration(surface, options) {
169
+ return surface.input.precise ? 180 + length(surface, options) / 1.5 : 150;
170
+ },
171
+ frame(context, options) {
172
+ if (!context.surface.input.precise)
173
+ return lockDefinition.frame(context, options);
174
+ const p = context.progress;
175
+ const time = (p * (180 + context.prepared.length / 1.5) - 180) * 1.5;
176
+ lockDefinition.frame({
177
+ ...context,
178
+ progress: time / context.prepared.length,
179
+ reveal(frame) {
180
+ context.reveal({
181
+ ...frame,
182
+ translateY: 2 * (1 - p),
183
+ clipStart: clamp(time / context.prepared.length),
184
+ });
185
+ },
186
+ }, options);
187
+ },
188
+ });
189
+ }
190
+ export const printDefinition = /* @__PURE__ */ printHandoff();
191
+ export const fadeDefinition = /* @__PURE__ */ definition('text-fade', 'handoff', {
192
+ duration(_surface, options) {
193
+ return options.duration;
194
+ },
195
+ prepare() {
196
+ return undefined;
197
+ },
198
+ frame(context) {
199
+ const p = context.progress;
200
+ for (const dot of context.surface.source)
201
+ context.dot({ ...dot, opacity: dot.opacity * (1 - p) });
202
+ context.reveal({ opacity: p });
203
+ },
204
+ });
205
+ export const defaultTextIdle = /* @__PURE__ */ Object.freeze({
206
+ contractVersion: 1,
207
+ family: 'text',
208
+ phase: 'idle',
209
+ id: 'dotquilt/scramble',
210
+ options: /* @__PURE__ */ Object.freeze({ changesPerSecond: 1000 / 280 }),
211
+ [brand]: scrambleDefinition,
212
+ });
213
+ export const defaultTextHandoff = /* @__PURE__ */ Object.freeze({
214
+ contractVersion: 1,
215
+ family: 'text',
216
+ phase: 'handoff',
217
+ id: 'dotquilt/text/morph-wipe',
218
+ options: /* @__PURE__ */ Object.freeze({
219
+ travel: morphTiming.travel,
220
+ wipeStart: morphTiming.wipeStart,
221
+ edge: morphTiming.edge,
222
+ }),
223
+ [brand]: textMorphDefinition,
224
+ });
225
+ /** Sine in-out, the curve the spec gives marks and text locks. */
226
+ function sineInOut(p) {
227
+ return 0.5 - 0.5 * Math.cos(Math.PI * p);
228
+ }
@@ -0,0 +1,4 @@
1
+ import type { Dot, GlyphCell } from '../animations.js';
2
+ /** A glyph mark's radius as a share of the matrix pitch. */
3
+ export declare const glyphMark = 0.36;
4
+ export declare function glyph(cell: GlyphCell, character: string, emit: (dot: Dot) => void, alpha?: number, lift?: number, scale?: number, matrix?: boolean): void;
@@ -0,0 +1,32 @@
1
+ import { clamp } from './math.js';
2
+ // Project-owned 5x7 prototype bitmap data, extended with authored lowercase/punctuation.
3
+ // Rows are packed base32; all printable Basic Latin code points are represented.
4
+ const rows = '00000004444404aaa0000avaava04fke5u4pq448m6cik8lid4480000248884284222480level0044v4400000448000v0000000066122488gehjlphe4c4444eeh1248vu11e11u26aiv22vggu11uegguhhev124888ehhehheehhf11e04404400440448248g84200v0v008421248eh12404ehnlngfehhvhhhuhhuhhufgggggfuhhhhhuvgguggvvggugggfggnhhfhhhvhhhv44444v7222iichikokihggggggvhrllhhhhpljhhhehhhhheuhhugggehhhliduhhukihfgge11uv444444hhhhhhehhhhha4hhhllrhhha4ahhhha4444v1248gve88888eg884221e22222e4ah0000000000v842000000e1fhfggmphhu00fgggf11djhhf00ehvgf698s8880fhhf1eggmphhh40c444e20622icggikokic44444e00qllll00mphhh00ehhhe00uhugg00fhf1100noggg00fge1u88s889600hhhjd00hhha400hhlla00ha4ah00hhf1e00v248v344o4434444444o44344o009m000';
5
+ /** A glyph mark's radius as a share of the matrix pitch. */
6
+ export const glyphMark = 0.36;
7
+ export function glyph(cell, character, emit, alpha = 1, lift = 0, scale = 1, matrix = false) {
8
+ const index = character.charCodeAt(0) - 32;
9
+ if (index < 0 || index >= 95)
10
+ return;
11
+ const b = cell.bounds;
12
+ // A square pitch, centred in the character's box, with marks about 70% of
13
+ // it across: distinct LED-like marks that never run into each other. It
14
+ // follows the line's height, so a narrow comma or 1 keeps the size of the
15
+ // characters around it (its marks sit in the middle columns).
16
+ const tall = b.height / 7;
17
+ const pitch = Math.min(tall, Math.max(b.width / 5, 0.75 * tall));
18
+ const left = b.x + (b.width - 5 * pitch) / 2, top = b.y + (b.height - 7 * pitch) / 2;
19
+ for (let y = 0; y < 7; y++)
20
+ for (let x = 0; x < 5; x++) {
21
+ const on = !!(Number.parseInt(rows[index * 7 + y] ?? '0', 32) &
22
+ (16 >> x));
23
+ if (on || matrix)
24
+ emit({
25
+ x: left + (x + 0.5) * pitch,
26
+ y: top + (y + 0.5) * pitch + lift,
27
+ size: clamp(pitch * glyphMark, 0.45, 3) * scale,
28
+ opacity: (on ? 0.8 : 0.06) * alpha,
29
+ tone: 'base',
30
+ });
31
+ }
32
+ }
@@ -0,0 +1,32 @@
1
+ import type { AnimationSurface, Dot } from '../animations.js';
2
+ import type { TextReveal } from './text-definitions.js';
3
+ export interface TextMorphOptions {
4
+ /** Each mark's own journey, as a share of the handoff. */
5
+ readonly travel: number;
6
+ /** When the real text starts to wipe in. */
7
+ readonly wipeStart: number;
8
+ /** Width of the soft front, in px. */
9
+ readonly edge: number;
10
+ }
11
+ export interface Travel {
12
+ readonly from: Dot;
13
+ readonly to: Dot;
14
+ readonly born: boolean;
15
+ readonly dies: boolean;
16
+ readonly order: number;
17
+ }
18
+ /**
19
+ * TextLoader's handoff (design/SPEC.md, "take shape, then hand over"): the
20
+ * scrambling marks slide into the real characters' shapes, lit while they
21
+ * travel, then the real text wipes in left to right (right to left in RTL)
22
+ * along a soft front, and the marks leave where it passes them.
23
+ */
24
+ export declare const textMorphDefinition: Readonly<{
25
+ family: 'text';
26
+ phase: 'handoff';
27
+ id: "dotquilt/text/morph-wipe";
28
+ handoff: import("./handoff.js").HandoffFactory;
29
+ duration(surface: AnimationSurface<'text'>): 150 | 1100;
30
+ prepare(surface: AnimationSurface<'text'>): readonly Travel[];
31
+ frame(context: TextReveal<readonly Travel[]>, options: TextMorphOptions): undefined;
32
+ }>;
@@ -0,0 +1,113 @@
1
+ import { handoff, morphTiming } from './marks.js';
2
+ import { clamp } from './math.js';
3
+ import { glyph } from './text-glyphs.js';
4
+ import { createTextHandoff } from './text-playback.js';
5
+ const sine = (t) => 0.5 - Math.cos(Math.PI * clamp(t)) / 2;
6
+ const mix = (a, b, t) => a + (b - a) * t;
7
+ const nearest = (dots, x, y) => {
8
+ let best, d = Number.POSITIVE_INFINITY;
9
+ for (const dot of dots) {
10
+ const e = (dot.x - x) ** 2 + (dot.y - y) ** 2;
11
+ if (e < d) {
12
+ d = e;
13
+ best = dot;
14
+ }
15
+ }
16
+ return best;
17
+ };
18
+ /**
19
+ * TextLoader's handoff (design/SPEC.md, "take shape, then hand over"): the
20
+ * scrambling marks slide into the real characters' shapes, lit while they
21
+ * travel, then the real text wipes in left to right (right to left in RTL)
22
+ * along a soft front, and the marks leave where it passes them.
23
+ */
24
+ export const textMorphDefinition = /* @__PURE__ */ Object.freeze({
25
+ family: 'text',
26
+ phase: 'handoff',
27
+ id: 'dotquilt/text/morph-wipe',
28
+ handoff: createTextHandoff,
29
+ duration(surface) {
30
+ return surface.input.precise ? handoff.duration : 150;
31
+ },
32
+ prepare(surface) {
33
+ const cells = surface.input.value;
34
+ if (!surface.input.precise || !cells.length)
35
+ return [];
36
+ // The idle's last frame, without its glow copies.
37
+ const source = surface.source.filter((dot) => dot.tone !== 'accent');
38
+ const width = Math.max(1, surface.width);
39
+ const centres = cells.map((cell) => cell.bounds.x + cell.bounds.width / 2);
40
+ const owned = cells.map(() => []);
41
+ for (const dot of source) {
42
+ let index = 0;
43
+ for (let i = 1; i < centres.length; i++)
44
+ if (Math.abs((centres[i] ?? 0) - dot.x) <
45
+ Math.abs((centres[index] ?? 0) - dot.x))
46
+ index = i;
47
+ owned[index]?.push(dot);
48
+ }
49
+ const travels = [];
50
+ cells.forEach((cell, index) => {
51
+ const targets = [];
52
+ glyph(cell, cell.character, (dot) => targets.push(dot));
53
+ const mine = owned[index] ?? [];
54
+ const free = new Set(mine);
55
+ const order = clamp((centres[index] ?? 0) / width);
56
+ for (const target of targets) {
57
+ const own = nearest([...free], target.x, target.y);
58
+ const from = own ?? nearest(mine, target.x, target.y);
59
+ if (own)
60
+ free.delete(own);
61
+ travels.push({
62
+ from: from ?? { ...target, opacity: 0 },
63
+ to: target,
64
+ born: !own,
65
+ dies: false,
66
+ order,
67
+ });
68
+ }
69
+ // Marks the real character doesn't need fold into it and fade.
70
+ for (const dot of free)
71
+ travels.push({
72
+ from: dot,
73
+ to: nearest(targets, dot.x, dot.y) ?? dot,
74
+ born: false,
75
+ dies: true,
76
+ order,
77
+ });
78
+ });
79
+ return travels;
80
+ },
81
+ frame(context, options) {
82
+ const { surface, progress: p, prepared } = context;
83
+ if (!surface.input.precise) {
84
+ for (const dot of surface.source)
85
+ context.dot({ ...dot, opacity: dot.opacity * (1 - p) });
86
+ context.reveal({ opacity: p });
87
+ return;
88
+ }
89
+ const width = Math.max(1, surface.width);
90
+ const rtl = context.rtl === true;
91
+ const { stagger } = morphTiming;
92
+ const { travel, wipeStart, edge } = options;
93
+ const at = -edge + (width + 2 * edge) * sine((p - wipeStart) / (1 - wipeStart));
94
+ for (const item of prepared) {
95
+ const order = rtl ? 1 - item.order : item.order;
96
+ const q = sine((p - stagger * order) / travel);
97
+ const x = mix(item.from.x, item.to.x, q), y = mix(item.from.y, item.to.y, q);
98
+ const start = item.born ? 0 : item.from.opacity;
99
+ const opacity = item.dies
100
+ ? mix(start, 0, clamp(q * 1.4))
101
+ : mix(start, item.to.opacity, q);
102
+ const ahead = rtl ? width - x : x;
103
+ context.dot({
104
+ x,
105
+ y,
106
+ size: mix(item.from.size, item.to.size, q),
107
+ opacity: opacity * clamp((ahead - at + edge) / edge),
108
+ tone: !item.dies && q > 0.08 && q < 0.82 ? 'accent' : 'base',
109
+ });
110
+ }
111
+ context.reveal({ opacity: 1, front: at, edge, rtl });
112
+ },
113
+ });
@@ -0,0 +1,4 @@
1
+ import type { HandoffFactory } from './handoff.js';
2
+ import type { Runner } from './runner.js';
3
+ export declare function createTextRunner(host: HTMLElement, report: (code: string) => void, invalidate: () => void): Runner;
4
+ export declare const createTextHandoff: HandoffFactory;
@@ -0,0 +1,119 @@
1
+ import { definitionOf } from './binding.js';
2
+ import { capturePainter } from './capture.js';
3
+ import { createEffect } from './effect.js';
4
+ import { now } from './element.js';
5
+ import { frames } from './frames.js';
6
+ import { createPainter } from './painter.js';
7
+ import { readSurface } from './surface.js';
8
+ // First-party recipes use the same bounded painter and document scheduler as
9
+ // author callbacks. Their fixed capabilities need no custom-target collection.
10
+ export function createTextRunner(host, report, invalidate) {
11
+ let painter, release;
12
+ let last = 0, phase = 0, previousSpeed = 1, failed = false;
13
+ const dispose = () => {
14
+ release?.();
15
+ release = undefined;
16
+ painter?.dispose();
17
+ painter = undefined;
18
+ last = 0;
19
+ };
20
+ return {
21
+ capture: () => capturePainter(painter),
22
+ reset() {
23
+ failed = false;
24
+ },
25
+ dispose,
26
+ draw(binding, still, speed) {
27
+ if (still &&
28
+ (host.ownerDocument.hidden ||
29
+ host.matches('[hidden],[data-dotquilt-offscreen]') ||
30
+ !host.clientWidth ||
31
+ !host.clientHeight)) {
32
+ dispose();
33
+ return;
34
+ }
35
+ if (failed || !binding)
36
+ return;
37
+ try {
38
+ const time = now(host), deltaMs = last ? Math.min(100, time - last) : 0;
39
+ phase += deltaMs * previousSpeed;
40
+ previousSpeed = speed;
41
+ last = still ? 0 : time;
42
+ const definition = definitionOf(binding);
43
+ painter ??= createPainter(host, report, undefined, true);
44
+ painter.draw((dot) => {
45
+ const context = {
46
+ surface: host[readSurface]('text'),
47
+ timeMs: phase,
48
+ dot,
49
+ };
50
+ (still ? definition.still : definition.frame)(context, binding.options);
51
+ });
52
+ if (still) {
53
+ release?.();
54
+ release = undefined;
55
+ }
56
+ else if (host.isConnected)
57
+ release ??= frames(host, invalidate);
58
+ }
59
+ catch {
60
+ failed = true;
61
+ dispose();
62
+ report('animation-failed');
63
+ }
64
+ },
65
+ };
66
+ }
67
+ export const createTextHandoff = (binding, { host, content, targets, duration: requestedDuration, current, own, report }) => {
68
+ if (targets.length)
69
+ throw new TypeError();
70
+ const definition = definitionOf(binding);
71
+ const surface = host[readSurface]('text');
72
+ const duration = requestedDuration ?? definition.duration(surface, binding.options);
73
+ const prepared = definition.prepare(surface, binding.options);
74
+ const reveal = createEffect(content, own);
75
+ const rtl = host.ownerDocument.defaultView?.getComputedStyle(host).direction === 'rtl';
76
+ let painter, release;
77
+ return {
78
+ duration,
79
+ draw(p) {
80
+ painter ??= createPainter(host, report, undefined, true);
81
+ painter.draw((dot) => {
82
+ const context = {
83
+ surface,
84
+ prepared: prepared,
85
+ timeMs: duration * p,
86
+ progress: p,
87
+ rtl,
88
+ dot,
89
+ reveal(frame) {
90
+ if (!current())
91
+ return;
92
+ // A soft front: opaque behind it, clear ahead, `edge` px between.
93
+ const { front, edge = 0 } = frame;
94
+ reveal({
95
+ opacity: frame.opacity,
96
+ translate: `0 ${frame.translateY ?? 0}px`,
97
+ ...(front === undefined
98
+ ? {
99
+ clipPath: `inset(0 ${(1 - (frame.clipStart ?? 1)) * 100}% 0 0)`,
100
+ }
101
+ : {
102
+ maskImage: `linear-gradient(${frame.rtl ? 270 : 90}deg,#000 ${(front - edge).toFixed(1)}px,#0000 ${front.toFixed(1)}px)`,
103
+ }),
104
+ });
105
+ },
106
+ };
107
+ definition.frame(context, binding.options);
108
+ });
109
+ },
110
+ activate(callback) {
111
+ release ??= frames(host, callback);
112
+ },
113
+ dispose() {
114
+ release?.();
115
+ release = undefined;
116
+ painter?.dispose();
117
+ },
118
+ };
119
+ };
@@ -0,0 +1,18 @@
1
+ import type { ScrambleOptions } from '../text-animations.js';
2
+ import { type TextDraw } from './text-definitions.js';
3
+ export declare const scrambleCharactersDefinition: Readonly<{
4
+ family: 'text';
5
+ phase: 'idle';
6
+ id: "dotquilt/scramble-characters" | "dotquilt/scramble-words";
7
+ runner: typeof import("./text-playback.js").createTextRunner;
8
+ still: (context: TextDraw) => undefined;
9
+ frame(context: TextDraw, options: ScrambleOptions): undefined;
10
+ }>;
11
+ export declare const scrambleWordsDefinition: Readonly<{
12
+ family: 'text';
13
+ phase: 'idle';
14
+ id: "dotquilt/scramble-characters" | "dotquilt/scramble-words";
15
+ runner: typeof import("./text-playback.js").createTextRunner;
16
+ still: (context: TextDraw) => undefined;
17
+ frame(context: TextDraw, options: ScrambleOptions): undefined;
18
+ }>;
@@ -0,0 +1,47 @@
1
+ import { noise, randomCharacter, scrambleDefinition, } from './text-definitions.js';
2
+ import { glyph } from './text-glyphs.js';
3
+ // Optional recipes share the existing glyph renderer, runner and still frame.
4
+ // Only their glyph-selection cadence differs; no additional clocks or state.
5
+ function scramble(sequentialWords) {
6
+ return Object.freeze({
7
+ family: 'text',
8
+ phase: 'idle',
9
+ id: sequentialWords
10
+ ? 'dotquilt/scramble-words'
11
+ : 'dotquilt/scramble-characters',
12
+ runner: scrambleDefinition.runner,
13
+ still: scrambleDefinition.still,
14
+ frame(context, options) {
15
+ if (!context.surface.input.precise)
16
+ return;
17
+ const cells = context.surface.input.mask;
18
+ let words = 0, boundary = true;
19
+ if (sequentialWords)
20
+ for (const cell of cells) {
21
+ if (cell.character === ' ')
22
+ boundary = true;
23
+ else if (boundary) {
24
+ words++;
25
+ boundary = false;
26
+ }
27
+ }
28
+ const time = (context.timeMs * options.changesPerSecond) / 1000;
29
+ let word = -1;
30
+ boundary = true;
31
+ cells.forEach((cell, i) => {
32
+ if (cell.character === ' ')
33
+ boundary = true;
34
+ else if (boundary) {
35
+ word++;
36
+ boundary = false;
37
+ }
38
+ const tick = sequentialWords
39
+ ? Math.floor((Math.floor(time) + words - 1 - word) / (words || 1))
40
+ : Math.floor(time + noise(i + 19));
41
+ glyph(cell, randomCharacter(cell.character, tick * 83 + i + 1), context.dot, 0.65, 0, 1, true);
42
+ });
43
+ },
44
+ });
45
+ }
46
+ export const scrambleCharactersDefinition = /* @__PURE__ */ scramble(false);
47
+ export const scrambleWordsDefinition = /* @__PURE__ */ scramble(true);
@@ -0,0 +1,9 @@
1
+ import type { Activity } from './element.js';
2
+ export declare const now: (host: HTMLElement) => number;
3
+ /**
4
+ * Automatic motion never runs longer than this: a loading period's idle stops
5
+ * after it, and a longer requested handoff is skipped. It stays under the
6
+ * 5 seconds after which moving content must be pausable (WCAG 2.2.2).
7
+ */
8
+ export declare const motionLimit = 4000;
9
+ export declare const remaining: (host: HTMLElement, activity: Activity) => number;
@@ -0,0 +1,13 @@
1
+ export const now = (host) => {
2
+ const p = host.ownerDocument.defaultView?.performance;
3
+ return p ? p.timeOrigin + p.now() : Date.now();
4
+ };
5
+ /**
6
+ * Automatic motion never runs longer than this: a loading period's idle stops
7
+ * after it, and a longer requested handoff is skipped. It stays under the
8
+ * 5 seconds after which moving content must be pausable (WCAG 2.2.2).
9
+ */
10
+ export const motionLimit = 4000;
11
+ export const remaining = (host, activity) => activity.started === undefined
12
+ ? motionLimit
13
+ : Math.max(0, motionLimit - (now(host) - activity.started));
@@ -0,0 +1,8 @@
1
+ /**
2
+ * While its external stylesheet loads, a host shows its static fallback
3
+ * through a slot and hides its own shadow nodes (see attachStyledShadow). The
4
+ * sheet applies before the hold is released, and its `display` rules override
5
+ * `hidden`, so on a slow frame both would show and the layout would double.
6
+ * This rule, part of the sheet itself, keeps them hidden until the release.
7
+ */
8
+ export declare const unstyledHold = ":host(:state(unstyled)) > :not(slot){display:none!important}";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * While its external stylesheet loads, a host shows its static fallback
3
+ * through a slot and hides its own shadow nodes (see attachStyledShadow). The
4
+ * sheet applies before the hold is released, and its `display` rules override
5
+ * `hidden`, so on a slow frame both would show and the layout would double.
6
+ * This rule, part of the sheet itself, keeps them hidden until the release.
7
+ */
8
+ export const unstyledHold = ':host(:state(unstyled)) > :not(slot){display:none!important}';
package/dist/line.css ADDED
@@ -0,0 +1,5 @@
1
+ :host{display:block;width:100%;height:1em;position:relative;border-radius:var(--dotquilt-radius,.375rem);overflow:hidden}:host .surface{position:absolute;inset:0;--s:var(--dotquilt-dot-size,4.4px);--g:calc(var(--s) + var(--dotquilt-dot-gap,4.6px));background:radial-gradient(circle,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) calc(var(--s)/2 - .5px),#0000 calc(var(--s)/2 + .5px)) center/var(--g) var(--g) space;opacity:0.37}:host .pulse{position:absolute;inset:0;--dotquilt-color:var(--dotquilt-accent-color,light-dark(#4f8f93,#8dc4c5));opacity:0;mask:linear-gradient(104deg,#0000 12.5%,#00000005 18.75%,#0000001b 26.56%,#0000005e 34.38%,#000000c7 42.19%,#000 50%,#000000c7 57.81%,#0000005e 65.63%,#0000001b 73.44%,#00000005 81.25%,#0000 87.5%) 0 0/128% 100% no-repeat}:host .pulse>.surface,:host .lift>.surface{opacity:1}:host .lift{position:absolute;inset:0;--dotquilt-color:var(--dotquilt-accent-color,light-dark(#4f8f93,#8dc4c5));opacity:0;mask:radial-gradient(circle 56px at var(--dotquilt-pointer-x,-999px) var(--dotquilt-pointer-y,-999px),#000,#0000);transition:opacity .32s cubic-bezier(.22,1,.36,1)}:host([mark=square]) .surface{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) center/8.5px 8.5px space;mask:linear-gradient(#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px),linear-gradient(90deg,#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px);mask-size:8.5px 8.5px;mask-position:center;mask-repeat:space;mask-composite:intersect}:host([mark=dash]) .surface{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) center/13px 9.5px space;mask:radial-gradient(circle at 3.5px 4.75px,#000 1.2px,#0000 2.2px),radial-gradient(circle at 9.5px 4.75px,#000 1.2px,#0000 2.2px),linear-gradient(#0000 2.55px,#000 3.55px,#000 5.95px,#0000 6.95px),linear-gradient(90deg,#0000 3px,#000 4px,#000 9px,#0000 10px);mask-size:13px 9.5px;mask-position:center;mask-repeat:space;mask-composite:add,add,intersect}:host [data-dotquilt-dissolve] circle{r:calc(var(--dotquilt-dot-size,4.4px)/2)}:host [data-dotquilt-dissolve] pattern>rect{transform-box:fill-box;transform-origin:center}:host(dotquilt-skeleton-text) [data-dotquilt-dissolve] > svg{border-radius:999px}:host([hidden]){display:none}:host > svg{position:absolute;inset:0;width:100%;height:100%;fill:var(--dotquilt-color,light-dark(#6e7889,#a3afc2))}@media(forced-colors:none){:host([data-custom]) .surface{visibility:hidden}}@media(hover:hover) and (pointer:fine){:host([pointer-response=lift][data-pointer]) .lift{opacity:0.9}}@media(forced-colors:active){:host .surface{border:1px dotted CanvasText}:host .pulse,:host .lift,:host > svg{display:none}}
2
+ :host(:state(unstyled)) > :not(slot){display:none!important}
3
+ :host{height:calc(2*(var(--dotquilt-dot-size,4.4px) + var(--dotquilt-dot-gap,4.6px)));border-radius:999px}:host .surface{--s:var(--dotquilt-dot-size,4.4px);--g:calc(var(--s) + var(--dotquilt-dot-gap,4.6px));background:radial-gradient(circle,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) calc(var(--s)/2 - .5px),#0000 calc(var(--s)/2 + .5px)) 0 0/var(--g) var(--g)}:host([mark=square]) .surface{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/8.5px 8.5px repeat;mask:linear-gradient(#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px),linear-gradient(90deg,#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px);mask-size:8.5px 8.5px;mask-position:0 0;mask-repeat:repeat;mask-composite:intersect}:host([mark=dash]) .surface{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/13px 9.5px repeat;mask:radial-gradient(circle at 3.5px 4.75px,#000 1.2px,#0000 2.2px),radial-gradient(circle at 9.5px 4.75px,#000 1.2px,#0000 2.2px),linear-gradient(#0000 2.55px,#000 3.55px,#000 5.95px,#0000 6.95px),linear-gradient(90deg,#0000 3px,#000 4px,#000 9px,#0000 10px);mask-size:13px 9.5px;mask-position:0 0;mask-repeat:repeat;mask-composite:add,add,intersect}:host([mark=square]){height:17px}:host([mark=dash]){height:19px}@supports (width:round(down,1px,1px)){@media(forced-colors:none){:host .surface{mask:linear-gradient(#000 0 0) 0/round(down,100%,var(--g)) no-repeat}:host([mark=square]) .surface{mask-image:linear-gradient(#000 0 0),linear-gradient(#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px),linear-gradient(90deg,#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px);mask-size:round(down,100%,8.5px),8.5px 8.5px,8.5px 8.5px;mask-position:0,0 0,0 0;mask-repeat:no-repeat,repeat,repeat;mask-composite:intersect,intersect}:host([mark=dash]) .surface{mask-image:linear-gradient(#000 0 0),radial-gradient(circle at 3.5px 4.75px,#000 1.2px,#0000 2.2px),radial-gradient(circle at 9.5px 4.75px,#000 1.2px,#0000 2.2px),linear-gradient(#0000 2.55px,#000 3.55px,#000 5.95px,#0000 6.95px),linear-gradient(90deg,#0000 3px,#000 4px,#000 9px,#0000 10px);mask-size:round(down,100%,13px),13px 9.5px,13px 9.5px,13px 9.5px,13px 9.5px;mask-position:0,0 0,0 0,0 0,0 0;mask-repeat:no-repeat,repeat,repeat,repeat,repeat;mask-composite:intersect,add,add,intersect}}}
4
+ dotquilt-skeleton-line{display:block;width:100%;height:calc(2*(var(--dotquilt-dot-size,4.4px) + var(--dotquilt-dot-gap,4.6px)));position:relative;border-radius:999px;overflow:hidden}dotquilt-skeleton-line [data-dotquilt-static]{display:block;position:absolute;inset:0;--s:var(--dotquilt-dot-size,4.4px);--g:calc(var(--s) + var(--dotquilt-dot-gap,4.6px));background:radial-gradient(circle,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) calc(var(--s)/2 - .5px),#0000 calc(var(--s)/2 + .5px)) 0 0/var(--g) var(--g);opacity:0.37}@media(forced-colors:active){dotquilt-skeleton-line [data-dotquilt-static]{border:1px dotted CanvasText}}@supports (width:round(down,1px,1px)){@media(forced-colors:none){dotquilt-skeleton-line [data-dotquilt-static]{mask:linear-gradient(#000 0 0) 0/round(down,100%,var(--g)) no-repeat}}}
5
+ dotquilt-skeleton-line[mark=square] [data-dotquilt-static]{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/8.5px 8.5px repeat;mask:linear-gradient(#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px),linear-gradient(90deg,#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px);mask-size:8.5px 8.5px;mask-position:0 0;mask-repeat:repeat;mask-composite:intersect}dotquilt-skeleton-line[mark=dash] [data-dotquilt-static]{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/13px 9.5px repeat;mask:radial-gradient(circle at 3.5px 4.75px,#000 1.2px,#0000 2.2px),radial-gradient(circle at 9.5px 4.75px,#000 1.2px,#0000 2.2px),linear-gradient(#0000 2.55px,#000 3.55px,#000 5.95px,#0000 6.95px),linear-gradient(90deg,#0000 3px,#000 4px,#000 9px,#0000 10px);mask-size:13px 9.5px;mask-position:0 0;mask-repeat:repeat;mask-composite:add,add,intersect}dotquilt-skeleton-line[mark=square]{height:17px}dotquilt-skeleton-line[mark=dash]{height:19px}@supports (width:round(down,1px,1px)){@media(forced-colors:none){dotquilt-skeleton-line[mark=square] [data-dotquilt-static]{mask-image:linear-gradient(#000 0 0),linear-gradient(#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px),linear-gradient(90deg,#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px);mask-size:round(down,100%,8.5px),8.5px 8.5px,8.5px 8.5px;mask-position:0,0 0,0 0;mask-repeat:no-repeat,repeat,repeat;mask-composite:intersect,intersect}dotquilt-skeleton-line[mark=dash] [data-dotquilt-static]{mask-image:linear-gradient(#000 0 0),radial-gradient(circle at 3.5px 4.75px,#000 1.2px,#0000 2.2px),radial-gradient(circle at 9.5px 4.75px,#000 1.2px,#0000 2.2px),linear-gradient(#0000 2.55px,#000 3.55px,#000 5.95px,#0000 6.95px),linear-gradient(90deg,#0000 3px,#000 4px,#000 9px,#0000 10px);mask-size:round(down,100%,13px),13px 9.5px,13px 9.5px,13px 9.5px,13px 9.5px;mask-position:0,0 0,0 0,0 0,0 0;mask-repeat:no-repeat,repeat,repeat,repeat,repeat;mask-composite:intersect,add,add,intersect}}}