marquee-content 7.0.0-dev.3 → 7.0.0-dev.4
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.
- package/README.md +3 -34
- package/dist/index.cjs +94 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.js +94 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,8 +66,7 @@ Calling a registration helper is only needed for an additional tag or global sty
|
|
|
66
66
|
|
|
67
67
|
| Option (HTML / JavaScript) | Type | Default | Description |
|
|
68
68
|
| --- | --- | --- | --- |
|
|
69
|
-
| `speed` | `number` | `90` | Base speed in px/s, clamped to `10`–`500`.
|
|
70
|
-
| `responsive-speed` / `responsiveSpeed` | `boolean` | `false` | Automatically reduces movement speed in narrow containers when enabled. |
|
|
69
|
+
| `speed` | `number` | `90` | Base speed in px/s, clamped to `10`–`500`. Independent of container width. |
|
|
71
70
|
| `mode` | `'auto' \| 'scroll'` | `'auto'` | `'auto'` for constant movement; `'scroll'` for page-scroll response and inertia. |
|
|
72
71
|
| `direction` | `'rtl' \| 'ltr'` | `'rtl'` | Base direction: right to left or left to right. |
|
|
73
72
|
| `pause-on-hover` / `pauseOnHover` | `boolean` | `false` | Pauses movement while the pointer is over the host. Items remain decorative and inert. |
|
|
@@ -85,7 +84,6 @@ marquee?.update({
|
|
|
85
84
|
mode: 'scroll',
|
|
86
85
|
direction: 'ltr',
|
|
87
86
|
speed: 120,
|
|
88
|
-
responsiveSpeed: false,
|
|
89
87
|
pauseOnHover: true,
|
|
90
88
|
});
|
|
91
89
|
|
|
@@ -110,38 +108,9 @@ On devices with a fine pointer, `scroll` listens to the window's vertical scroll
|
|
|
110
108
|
|
|
111
109
|
On touch devices matching `(hover: none) and (pointer: coarse)`, `scroll` follows the scrolling direction at the configured constant speed, without acceleration or decay. Movement continues in the last direction after scrolling stops. The `direction` option determines the base direction, as on desktop. Direction changes preserve the current position and use a native CSS animation without a JavaScript frame loop. The component responds to changes in the input capabilities.
|
|
112
110
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
## Responsive speed
|
|
116
|
-
|
|
117
|
-
Responsive speed is disabled by default. In `auto` mode, `speed="90"` gives `90px/s` at any container width. In `scroll` mode, it sets the base speed; on fine-pointer devices, scrolling and inertia intentionally change it.
|
|
118
|
-
|
|
119
|
-
Enable responsive speed to automatically slow movement in narrow containers:
|
|
120
|
-
|
|
121
|
-
```html
|
|
122
|
-
<marquee-content speed="90" responsive-speed>
|
|
123
|
-
<span>Slower movement in narrow containers</span>
|
|
124
|
-
</marquee-content>
|
|
125
|
-
```
|
|
111
|
+
During touch scrolling, direction changes require page movement matching the vertical finger gesture. This filters elastic rebound at the page edges, including movement back inside the scroll range. Moving a finger or scrolling a nested container alone does not change the marquee direction.
|
|
126
112
|
|
|
127
|
-
|
|
128
|
-
const marquee = document.querySelector('marquee-content');
|
|
129
|
-
|
|
130
|
-
if (marquee) {
|
|
131
|
-
marquee.responsiveSpeed = true;
|
|
132
|
-
// Equivalent: marquee.update({ responsiveSpeed: true });
|
|
133
|
-
}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
When enabled, scaling uses the **component's width**, in CSS pixels:
|
|
137
|
-
|
|
138
|
-
```text
|
|
139
|
-
effective base speed = speed × clamp(component width / 1280, 0.55, 1)
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
At widths up to `704px` (`1280 × 0.55`), speed stays at 55% of the configured value: `speed="90"` becomes `49.5px/s`. Between `704px` and `1280px`, it increases linearly. At `1280px` and above, it uses the configured speed without scaling.
|
|
143
|
-
|
|
144
|
-
Remove the attribute or set `responsive-speed="false"` to disable scaling again.
|
|
113
|
+
While speed is changing on a fine-pointer device, `scroll` updates the track's transform on animation frames. Once speed settles, it returns to the Web Animations API and stops the JavaScript frame loop.
|
|
145
114
|
|
|
146
115
|
## Vue 3 with Vite
|
|
147
116
|
|
package/dist/index.cjs
CHANGED
|
@@ -45,10 +45,6 @@ const DEFAULT_OPTIONS = {
|
|
|
45
45
|
speed: 90,
|
|
46
46
|
mode: "auto",
|
|
47
47
|
direction: "rtl",
|
|
48
|
-
responsiveSpeed: false,
|
|
49
|
-
referenceWidth: 1280,
|
|
50
|
-
minSpeedFactor: .55,
|
|
51
|
-
maxSpeedFactor: 1,
|
|
52
48
|
pauseOnHover: false,
|
|
53
49
|
pauseWhenOutOfView: true,
|
|
54
50
|
recalculateAfterFontsReady: true,
|
|
@@ -61,20 +57,19 @@ const OBSERVED_ATTRIBUTES = [
|
|
|
61
57
|
"speed",
|
|
62
58
|
"mode",
|
|
63
59
|
"direction",
|
|
64
|
-
"pause-on-hover"
|
|
65
|
-
"responsive-speed"
|
|
60
|
+
"pause-on-hover"
|
|
66
61
|
];
|
|
67
62
|
const OPTION_ATTRIBUTE_MAP = {
|
|
68
63
|
speed: "speed",
|
|
69
64
|
mode: "mode",
|
|
70
65
|
direction: "direction",
|
|
71
|
-
pauseOnHover: "pause-on-hover"
|
|
72
|
-
responsiveSpeed: "responsive-speed"
|
|
66
|
+
pauseOnHover: "pause-on-hover"
|
|
73
67
|
};
|
|
74
68
|
const MARQUEE_CONTENT_CSS_PROPS = ["--marquee-content-distance", "--marquee-content-duration"];
|
|
75
69
|
const SCROLL_TIME_SCALE_SMOOTHING_SECONDS = .12;
|
|
76
70
|
const TOUCH_INPUT_QUERY = "(hover: none) and (pointer: coarse)";
|
|
77
71
|
const TOUCH_SCROLL_EDGE_THRESHOLD = 1;
|
|
72
|
+
const TOUCH_SCROLL_IDLE_DELAY = 250;
|
|
78
73
|
const HTMLElementBase = globalThis.HTMLElement ?? class {};
|
|
79
74
|
const MARQUEE_CONTENT_RUNTIME_CSS = `
|
|
80
75
|
@keyframes marquee-content-auto {
|
|
@@ -154,6 +149,7 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
154
149
|
reducedMotion = false;
|
|
155
150
|
touchInput = false;
|
|
156
151
|
isListeningToScroll = false;
|
|
152
|
+
isListeningToTouch = false;
|
|
157
153
|
distance = 0;
|
|
158
154
|
containerWidth = 0;
|
|
159
155
|
group = null;
|
|
@@ -170,6 +166,9 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
170
166
|
scrollBoostStartedAt = 0;
|
|
171
167
|
lastScrollY = 0;
|
|
172
168
|
lastScrollTime = 0;
|
|
169
|
+
lastTouchY = null;
|
|
170
|
+
touchScrollDirection = 0;
|
|
171
|
+
touchScrollResetTimer = null;
|
|
173
172
|
constructor() {
|
|
174
173
|
if (typeof HTMLElement === "undefined") throw new Error("[MarqueeContent] Create elements in a browser, after client initialization.");
|
|
175
174
|
super();
|
|
@@ -260,12 +259,6 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
260
259
|
set pauseOnHover(value) {
|
|
261
260
|
this.setNullableAttribute("pause-on-hover", value);
|
|
262
261
|
}
|
|
263
|
-
get responsiveSpeed() {
|
|
264
|
-
return this.options.responsiveSpeed;
|
|
265
|
-
}
|
|
266
|
-
set responsiveSpeed(value) {
|
|
267
|
-
this.setNullableAttribute("responsive-speed", value);
|
|
268
|
-
}
|
|
269
262
|
update(options = {}) {
|
|
270
263
|
Object.entries(options).forEach(([key, value]) => {
|
|
271
264
|
const attributeName = OPTION_ATTRIBUTE_MAP[key];
|
|
@@ -377,9 +370,11 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
377
370
|
const deltaTime = Math.max((now - this.lastScrollTime) / 1e3, .016);
|
|
378
371
|
this.lastScrollY = currentScrollY;
|
|
379
372
|
this.lastScrollTime = now;
|
|
373
|
+
if (this.touchInput) this.scheduleTouchScrollReset();
|
|
380
374
|
if (Math.abs(deltaY) < .5) return;
|
|
381
375
|
const velocity = deltaY / deltaTime;
|
|
382
376
|
const direction = velocity >= 0 ? 1 : -1;
|
|
377
|
+
if (this.touchInput && (this.lastTouchY !== null && this.touchScrollDirection === 0 || this.touchScrollDirection !== 0 && direction !== this.touchScrollDirection)) return;
|
|
383
378
|
const directionChanged = direction !== this.scrollDirectionFactor;
|
|
384
379
|
this.scrollDirectionFactor = direction;
|
|
385
380
|
if (this.touchInput) {
|
|
@@ -393,6 +388,49 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
393
388
|
} else this.scrollBoostStartValue = 0;
|
|
394
389
|
this.onScrollBoostChanged();
|
|
395
390
|
};
|
|
391
|
+
handleTouchStart = (event) => {
|
|
392
|
+
this.resetTouchScroll();
|
|
393
|
+
const touch = event.touches.length === 1 ? event.touches[0] : null;
|
|
394
|
+
if (touch) this.lastTouchY = touch.clientY;
|
|
395
|
+
};
|
|
396
|
+
handleTouchMove = (event) => {
|
|
397
|
+
if (event.touches.length !== 1) {
|
|
398
|
+
this.resetTouchScroll();
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
const touch = event.touches[0];
|
|
402
|
+
if (!touch || this.lastTouchY === null) return;
|
|
403
|
+
const deltaY = this.lastTouchY - touch.clientY;
|
|
404
|
+
if (Math.abs(deltaY) < .5) return;
|
|
405
|
+
this.lastTouchY = touch.clientY;
|
|
406
|
+
this.touchScrollDirection = deltaY > 0 ? 1 : -1;
|
|
407
|
+
};
|
|
408
|
+
handleTouchEnd = (event) => {
|
|
409
|
+
if (event.touches.length > 0) {
|
|
410
|
+
this.resetTouchScroll();
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
this.lastTouchY = null;
|
|
414
|
+
this.scheduleTouchScrollReset();
|
|
415
|
+
};
|
|
416
|
+
handleScrollEnd = () => {
|
|
417
|
+
if (this.lastTouchY === null) this.resetTouchScroll();
|
|
418
|
+
};
|
|
419
|
+
scheduleTouchScrollReset() {
|
|
420
|
+
if (this.touchScrollResetTimer !== null) {
|
|
421
|
+
window.clearTimeout(this.touchScrollResetTimer);
|
|
422
|
+
this.touchScrollResetTimer = null;
|
|
423
|
+
}
|
|
424
|
+
if (this.lastTouchY === null && this.touchScrollDirection !== 0) this.touchScrollResetTimer = window.setTimeout(this.resetTouchScroll, TOUCH_SCROLL_IDLE_DELAY);
|
|
425
|
+
}
|
|
426
|
+
resetTouchScroll = () => {
|
|
427
|
+
if (this.touchScrollResetTimer !== null) {
|
|
428
|
+
window.clearTimeout(this.touchScrollResetTimer);
|
|
429
|
+
this.touchScrollResetTimer = null;
|
|
430
|
+
}
|
|
431
|
+
this.lastTouchY = null;
|
|
432
|
+
this.touchScrollDirection = 0;
|
|
433
|
+
};
|
|
396
434
|
onScrollBoostChanged() {
|
|
397
435
|
if (!this.mounted || this.getEffectiveMode() !== "scroll" || this.reducedMotion) return;
|
|
398
436
|
if (!this.canAnimate() || this.distance <= 0) return;
|
|
@@ -404,13 +442,44 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
404
442
|
this.startAnimationLoop();
|
|
405
443
|
}
|
|
406
444
|
updateScrollListener(shouldListen = this.mounted && this.options.mode === "scroll") {
|
|
407
|
-
if (shouldListen
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
445
|
+
if (shouldListen !== this.isListeningToScroll) {
|
|
446
|
+
if (shouldListen) {
|
|
447
|
+
this.lastScrollY = this.getScrollY();
|
|
448
|
+
this.lastScrollTime = performance.now();
|
|
449
|
+
window.addEventListener("scroll", this.handleScroll, { passive: true });
|
|
450
|
+
} else window.removeEventListener("scroll", this.handleScroll);
|
|
451
|
+
this.isListeningToScroll = shouldListen;
|
|
452
|
+
}
|
|
453
|
+
const shouldListenToTouch = shouldListen && this.touchInput;
|
|
454
|
+
if (shouldListenToTouch !== this.isListeningToTouch) {
|
|
455
|
+
if (shouldListenToTouch) {
|
|
456
|
+
window.addEventListener("touchstart", this.handleTouchStart, {
|
|
457
|
+
passive: true,
|
|
458
|
+
capture: true
|
|
459
|
+
});
|
|
460
|
+
window.addEventListener("touchmove", this.handleTouchMove, {
|
|
461
|
+
passive: true,
|
|
462
|
+
capture: true
|
|
463
|
+
});
|
|
464
|
+
window.addEventListener("touchend", this.handleTouchEnd, {
|
|
465
|
+
passive: true,
|
|
466
|
+
capture: true
|
|
467
|
+
});
|
|
468
|
+
window.addEventListener("touchcancel", this.handleTouchEnd, {
|
|
469
|
+
passive: true,
|
|
470
|
+
capture: true
|
|
471
|
+
});
|
|
472
|
+
window.addEventListener("scrollend", this.handleScrollEnd);
|
|
473
|
+
} else {
|
|
474
|
+
window.removeEventListener("touchstart", this.handleTouchStart, true);
|
|
475
|
+
window.removeEventListener("touchmove", this.handleTouchMove, true);
|
|
476
|
+
window.removeEventListener("touchend", this.handleTouchEnd, true);
|
|
477
|
+
window.removeEventListener("touchcancel", this.handleTouchEnd, true);
|
|
478
|
+
window.removeEventListener("scrollend", this.handleScrollEnd);
|
|
479
|
+
this.resetTouchScroll();
|
|
480
|
+
}
|
|
481
|
+
this.isListeningToTouch = shouldListenToTouch;
|
|
482
|
+
}
|
|
414
483
|
}
|
|
415
484
|
scheduleRebuild = () => {
|
|
416
485
|
if (!this.mounted) return;
|
|
@@ -428,7 +497,7 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
428
497
|
applyOptions() {
|
|
429
498
|
if (!this.mounted) return;
|
|
430
499
|
const progress = this.scrollAnimation ? this.getScrollAnimationProgress() : this.getAutoAnimation()?.effect?.getComputedTiming().progress ?? this.scrollProgress;
|
|
431
|
-
this.scrollBaseSpeed = this.
|
|
500
|
+
this.scrollBaseSpeed = this.options.speed;
|
|
432
501
|
const duration = this.distance / this.scrollBaseSpeed;
|
|
433
502
|
this.setAttribute("data-marquee-content-mode", this.options.mode);
|
|
434
503
|
this.toggleAttribute("data-marquee-content-pause-on-hover", this.options.pauseOnHover);
|
|
@@ -596,6 +665,8 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
596
665
|
handleTouchInputChange = (event) => {
|
|
597
666
|
if (!this.mounted || event.matches === this.touchInput) return;
|
|
598
667
|
this.touchInput = event.matches;
|
|
668
|
+
this.lastScrollY = this.getScrollY();
|
|
669
|
+
this.lastScrollTime = performance.now();
|
|
599
670
|
this.stopAnimationLoop();
|
|
600
671
|
this.cancelScrollAnimation();
|
|
601
672
|
this.scrollMotionActive = false;
|
|
@@ -788,19 +859,13 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
788
859
|
const easedProgress = this.easeOutCubic(progress);
|
|
789
860
|
return this.scrollBoostStartValue * (1 - easedProgress);
|
|
790
861
|
}
|
|
791
|
-
getCurrentSpeed(containerWidth) {
|
|
792
|
-
if (!this.options.responsiveSpeed) return this.options.speed;
|
|
793
|
-
const factor = this.clamp(containerWidth / this.options.referenceWidth, this.options.minSpeedFactor, this.options.maxSpeedFactor);
|
|
794
|
-
return this.options.speed * factor;
|
|
795
|
-
}
|
|
796
862
|
resolveOptions() {
|
|
797
863
|
return {
|
|
798
864
|
...DEFAULT_OPTIONS,
|
|
799
865
|
speed: this.num("speed", DEFAULT_OPTIONS.speed, 10, 500),
|
|
800
866
|
mode: this.parseMode(this.getAttribute("mode"), DEFAULT_OPTIONS.mode),
|
|
801
867
|
direction: this.parseDirection(this.getAttribute("direction"), DEFAULT_OPTIONS.direction),
|
|
802
|
-
pauseOnHover: this.parseBoolean(this.getAttribute("pause-on-hover"), DEFAULT_OPTIONS.pauseOnHover)
|
|
803
|
-
responsiveSpeed: this.parseBoolean(this.getAttribute("responsive-speed"), DEFAULT_OPTIONS.responsiveSpeed)
|
|
868
|
+
pauseOnHover: this.parseBoolean(this.getAttribute("pause-on-hover"), DEFAULT_OPTIONS.pauseOnHover)
|
|
804
869
|
};
|
|
805
870
|
}
|
|
806
871
|
num(attributeName, fallback, min, max) {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["DEFAULT_CSS_TEXT"],"sources":["../src/styles.ts","../src/marquee-content.ts","../src/index.ts"],"sourcesContent":["import './marquee-content.css';\nimport DEFAULT_CSS_TEXT from './marquee-content.css?inline';\n\nexport type MarqueeContentStyleInput = CSSStyleSheet | string | null | undefined;\n\nexport interface MarqueeContentStyleEntry {\n sheet: CSSStyleSheet | null;\n cssText: string;\n}\n\nexport const marqueeContentCssText: string = DEFAULT_CSS_TEXT;\n\nexport function createConstructableStyleSheet(cssText: string): CSSStyleSheet | null {\n if (\n typeof CSSStyleSheet === 'undefined' ||\n typeof CSSStyleSheet.prototype.replaceSync !== 'function'\n ) {\n return null;\n }\n\n try {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(cssText);\n return sheet;\n } catch {\n return null;\n }\n}\n\nexport function cssStyleSheetToText(sheet: CSSStyleSheet): string {\n try {\n return Array.from(sheet.cssRules)\n .map((rule) => rule.cssText)\n .join('\\n');\n } catch {\n return '';\n }\n}\n\nexport function normalizeStyleInput(input: MarqueeContentStyleInput): MarqueeContentStyleEntry {\n if (!input) {\n return {\n sheet: null,\n cssText: '',\n };\n }\n\n if (typeof input === 'string') {\n return {\n sheet: createConstructableStyleSheet(input),\n cssText: input,\n };\n }\n\n return {\n sheet: input,\n cssText: cssStyleSheetToText(input),\n };\n}\n\nexport function canUseAdoptedStyleSheets(root: ShadowRoot): boolean {\n return (\n typeof CSSStyleSheet !== 'undefined' &&\n 'adoptedStyleSheets' in root &&\n typeof CSSStyleSheet.prototype.replaceSync === 'function'\n );\n}\n","import {\n type MarqueeContentStyleEntry,\n type MarqueeContentStyleInput,\n marqueeContentCssText,\n normalizeStyleInput,\n} from './styles';\n\nexport type MarqueeContentDirection = 'rtl' | 'ltr';\nexport type MarqueeContentMode = 'auto' | 'scroll';\n\nexport interface MarqueeContentOptions {\n speed?: number | string | null;\n mode?: MarqueeContentMode | null;\n direction?: MarqueeContentDirection | null;\n pauseOnHover?: boolean | string | null;\n responsiveSpeed?: boolean | string | null;\n}\n\ninterface MarqueeContentResolvedOptions {\n speed: number;\n mode: MarqueeContentMode;\n direction: MarqueeContentDirection;\n\n responsiveSpeed: boolean;\n referenceWidth: number;\n minSpeedFactor: number;\n maxSpeedFactor: number;\n\n pauseOnHover: boolean;\n pauseWhenOutOfView: boolean;\n recalculateAfterFontsReady: boolean;\n\n scrollVelocityFactor: number;\n scrollMinExtraSpeed: number;\n scrollMaxExtraSpeed: number;\n scrollInertiaDuration: number;\n}\n\nexport interface DefineMarqueeContentOptions {\n stylesheet?: MarqueeContentStyleInput;\n styleOverrides?: MarqueeContentStyleInput;\n}\n\nexport interface InitMarqueeContentsOptions extends DefineMarqueeContentOptions {\n tagName?: string;\n}\n\nexport const MARQUEE_CONTENT_TAG = 'marquee-content';\n\nconst DEFAULT_OPTIONS: MarqueeContentResolvedOptions = {\n speed: 90,\n mode: 'auto',\n direction: 'rtl',\n\n responsiveSpeed: false,\n referenceWidth: 1280,\n minSpeedFactor: 0.55,\n maxSpeedFactor: 1,\n\n pauseOnHover: false,\n pauseWhenOutOfView: true,\n recalculateAfterFontsReady: true,\n\n scrollVelocityFactor: 150,\n scrollMinExtraSpeed: 0.05,\n scrollMaxExtraSpeed: 5,\n scrollInertiaDuration: 2500,\n};\n\nconst OBSERVED_ATTRIBUTES = [\n 'speed',\n 'mode',\n 'direction',\n 'pause-on-hover',\n 'responsive-speed',\n] as const;\n\nconst OPTION_ATTRIBUTE_MAP: Record<keyof MarqueeContentOptions, string> = {\n speed: 'speed',\n mode: 'mode',\n direction: 'direction',\n pauseOnHover: 'pause-on-hover',\n responsiveSpeed: 'responsive-speed',\n};\n\nconst MARQUEE_CONTENT_CSS_PROPS = [\n '--marquee-content-distance',\n '--marquee-content-duration',\n] as const;\n\nconst SCROLL_TIME_SCALE_SMOOTHING_SECONDS = 0.12;\nconst TOUCH_INPUT_QUERY = '(hover: none) and (pointer: coarse)';\nconst TOUCH_SCROLL_EDGE_THRESHOLD = 1;\n\n// Server imports do not need a DOM; element construction still requires a browser.\nconst HTMLElementBase = (globalThis.HTMLElement ?? class {}) as typeof HTMLElement;\n\nconst MARQUEE_CONTENT_RUNTIME_CSS = `\n @keyframes marquee-content-auto {\n to {\n transform: translate3d(calc(-1 * var(--marquee-content-distance)), 0, 0);\n }\n }\n\n .marquee-content__source {\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n\n .marquee-content__source::slotted(*) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n`;\n\nconst TEMPLATE = `\n <slot class=\"marquee-content__source\"></slot>\n\n <div class=\"marquee-content__viewport\" part=\"viewport\">\n <div class=\"marquee-content__track\" part=\"track\" aria-hidden=\"true\" inert></div>\n </div>\n`;\n\nexport class MarqueeContent extends HTMLElementBase {\n static get observedAttributes(): string[] {\n return [...OBSERVED_ATTRIBUTES];\n }\n\n private static readonly instances = new Set<MarqueeContent>();\n\n private static readonly runtimeStylesheetEntry: MarqueeContentStyleEntry = normalizeStyleInput(\n MARQUEE_CONTENT_RUNTIME_CSS,\n );\n\n private static stylesheetEntry: MarqueeContentStyleEntry =\n normalizeStyleInput(marqueeContentCssText);\n\n private static styleOverridesEntry: MarqueeContentStyleEntry = normalizeStyleInput(null);\n\n static configureStyles(options: DefineMarqueeContentOptions = {}): void {\n if (!('stylesheet' in options) && !('styleOverrides' in options)) {\n return;\n }\n\n if ('stylesheet' in options) {\n MarqueeContent.stylesheetEntry = normalizeStyleInput(\n options.stylesheet ?? marqueeContentCssText,\n );\n }\n\n if ('styleOverrides' in options) {\n MarqueeContent.styleOverridesEntry = normalizeStyleInput(options.styleOverrides);\n }\n\n MarqueeContent.instances.forEach((instance) => {\n instance.applyAllStyles();\n instance.scheduleRebuild();\n });\n }\n\n static setStylesheet(stylesheet: MarqueeContentStyleInput): void {\n MarqueeContent.configureStyles({ stylesheet });\n }\n\n static setStyleOverrides(styleOverrides: MarqueeContentStyleInput): void {\n MarqueeContent.configureStyles({ styleOverrides });\n }\n\n private readonly shadow: ShadowRoot;\n private readonly sourceSlot: HTMLSlotElement;\n private readonly viewport: HTMLElement;\n private readonly track: HTMLElement;\n\n private options: MarqueeContentResolvedOptions = { ...DEFAULT_OPTIONS };\n private sourceNodes: Node[] = [];\n\n private resizeObserver: ResizeObserver | null = null;\n private mutationObserver: MutationObserver | null = null;\n private intersectionObserver: IntersectionObserver | null = null;\n private abortController: AbortController | null = null;\n private reducedMotionMediaQuery: MediaQueryList | null = null;\n private touchInputMediaQuery: MediaQueryList | null = null;\n\n private animationFrameId: number | null = null;\n private rebuildFrameId: number | null = null;\n private lastFrameTime: number | null = null;\n\n private mounted = false;\n private isHovered = false;\n private isFocused = false;\n private isInViewport = true;\n private reducedMotion = false;\n private touchInput = false;\n private isListeningToScroll = false;\n\n private distance = 0;\n private containerWidth = 0;\n private group: HTMLElement | null = null;\n private layoutPending = false;\n\n private scrollAnimation: Animation | null = null;\n private scrollAnimationDuration = 0;\n private scrollAnimationDistance = 0;\n private scrollProgress = 0;\n private scrollMotionActive = false;\n private scrollBaseSpeed = DEFAULT_OPTIONS.speed;\n\n private scrollDirectionFactor: 1 | -1 = 1;\n private currentTimeScale = 1;\n private scrollBoostStartValue = 0;\n private scrollBoostStartedAt = 0;\n private lastScrollY = 0;\n private lastScrollTime = 0;\n\n constructor() {\n if (typeof HTMLElement === 'undefined') {\n throw new Error(\n '[MarqueeContent] Create elements in a browser, after client initialization.',\n );\n }\n\n super();\n\n this.shadow = this.attachShadow({ mode: 'open' });\n this.applyAllStyles();\n\n const template = document.createElement('template');\n template.innerHTML = TEMPLATE;\n this.shadow.appendChild(template.content.cloneNode(true));\n\n const sourceSlot = this.shadow.querySelector<HTMLSlotElement>('slot.marquee-content__source');\n const viewport = this.shadow.querySelector<HTMLElement>('.marquee-content__viewport');\n\n const track = this.shadow.querySelector<HTMLElement>('.marquee-content__track');\n\n if (!sourceSlot) {\n throw new Error('[MarqueeContent] Source slot was not found.');\n }\n\n if (!track) {\n throw new Error('[MarqueeContent] Track element was not found.');\n }\n\n if (!viewport) {\n throw new Error('[MarqueeContent] Viewport element was not found.');\n }\n\n this.sourceSlot = sourceSlot;\n this.viewport = viewport;\n this.track = track;\n }\n\n connectedCallback(): void {\n if (this.mounted) {\n return;\n }\n\n MarqueeContent.instances.add(this);\n\n this.mounted = true;\n this.applyAllStyles();\n this.abortController = new AbortController();\n this.options = this.resolveOptions();\n\n this.lastScrollY = this.getScrollY();\n this.lastScrollTime = performance.now();\n\n this.sourceSlot.addEventListener('slotchange', this.handleSlotChange, {\n signal: this.abortController.signal,\n });\n\n // Only source loads should rebuild the track, never loads from its decorative copies.\n for (const eventName of ['load', 'error']) {\n this.addEventListener(eventName, this.handleSourceLoad, {\n capture: true,\n signal: this.abortController.signal,\n });\n this.shadow.addEventListener(eventName, this.completeLayout, {\n capture: true,\n signal: this.abortController.signal,\n });\n }\n\n this.addEventListener('pointerenter', this.handlePointerEnter, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('pointerleave', this.handlePointerLeave, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('focusin', this.handleFocusIn, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('focusout', this.handleFocusOut, {\n signal: this.abortController.signal,\n });\n\n window.addEventListener('orientationchange', this.scheduleRebuild, {\n signal: this.abortController.signal,\n });\n\n this.resizeObserver = new ResizeObserver(this.handleResize);\n this.resizeObserver.observe(this);\n this.resizeObserver.observe(this.viewport);\n\n this.intersectionObserver = new IntersectionObserver(this.handleIntersectionChange);\n this.intersectionObserver.observe(this);\n\n this.setupReducedMotionWatcher();\n this.setupTouchInputWatcher();\n this.watchSourceNodes();\n this.updateScrollListener();\n this.rebuild();\n\n if (this.options.recalculateAfterFontsReady) {\n this.rebuildAfterFontsReady();\n }\n }\n\n disconnectedCallback(): void {\n this.teardown();\n MarqueeContent.instances.delete(this);\n }\n\n attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue) {\n return;\n }\n\n this.options = this.resolveOptions();\n\n if (!this.mounted) {\n return;\n }\n\n this.updateScrollListener();\n this.applyOptions();\n }\n\n get speed(): number {\n return this.options.speed;\n }\n\n set speed(value: number | string | null | undefined) {\n this.setNullableAttribute('speed', value);\n }\n\n get mode(): MarqueeContentMode {\n return this.options.mode;\n }\n\n set mode(value: MarqueeContentMode | null | undefined) {\n this.setNullableAttribute('mode', value);\n }\n\n get direction(): MarqueeContentDirection {\n return this.options.direction;\n }\n\n set direction(value: MarqueeContentDirection | null | undefined) {\n this.setNullableAttribute('direction', value);\n }\n\n get pauseOnHover(): boolean {\n return this.options.pauseOnHover;\n }\n\n set pauseOnHover(value: boolean | string | null | undefined) {\n this.setNullableAttribute('pause-on-hover', value);\n }\n\n get responsiveSpeed(): boolean {\n return this.options.responsiveSpeed;\n }\n\n set responsiveSpeed(value: boolean | string | null | undefined) {\n this.setNullableAttribute('responsive-speed', value);\n }\n\n update(options: MarqueeContentOptions = {}): void {\n Object.entries(options).forEach(([key, value]) => {\n const attributeName = OPTION_ATTRIBUTE_MAP[key as keyof MarqueeContentOptions];\n\n if (attributeName) {\n this.setNullableAttribute(attributeName, value);\n }\n });\n\n this.options = this.resolveOptions();\n this.updateScrollListener();\n this.applyOptions();\n }\n\n refresh(): void {\n this.scheduleRebuild();\n }\n\n private applyAllStyles(): void {\n const runtime = MarqueeContent.runtimeStylesheetEntry;\n const base = MarqueeContent.stylesheetEntry;\n const overrides = MarqueeContent.styleOverridesEntry;\n const sheets: CSSStyleSheet[] = [];\n\n if (runtime.sheet) {\n sheets.push(runtime.sheet);\n }\n\n if (base.sheet) {\n sheets.push(base.sheet);\n }\n\n if (overrides.sheet) {\n sheets.push(overrides.sheet);\n }\n\n this.shadow.adoptedStyleSheets = sheets;\n }\n\n private teardown(): void {\n if (!this.mounted) {\n return;\n }\n\n this.mounted = false;\n\n this.stopAnimationLoop();\n this.stopCssAnimation();\n this.cancelScrollAnimation();\n this.cancelScheduledRebuild();\n this.updateScrollListener(false);\n\n this.resizeObserver?.disconnect();\n this.mutationObserver?.disconnect();\n this.intersectionObserver?.disconnect();\n\n this.removeReducedMotionWatcher();\n this.removeTouchInputWatcher();\n\n this.abortController?.abort();\n\n this.group = null;\n this.layoutPending = false;\n this.containerWidth = 0;\n this.resizeObserver = null;\n this.mutationObserver = null;\n this.intersectionObserver = null;\n this.abortController = null;\n\n this.track.replaceChildren();\n this.removeAttribute('data-marquee-content-ready');\n this.removeAttribute('data-marquee-content-mode');\n this.removeAttribute('data-marquee-content-pause-on-hover');\n this.removeAttribute('data-marquee-content-reduced-motion');\n\n MARQUEE_CONTENT_CSS_PROPS.forEach((prop) => {\n this.style.removeProperty(prop);\n });\n\n this.distance = 0;\n this.isHovered = false;\n this.isFocused = false;\n this.isInViewport = true;\n this.scrollDirectionFactor = 1;\n this.scrollBoostStartValue = 0;\n this.scrollBoostStartedAt = 0;\n this.scrollProgress = 0;\n this.scrollMotionActive = false;\n this.scrollBaseSpeed = DEFAULT_OPTIONS.speed;\n this.currentTimeScale = 1;\n this.lastFrameTime = null;\n }\n\n private handleResize = (): void => {\n if (\n this.measureViewportWidth() !== this.containerWidth ||\n (this.group &&\n !this.layoutPending &&\n Math.abs(this.measureGroup(this.group) - this.distance) > 0.01)\n ) {\n this.scheduleRebuild();\n }\n };\n\n private handleSourceLoad = (event: Event): void => {\n // A shadow-tree event may be retargeted to the host; only authored descendants count.\n if (event.target instanceof Node && event.target !== this && this.contains(event.target)) {\n this.scheduleRebuild();\n }\n };\n\n private handleSlotChange = (): void => {\n this.watchSourceNodes();\n this.scheduleRebuild();\n };\n\n private handlePointerEnter = (): void => {\n this.isHovered = true;\n this.updateAnimationLoopState();\n };\n\n private handlePointerLeave = (): void => {\n this.isHovered = false;\n this.updateAnimationLoopState();\n };\n\n private handleFocusIn = (): void => {\n this.isFocused = true;\n this.updateAnimationLoopState();\n };\n\n private handleFocusOut = (): void => {\n this.isFocused = false;\n this.updateAnimationLoopState();\n };\n\n private handleIntersectionChange = (entries: IntersectionObserverEntry[]): void => {\n const entry = entries[0];\n\n if (!entry) {\n return;\n }\n\n this.isInViewport = entry.isIntersecting;\n this.updateAnimationLoopState();\n };\n\n private handleReducedMotionChange = (event: MediaQueryListEvent | MediaQueryList): void => {\n this.reducedMotion = event.matches;\n\n if (this.reducedMotion) {\n this.track.style.transform = 'none';\n } else if (this.getEffectiveMode() === 'scroll') {\n this.track.style.transform = '';\n }\n\n this.updateAnimationLoopState();\n this.scheduleRebuild();\n };\n\n private handleScroll = (): void => {\n if (this.options.mode !== 'scroll') {\n return;\n }\n\n const now = performance.now();\n const currentScrollY = this.getScrollY();\n\n const deltaY = currentScrollY - this.lastScrollY;\n const deltaTime = Math.max((now - this.lastScrollTime) / 1000, 0.016);\n\n this.lastScrollY = currentScrollY;\n this.lastScrollTime = now;\n\n if (Math.abs(deltaY) < 0.5) {\n return;\n }\n\n const velocity = deltaY / deltaTime;\n\n const direction = velocity >= 0 ? 1 : -1;\n const directionChanged = direction !== this.scrollDirectionFactor;\n this.scrollDirectionFactor = direction;\n\n if (this.touchInput) {\n if (directionChanged) {\n this.applyOptions();\n }\n return;\n }\n\n const extraSpeed = this.clamp(\n velocity / this.options.scrollVelocityFactor,\n -this.options.scrollMaxExtraSpeed,\n this.options.scrollMaxExtraSpeed,\n );\n\n if (Math.abs(extraSpeed) >= this.options.scrollMinExtraSpeed) {\n this.scrollBoostStartValue = extraSpeed;\n this.scrollBoostStartedAt = now;\n } else {\n this.scrollBoostStartValue = 0;\n }\n\n this.onScrollBoostChanged();\n };\n\n private onScrollBoostChanged(): void {\n if (!this.mounted || this.getEffectiveMode() !== 'scroll' || this.reducedMotion) {\n return;\n }\n\n if (!this.canAnimate() || this.distance <= 0) {\n return;\n }\n\n if (!this.scrollMotionActive) {\n this.cancelScrollAnimation();\n this.scrollMotionActive = true;\n this.renderScrollProgress();\n }\n\n this.startAnimationLoop();\n }\n\n private updateScrollListener(\n shouldListen = this.mounted && this.options.mode === 'scroll',\n ): void {\n if (shouldListen === this.isListeningToScroll) {\n return;\n }\n\n if (shouldListen) {\n this.lastScrollY = this.getScrollY();\n this.lastScrollTime = performance.now();\n window.addEventListener('scroll', this.handleScroll, { passive: true });\n } else {\n window.removeEventListener('scroll', this.handleScroll);\n }\n\n this.isListeningToScroll = shouldListen;\n }\n\n private scheduleRebuild = (): void => {\n if (!this.mounted) {\n return;\n }\n\n this.cancelScheduledRebuild();\n\n this.rebuildFrameId = requestAnimationFrame(() => {\n this.rebuildFrameId = null;\n this.rebuild();\n });\n };\n\n private cancelScheduledRebuild(): void {\n if (this.rebuildFrameId === null) {\n return;\n }\n\n cancelAnimationFrame(this.rebuildFrameId);\n this.rebuildFrameId = null;\n }\n\n private applyOptions(): void {\n if (!this.mounted) {\n return;\n }\n\n const progress = this.scrollAnimation\n ? this.getScrollAnimationProgress()\n : (this.getAutoAnimation()?.effect?.getComputedTiming().progress ?? this.scrollProgress);\n this.scrollBaseSpeed = this.getCurrentSpeed(this.clientWidth);\n const duration = this.distance / this.scrollBaseSpeed;\n\n this.setAttribute('data-marquee-content-mode', this.options.mode);\n this.toggleAttribute('data-marquee-content-pause-on-hover', this.options.pauseOnHover);\n this.toggleAttribute('data-marquee-content-reduced-motion', this.reducedMotion);\n\n if (this.distance > 0) {\n this.style.setProperty('--marquee-content-distance', `${this.distance}px`);\n this.style.setProperty('--marquee-content-duration', `${duration}s`);\n }\n\n if (progress != null) {\n this.scrollProgress = progress;\n }\n\n this.updateAnimationLoopState();\n\n if (progress != null && this.getEffectiveMode() === 'auto' && !this.reducedMotion) {\n const animation = this.getAutoAnimation();\n\n if (animation) {\n animation.currentTime =\n duration *\n 1000 *\n (this.track.style.animationDirection === 'reverse' ? 1 - progress : progress);\n }\n }\n }\n\n private getAutoAnimation(): Animation | undefined {\n return this.track\n .getAnimations()\n .find(\n (animation) =>\n 'animationName' in animation && animation.animationName === 'marquee-content-auto',\n );\n }\n\n private rebuild(): void {\n if (!this.mounted) {\n return;\n }\n\n this.options = this.resolveOptions();\n this.updateScrollListener();\n const progress = this.scrollAnimation\n ? this.getScrollAnimationProgress()\n : this.getAutoAnimation()?.effect?.getComputedTiming().progress;\n\n if (progress != null) {\n this.scrollProgress = progress;\n }\n\n this.distance = 0;\n this.layoutPending = false;\n this.updateAnimationLoopState();\n this.removeAttribute('data-marquee-content-ready');\n this.toggleAttribute('data-marquee-content-reduced-motion', this.reducedMotion);\n this.containerWidth = this.measureViewportWidth();\n\n if (this.group) {\n this.resizeObserver?.unobserve(this.group);\n this.group = null;\n }\n\n this.sourceNodes = this.getSourceNodes();\n\n if (this.containerWidth <= 0 || this.sourceNodes.length === 0) {\n this.distance = 0;\n this.track.replaceChildren();\n this.applyOptions();\n return;\n }\n\n this.group = this.createGroup();\n this.track.replaceChildren(this.group);\n this.layoutPending = true;\n this.completeLayout();\n }\n\n private completeLayout = (): void => {\n const group = this.group;\n\n if (!this.mounted || !group || !this.layoutPending) {\n return;\n }\n\n // Cached clones can load asynchronously. Keep the measured source period in place\n // and reconcile coverage again when loading finishes in case its dimensions changed.\n if (this.hasPendingImages(this.track)) {\n return;\n }\n\n if (!this.reducedMotion) {\n this.fillTrack(group);\n\n if (this.hasPendingImages(this.track)) {\n return;\n }\n }\n\n this.layoutPending = false;\n this.distance = this.measureGroup(group);\n this.resizeObserver?.observe(group);\n\n if (!Number.isFinite(this.distance) || this.distance <= 0) {\n this.track.replaceChildren();\n this.applyOptions();\n return;\n }\n\n this.setAttribute('data-marquee-content-ready', 'true');\n this.applyOptions();\n };\n\n private hasPendingImages(root: ParentNode): boolean {\n return Array.from(root.querySelectorAll('img')).some((image) => !image.complete);\n }\n\n private measureViewportWidth(): number {\n if (this.viewport.getClientRects().length === 0) {\n return 0;\n }\n\n const style = getComputedStyle(this.viewport);\n const width = Number.parseFloat(style.width);\n\n if (!Number.isFinite(width)) {\n return this.viewport.clientWidth;\n }\n\n // Preserve fractional layout pixels and ignore ancestor transforms.\n return style.boxSizing === 'border-box'\n ? width - Number.parseFloat(style.borderLeftWidth) - Number.parseFloat(style.borderRightWidth)\n : width + Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight);\n }\n\n private measureGroup(group: HTMLElement): number {\n const style = getComputedStyle(group);\n const width = Number.parseFloat(style.width);\n\n if (!Number.isFinite(width)) {\n return group.scrollWidth;\n }\n\n if (style.boxSizing === 'border-box') {\n return width;\n }\n\n return (\n width +\n Number.parseFloat(style.paddingLeft) +\n Number.parseFloat(style.paddingRight) +\n Number.parseFloat(style.borderLeftWidth) +\n Number.parseFloat(style.borderRightWidth)\n );\n }\n\n private createGroup(): HTMLElement {\n const group = document.createElement('div');\n\n group.className = 'marquee-content__group';\n group.setAttribute('part', 'group');\n\n this.appendSourceNodes(group);\n\n return group;\n }\n\n private fillTrack(group: HTMLElement): void {\n const period = this.measureGroup(group);\n\n if (!Number.isFinite(period) || period <= 0) {\n return;\n }\n\n // One period moves offscreen while the remaining copies cover the viewport.\n // Repeat whole groups so custom padding and borders recur at every seam.\n const groupCount = Math.ceil(this.containerWidth / period) + 1;\n\n while (this.track.childElementCount > groupCount) {\n this.track.lastElementChild?.remove();\n }\n\n const fragment = document.createDocumentFragment();\n\n for (let index = this.track.childElementCount; index < groupCount; index += 1) {\n fragment.appendChild(group.cloneNode(true));\n }\n\n this.track.appendChild(fragment);\n }\n\n private appendSourceNodes(target: HTMLElement): void {\n const fragment = document.createDocumentFragment();\n\n this.sourceNodes.forEach((node) => {\n fragment.append(this.cloneSourceNode(node));\n });\n\n target.appendChild(fragment);\n }\n\n private cloneSourceNode(node: Node): Node {\n const clone = node.cloneNode(true);\n\n if (clone instanceof Element) {\n const currentPart = clone.getAttribute('part');\n\n clone.setAttribute('part', currentPart ? `${currentPart} item` : 'item');\n\n // Offscreen lazy copies still need intrinsic dimensions before the loop can be measured.\n if (clone instanceof HTMLImageElement) {\n clone.loading = 'eager';\n }\n\n clone.querySelectorAll('img').forEach((image) => {\n image.loading = 'eager';\n });\n }\n\n return clone;\n }\n\n private getSourceNodes(): Node[] {\n return this.sourceSlot.assignedNodes({ flatten: true }).filter((node) => {\n if (node.nodeType === Node.TEXT_NODE) {\n return Boolean(node.textContent?.trim());\n }\n\n return node.nodeType === Node.ELEMENT_NODE;\n });\n }\n\n private watchSourceNodes(): void {\n this.mutationObserver?.disconnect();\n\n this.mutationObserver = new MutationObserver(this.scheduleRebuild);\n\n this.sourceSlot.assignedNodes({ flatten: true }).forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n this.mutationObserver?.observe(node, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n });\n\n return;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n this.mutationObserver?.observe(node, {\n characterData: true,\n });\n }\n });\n }\n\n private setupReducedMotionWatcher(): void {\n if (!('matchMedia' in window)) {\n return;\n }\n\n this.reducedMotionMediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');\n\n this.reducedMotion = this.reducedMotionMediaQuery.matches;\n this.reducedMotionMediaQuery.addEventListener('change', this.handleReducedMotionChange, {\n signal: this.abortController?.signal,\n });\n }\n\n private removeReducedMotionWatcher(): void {\n if (!this.reducedMotionMediaQuery) {\n return;\n }\n\n this.reducedMotionMediaQuery.removeEventListener('change', this.handleReducedMotionChange);\n\n this.reducedMotionMediaQuery = null;\n }\n\n private getEffectiveMode(): MarqueeContentMode {\n return this.touchInput ? 'auto' : this.options.mode;\n }\n\n private setupTouchInputWatcher(): void {\n if (!('matchMedia' in window)) {\n return;\n }\n\n this.touchInputMediaQuery = window.matchMedia(TOUCH_INPUT_QUERY);\n this.touchInput = this.touchInputMediaQuery.matches;\n this.touchInputMediaQuery.addEventListener('change', this.handleTouchInputChange, {\n signal: this.abortController?.signal,\n });\n }\n\n private removeTouchInputWatcher(): void {\n this.touchInputMediaQuery?.removeEventListener('change', this.handleTouchInputChange);\n this.touchInputMediaQuery = null;\n this.touchInput = false;\n }\n\n private handleTouchInputChange = (event: MediaQueryListEvent): void => {\n if (!this.mounted || event.matches === this.touchInput) {\n return;\n }\n\n this.touchInput = event.matches;\n this.stopAnimationLoop();\n this.cancelScrollAnimation();\n this.scrollMotionActive = false;\n this.scrollBoostStartValue = 0;\n this.scrollBoostStartedAt = 0;\n this.currentTimeScale = this.getDirectionFactor() * this.scrollDirectionFactor;\n this.updateScrollListener();\n this.applyOptions();\n };\n\n private updateAnimationLoopState(): void {\n if (!this.mounted || this.distance <= 0 || this.reducedMotion) {\n this.stopAnimationLoop();\n this.stopCssAnimation();\n this.cancelScrollAnimation();\n\n // A rebuild temporarily has no distance. Keep its phase and speed until layout\n // completes, while mode changes and reduced motion leave the active path.\n if (!this.mounted || this.getEffectiveMode() !== 'scroll' || this.reducedMotion) {\n this.scrollMotionActive = false;\n }\n\n this.track.style.transform = this.reducedMotion ? 'none' : '';\n return;\n }\n\n if (this.getEffectiveMode() === 'scroll') {\n this.stopCssAnimation();\n\n if (this.scrollMotionActive) {\n this.renderScrollProgress();\n\n if (this.canAnimate()) {\n this.startAnimationLoop();\n } else {\n this.stopAnimationLoop();\n }\n\n return;\n }\n\n this.currentTimeScale = this.getDirectionFactor() * this.scrollDirectionFactor;\n this.ensureScrollAnimation();\n\n if (!this.scrollAnimation || !this.canAnimate()) {\n this.scrollAnimation?.pause();\n this.stopAnimationLoop();\n return;\n }\n\n if (this.scrollBoostStartValue !== 0) {\n this.onScrollBoostChanged();\n } else {\n this.track.style.transform = '';\n\n if (this.scrollAnimation.playState !== 'running') {\n this.scrollAnimation.play();\n }\n }\n\n return;\n }\n\n this.stopAnimationLoop();\n this.cancelScrollAnimation();\n this.scrollMotionActive = false;\n this.startCssAnimation();\n this.track.style.animationPlayState = this.canAnimate() ? 'running' : 'paused';\n }\n\n private canAnimate(): boolean {\n if (this.options.pauseOnHover && this.isHovered) {\n return false;\n }\n\n if (this.isFocused) {\n return false;\n }\n\n if (this.options.pauseWhenOutOfView && !this.isInViewport) {\n return false;\n }\n\n return true;\n }\n\n private startAnimationLoop(): void {\n if (this.animationFrameId !== null) {\n return;\n }\n\n this.lastFrameTime = performance.now();\n this.animationFrameId = requestAnimationFrame(this.tick);\n }\n\n private stopAnimationLoop(): void {\n if (this.animationFrameId === null) {\n this.lastFrameTime = null;\n return;\n }\n\n cancelAnimationFrame(this.animationFrameId);\n this.animationFrameId = null;\n this.lastFrameTime = null;\n }\n\n private startCssAnimation(): void {\n const scrollDirection =\n this.touchInput && this.options.mode === 'scroll' ? this.scrollDirectionFactor : 1;\n const animationDirection =\n this.getDirectionFactor() * scrollDirection < 0 ? 'reverse' : 'normal';\n\n this.track.style.transform = '';\n\n if (this.track.style.animationName !== 'marquee-content-auto') {\n this.track.style.animationName = 'marquee-content-auto';\n this.track.style.animationDuration = 'var(--marquee-content-duration)';\n this.track.style.animationTimingFunction = 'linear';\n this.track.style.animationIterationCount = 'infinite';\n }\n\n if (this.track.style.animationDirection !== animationDirection) {\n this.track.style.animationDirection = animationDirection;\n }\n }\n\n private stopCssAnimation(): void {\n this.track.style.animationName = '';\n this.track.style.animationDuration = '';\n this.track.style.animationTimingFunction = '';\n this.track.style.animationIterationCount = '';\n this.track.style.animationDirection = '';\n this.track.style.animationPlayState = '';\n }\n\n private tick = (now: number): void => {\n this.animationFrameId = null;\n\n if (\n !this.mounted ||\n this.getEffectiveMode() !== 'scroll' ||\n this.distance <= 0 ||\n this.reducedMotion ||\n !this.canAnimate() ||\n !this.scrollMotionActive\n ) {\n return;\n }\n\n const settled = this.advanceScrollMotion(now);\n\n if (settled) {\n this.scrollMotionActive = false;\n this.ensureScrollAnimation();\n this.track.style.transform = '';\n this.lastFrameTime = null;\n return;\n }\n\n this.animationFrameId = requestAnimationFrame(this.tick);\n };\n\n private ensureScrollAnimation(): void {\n if (this.distance <= 0) {\n this.cancelScrollAnimation();\n return;\n }\n\n const currentSpeed = this.scrollBaseSpeed;\n const durationMs = currentSpeed > 0 ? (this.distance / currentSpeed) * 1000 : 0;\n const reversed = this.currentTimeScale < 0;\n\n if (durationMs <= 0) {\n this.cancelScrollAnimation();\n return;\n }\n\n if (\n this.scrollAnimation &&\n this.scrollAnimationDistance === this.distance &&\n this.scrollAnimationDuration === durationMs &&\n this.scrollAnimation.effect?.getTiming().direction === (reversed ? 'reverse' : 'normal')\n ) {\n return;\n }\n\n const progress = this.getScrollAnimationProgress();\n if (this.scrollAnimation) {\n this.scrollAnimation.cancel();\n this.scrollAnimation = null;\n }\n\n const animation = this.track.animate(\n [\n { transform: 'translate3d(0px, 0, 0)' },\n { transform: `translate3d(${-this.distance}px, 0, 0)` },\n ],\n {\n duration: durationMs,\n iterations: Number.POSITIVE_INFINITY,\n easing: 'linear',\n },\n );\n\n // Reverse the effect while keeping time positive, so long-running motion cannot end at zero.\n animation.effect?.updateTiming({ direction: reversed ? 'reverse' : 'normal' });\n animation.currentTime = durationMs * (reversed ? 1 - progress : progress);\n animation.playbackRate = Math.abs(this.currentTimeScale);\n\n this.scrollAnimation = animation;\n this.scrollAnimationDuration = durationMs;\n this.scrollAnimationDistance = this.distance;\n this.scrollProgress = progress;\n }\n\n private cancelScrollAnimation(): void {\n if (!this.scrollAnimation) {\n return;\n }\n\n this.scrollProgress = this.getScrollAnimationProgress();\n this.scrollAnimation.cancel();\n this.scrollAnimation = null;\n this.scrollAnimationDuration = 0;\n this.scrollAnimationDistance = 0;\n }\n\n private getScrollAnimationProgress(): number {\n const animation = this.scrollAnimation;\n\n if (!animation || this.scrollAnimationDuration <= 0) {\n return this.scrollProgress;\n }\n\n // currentTime can be rounded by the browser. Computed progress reflects the\n // rendered phase and already accounts for a reversed effect.\n const progress = animation.effect?.getComputedTiming().progress;\n\n if (progress != null) {\n return progress % 1;\n }\n\n const currentTime = animation.currentTime;\n\n if (typeof currentTime !== 'number') {\n return this.scrollProgress;\n }\n\n const fraction = (currentTime / this.scrollAnimationDuration) % 1;\n\n const normalized = fraction < 0 ? fraction + 1 : fraction;\n\n return animation.effect?.getTiming().direction === 'reverse'\n ? (1 - normalized) % 1\n : normalized;\n }\n\n private advanceScrollMotion(now: number): boolean {\n const target = this.getCurrentTimeScale(now);\n const previousTimeScale = this.currentTimeScale;\n const previousTime = this.lastFrameTime ?? now;\n const deltaTime = this.clamp((now - previousTime) / 1000, 0, 0.064);\n\n this.lastFrameTime = now;\n\n const smoothingFactor = 1 - Math.exp(-deltaTime / SCROLL_TIME_SCALE_SMOOTHING_SECONDS);\n\n this.currentTimeScale += (target - this.currentTimeScale) * smoothingFactor;\n\n const settled =\n this.scrollBoostStartValue === 0 && Math.abs(target - this.currentTimeScale) < 0.001;\n\n if (settled) {\n this.currentTimeScale = target;\n }\n\n // Keep changing speed on the frame clock, without resynchronizing an accelerated\n // WAAPI animation on every frame. Idle motion returns to WAAPI after settling.\n const averageTimeScale = (previousTimeScale + this.currentTimeScale) / 2;\n const progress =\n this.scrollProgress + (this.scrollBaseSpeed * averageTimeScale * deltaTime) / this.distance;\n\n this.scrollProgress = ((progress % 1) + 1) % 1;\n this.renderScrollProgress();\n\n return settled;\n }\n\n private renderScrollProgress(): void {\n this.track.style.transform = `translate3d(${-this.scrollProgress * this.distance}px, 0, 0)`;\n }\n\n private getCurrentTimeScale(now: number): number {\n const directionFactor = this.getDirectionFactor();\n\n if (this.getEffectiveMode() !== 'scroll') {\n return directionFactor;\n }\n\n const boost = this.getScrollBoost(now);\n const scrollTimeScale = this.scrollDirectionFactor + boost;\n\n return this.clamp(\n directionFactor * scrollTimeScale,\n -1 - this.options.scrollMaxExtraSpeed,\n 1 + this.options.scrollMaxExtraSpeed,\n );\n }\n\n private getDirectionFactor(): 1 | -1 {\n return this.options.direction === 'ltr' ? -1 : 1;\n }\n\n private getScrollBoost(now: number): number {\n if (this.scrollBoostStartValue === 0) {\n return 0;\n }\n\n const duration = this.options.scrollInertiaDuration;\n\n if (duration <= 0) {\n this.scrollBoostStartValue = 0;\n return 0;\n }\n\n const progress = this.clamp((now - this.scrollBoostStartedAt) / duration, 0, 1);\n\n if (progress >= 1) {\n this.scrollBoostStartValue = 0;\n return 0;\n }\n\n const easedProgress = this.easeOutCubic(progress);\n\n return this.scrollBoostStartValue * (1 - easedProgress);\n }\n\n private getCurrentSpeed(containerWidth: number): number {\n if (!this.options.responsiveSpeed) {\n return this.options.speed;\n }\n\n const factor = this.clamp(\n containerWidth / this.options.referenceWidth,\n this.options.minSpeedFactor,\n this.options.maxSpeedFactor,\n );\n\n return this.options.speed * factor;\n }\n\n private resolveOptions(): MarqueeContentResolvedOptions {\n return {\n ...DEFAULT_OPTIONS,\n speed: this.num('speed', DEFAULT_OPTIONS.speed, 10, 500),\n mode: this.parseMode(this.getAttribute('mode'), DEFAULT_OPTIONS.mode),\n direction: this.parseDirection(this.getAttribute('direction'), DEFAULT_OPTIONS.direction),\n pauseOnHover: this.parseBoolean(\n this.getAttribute('pause-on-hover'),\n DEFAULT_OPTIONS.pauseOnHover,\n ),\n responsiveSpeed: this.parseBoolean(\n this.getAttribute('responsive-speed'),\n DEFAULT_OPTIONS.responsiveSpeed,\n ),\n };\n }\n\n private num(attributeName: string, fallback: number, min: number, max: number): number {\n return this.clamp(this.parseNumber(this.getAttribute(attributeName), fallback), min, max);\n }\n\n private parseNumber(value: string | null, fallback: number): number {\n if (value === null || value.trim() === '') {\n return fallback;\n }\n\n const parsed = Number(value);\n\n return Number.isFinite(parsed) ? parsed : fallback;\n }\n\n private parseBoolean(value: string | null, fallback: boolean): boolean {\n if (value === null) {\n return fallback;\n }\n\n const normalizedValue = value.trim().toLowerCase();\n\n if (normalizedValue === '') {\n return true;\n }\n\n if (['true', '1', 'yes', 'on'].includes(normalizedValue)) {\n return true;\n }\n\n if (['false', '0', 'no', 'off'].includes(normalizedValue)) {\n return false;\n }\n\n return fallback;\n }\n\n private parseMode(value: string | null, fallback: MarqueeContentMode): MarqueeContentMode {\n if (value === 'auto' || value === 'scroll') {\n return value;\n }\n\n return fallback;\n }\n\n private parseDirection(\n value: string | null,\n fallback: MarqueeContentDirection,\n ): MarqueeContentDirection {\n if (value === 'rtl' || value === 'ltr') {\n return value;\n }\n\n return fallback;\n }\n\n private setNullableAttribute(\n name: string,\n value: string | number | boolean | null | undefined,\n ): void {\n if (value === null || value === undefined) {\n this.removeAttribute(name);\n return;\n }\n\n this.setAttribute(name, String(value));\n }\n\n private getScrollY(): number {\n const scrollY = window.scrollY || window.pageYOffset || 0;\n if (!this.touchInput) {\n return scrollY;\n }\n\n const scroller = document.scrollingElement ?? document.documentElement;\n const maxScroll = Math.max(0, scroller.scrollHeight - scroller.clientHeight);\n\n // Ignore rubber-band movement and subpixel jitter at either page edge.\n if (scrollY <= TOUCH_SCROLL_EDGE_THRESHOLD) {\n return 0;\n }\n if (scrollY >= maxScroll - TOUCH_SCROLL_EDGE_THRESHOLD) {\n return maxScroll;\n }\n return scrollY;\n }\n\n private clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n }\n\n private easeOutCubic(value: number): number {\n return 1 - (1 - value) ** 3;\n }\n\n private rebuildAfterFontsReady(): void {\n const fonts = (\n document as Document & {\n fonts?: { ready: Promise<unknown> };\n }\n ).fonts;\n\n if (!fonts?.ready) {\n return;\n }\n\n void fonts.ready.then(this.scheduleRebuild).catch(() => undefined);\n }\n}\n\nexport function defineMarqueeContent(\n tagName = MARQUEE_CONTENT_TAG,\n options: DefineMarqueeContentOptions = {},\n): void {\n if (typeof window === 'undefined' || !window.customElements) {\n return;\n }\n\n MarqueeContent.configureStyles(options);\n\n if (!window.customElements.get(tagName)) {\n const elementClass =\n tagName === MARQUEE_CONTENT_TAG ? MarqueeContent : class extends MarqueeContent {};\n window.customElements.define(tagName, elementClass);\n }\n}\n\nexport function initMarqueeContents(options: InitMarqueeContentsOptions = {}): void {\n const { tagName = MARQUEE_CONTENT_TAG, ...styleOptions } = options;\n\n defineMarqueeContent(tagName, styleOptions);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'marquee-content': MarqueeContent;\n }\n}\n","export type {\n DefineMarqueeContentOptions,\n InitMarqueeContentsOptions,\n MarqueeContentDirection,\n MarqueeContentMode,\n MarqueeContentOptions,\n} from './marquee-content';\nexport {\n defineMarqueeContent,\n initMarqueeContents,\n MARQUEE_CONTENT_TAG,\n MarqueeContent,\n} from './marquee-content';\nexport type {\n MarqueeContentStyleEntry,\n MarqueeContentStyleInput,\n} from './styles';\nexport {\n createConstructableStyleSheet,\n cssStyleSheetToText,\n marqueeContentCssText,\n normalizeStyleInput,\n} from './styles';\n\nimport { defineMarqueeContent } from './marquee-content';\n\ndefineMarqueeContent();\n"],"mappings":";;;;;;;AAUA,MAAa,wBAAgCA;AAE7C,SAAgB,8BAA8B,SAAuC;CACnF,IACE,OAAO,kBAAkB,eACzB,OAAO,cAAc,UAAU,gBAAgB,YAE/C,OAAO;CAGT,IAAI;EACF,MAAM,QAAQ,IAAI,cAAc;EAChC,MAAM,YAAY,OAAO;EACzB,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,oBAAoB,OAA8B;CAChE,IAAI;EACF,OAAO,MAAM,KAAK,MAAM,QAAQ,CAAC,CAC9B,KAAK,SAAS,KAAK,OAAO,CAAC,CAC3B,KAAK,IAAI;CACd,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,oBAAoB,OAA2D;CAC7F,IAAI,CAAC,OACH,OAAO;EACL,OAAO;EACP,SAAS;CACX;CAGF,IAAI,OAAO,UAAU,UACnB,OAAO;EACL,OAAO,8BAA8B,KAAK;EAC1C,SAAS;CACX;CAGF,OAAO;EACL,OAAO;EACP,SAAS,oBAAoB,KAAK;CACpC;AACF;;;;ACXA,MAAa,sBAAsB;AAEnC,MAAM,kBAAiD;CACrD,OAAO;CACP,MAAM;CACN,WAAW;CAEX,iBAAiB;CACjB,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAEhB,cAAc;CACd,oBAAoB;CACpB,4BAA4B;CAE5B,sBAAsB;CACtB,qBAAqB;CACrB,qBAAqB;CACrB,uBAAuB;AACzB;AAEA,MAAM,sBAAsB;CAC1B;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,uBAAoE;CACxE,OAAO;CACP,MAAM;CACN,WAAW;CACX,cAAc;CACd,iBAAiB;AACnB;AAEA,MAAM,4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,UAAuC,CAAC,GAClC;CACN,IAAI,OAAO,WAAW,eAAe,CAAC,OAAO,gBAC3C;CAGF,eAAe,gBAAgB,OAAO;CAEtC,IAAI,CAAC,OAAO,eAAe,IAAI,OAAO,GAAG;EACvC,MAAM,eACJ,gCAAkC,iBAAiB,cAAc,eAAe,CAAC;EACnF,OAAO,eAAe,OAAO,SAAS,YAAY;CACpD;AACF;AAEA,SAAgB,oBAAoB,UAAsC,CAAC,GAAS;CAClF,MAAM,EAAE,UAAU,qBAAqB,GAAG,iBAAiB;CAE3D,qBAAqB,SAAS,YAAY;AAC5C;;;;ACt6CA,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["DEFAULT_CSS_TEXT"],"sources":["../src/styles.ts","../src/marquee-content.ts","../src/index.ts"],"sourcesContent":["import './marquee-content.css';\nimport DEFAULT_CSS_TEXT from './marquee-content.css?inline';\n\nexport type MarqueeContentStyleInput = CSSStyleSheet | string | null | undefined;\n\nexport interface MarqueeContentStyleEntry {\n sheet: CSSStyleSheet | null;\n cssText: string;\n}\n\nexport const marqueeContentCssText: string = DEFAULT_CSS_TEXT;\n\nexport function createConstructableStyleSheet(cssText: string): CSSStyleSheet | null {\n if (\n typeof CSSStyleSheet === 'undefined' ||\n typeof CSSStyleSheet.prototype.replaceSync !== 'function'\n ) {\n return null;\n }\n\n try {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(cssText);\n return sheet;\n } catch {\n return null;\n }\n}\n\nexport function cssStyleSheetToText(sheet: CSSStyleSheet): string {\n try {\n return Array.from(sheet.cssRules)\n .map((rule) => rule.cssText)\n .join('\\n');\n } catch {\n return '';\n }\n}\n\nexport function normalizeStyleInput(input: MarqueeContentStyleInput): MarqueeContentStyleEntry {\n if (!input) {\n return {\n sheet: null,\n cssText: '',\n };\n }\n\n if (typeof input === 'string') {\n return {\n sheet: createConstructableStyleSheet(input),\n cssText: input,\n };\n }\n\n return {\n sheet: input,\n cssText: cssStyleSheetToText(input),\n };\n}\n\nexport function canUseAdoptedStyleSheets(root: ShadowRoot): boolean {\n return (\n typeof CSSStyleSheet !== 'undefined' &&\n 'adoptedStyleSheets' in root &&\n typeof CSSStyleSheet.prototype.replaceSync === 'function'\n );\n}\n","import {\n type MarqueeContentStyleEntry,\n type MarqueeContentStyleInput,\n marqueeContentCssText,\n normalizeStyleInput,\n} from './styles';\n\nexport type MarqueeContentDirection = 'rtl' | 'ltr';\nexport type MarqueeContentMode = 'auto' | 'scroll';\n\nexport interface MarqueeContentOptions {\n speed?: number | string | null;\n mode?: MarqueeContentMode | null;\n direction?: MarqueeContentDirection | null;\n pauseOnHover?: boolean | string | null;\n}\n\ninterface MarqueeContentResolvedOptions {\n speed: number;\n mode: MarqueeContentMode;\n direction: MarqueeContentDirection;\n\n pauseOnHover: boolean;\n pauseWhenOutOfView: boolean;\n recalculateAfterFontsReady: boolean;\n\n scrollVelocityFactor: number;\n scrollMinExtraSpeed: number;\n scrollMaxExtraSpeed: number;\n scrollInertiaDuration: number;\n}\n\nexport interface DefineMarqueeContentOptions {\n stylesheet?: MarqueeContentStyleInput;\n styleOverrides?: MarqueeContentStyleInput;\n}\n\nexport interface InitMarqueeContentsOptions extends DefineMarqueeContentOptions {\n tagName?: string;\n}\n\nexport const MARQUEE_CONTENT_TAG = 'marquee-content';\n\nconst DEFAULT_OPTIONS: MarqueeContentResolvedOptions = {\n speed: 90,\n mode: 'auto',\n direction: 'rtl',\n\n pauseOnHover: false,\n pauseWhenOutOfView: true,\n recalculateAfterFontsReady: true,\n\n scrollVelocityFactor: 150,\n scrollMinExtraSpeed: 0.05,\n scrollMaxExtraSpeed: 5,\n scrollInertiaDuration: 2500,\n};\n\nconst OBSERVED_ATTRIBUTES = ['speed', 'mode', 'direction', 'pause-on-hover'] as const;\n\nconst OPTION_ATTRIBUTE_MAP: Record<keyof MarqueeContentOptions, string> = {\n speed: 'speed',\n mode: 'mode',\n direction: 'direction',\n pauseOnHover: 'pause-on-hover',\n};\n\nconst MARQUEE_CONTENT_CSS_PROPS = [\n '--marquee-content-distance',\n '--marquee-content-duration',\n] as const;\n\nconst SCROLL_TIME_SCALE_SMOOTHING_SECONDS = 0.12;\nconst TOUCH_INPUT_QUERY = '(hover: none) and (pointer: coarse)';\nconst TOUCH_SCROLL_EDGE_THRESHOLD = 1;\nconst TOUCH_SCROLL_IDLE_DELAY = 250;\n\n// Server imports do not need a DOM; element construction still requires a browser.\nconst HTMLElementBase = (globalThis.HTMLElement ?? class {}) as typeof HTMLElement;\n\nconst MARQUEE_CONTENT_RUNTIME_CSS = `\n @keyframes marquee-content-auto {\n to {\n transform: translate3d(calc(-1 * var(--marquee-content-distance)), 0, 0);\n }\n }\n\n .marquee-content__source {\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n\n .marquee-content__source::slotted(*) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n`;\n\nconst TEMPLATE = `\n <slot class=\"marquee-content__source\"></slot>\n\n <div class=\"marquee-content__viewport\" part=\"viewport\">\n <div class=\"marquee-content__track\" part=\"track\" aria-hidden=\"true\" inert></div>\n </div>\n`;\n\nexport class MarqueeContent extends HTMLElementBase {\n static get observedAttributes(): string[] {\n return [...OBSERVED_ATTRIBUTES];\n }\n\n private static readonly instances = new Set<MarqueeContent>();\n\n private static readonly runtimeStylesheetEntry: MarqueeContentStyleEntry = normalizeStyleInput(\n MARQUEE_CONTENT_RUNTIME_CSS,\n );\n\n private static stylesheetEntry: MarqueeContentStyleEntry =\n normalizeStyleInput(marqueeContentCssText);\n\n private static styleOverridesEntry: MarqueeContentStyleEntry = normalizeStyleInput(null);\n\n static configureStyles(options: DefineMarqueeContentOptions = {}): void {\n if (!('stylesheet' in options) && !('styleOverrides' in options)) {\n return;\n }\n\n if ('stylesheet' in options) {\n MarqueeContent.stylesheetEntry = normalizeStyleInput(\n options.stylesheet ?? marqueeContentCssText,\n );\n }\n\n if ('styleOverrides' in options) {\n MarqueeContent.styleOverridesEntry = normalizeStyleInput(options.styleOverrides);\n }\n\n MarqueeContent.instances.forEach((instance) => {\n instance.applyAllStyles();\n instance.scheduleRebuild();\n });\n }\n\n static setStylesheet(stylesheet: MarqueeContentStyleInput): void {\n MarqueeContent.configureStyles({ stylesheet });\n }\n\n static setStyleOverrides(styleOverrides: MarqueeContentStyleInput): void {\n MarqueeContent.configureStyles({ styleOverrides });\n }\n\n private readonly shadow: ShadowRoot;\n private readonly sourceSlot: HTMLSlotElement;\n private readonly viewport: HTMLElement;\n private readonly track: HTMLElement;\n\n private options: MarqueeContentResolvedOptions = { ...DEFAULT_OPTIONS };\n private sourceNodes: Node[] = [];\n\n private resizeObserver: ResizeObserver | null = null;\n private mutationObserver: MutationObserver | null = null;\n private intersectionObserver: IntersectionObserver | null = null;\n private abortController: AbortController | null = null;\n private reducedMotionMediaQuery: MediaQueryList | null = null;\n private touchInputMediaQuery: MediaQueryList | null = null;\n\n private animationFrameId: number | null = null;\n private rebuildFrameId: number | null = null;\n private lastFrameTime: number | null = null;\n\n private mounted = false;\n private isHovered = false;\n private isFocused = false;\n private isInViewport = true;\n private reducedMotion = false;\n private touchInput = false;\n private isListeningToScroll = false;\n private isListeningToTouch = false;\n\n private distance = 0;\n private containerWidth = 0;\n private group: HTMLElement | null = null;\n private layoutPending = false;\n\n private scrollAnimation: Animation | null = null;\n private scrollAnimationDuration = 0;\n private scrollAnimationDistance = 0;\n private scrollProgress = 0;\n private scrollMotionActive = false;\n private scrollBaseSpeed = DEFAULT_OPTIONS.speed;\n\n private scrollDirectionFactor: 1 | -1 = 1;\n private currentTimeScale = 1;\n private scrollBoostStartValue = 0;\n private scrollBoostStartedAt = 0;\n private lastScrollY = 0;\n private lastScrollTime = 0;\n private lastTouchY: number | null = null;\n private touchScrollDirection: 1 | -1 | 0 = 0;\n private touchScrollResetTimer: number | null = null;\n\n constructor() {\n if (typeof HTMLElement === 'undefined') {\n throw new Error(\n '[MarqueeContent] Create elements in a browser, after client initialization.',\n );\n }\n\n super();\n\n this.shadow = this.attachShadow({ mode: 'open' });\n this.applyAllStyles();\n\n const template = document.createElement('template');\n template.innerHTML = TEMPLATE;\n this.shadow.appendChild(template.content.cloneNode(true));\n\n const sourceSlot = this.shadow.querySelector<HTMLSlotElement>('slot.marquee-content__source');\n const viewport = this.shadow.querySelector<HTMLElement>('.marquee-content__viewport');\n\n const track = this.shadow.querySelector<HTMLElement>('.marquee-content__track');\n\n if (!sourceSlot) {\n throw new Error('[MarqueeContent] Source slot was not found.');\n }\n\n if (!track) {\n throw new Error('[MarqueeContent] Track element was not found.');\n }\n\n if (!viewport) {\n throw new Error('[MarqueeContent] Viewport element was not found.');\n }\n\n this.sourceSlot = sourceSlot;\n this.viewport = viewport;\n this.track = track;\n }\n\n connectedCallback(): void {\n if (this.mounted) {\n return;\n }\n\n MarqueeContent.instances.add(this);\n\n this.mounted = true;\n this.applyAllStyles();\n this.abortController = new AbortController();\n this.options = this.resolveOptions();\n\n this.lastScrollY = this.getScrollY();\n this.lastScrollTime = performance.now();\n\n this.sourceSlot.addEventListener('slotchange', this.handleSlotChange, {\n signal: this.abortController.signal,\n });\n\n // Only source loads should rebuild the track, never loads from its decorative copies.\n for (const eventName of ['load', 'error']) {\n this.addEventListener(eventName, this.handleSourceLoad, {\n capture: true,\n signal: this.abortController.signal,\n });\n this.shadow.addEventListener(eventName, this.completeLayout, {\n capture: true,\n signal: this.abortController.signal,\n });\n }\n\n this.addEventListener('pointerenter', this.handlePointerEnter, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('pointerleave', this.handlePointerLeave, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('focusin', this.handleFocusIn, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('focusout', this.handleFocusOut, {\n signal: this.abortController.signal,\n });\n\n window.addEventListener('orientationchange', this.scheduleRebuild, {\n signal: this.abortController.signal,\n });\n\n this.resizeObserver = new ResizeObserver(this.handleResize);\n this.resizeObserver.observe(this);\n this.resizeObserver.observe(this.viewport);\n\n this.intersectionObserver = new IntersectionObserver(this.handleIntersectionChange);\n this.intersectionObserver.observe(this);\n\n this.setupReducedMotionWatcher();\n this.setupTouchInputWatcher();\n this.watchSourceNodes();\n this.updateScrollListener();\n this.rebuild();\n\n if (this.options.recalculateAfterFontsReady) {\n this.rebuildAfterFontsReady();\n }\n }\n\n disconnectedCallback(): void {\n this.teardown();\n MarqueeContent.instances.delete(this);\n }\n\n attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue) {\n return;\n }\n\n this.options = this.resolveOptions();\n\n if (!this.mounted) {\n return;\n }\n\n this.updateScrollListener();\n this.applyOptions();\n }\n\n get speed(): number {\n return this.options.speed;\n }\n\n set speed(value: number | string | null | undefined) {\n this.setNullableAttribute('speed', value);\n }\n\n get mode(): MarqueeContentMode {\n return this.options.mode;\n }\n\n set mode(value: MarqueeContentMode | null | undefined) {\n this.setNullableAttribute('mode', value);\n }\n\n get direction(): MarqueeContentDirection {\n return this.options.direction;\n }\n\n set direction(value: MarqueeContentDirection | null | undefined) {\n this.setNullableAttribute('direction', value);\n }\n\n get pauseOnHover(): boolean {\n return this.options.pauseOnHover;\n }\n\n set pauseOnHover(value: boolean | string | null | undefined) {\n this.setNullableAttribute('pause-on-hover', value);\n }\n\n update(options: MarqueeContentOptions = {}): void {\n Object.entries(options).forEach(([key, value]) => {\n const attributeName = OPTION_ATTRIBUTE_MAP[key as keyof MarqueeContentOptions];\n\n if (attributeName) {\n this.setNullableAttribute(attributeName, value);\n }\n });\n\n this.options = this.resolveOptions();\n this.updateScrollListener();\n this.applyOptions();\n }\n\n refresh(): void {\n this.scheduleRebuild();\n }\n\n private applyAllStyles(): void {\n const runtime = MarqueeContent.runtimeStylesheetEntry;\n const base = MarqueeContent.stylesheetEntry;\n const overrides = MarqueeContent.styleOverridesEntry;\n const sheets: CSSStyleSheet[] = [];\n\n if (runtime.sheet) {\n sheets.push(runtime.sheet);\n }\n\n if (base.sheet) {\n sheets.push(base.sheet);\n }\n\n if (overrides.sheet) {\n sheets.push(overrides.sheet);\n }\n\n this.shadow.adoptedStyleSheets = sheets;\n }\n\n private teardown(): void {\n if (!this.mounted) {\n return;\n }\n\n this.mounted = false;\n\n this.stopAnimationLoop();\n this.stopCssAnimation();\n this.cancelScrollAnimation();\n this.cancelScheduledRebuild();\n this.updateScrollListener(false);\n\n this.resizeObserver?.disconnect();\n this.mutationObserver?.disconnect();\n this.intersectionObserver?.disconnect();\n\n this.removeReducedMotionWatcher();\n this.removeTouchInputWatcher();\n\n this.abortController?.abort();\n\n this.group = null;\n this.layoutPending = false;\n this.containerWidth = 0;\n this.resizeObserver = null;\n this.mutationObserver = null;\n this.intersectionObserver = null;\n this.abortController = null;\n\n this.track.replaceChildren();\n this.removeAttribute('data-marquee-content-ready');\n this.removeAttribute('data-marquee-content-mode');\n this.removeAttribute('data-marquee-content-pause-on-hover');\n this.removeAttribute('data-marquee-content-reduced-motion');\n\n MARQUEE_CONTENT_CSS_PROPS.forEach((prop) => {\n this.style.removeProperty(prop);\n });\n\n this.distance = 0;\n this.isHovered = false;\n this.isFocused = false;\n this.isInViewport = true;\n this.scrollDirectionFactor = 1;\n this.scrollBoostStartValue = 0;\n this.scrollBoostStartedAt = 0;\n this.scrollProgress = 0;\n this.scrollMotionActive = false;\n this.scrollBaseSpeed = DEFAULT_OPTIONS.speed;\n this.currentTimeScale = 1;\n this.lastFrameTime = null;\n }\n\n private handleResize = (): void => {\n if (\n this.measureViewportWidth() !== this.containerWidth ||\n (this.group &&\n !this.layoutPending &&\n Math.abs(this.measureGroup(this.group) - this.distance) > 0.01)\n ) {\n this.scheduleRebuild();\n }\n };\n\n private handleSourceLoad = (event: Event): void => {\n // A shadow-tree event may be retargeted to the host; only authored descendants count.\n if (event.target instanceof Node && event.target !== this && this.contains(event.target)) {\n this.scheduleRebuild();\n }\n };\n\n private handleSlotChange = (): void => {\n this.watchSourceNodes();\n this.scheduleRebuild();\n };\n\n private handlePointerEnter = (): void => {\n this.isHovered = true;\n this.updateAnimationLoopState();\n };\n\n private handlePointerLeave = (): void => {\n this.isHovered = false;\n this.updateAnimationLoopState();\n };\n\n private handleFocusIn = (): void => {\n this.isFocused = true;\n this.updateAnimationLoopState();\n };\n\n private handleFocusOut = (): void => {\n this.isFocused = false;\n this.updateAnimationLoopState();\n };\n\n private handleIntersectionChange = (entries: IntersectionObserverEntry[]): void => {\n const entry = entries[0];\n\n if (!entry) {\n return;\n }\n\n this.isInViewport = entry.isIntersecting;\n this.updateAnimationLoopState();\n };\n\n private handleReducedMotionChange = (event: MediaQueryListEvent | MediaQueryList): void => {\n this.reducedMotion = event.matches;\n\n if (this.reducedMotion) {\n this.track.style.transform = 'none';\n } else if (this.getEffectiveMode() === 'scroll') {\n this.track.style.transform = '';\n }\n\n this.updateAnimationLoopState();\n this.scheduleRebuild();\n };\n\n private handleScroll = (): void => {\n if (this.options.mode !== 'scroll') {\n return;\n }\n\n const now = performance.now();\n const currentScrollY = this.getScrollY();\n\n const deltaY = currentScrollY - this.lastScrollY;\n const deltaTime = Math.max((now - this.lastScrollTime) / 1000, 0.016);\n\n this.lastScrollY = currentScrollY;\n this.lastScrollTime = now;\n\n if (this.touchInput) {\n this.scheduleTouchScrollReset();\n }\n\n if (Math.abs(deltaY) < 0.5) {\n return;\n }\n\n const velocity = deltaY / deltaTime;\n\n const direction = velocity >= 0 ? 1 : -1;\n // A rubber-band return can cross back inside the page bounds. Only accept\n // motion matching the finger, including its momentum after touchend.\n if (\n this.touchInput &&\n ((this.lastTouchY !== null && this.touchScrollDirection === 0) ||\n (this.touchScrollDirection !== 0 && direction !== this.touchScrollDirection))\n ) {\n return;\n }\n\n const directionChanged = direction !== this.scrollDirectionFactor;\n this.scrollDirectionFactor = direction;\n\n if (this.touchInput) {\n if (directionChanged) {\n this.applyOptions();\n }\n return;\n }\n\n const extraSpeed = this.clamp(\n velocity / this.options.scrollVelocityFactor,\n -this.options.scrollMaxExtraSpeed,\n this.options.scrollMaxExtraSpeed,\n );\n\n if (Math.abs(extraSpeed) >= this.options.scrollMinExtraSpeed) {\n this.scrollBoostStartValue = extraSpeed;\n this.scrollBoostStartedAt = now;\n } else {\n this.scrollBoostStartValue = 0;\n }\n\n this.onScrollBoostChanged();\n };\n\n private handleTouchStart = (event: TouchEvent): void => {\n this.resetTouchScroll();\n const touch = event.touches.length === 1 ? event.touches[0] : null;\n if (touch) {\n this.lastTouchY = touch.clientY;\n }\n };\n\n private handleTouchMove = (event: TouchEvent): void => {\n if (event.touches.length !== 1) {\n this.resetTouchScroll();\n return;\n }\n const touch = event.touches[0];\n if (!touch || this.lastTouchY === null) {\n return;\n }\n const deltaY = this.lastTouchY - touch.clientY;\n if (Math.abs(deltaY) < 0.5) {\n return;\n }\n this.lastTouchY = touch.clientY;\n this.touchScrollDirection = deltaY > 0 ? 1 : -1;\n };\n\n private handleTouchEnd = (event: TouchEvent): void => {\n if (event.touches.length > 0) {\n this.resetTouchScroll();\n return;\n }\n this.lastTouchY = null;\n this.scheduleTouchScrollReset();\n };\n\n private handleScrollEnd = (): void => {\n if (this.lastTouchY === null) {\n this.resetTouchScroll();\n }\n };\n\n private scheduleTouchScrollReset(): void {\n if (this.touchScrollResetTimer !== null) {\n window.clearTimeout(this.touchScrollResetTimer);\n this.touchScrollResetTimer = null;\n }\n if (this.lastTouchY === null && this.touchScrollDirection !== 0) {\n // Also release intent when a gesture scrolls a nested element, or on Safari\n // versions without scrollend. Every page scroll extends this idle window.\n this.touchScrollResetTimer = window.setTimeout(\n this.resetTouchScroll,\n TOUCH_SCROLL_IDLE_DELAY,\n );\n }\n }\n\n private resetTouchScroll = (): void => {\n if (this.touchScrollResetTimer !== null) {\n window.clearTimeout(this.touchScrollResetTimer);\n this.touchScrollResetTimer = null;\n }\n this.lastTouchY = null;\n this.touchScrollDirection = 0;\n };\n\n private onScrollBoostChanged(): void {\n if (!this.mounted || this.getEffectiveMode() !== 'scroll' || this.reducedMotion) {\n return;\n }\n\n if (!this.canAnimate() || this.distance <= 0) {\n return;\n }\n\n if (!this.scrollMotionActive) {\n this.cancelScrollAnimation();\n this.scrollMotionActive = true;\n this.renderScrollProgress();\n }\n\n this.startAnimationLoop();\n }\n\n private updateScrollListener(\n shouldListen = this.mounted && this.options.mode === 'scroll',\n ): void {\n if (shouldListen !== this.isListeningToScroll) {\n if (shouldListen) {\n this.lastScrollY = this.getScrollY();\n this.lastScrollTime = performance.now();\n window.addEventListener('scroll', this.handleScroll, { passive: true });\n } else {\n window.removeEventListener('scroll', this.handleScroll);\n }\n this.isListeningToScroll = shouldListen;\n }\n\n const shouldListenToTouch = shouldListen && this.touchInput;\n if (shouldListenToTouch !== this.isListeningToTouch) {\n if (shouldListenToTouch) {\n window.addEventListener('touchstart', this.handleTouchStart, {\n passive: true,\n capture: true,\n });\n window.addEventListener('touchmove', this.handleTouchMove, {\n passive: true,\n capture: true,\n });\n window.addEventListener('touchend', this.handleTouchEnd, { passive: true, capture: true });\n window.addEventListener('touchcancel', this.handleTouchEnd, {\n passive: true,\n capture: true,\n });\n window.addEventListener('scrollend', this.handleScrollEnd);\n } else {\n window.removeEventListener('touchstart', this.handleTouchStart, true);\n window.removeEventListener('touchmove', this.handleTouchMove, true);\n window.removeEventListener('touchend', this.handleTouchEnd, true);\n window.removeEventListener('touchcancel', this.handleTouchEnd, true);\n window.removeEventListener('scrollend', this.handleScrollEnd);\n this.resetTouchScroll();\n }\n this.isListeningToTouch = shouldListenToTouch;\n }\n }\n\n private scheduleRebuild = (): void => {\n if (!this.mounted) {\n return;\n }\n\n this.cancelScheduledRebuild();\n\n this.rebuildFrameId = requestAnimationFrame(() => {\n this.rebuildFrameId = null;\n this.rebuild();\n });\n };\n\n private cancelScheduledRebuild(): void {\n if (this.rebuildFrameId === null) {\n return;\n }\n\n cancelAnimationFrame(this.rebuildFrameId);\n this.rebuildFrameId = null;\n }\n\n private applyOptions(): void {\n if (!this.mounted) {\n return;\n }\n\n const progress = this.scrollAnimation\n ? this.getScrollAnimationProgress()\n : (this.getAutoAnimation()?.effect?.getComputedTiming().progress ?? this.scrollProgress);\n this.scrollBaseSpeed = this.options.speed;\n const duration = this.distance / this.scrollBaseSpeed;\n\n this.setAttribute('data-marquee-content-mode', this.options.mode);\n this.toggleAttribute('data-marquee-content-pause-on-hover', this.options.pauseOnHover);\n this.toggleAttribute('data-marquee-content-reduced-motion', this.reducedMotion);\n\n if (this.distance > 0) {\n this.style.setProperty('--marquee-content-distance', `${this.distance}px`);\n this.style.setProperty('--marquee-content-duration', `${duration}s`);\n }\n\n if (progress != null) {\n this.scrollProgress = progress;\n }\n\n this.updateAnimationLoopState();\n\n if (progress != null && this.getEffectiveMode() === 'auto' && !this.reducedMotion) {\n const animation = this.getAutoAnimation();\n\n if (animation) {\n animation.currentTime =\n duration *\n 1000 *\n (this.track.style.animationDirection === 'reverse' ? 1 - progress : progress);\n }\n }\n }\n\n private getAutoAnimation(): Animation | undefined {\n return this.track\n .getAnimations()\n .find(\n (animation) =>\n 'animationName' in animation && animation.animationName === 'marquee-content-auto',\n );\n }\n\n private rebuild(): void {\n if (!this.mounted) {\n return;\n }\n\n this.options = this.resolveOptions();\n this.updateScrollListener();\n const progress = this.scrollAnimation\n ? this.getScrollAnimationProgress()\n : this.getAutoAnimation()?.effect?.getComputedTiming().progress;\n\n if (progress != null) {\n this.scrollProgress = progress;\n }\n\n this.distance = 0;\n this.layoutPending = false;\n this.updateAnimationLoopState();\n this.removeAttribute('data-marquee-content-ready');\n this.toggleAttribute('data-marquee-content-reduced-motion', this.reducedMotion);\n this.containerWidth = this.measureViewportWidth();\n\n if (this.group) {\n this.resizeObserver?.unobserve(this.group);\n this.group = null;\n }\n\n this.sourceNodes = this.getSourceNodes();\n\n if (this.containerWidth <= 0 || this.sourceNodes.length === 0) {\n this.distance = 0;\n this.track.replaceChildren();\n this.applyOptions();\n return;\n }\n\n this.group = this.createGroup();\n this.track.replaceChildren(this.group);\n this.layoutPending = true;\n this.completeLayout();\n }\n\n private completeLayout = (): void => {\n const group = this.group;\n\n if (!this.mounted || !group || !this.layoutPending) {\n return;\n }\n\n // Cached clones can load asynchronously. Keep the measured source period in place\n // and reconcile coverage again when loading finishes in case its dimensions changed.\n if (this.hasPendingImages(this.track)) {\n return;\n }\n\n if (!this.reducedMotion) {\n this.fillTrack(group);\n\n if (this.hasPendingImages(this.track)) {\n return;\n }\n }\n\n this.layoutPending = false;\n this.distance = this.measureGroup(group);\n this.resizeObserver?.observe(group);\n\n if (!Number.isFinite(this.distance) || this.distance <= 0) {\n this.track.replaceChildren();\n this.applyOptions();\n return;\n }\n\n this.setAttribute('data-marquee-content-ready', 'true');\n this.applyOptions();\n };\n\n private hasPendingImages(root: ParentNode): boolean {\n return Array.from(root.querySelectorAll('img')).some((image) => !image.complete);\n }\n\n private measureViewportWidth(): number {\n if (this.viewport.getClientRects().length === 0) {\n return 0;\n }\n\n const style = getComputedStyle(this.viewport);\n const width = Number.parseFloat(style.width);\n\n if (!Number.isFinite(width)) {\n return this.viewport.clientWidth;\n }\n\n // Preserve fractional layout pixels and ignore ancestor transforms.\n return style.boxSizing === 'border-box'\n ? width - Number.parseFloat(style.borderLeftWidth) - Number.parseFloat(style.borderRightWidth)\n : width + Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight);\n }\n\n private measureGroup(group: HTMLElement): number {\n const style = getComputedStyle(group);\n const width = Number.parseFloat(style.width);\n\n if (!Number.isFinite(width)) {\n return group.scrollWidth;\n }\n\n if (style.boxSizing === 'border-box') {\n return width;\n }\n\n return (\n width +\n Number.parseFloat(style.paddingLeft) +\n Number.parseFloat(style.paddingRight) +\n Number.parseFloat(style.borderLeftWidth) +\n Number.parseFloat(style.borderRightWidth)\n );\n }\n\n private createGroup(): HTMLElement {\n const group = document.createElement('div');\n\n group.className = 'marquee-content__group';\n group.setAttribute('part', 'group');\n\n this.appendSourceNodes(group);\n\n return group;\n }\n\n private fillTrack(group: HTMLElement): void {\n const period = this.measureGroup(group);\n\n if (!Number.isFinite(period) || period <= 0) {\n return;\n }\n\n // One period moves offscreen while the remaining copies cover the viewport.\n // Repeat whole groups so custom padding and borders recur at every seam.\n const groupCount = Math.ceil(this.containerWidth / period) + 1;\n\n while (this.track.childElementCount > groupCount) {\n this.track.lastElementChild?.remove();\n }\n\n const fragment = document.createDocumentFragment();\n\n for (let index = this.track.childElementCount; index < groupCount; index += 1) {\n fragment.appendChild(group.cloneNode(true));\n }\n\n this.track.appendChild(fragment);\n }\n\n private appendSourceNodes(target: HTMLElement): void {\n const fragment = document.createDocumentFragment();\n\n this.sourceNodes.forEach((node) => {\n fragment.append(this.cloneSourceNode(node));\n });\n\n target.appendChild(fragment);\n }\n\n private cloneSourceNode(node: Node): Node {\n const clone = node.cloneNode(true);\n\n if (clone instanceof Element) {\n const currentPart = clone.getAttribute('part');\n\n clone.setAttribute('part', currentPart ? `${currentPart} item` : 'item');\n\n // Offscreen lazy copies still need intrinsic dimensions before the loop can be measured.\n if (clone instanceof HTMLImageElement) {\n clone.loading = 'eager';\n }\n\n clone.querySelectorAll('img').forEach((image) => {\n image.loading = 'eager';\n });\n }\n\n return clone;\n }\n\n private getSourceNodes(): Node[] {\n return this.sourceSlot.assignedNodes({ flatten: true }).filter((node) => {\n if (node.nodeType === Node.TEXT_NODE) {\n return Boolean(node.textContent?.trim());\n }\n\n return node.nodeType === Node.ELEMENT_NODE;\n });\n }\n\n private watchSourceNodes(): void {\n this.mutationObserver?.disconnect();\n\n this.mutationObserver = new MutationObserver(this.scheduleRebuild);\n\n this.sourceSlot.assignedNodes({ flatten: true }).forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n this.mutationObserver?.observe(node, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n });\n\n return;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n this.mutationObserver?.observe(node, {\n characterData: true,\n });\n }\n });\n }\n\n private setupReducedMotionWatcher(): void {\n if (!('matchMedia' in window)) {\n return;\n }\n\n this.reducedMotionMediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');\n\n this.reducedMotion = this.reducedMotionMediaQuery.matches;\n this.reducedMotionMediaQuery.addEventListener('change', this.handleReducedMotionChange, {\n signal: this.abortController?.signal,\n });\n }\n\n private removeReducedMotionWatcher(): void {\n if (!this.reducedMotionMediaQuery) {\n return;\n }\n\n this.reducedMotionMediaQuery.removeEventListener('change', this.handleReducedMotionChange);\n\n this.reducedMotionMediaQuery = null;\n }\n\n private getEffectiveMode(): MarqueeContentMode {\n return this.touchInput ? 'auto' : this.options.mode;\n }\n\n private setupTouchInputWatcher(): void {\n if (!('matchMedia' in window)) {\n return;\n }\n\n this.touchInputMediaQuery = window.matchMedia(TOUCH_INPUT_QUERY);\n this.touchInput = this.touchInputMediaQuery.matches;\n this.touchInputMediaQuery.addEventListener('change', this.handleTouchInputChange, {\n signal: this.abortController?.signal,\n });\n }\n\n private removeTouchInputWatcher(): void {\n this.touchInputMediaQuery?.removeEventListener('change', this.handleTouchInputChange);\n this.touchInputMediaQuery = null;\n this.touchInput = false;\n }\n\n private handleTouchInputChange = (event: MediaQueryListEvent): void => {\n if (!this.mounted || event.matches === this.touchInput) {\n return;\n }\n\n this.touchInput = event.matches;\n this.lastScrollY = this.getScrollY();\n this.lastScrollTime = performance.now();\n this.stopAnimationLoop();\n this.cancelScrollAnimation();\n this.scrollMotionActive = false;\n this.scrollBoostStartValue = 0;\n this.scrollBoostStartedAt = 0;\n this.currentTimeScale = this.getDirectionFactor() * this.scrollDirectionFactor;\n this.updateScrollListener();\n this.applyOptions();\n };\n\n private updateAnimationLoopState(): void {\n if (!this.mounted || this.distance <= 0 || this.reducedMotion) {\n this.stopAnimationLoop();\n this.stopCssAnimation();\n this.cancelScrollAnimation();\n\n // A rebuild temporarily has no distance. Keep its phase and speed until layout\n // completes, while mode changes and reduced motion leave the active path.\n if (!this.mounted || this.getEffectiveMode() !== 'scroll' || this.reducedMotion) {\n this.scrollMotionActive = false;\n }\n\n this.track.style.transform = this.reducedMotion ? 'none' : '';\n return;\n }\n\n if (this.getEffectiveMode() === 'scroll') {\n this.stopCssAnimation();\n\n if (this.scrollMotionActive) {\n this.renderScrollProgress();\n\n if (this.canAnimate()) {\n this.startAnimationLoop();\n } else {\n this.stopAnimationLoop();\n }\n\n return;\n }\n\n this.currentTimeScale = this.getDirectionFactor() * this.scrollDirectionFactor;\n this.ensureScrollAnimation();\n\n if (!this.scrollAnimation || !this.canAnimate()) {\n this.scrollAnimation?.pause();\n this.stopAnimationLoop();\n return;\n }\n\n if (this.scrollBoostStartValue !== 0) {\n this.onScrollBoostChanged();\n } else {\n this.track.style.transform = '';\n\n if (this.scrollAnimation.playState !== 'running') {\n this.scrollAnimation.play();\n }\n }\n\n return;\n }\n\n this.stopAnimationLoop();\n this.cancelScrollAnimation();\n this.scrollMotionActive = false;\n this.startCssAnimation();\n this.track.style.animationPlayState = this.canAnimate() ? 'running' : 'paused';\n }\n\n private canAnimate(): boolean {\n if (this.options.pauseOnHover && this.isHovered) {\n return false;\n }\n\n if (this.isFocused) {\n return false;\n }\n\n if (this.options.pauseWhenOutOfView && !this.isInViewport) {\n return false;\n }\n\n return true;\n }\n\n private startAnimationLoop(): void {\n if (this.animationFrameId !== null) {\n return;\n }\n\n this.lastFrameTime = performance.now();\n this.animationFrameId = requestAnimationFrame(this.tick);\n }\n\n private stopAnimationLoop(): void {\n if (this.animationFrameId === null) {\n this.lastFrameTime = null;\n return;\n }\n\n cancelAnimationFrame(this.animationFrameId);\n this.animationFrameId = null;\n this.lastFrameTime = null;\n }\n\n private startCssAnimation(): void {\n const scrollDirection =\n this.touchInput && this.options.mode === 'scroll' ? this.scrollDirectionFactor : 1;\n const animationDirection =\n this.getDirectionFactor() * scrollDirection < 0 ? 'reverse' : 'normal';\n\n this.track.style.transform = '';\n\n if (this.track.style.animationName !== 'marquee-content-auto') {\n this.track.style.animationName = 'marquee-content-auto';\n this.track.style.animationDuration = 'var(--marquee-content-duration)';\n this.track.style.animationTimingFunction = 'linear';\n this.track.style.animationIterationCount = 'infinite';\n }\n\n if (this.track.style.animationDirection !== animationDirection) {\n this.track.style.animationDirection = animationDirection;\n }\n }\n\n private stopCssAnimation(): void {\n this.track.style.animationName = '';\n this.track.style.animationDuration = '';\n this.track.style.animationTimingFunction = '';\n this.track.style.animationIterationCount = '';\n this.track.style.animationDirection = '';\n this.track.style.animationPlayState = '';\n }\n\n private tick = (now: number): void => {\n this.animationFrameId = null;\n\n if (\n !this.mounted ||\n this.getEffectiveMode() !== 'scroll' ||\n this.distance <= 0 ||\n this.reducedMotion ||\n !this.canAnimate() ||\n !this.scrollMotionActive\n ) {\n return;\n }\n\n const settled = this.advanceScrollMotion(now);\n\n if (settled) {\n this.scrollMotionActive = false;\n this.ensureScrollAnimation();\n this.track.style.transform = '';\n this.lastFrameTime = null;\n return;\n }\n\n this.animationFrameId = requestAnimationFrame(this.tick);\n };\n\n private ensureScrollAnimation(): void {\n if (this.distance <= 0) {\n this.cancelScrollAnimation();\n return;\n }\n\n const currentSpeed = this.scrollBaseSpeed;\n const durationMs = currentSpeed > 0 ? (this.distance / currentSpeed) * 1000 : 0;\n const reversed = this.currentTimeScale < 0;\n\n if (durationMs <= 0) {\n this.cancelScrollAnimation();\n return;\n }\n\n if (\n this.scrollAnimation &&\n this.scrollAnimationDistance === this.distance &&\n this.scrollAnimationDuration === durationMs &&\n this.scrollAnimation.effect?.getTiming().direction === (reversed ? 'reverse' : 'normal')\n ) {\n return;\n }\n\n const progress = this.getScrollAnimationProgress();\n if (this.scrollAnimation) {\n this.scrollAnimation.cancel();\n this.scrollAnimation = null;\n }\n\n const animation = this.track.animate(\n [\n { transform: 'translate3d(0px, 0, 0)' },\n { transform: `translate3d(${-this.distance}px, 0, 0)` },\n ],\n {\n duration: durationMs,\n iterations: Number.POSITIVE_INFINITY,\n easing: 'linear',\n },\n );\n\n // Reverse the effect while keeping time positive, so long-running motion cannot end at zero.\n animation.effect?.updateTiming({ direction: reversed ? 'reverse' : 'normal' });\n animation.currentTime = durationMs * (reversed ? 1 - progress : progress);\n animation.playbackRate = Math.abs(this.currentTimeScale);\n\n this.scrollAnimation = animation;\n this.scrollAnimationDuration = durationMs;\n this.scrollAnimationDistance = this.distance;\n this.scrollProgress = progress;\n }\n\n private cancelScrollAnimation(): void {\n if (!this.scrollAnimation) {\n return;\n }\n\n this.scrollProgress = this.getScrollAnimationProgress();\n this.scrollAnimation.cancel();\n this.scrollAnimation = null;\n this.scrollAnimationDuration = 0;\n this.scrollAnimationDistance = 0;\n }\n\n private getScrollAnimationProgress(): number {\n const animation = this.scrollAnimation;\n\n if (!animation || this.scrollAnimationDuration <= 0) {\n return this.scrollProgress;\n }\n\n // currentTime can be rounded by the browser. Computed progress reflects the\n // rendered phase and already accounts for a reversed effect.\n const progress = animation.effect?.getComputedTiming().progress;\n\n if (progress != null) {\n return progress % 1;\n }\n\n const currentTime = animation.currentTime;\n\n if (typeof currentTime !== 'number') {\n return this.scrollProgress;\n }\n\n const fraction = (currentTime / this.scrollAnimationDuration) % 1;\n\n const normalized = fraction < 0 ? fraction + 1 : fraction;\n\n return animation.effect?.getTiming().direction === 'reverse'\n ? (1 - normalized) % 1\n : normalized;\n }\n\n private advanceScrollMotion(now: number): boolean {\n const target = this.getCurrentTimeScale(now);\n const previousTimeScale = this.currentTimeScale;\n const previousTime = this.lastFrameTime ?? now;\n const deltaTime = this.clamp((now - previousTime) / 1000, 0, 0.064);\n\n this.lastFrameTime = now;\n\n const smoothingFactor = 1 - Math.exp(-deltaTime / SCROLL_TIME_SCALE_SMOOTHING_SECONDS);\n\n this.currentTimeScale += (target - this.currentTimeScale) * smoothingFactor;\n\n const settled =\n this.scrollBoostStartValue === 0 && Math.abs(target - this.currentTimeScale) < 0.001;\n\n if (settled) {\n this.currentTimeScale = target;\n }\n\n // Keep changing speed on the frame clock, without resynchronizing an accelerated\n // WAAPI animation on every frame. Idle motion returns to WAAPI after settling.\n const averageTimeScale = (previousTimeScale + this.currentTimeScale) / 2;\n const progress =\n this.scrollProgress + (this.scrollBaseSpeed * averageTimeScale * deltaTime) / this.distance;\n\n this.scrollProgress = ((progress % 1) + 1) % 1;\n this.renderScrollProgress();\n\n return settled;\n }\n\n private renderScrollProgress(): void {\n this.track.style.transform = `translate3d(${-this.scrollProgress * this.distance}px, 0, 0)`;\n }\n\n private getCurrentTimeScale(now: number): number {\n const directionFactor = this.getDirectionFactor();\n\n if (this.getEffectiveMode() !== 'scroll') {\n return directionFactor;\n }\n\n const boost = this.getScrollBoost(now);\n const scrollTimeScale = this.scrollDirectionFactor + boost;\n\n return this.clamp(\n directionFactor * scrollTimeScale,\n -1 - this.options.scrollMaxExtraSpeed,\n 1 + this.options.scrollMaxExtraSpeed,\n );\n }\n\n private getDirectionFactor(): 1 | -1 {\n return this.options.direction === 'ltr' ? -1 : 1;\n }\n\n private getScrollBoost(now: number): number {\n if (this.scrollBoostStartValue === 0) {\n return 0;\n }\n\n const duration = this.options.scrollInertiaDuration;\n\n if (duration <= 0) {\n this.scrollBoostStartValue = 0;\n return 0;\n }\n\n const progress = this.clamp((now - this.scrollBoostStartedAt) / duration, 0, 1);\n\n if (progress >= 1) {\n this.scrollBoostStartValue = 0;\n return 0;\n }\n\n const easedProgress = this.easeOutCubic(progress);\n\n return this.scrollBoostStartValue * (1 - easedProgress);\n }\n\n private resolveOptions(): MarqueeContentResolvedOptions {\n return {\n ...DEFAULT_OPTIONS,\n speed: this.num('speed', DEFAULT_OPTIONS.speed, 10, 500),\n mode: this.parseMode(this.getAttribute('mode'), DEFAULT_OPTIONS.mode),\n direction: this.parseDirection(this.getAttribute('direction'), DEFAULT_OPTIONS.direction),\n pauseOnHover: this.parseBoolean(\n this.getAttribute('pause-on-hover'),\n DEFAULT_OPTIONS.pauseOnHover,\n ),\n };\n }\n\n private num(attributeName: string, fallback: number, min: number, max: number): number {\n return this.clamp(this.parseNumber(this.getAttribute(attributeName), fallback), min, max);\n }\n\n private parseNumber(value: string | null, fallback: number): number {\n if (value === null || value.trim() === '') {\n return fallback;\n }\n\n const parsed = Number(value);\n\n return Number.isFinite(parsed) ? parsed : fallback;\n }\n\n private parseBoolean(value: string | null, fallback: boolean): boolean {\n if (value === null) {\n return fallback;\n }\n\n const normalizedValue = value.trim().toLowerCase();\n\n if (normalizedValue === '') {\n return true;\n }\n\n if (['true', '1', 'yes', 'on'].includes(normalizedValue)) {\n return true;\n }\n\n if (['false', '0', 'no', 'off'].includes(normalizedValue)) {\n return false;\n }\n\n return fallback;\n }\n\n private parseMode(value: string | null, fallback: MarqueeContentMode): MarqueeContentMode {\n if (value === 'auto' || value === 'scroll') {\n return value;\n }\n\n return fallback;\n }\n\n private parseDirection(\n value: string | null,\n fallback: MarqueeContentDirection,\n ): MarqueeContentDirection {\n if (value === 'rtl' || value === 'ltr') {\n return value;\n }\n\n return fallback;\n }\n\n private setNullableAttribute(\n name: string,\n value: string | number | boolean | null | undefined,\n ): void {\n if (value === null || value === undefined) {\n this.removeAttribute(name);\n return;\n }\n\n this.setAttribute(name, String(value));\n }\n\n private getScrollY(): number {\n const scrollY = window.scrollY || window.pageYOffset || 0;\n if (!this.touchInput) {\n return scrollY;\n }\n\n const scroller = document.scrollingElement ?? document.documentElement;\n const maxScroll = Math.max(0, scroller.scrollHeight - scroller.clientHeight);\n\n // Ignore rubber-band movement and subpixel jitter at either page edge.\n if (scrollY <= TOUCH_SCROLL_EDGE_THRESHOLD) {\n return 0;\n }\n if (scrollY >= maxScroll - TOUCH_SCROLL_EDGE_THRESHOLD) {\n return maxScroll;\n }\n return scrollY;\n }\n\n private clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n }\n\n private easeOutCubic(value: number): number {\n return 1 - (1 - value) ** 3;\n }\n\n private rebuildAfterFontsReady(): void {\n const fonts = (\n document as Document & {\n fonts?: { ready: Promise<unknown> };\n }\n ).fonts;\n\n if (!fonts?.ready) {\n return;\n }\n\n void fonts.ready.then(this.scheduleRebuild).catch(() => undefined);\n }\n}\n\nexport function defineMarqueeContent(\n tagName = MARQUEE_CONTENT_TAG,\n options: DefineMarqueeContentOptions = {},\n): void {\n if (typeof window === 'undefined' || !window.customElements) {\n return;\n }\n\n MarqueeContent.configureStyles(options);\n\n if (!window.customElements.get(tagName)) {\n const elementClass =\n tagName === MARQUEE_CONTENT_TAG ? MarqueeContent : class extends MarqueeContent {};\n window.customElements.define(tagName, elementClass);\n }\n}\n\nexport function initMarqueeContents(options: InitMarqueeContentsOptions = {}): void {\n const { tagName = MARQUEE_CONTENT_TAG, ...styleOptions } = options;\n\n defineMarqueeContent(tagName, styleOptions);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'marquee-content': MarqueeContent;\n }\n}\n","export type {\n DefineMarqueeContentOptions,\n InitMarqueeContentsOptions,\n MarqueeContentDirection,\n MarqueeContentMode,\n MarqueeContentOptions,\n} from './marquee-content';\nexport {\n defineMarqueeContent,\n initMarqueeContents,\n MARQUEE_CONTENT_TAG,\n MarqueeContent,\n} from './marquee-content';\nexport type {\n MarqueeContentStyleEntry,\n MarqueeContentStyleInput,\n} from './styles';\nexport {\n createConstructableStyleSheet,\n cssStyleSheetToText,\n marqueeContentCssText,\n normalizeStyleInput,\n} from './styles';\n\nimport { defineMarqueeContent } from './marquee-content';\n\ndefineMarqueeContent();\n"],"mappings":";;;;;;;AAUA,MAAa,wBAAgCA;AAE7C,SAAgB,8BAA8B,SAAuC;CACnF,IACE,OAAO,kBAAkB,eACzB,OAAO,cAAc,UAAU,gBAAgB,YAE/C,OAAO;CAGT,IAAI;EACF,MAAM,QAAQ,IAAI,cAAc;EAChC,MAAM,YAAY,OAAO;EACzB,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,oBAAoB,OAA8B;CAChE,IAAI;EACF,OAAO,MAAM,KAAK,MAAM,QAAQ,CAAC,CAC9B,KAAK,SAAS,KAAK,OAAO,CAAC,CAC3B,KAAK,IAAI;CACd,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,oBAAoB,OAA2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AAoB,UAAsC,CAAC,GAAS;CAClF,MAAM,EAAE,UAAU,qBAAqB,GAAG,iBAAiB;CAE3D,qBAAqB,SAAS,YAAY;AAC5C;;;;ACx+CA,qBAAqB"}
|
package/dist/index.d.cts
CHANGED
|
@@ -17,7 +17,6 @@ interface MarqueeContentOptions {
|
|
|
17
17
|
mode?: MarqueeContentMode | null;
|
|
18
18
|
direction?: MarqueeContentDirection | null;
|
|
19
19
|
pauseOnHover?: boolean | string | null;
|
|
20
|
-
responsiveSpeed?: boolean | string | null;
|
|
21
20
|
}
|
|
22
21
|
interface DefineMarqueeContentOptions {
|
|
23
22
|
stylesheet?: MarqueeContentStyleInput;
|
|
@@ -59,6 +58,7 @@ declare class MarqueeContent extends HTMLElementBase {
|
|
|
59
58
|
private reducedMotion;
|
|
60
59
|
private touchInput;
|
|
61
60
|
private isListeningToScroll;
|
|
61
|
+
private isListeningToTouch;
|
|
62
62
|
private distance;
|
|
63
63
|
private containerWidth;
|
|
64
64
|
private group;
|
|
@@ -75,6 +75,9 @@ declare class MarqueeContent extends HTMLElementBase {
|
|
|
75
75
|
private scrollBoostStartedAt;
|
|
76
76
|
private lastScrollY;
|
|
77
77
|
private lastScrollTime;
|
|
78
|
+
private lastTouchY;
|
|
79
|
+
private touchScrollDirection;
|
|
80
|
+
private touchScrollResetTimer;
|
|
78
81
|
constructor();
|
|
79
82
|
connectedCallback(): void;
|
|
80
83
|
disconnectedCallback(): void;
|
|
@@ -87,8 +90,6 @@ declare class MarqueeContent extends HTMLElementBase {
|
|
|
87
90
|
set direction(value: MarqueeContentDirection | null | undefined);
|
|
88
91
|
get pauseOnHover(): boolean;
|
|
89
92
|
set pauseOnHover(value: boolean | string | null | undefined);
|
|
90
|
-
get responsiveSpeed(): boolean;
|
|
91
|
-
set responsiveSpeed(value: boolean | string | null | undefined);
|
|
92
93
|
update(options?: MarqueeContentOptions): void;
|
|
93
94
|
refresh(): void;
|
|
94
95
|
private applyAllStyles;
|
|
@@ -103,6 +104,12 @@ declare class MarqueeContent extends HTMLElementBase {
|
|
|
103
104
|
private handleIntersectionChange;
|
|
104
105
|
private handleReducedMotionChange;
|
|
105
106
|
private handleScroll;
|
|
107
|
+
private handleTouchStart;
|
|
108
|
+
private handleTouchMove;
|
|
109
|
+
private handleTouchEnd;
|
|
110
|
+
private handleScrollEnd;
|
|
111
|
+
private scheduleTouchScrollReset;
|
|
112
|
+
private resetTouchScroll;
|
|
106
113
|
private onScrollBoostChanged;
|
|
107
114
|
private updateScrollListener;
|
|
108
115
|
private scheduleRebuild;
|
|
@@ -141,7 +148,6 @@ declare class MarqueeContent extends HTMLElementBase {
|
|
|
141
148
|
private getCurrentTimeScale;
|
|
142
149
|
private getDirectionFactor;
|
|
143
150
|
private getScrollBoost;
|
|
144
|
-
private getCurrentSpeed;
|
|
145
151
|
private resolveOptions;
|
|
146
152
|
private num;
|
|
147
153
|
private parseNumber;
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ interface MarqueeContentOptions {
|
|
|
17
17
|
mode?: MarqueeContentMode | null;
|
|
18
18
|
direction?: MarqueeContentDirection | null;
|
|
19
19
|
pauseOnHover?: boolean | string | null;
|
|
20
|
-
responsiveSpeed?: boolean | string | null;
|
|
21
20
|
}
|
|
22
21
|
interface DefineMarqueeContentOptions {
|
|
23
22
|
stylesheet?: MarqueeContentStyleInput;
|
|
@@ -59,6 +58,7 @@ declare class MarqueeContent extends HTMLElementBase {
|
|
|
59
58
|
private reducedMotion;
|
|
60
59
|
private touchInput;
|
|
61
60
|
private isListeningToScroll;
|
|
61
|
+
private isListeningToTouch;
|
|
62
62
|
private distance;
|
|
63
63
|
private containerWidth;
|
|
64
64
|
private group;
|
|
@@ -75,6 +75,9 @@ declare class MarqueeContent extends HTMLElementBase {
|
|
|
75
75
|
private scrollBoostStartedAt;
|
|
76
76
|
private lastScrollY;
|
|
77
77
|
private lastScrollTime;
|
|
78
|
+
private lastTouchY;
|
|
79
|
+
private touchScrollDirection;
|
|
80
|
+
private touchScrollResetTimer;
|
|
78
81
|
constructor();
|
|
79
82
|
connectedCallback(): void;
|
|
80
83
|
disconnectedCallback(): void;
|
|
@@ -87,8 +90,6 @@ declare class MarqueeContent extends HTMLElementBase {
|
|
|
87
90
|
set direction(value: MarqueeContentDirection | null | undefined);
|
|
88
91
|
get pauseOnHover(): boolean;
|
|
89
92
|
set pauseOnHover(value: boolean | string | null | undefined);
|
|
90
|
-
get responsiveSpeed(): boolean;
|
|
91
|
-
set responsiveSpeed(value: boolean | string | null | undefined);
|
|
92
93
|
update(options?: MarqueeContentOptions): void;
|
|
93
94
|
refresh(): void;
|
|
94
95
|
private applyAllStyles;
|
|
@@ -103,6 +104,12 @@ declare class MarqueeContent extends HTMLElementBase {
|
|
|
103
104
|
private handleIntersectionChange;
|
|
104
105
|
private handleReducedMotionChange;
|
|
105
106
|
private handleScroll;
|
|
107
|
+
private handleTouchStart;
|
|
108
|
+
private handleTouchMove;
|
|
109
|
+
private handleTouchEnd;
|
|
110
|
+
private handleScrollEnd;
|
|
111
|
+
private scheduleTouchScrollReset;
|
|
112
|
+
private resetTouchScroll;
|
|
106
113
|
private onScrollBoostChanged;
|
|
107
114
|
private updateScrollListener;
|
|
108
115
|
private scheduleRebuild;
|
|
@@ -141,7 +148,6 @@ declare class MarqueeContent extends HTMLElementBase {
|
|
|
141
148
|
private getCurrentTimeScale;
|
|
142
149
|
private getDirectionFactor;
|
|
143
150
|
private getScrollBoost;
|
|
144
|
-
private getCurrentSpeed;
|
|
145
151
|
private resolveOptions;
|
|
146
152
|
private num;
|
|
147
153
|
private parseNumber;
|
package/dist/index.js
CHANGED
|
@@ -43,10 +43,6 @@ const DEFAULT_OPTIONS = {
|
|
|
43
43
|
speed: 90,
|
|
44
44
|
mode: "auto",
|
|
45
45
|
direction: "rtl",
|
|
46
|
-
responsiveSpeed: false,
|
|
47
|
-
referenceWidth: 1280,
|
|
48
|
-
minSpeedFactor: .55,
|
|
49
|
-
maxSpeedFactor: 1,
|
|
50
46
|
pauseOnHover: false,
|
|
51
47
|
pauseWhenOutOfView: true,
|
|
52
48
|
recalculateAfterFontsReady: true,
|
|
@@ -59,20 +55,19 @@ const OBSERVED_ATTRIBUTES = [
|
|
|
59
55
|
"speed",
|
|
60
56
|
"mode",
|
|
61
57
|
"direction",
|
|
62
|
-
"pause-on-hover"
|
|
63
|
-
"responsive-speed"
|
|
58
|
+
"pause-on-hover"
|
|
64
59
|
];
|
|
65
60
|
const OPTION_ATTRIBUTE_MAP = {
|
|
66
61
|
speed: "speed",
|
|
67
62
|
mode: "mode",
|
|
68
63
|
direction: "direction",
|
|
69
|
-
pauseOnHover: "pause-on-hover"
|
|
70
|
-
responsiveSpeed: "responsive-speed"
|
|
64
|
+
pauseOnHover: "pause-on-hover"
|
|
71
65
|
};
|
|
72
66
|
const MARQUEE_CONTENT_CSS_PROPS = ["--marquee-content-distance", "--marquee-content-duration"];
|
|
73
67
|
const SCROLL_TIME_SCALE_SMOOTHING_SECONDS = .12;
|
|
74
68
|
const TOUCH_INPUT_QUERY = "(hover: none) and (pointer: coarse)";
|
|
75
69
|
const TOUCH_SCROLL_EDGE_THRESHOLD = 1;
|
|
70
|
+
const TOUCH_SCROLL_IDLE_DELAY = 250;
|
|
76
71
|
const HTMLElementBase = globalThis.HTMLElement ?? class {};
|
|
77
72
|
const MARQUEE_CONTENT_RUNTIME_CSS = `
|
|
78
73
|
@keyframes marquee-content-auto {
|
|
@@ -152,6 +147,7 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
152
147
|
reducedMotion = false;
|
|
153
148
|
touchInput = false;
|
|
154
149
|
isListeningToScroll = false;
|
|
150
|
+
isListeningToTouch = false;
|
|
155
151
|
distance = 0;
|
|
156
152
|
containerWidth = 0;
|
|
157
153
|
group = null;
|
|
@@ -168,6 +164,9 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
168
164
|
scrollBoostStartedAt = 0;
|
|
169
165
|
lastScrollY = 0;
|
|
170
166
|
lastScrollTime = 0;
|
|
167
|
+
lastTouchY = null;
|
|
168
|
+
touchScrollDirection = 0;
|
|
169
|
+
touchScrollResetTimer = null;
|
|
171
170
|
constructor() {
|
|
172
171
|
if (typeof HTMLElement === "undefined") throw new Error("[MarqueeContent] Create elements in a browser, after client initialization.");
|
|
173
172
|
super();
|
|
@@ -258,12 +257,6 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
258
257
|
set pauseOnHover(value) {
|
|
259
258
|
this.setNullableAttribute("pause-on-hover", value);
|
|
260
259
|
}
|
|
261
|
-
get responsiveSpeed() {
|
|
262
|
-
return this.options.responsiveSpeed;
|
|
263
|
-
}
|
|
264
|
-
set responsiveSpeed(value) {
|
|
265
|
-
this.setNullableAttribute("responsive-speed", value);
|
|
266
|
-
}
|
|
267
260
|
update(options = {}) {
|
|
268
261
|
Object.entries(options).forEach(([key, value]) => {
|
|
269
262
|
const attributeName = OPTION_ATTRIBUTE_MAP[key];
|
|
@@ -375,9 +368,11 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
375
368
|
const deltaTime = Math.max((now - this.lastScrollTime) / 1e3, .016);
|
|
376
369
|
this.lastScrollY = currentScrollY;
|
|
377
370
|
this.lastScrollTime = now;
|
|
371
|
+
if (this.touchInput) this.scheduleTouchScrollReset();
|
|
378
372
|
if (Math.abs(deltaY) < .5) return;
|
|
379
373
|
const velocity = deltaY / deltaTime;
|
|
380
374
|
const direction = velocity >= 0 ? 1 : -1;
|
|
375
|
+
if (this.touchInput && (this.lastTouchY !== null && this.touchScrollDirection === 0 || this.touchScrollDirection !== 0 && direction !== this.touchScrollDirection)) return;
|
|
381
376
|
const directionChanged = direction !== this.scrollDirectionFactor;
|
|
382
377
|
this.scrollDirectionFactor = direction;
|
|
383
378
|
if (this.touchInput) {
|
|
@@ -391,6 +386,49 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
391
386
|
} else this.scrollBoostStartValue = 0;
|
|
392
387
|
this.onScrollBoostChanged();
|
|
393
388
|
};
|
|
389
|
+
handleTouchStart = (event) => {
|
|
390
|
+
this.resetTouchScroll();
|
|
391
|
+
const touch = event.touches.length === 1 ? event.touches[0] : null;
|
|
392
|
+
if (touch) this.lastTouchY = touch.clientY;
|
|
393
|
+
};
|
|
394
|
+
handleTouchMove = (event) => {
|
|
395
|
+
if (event.touches.length !== 1) {
|
|
396
|
+
this.resetTouchScroll();
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
const touch = event.touches[0];
|
|
400
|
+
if (!touch || this.lastTouchY === null) return;
|
|
401
|
+
const deltaY = this.lastTouchY - touch.clientY;
|
|
402
|
+
if (Math.abs(deltaY) < .5) return;
|
|
403
|
+
this.lastTouchY = touch.clientY;
|
|
404
|
+
this.touchScrollDirection = deltaY > 0 ? 1 : -1;
|
|
405
|
+
};
|
|
406
|
+
handleTouchEnd = (event) => {
|
|
407
|
+
if (event.touches.length > 0) {
|
|
408
|
+
this.resetTouchScroll();
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
this.lastTouchY = null;
|
|
412
|
+
this.scheduleTouchScrollReset();
|
|
413
|
+
};
|
|
414
|
+
handleScrollEnd = () => {
|
|
415
|
+
if (this.lastTouchY === null) this.resetTouchScroll();
|
|
416
|
+
};
|
|
417
|
+
scheduleTouchScrollReset() {
|
|
418
|
+
if (this.touchScrollResetTimer !== null) {
|
|
419
|
+
window.clearTimeout(this.touchScrollResetTimer);
|
|
420
|
+
this.touchScrollResetTimer = null;
|
|
421
|
+
}
|
|
422
|
+
if (this.lastTouchY === null && this.touchScrollDirection !== 0) this.touchScrollResetTimer = window.setTimeout(this.resetTouchScroll, TOUCH_SCROLL_IDLE_DELAY);
|
|
423
|
+
}
|
|
424
|
+
resetTouchScroll = () => {
|
|
425
|
+
if (this.touchScrollResetTimer !== null) {
|
|
426
|
+
window.clearTimeout(this.touchScrollResetTimer);
|
|
427
|
+
this.touchScrollResetTimer = null;
|
|
428
|
+
}
|
|
429
|
+
this.lastTouchY = null;
|
|
430
|
+
this.touchScrollDirection = 0;
|
|
431
|
+
};
|
|
394
432
|
onScrollBoostChanged() {
|
|
395
433
|
if (!this.mounted || this.getEffectiveMode() !== "scroll" || this.reducedMotion) return;
|
|
396
434
|
if (!this.canAnimate() || this.distance <= 0) return;
|
|
@@ -402,13 +440,44 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
402
440
|
this.startAnimationLoop();
|
|
403
441
|
}
|
|
404
442
|
updateScrollListener(shouldListen = this.mounted && this.options.mode === "scroll") {
|
|
405
|
-
if (shouldListen
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
443
|
+
if (shouldListen !== this.isListeningToScroll) {
|
|
444
|
+
if (shouldListen) {
|
|
445
|
+
this.lastScrollY = this.getScrollY();
|
|
446
|
+
this.lastScrollTime = performance.now();
|
|
447
|
+
window.addEventListener("scroll", this.handleScroll, { passive: true });
|
|
448
|
+
} else window.removeEventListener("scroll", this.handleScroll);
|
|
449
|
+
this.isListeningToScroll = shouldListen;
|
|
450
|
+
}
|
|
451
|
+
const shouldListenToTouch = shouldListen && this.touchInput;
|
|
452
|
+
if (shouldListenToTouch !== this.isListeningToTouch) {
|
|
453
|
+
if (shouldListenToTouch) {
|
|
454
|
+
window.addEventListener("touchstart", this.handleTouchStart, {
|
|
455
|
+
passive: true,
|
|
456
|
+
capture: true
|
|
457
|
+
});
|
|
458
|
+
window.addEventListener("touchmove", this.handleTouchMove, {
|
|
459
|
+
passive: true,
|
|
460
|
+
capture: true
|
|
461
|
+
});
|
|
462
|
+
window.addEventListener("touchend", this.handleTouchEnd, {
|
|
463
|
+
passive: true,
|
|
464
|
+
capture: true
|
|
465
|
+
});
|
|
466
|
+
window.addEventListener("touchcancel", this.handleTouchEnd, {
|
|
467
|
+
passive: true,
|
|
468
|
+
capture: true
|
|
469
|
+
});
|
|
470
|
+
window.addEventListener("scrollend", this.handleScrollEnd);
|
|
471
|
+
} else {
|
|
472
|
+
window.removeEventListener("touchstart", this.handleTouchStart, true);
|
|
473
|
+
window.removeEventListener("touchmove", this.handleTouchMove, true);
|
|
474
|
+
window.removeEventListener("touchend", this.handleTouchEnd, true);
|
|
475
|
+
window.removeEventListener("touchcancel", this.handleTouchEnd, true);
|
|
476
|
+
window.removeEventListener("scrollend", this.handleScrollEnd);
|
|
477
|
+
this.resetTouchScroll();
|
|
478
|
+
}
|
|
479
|
+
this.isListeningToTouch = shouldListenToTouch;
|
|
480
|
+
}
|
|
412
481
|
}
|
|
413
482
|
scheduleRebuild = () => {
|
|
414
483
|
if (!this.mounted) return;
|
|
@@ -426,7 +495,7 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
426
495
|
applyOptions() {
|
|
427
496
|
if (!this.mounted) return;
|
|
428
497
|
const progress = this.scrollAnimation ? this.getScrollAnimationProgress() : this.getAutoAnimation()?.effect?.getComputedTiming().progress ?? this.scrollProgress;
|
|
429
|
-
this.scrollBaseSpeed = this.
|
|
498
|
+
this.scrollBaseSpeed = this.options.speed;
|
|
430
499
|
const duration = this.distance / this.scrollBaseSpeed;
|
|
431
500
|
this.setAttribute("data-marquee-content-mode", this.options.mode);
|
|
432
501
|
this.toggleAttribute("data-marquee-content-pause-on-hover", this.options.pauseOnHover);
|
|
@@ -594,6 +663,8 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
594
663
|
handleTouchInputChange = (event) => {
|
|
595
664
|
if (!this.mounted || event.matches === this.touchInput) return;
|
|
596
665
|
this.touchInput = event.matches;
|
|
666
|
+
this.lastScrollY = this.getScrollY();
|
|
667
|
+
this.lastScrollTime = performance.now();
|
|
597
668
|
this.stopAnimationLoop();
|
|
598
669
|
this.cancelScrollAnimation();
|
|
599
670
|
this.scrollMotionActive = false;
|
|
@@ -786,19 +857,13 @@ var MarqueeContent = class MarqueeContent extends HTMLElementBase {
|
|
|
786
857
|
const easedProgress = this.easeOutCubic(progress);
|
|
787
858
|
return this.scrollBoostStartValue * (1 - easedProgress);
|
|
788
859
|
}
|
|
789
|
-
getCurrentSpeed(containerWidth) {
|
|
790
|
-
if (!this.options.responsiveSpeed) return this.options.speed;
|
|
791
|
-
const factor = this.clamp(containerWidth / this.options.referenceWidth, this.options.minSpeedFactor, this.options.maxSpeedFactor);
|
|
792
|
-
return this.options.speed * factor;
|
|
793
|
-
}
|
|
794
860
|
resolveOptions() {
|
|
795
861
|
return {
|
|
796
862
|
...DEFAULT_OPTIONS,
|
|
797
863
|
speed: this.num("speed", DEFAULT_OPTIONS.speed, 10, 500),
|
|
798
864
|
mode: this.parseMode(this.getAttribute("mode"), DEFAULT_OPTIONS.mode),
|
|
799
865
|
direction: this.parseDirection(this.getAttribute("direction"), DEFAULT_OPTIONS.direction),
|
|
800
|
-
pauseOnHover: this.parseBoolean(this.getAttribute("pause-on-hover"), DEFAULT_OPTIONS.pauseOnHover)
|
|
801
|
-
responsiveSpeed: this.parseBoolean(this.getAttribute("responsive-speed"), DEFAULT_OPTIONS.responsiveSpeed)
|
|
866
|
+
pauseOnHover: this.parseBoolean(this.getAttribute("pause-on-hover"), DEFAULT_OPTIONS.pauseOnHover)
|
|
802
867
|
};
|
|
803
868
|
}
|
|
804
869
|
num(attributeName, fallback, min, max) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DEFAULT_CSS_TEXT"],"sources":["../src/styles.ts","../src/marquee-content.ts","../src/index.ts"],"sourcesContent":["import './marquee-content.css';\nimport DEFAULT_CSS_TEXT from './marquee-content.css?inline';\n\nexport type MarqueeContentStyleInput = CSSStyleSheet | string | null | undefined;\n\nexport interface MarqueeContentStyleEntry {\n sheet: CSSStyleSheet | null;\n cssText: string;\n}\n\nexport const marqueeContentCssText: string = DEFAULT_CSS_TEXT;\n\nexport function createConstructableStyleSheet(cssText: string): CSSStyleSheet | null {\n if (\n typeof CSSStyleSheet === 'undefined' ||\n typeof CSSStyleSheet.prototype.replaceSync !== 'function'\n ) {\n return null;\n }\n\n try {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(cssText);\n return sheet;\n } catch {\n return null;\n }\n}\n\nexport function cssStyleSheetToText(sheet: CSSStyleSheet): string {\n try {\n return Array.from(sheet.cssRules)\n .map((rule) => rule.cssText)\n .join('\\n');\n } catch {\n return '';\n }\n}\n\nexport function normalizeStyleInput(input: MarqueeContentStyleInput): MarqueeContentStyleEntry {\n if (!input) {\n return {\n sheet: null,\n cssText: '',\n };\n }\n\n if (typeof input === 'string') {\n return {\n sheet: createConstructableStyleSheet(input),\n cssText: input,\n };\n }\n\n return {\n sheet: input,\n cssText: cssStyleSheetToText(input),\n };\n}\n\nexport function canUseAdoptedStyleSheets(root: ShadowRoot): boolean {\n return (\n typeof CSSStyleSheet !== 'undefined' &&\n 'adoptedStyleSheets' in root &&\n typeof CSSStyleSheet.prototype.replaceSync === 'function'\n );\n}\n","import {\n type MarqueeContentStyleEntry,\n type MarqueeContentStyleInput,\n marqueeContentCssText,\n normalizeStyleInput,\n} from './styles';\n\nexport type MarqueeContentDirection = 'rtl' | 'ltr';\nexport type MarqueeContentMode = 'auto' | 'scroll';\n\nexport interface MarqueeContentOptions {\n speed?: number | string | null;\n mode?: MarqueeContentMode | null;\n direction?: MarqueeContentDirection | null;\n pauseOnHover?: boolean | string | null;\n responsiveSpeed?: boolean | string | null;\n}\n\ninterface MarqueeContentResolvedOptions {\n speed: number;\n mode: MarqueeContentMode;\n direction: MarqueeContentDirection;\n\n responsiveSpeed: boolean;\n referenceWidth: number;\n minSpeedFactor: number;\n maxSpeedFactor: number;\n\n pauseOnHover: boolean;\n pauseWhenOutOfView: boolean;\n recalculateAfterFontsReady: boolean;\n\n scrollVelocityFactor: number;\n scrollMinExtraSpeed: number;\n scrollMaxExtraSpeed: number;\n scrollInertiaDuration: number;\n}\n\nexport interface DefineMarqueeContentOptions {\n stylesheet?: MarqueeContentStyleInput;\n styleOverrides?: MarqueeContentStyleInput;\n}\n\nexport interface InitMarqueeContentsOptions extends DefineMarqueeContentOptions {\n tagName?: string;\n}\n\nexport const MARQUEE_CONTENT_TAG = 'marquee-content';\n\nconst DEFAULT_OPTIONS: MarqueeContentResolvedOptions = {\n speed: 90,\n mode: 'auto',\n direction: 'rtl',\n\n responsiveSpeed: false,\n referenceWidth: 1280,\n minSpeedFactor: 0.55,\n maxSpeedFactor: 1,\n\n pauseOnHover: false,\n pauseWhenOutOfView: true,\n recalculateAfterFontsReady: true,\n\n scrollVelocityFactor: 150,\n scrollMinExtraSpeed: 0.05,\n scrollMaxExtraSpeed: 5,\n scrollInertiaDuration: 2500,\n};\n\nconst OBSERVED_ATTRIBUTES = [\n 'speed',\n 'mode',\n 'direction',\n 'pause-on-hover',\n 'responsive-speed',\n] as const;\n\nconst OPTION_ATTRIBUTE_MAP: Record<keyof MarqueeContentOptions, string> = {\n speed: 'speed',\n mode: 'mode',\n direction: 'direction',\n pauseOnHover: 'pause-on-hover',\n responsiveSpeed: 'responsive-speed',\n};\n\nconst MARQUEE_CONTENT_CSS_PROPS = [\n '--marquee-content-distance',\n '--marquee-content-duration',\n] as const;\n\nconst SCROLL_TIME_SCALE_SMOOTHING_SECONDS = 0.12;\nconst TOUCH_INPUT_QUERY = '(hover: none) and (pointer: coarse)';\nconst TOUCH_SCROLL_EDGE_THRESHOLD = 1;\n\n// Server imports do not need a DOM; element construction still requires a browser.\nconst HTMLElementBase = (globalThis.HTMLElement ?? class {}) as typeof HTMLElement;\n\nconst MARQUEE_CONTENT_RUNTIME_CSS = `\n @keyframes marquee-content-auto {\n to {\n transform: translate3d(calc(-1 * var(--marquee-content-distance)), 0, 0);\n }\n }\n\n .marquee-content__source {\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n\n .marquee-content__source::slotted(*) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n`;\n\nconst TEMPLATE = `\n <slot class=\"marquee-content__source\"></slot>\n\n <div class=\"marquee-content__viewport\" part=\"viewport\">\n <div class=\"marquee-content__track\" part=\"track\" aria-hidden=\"true\" inert></div>\n </div>\n`;\n\nexport class MarqueeContent extends HTMLElementBase {\n static get observedAttributes(): string[] {\n return [...OBSERVED_ATTRIBUTES];\n }\n\n private static readonly instances = new Set<MarqueeContent>();\n\n private static readonly runtimeStylesheetEntry: MarqueeContentStyleEntry = normalizeStyleInput(\n MARQUEE_CONTENT_RUNTIME_CSS,\n );\n\n private static stylesheetEntry: MarqueeContentStyleEntry =\n normalizeStyleInput(marqueeContentCssText);\n\n private static styleOverridesEntry: MarqueeContentStyleEntry = normalizeStyleInput(null);\n\n static configureStyles(options: DefineMarqueeContentOptions = {}): void {\n if (!('stylesheet' in options) && !('styleOverrides' in options)) {\n return;\n }\n\n if ('stylesheet' in options) {\n MarqueeContent.stylesheetEntry = normalizeStyleInput(\n options.stylesheet ?? marqueeContentCssText,\n );\n }\n\n if ('styleOverrides' in options) {\n MarqueeContent.styleOverridesEntry = normalizeStyleInput(options.styleOverrides);\n }\n\n MarqueeContent.instances.forEach((instance) => {\n instance.applyAllStyles();\n instance.scheduleRebuild();\n });\n }\n\n static setStylesheet(stylesheet: MarqueeContentStyleInput): void {\n MarqueeContent.configureStyles({ stylesheet });\n }\n\n static setStyleOverrides(styleOverrides: MarqueeContentStyleInput): void {\n MarqueeContent.configureStyles({ styleOverrides });\n }\n\n private readonly shadow: ShadowRoot;\n private readonly sourceSlot: HTMLSlotElement;\n private readonly viewport: HTMLElement;\n private readonly track: HTMLElement;\n\n private options: MarqueeContentResolvedOptions = { ...DEFAULT_OPTIONS };\n private sourceNodes: Node[] = [];\n\n private resizeObserver: ResizeObserver | null = null;\n private mutationObserver: MutationObserver | null = null;\n private intersectionObserver: IntersectionObserver | null = null;\n private abortController: AbortController | null = null;\n private reducedMotionMediaQuery: MediaQueryList | null = null;\n private touchInputMediaQuery: MediaQueryList | null = null;\n\n private animationFrameId: number | null = null;\n private rebuildFrameId: number | null = null;\n private lastFrameTime: number | null = null;\n\n private mounted = false;\n private isHovered = false;\n private isFocused = false;\n private isInViewport = true;\n private reducedMotion = false;\n private touchInput = false;\n private isListeningToScroll = false;\n\n private distance = 0;\n private containerWidth = 0;\n private group: HTMLElement | null = null;\n private layoutPending = false;\n\n private scrollAnimation: Animation | null = null;\n private scrollAnimationDuration = 0;\n private scrollAnimationDistance = 0;\n private scrollProgress = 0;\n private scrollMotionActive = false;\n private scrollBaseSpeed = DEFAULT_OPTIONS.speed;\n\n private scrollDirectionFactor: 1 | -1 = 1;\n private currentTimeScale = 1;\n private scrollBoostStartValue = 0;\n private scrollBoostStartedAt = 0;\n private lastScrollY = 0;\n private lastScrollTime = 0;\n\n constructor() {\n if (typeof HTMLElement === 'undefined') {\n throw new Error(\n '[MarqueeContent] Create elements in a browser, after client initialization.',\n );\n }\n\n super();\n\n this.shadow = this.attachShadow({ mode: 'open' });\n this.applyAllStyles();\n\n const template = document.createElement('template');\n template.innerHTML = TEMPLATE;\n this.shadow.appendChild(template.content.cloneNode(true));\n\n const sourceSlot = this.shadow.querySelector<HTMLSlotElement>('slot.marquee-content__source');\n const viewport = this.shadow.querySelector<HTMLElement>('.marquee-content__viewport');\n\n const track = this.shadow.querySelector<HTMLElement>('.marquee-content__track');\n\n if (!sourceSlot) {\n throw new Error('[MarqueeContent] Source slot was not found.');\n }\n\n if (!track) {\n throw new Error('[MarqueeContent] Track element was not found.');\n }\n\n if (!viewport) {\n throw new Error('[MarqueeContent] Viewport element was not found.');\n }\n\n this.sourceSlot = sourceSlot;\n this.viewport = viewport;\n this.track = track;\n }\n\n connectedCallback(): void {\n if (this.mounted) {\n return;\n }\n\n MarqueeContent.instances.add(this);\n\n this.mounted = true;\n this.applyAllStyles();\n this.abortController = new AbortController();\n this.options = this.resolveOptions();\n\n this.lastScrollY = this.getScrollY();\n this.lastScrollTime = performance.now();\n\n this.sourceSlot.addEventListener('slotchange', this.handleSlotChange, {\n signal: this.abortController.signal,\n });\n\n // Only source loads should rebuild the track, never loads from its decorative copies.\n for (const eventName of ['load', 'error']) {\n this.addEventListener(eventName, this.handleSourceLoad, {\n capture: true,\n signal: this.abortController.signal,\n });\n this.shadow.addEventListener(eventName, this.completeLayout, {\n capture: true,\n signal: this.abortController.signal,\n });\n }\n\n this.addEventListener('pointerenter', this.handlePointerEnter, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('pointerleave', this.handlePointerLeave, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('focusin', this.handleFocusIn, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('focusout', this.handleFocusOut, {\n signal: this.abortController.signal,\n });\n\n window.addEventListener('orientationchange', this.scheduleRebuild, {\n signal: this.abortController.signal,\n });\n\n this.resizeObserver = new ResizeObserver(this.handleResize);\n this.resizeObserver.observe(this);\n this.resizeObserver.observe(this.viewport);\n\n this.intersectionObserver = new IntersectionObserver(this.handleIntersectionChange);\n this.intersectionObserver.observe(this);\n\n this.setupReducedMotionWatcher();\n this.setupTouchInputWatcher();\n this.watchSourceNodes();\n this.updateScrollListener();\n this.rebuild();\n\n if (this.options.recalculateAfterFontsReady) {\n this.rebuildAfterFontsReady();\n }\n }\n\n disconnectedCallback(): void {\n this.teardown();\n MarqueeContent.instances.delete(this);\n }\n\n attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue) {\n return;\n }\n\n this.options = this.resolveOptions();\n\n if (!this.mounted) {\n return;\n }\n\n this.updateScrollListener();\n this.applyOptions();\n }\n\n get speed(): number {\n return this.options.speed;\n }\n\n set speed(value: number | string | null | undefined) {\n this.setNullableAttribute('speed', value);\n }\n\n get mode(): MarqueeContentMode {\n return this.options.mode;\n }\n\n set mode(value: MarqueeContentMode | null | undefined) {\n this.setNullableAttribute('mode', value);\n }\n\n get direction(): MarqueeContentDirection {\n return this.options.direction;\n }\n\n set direction(value: MarqueeContentDirection | null | undefined) {\n this.setNullableAttribute('direction', value);\n }\n\n get pauseOnHover(): boolean {\n return this.options.pauseOnHover;\n }\n\n set pauseOnHover(value: boolean | string | null | undefined) {\n this.setNullableAttribute('pause-on-hover', value);\n }\n\n get responsiveSpeed(): boolean {\n return this.options.responsiveSpeed;\n }\n\n set responsiveSpeed(value: boolean | string | null | undefined) {\n this.setNullableAttribute('responsive-speed', value);\n }\n\n update(options: MarqueeContentOptions = {}): void {\n Object.entries(options).forEach(([key, value]) => {\n const attributeName = OPTION_ATTRIBUTE_MAP[key as keyof MarqueeContentOptions];\n\n if (attributeName) {\n this.setNullableAttribute(attributeName, value);\n }\n });\n\n this.options = this.resolveOptions();\n this.updateScrollListener();\n this.applyOptions();\n }\n\n refresh(): void {\n this.scheduleRebuild();\n }\n\n private applyAllStyles(): void {\n const runtime = MarqueeContent.runtimeStylesheetEntry;\n const base = MarqueeContent.stylesheetEntry;\n const overrides = MarqueeContent.styleOverridesEntry;\n const sheets: CSSStyleSheet[] = [];\n\n if (runtime.sheet) {\n sheets.push(runtime.sheet);\n }\n\n if (base.sheet) {\n sheets.push(base.sheet);\n }\n\n if (overrides.sheet) {\n sheets.push(overrides.sheet);\n }\n\n this.shadow.adoptedStyleSheets = sheets;\n }\n\n private teardown(): void {\n if (!this.mounted) {\n return;\n }\n\n this.mounted = false;\n\n this.stopAnimationLoop();\n this.stopCssAnimation();\n this.cancelScrollAnimation();\n this.cancelScheduledRebuild();\n this.updateScrollListener(false);\n\n this.resizeObserver?.disconnect();\n this.mutationObserver?.disconnect();\n this.intersectionObserver?.disconnect();\n\n this.removeReducedMotionWatcher();\n this.removeTouchInputWatcher();\n\n this.abortController?.abort();\n\n this.group = null;\n this.layoutPending = false;\n this.containerWidth = 0;\n this.resizeObserver = null;\n this.mutationObserver = null;\n this.intersectionObserver = null;\n this.abortController = null;\n\n this.track.replaceChildren();\n this.removeAttribute('data-marquee-content-ready');\n this.removeAttribute('data-marquee-content-mode');\n this.removeAttribute('data-marquee-content-pause-on-hover');\n this.removeAttribute('data-marquee-content-reduced-motion');\n\n MARQUEE_CONTENT_CSS_PROPS.forEach((prop) => {\n this.style.removeProperty(prop);\n });\n\n this.distance = 0;\n this.isHovered = false;\n this.isFocused = false;\n this.isInViewport = true;\n this.scrollDirectionFactor = 1;\n this.scrollBoostStartValue = 0;\n this.scrollBoostStartedAt = 0;\n this.scrollProgress = 0;\n this.scrollMotionActive = false;\n this.scrollBaseSpeed = DEFAULT_OPTIONS.speed;\n this.currentTimeScale = 1;\n this.lastFrameTime = null;\n }\n\n private handleResize = (): void => {\n if (\n this.measureViewportWidth() !== this.containerWidth ||\n (this.group &&\n !this.layoutPending &&\n Math.abs(this.measureGroup(this.group) - this.distance) > 0.01)\n ) {\n this.scheduleRebuild();\n }\n };\n\n private handleSourceLoad = (event: Event): void => {\n // A shadow-tree event may be retargeted to the host; only authored descendants count.\n if (event.target instanceof Node && event.target !== this && this.contains(event.target)) {\n this.scheduleRebuild();\n }\n };\n\n private handleSlotChange = (): void => {\n this.watchSourceNodes();\n this.scheduleRebuild();\n };\n\n private handlePointerEnter = (): void => {\n this.isHovered = true;\n this.updateAnimationLoopState();\n };\n\n private handlePointerLeave = (): void => {\n this.isHovered = false;\n this.updateAnimationLoopState();\n };\n\n private handleFocusIn = (): void => {\n this.isFocused = true;\n this.updateAnimationLoopState();\n };\n\n private handleFocusOut = (): void => {\n this.isFocused = false;\n this.updateAnimationLoopState();\n };\n\n private handleIntersectionChange = (entries: IntersectionObserverEntry[]): void => {\n const entry = entries[0];\n\n if (!entry) {\n return;\n }\n\n this.isInViewport = entry.isIntersecting;\n this.updateAnimationLoopState();\n };\n\n private handleReducedMotionChange = (event: MediaQueryListEvent | MediaQueryList): void => {\n this.reducedMotion = event.matches;\n\n if (this.reducedMotion) {\n this.track.style.transform = 'none';\n } else if (this.getEffectiveMode() === 'scroll') {\n this.track.style.transform = '';\n }\n\n this.updateAnimationLoopState();\n this.scheduleRebuild();\n };\n\n private handleScroll = (): void => {\n if (this.options.mode !== 'scroll') {\n return;\n }\n\n const now = performance.now();\n const currentScrollY = this.getScrollY();\n\n const deltaY = currentScrollY - this.lastScrollY;\n const deltaTime = Math.max((now - this.lastScrollTime) / 1000, 0.016);\n\n this.lastScrollY = currentScrollY;\n this.lastScrollTime = now;\n\n if (Math.abs(deltaY) < 0.5) {\n return;\n }\n\n const velocity = deltaY / deltaTime;\n\n const direction = velocity >= 0 ? 1 : -1;\n const directionChanged = direction !== this.scrollDirectionFactor;\n this.scrollDirectionFactor = direction;\n\n if (this.touchInput) {\n if (directionChanged) {\n this.applyOptions();\n }\n return;\n }\n\n const extraSpeed = this.clamp(\n velocity / this.options.scrollVelocityFactor,\n -this.options.scrollMaxExtraSpeed,\n this.options.scrollMaxExtraSpeed,\n );\n\n if (Math.abs(extraSpeed) >= this.options.scrollMinExtraSpeed) {\n this.scrollBoostStartValue = extraSpeed;\n this.scrollBoostStartedAt = now;\n } else {\n this.scrollBoostStartValue = 0;\n }\n\n this.onScrollBoostChanged();\n };\n\n private onScrollBoostChanged(): void {\n if (!this.mounted || this.getEffectiveMode() !== 'scroll' || this.reducedMotion) {\n return;\n }\n\n if (!this.canAnimate() || this.distance <= 0) {\n return;\n }\n\n if (!this.scrollMotionActive) {\n this.cancelScrollAnimation();\n this.scrollMotionActive = true;\n this.renderScrollProgress();\n }\n\n this.startAnimationLoop();\n }\n\n private updateScrollListener(\n shouldListen = this.mounted && this.options.mode === 'scroll',\n ): void {\n if (shouldListen === this.isListeningToScroll) {\n return;\n }\n\n if (shouldListen) {\n this.lastScrollY = this.getScrollY();\n this.lastScrollTime = performance.now();\n window.addEventListener('scroll', this.handleScroll, { passive: true });\n } else {\n window.removeEventListener('scroll', this.handleScroll);\n }\n\n this.isListeningToScroll = shouldListen;\n }\n\n private scheduleRebuild = (): void => {\n if (!this.mounted) {\n return;\n }\n\n this.cancelScheduledRebuild();\n\n this.rebuildFrameId = requestAnimationFrame(() => {\n this.rebuildFrameId = null;\n this.rebuild();\n });\n };\n\n private cancelScheduledRebuild(): void {\n if (this.rebuildFrameId === null) {\n return;\n }\n\n cancelAnimationFrame(this.rebuildFrameId);\n this.rebuildFrameId = null;\n }\n\n private applyOptions(): void {\n if (!this.mounted) {\n return;\n }\n\n const progress = this.scrollAnimation\n ? this.getScrollAnimationProgress()\n : (this.getAutoAnimation()?.effect?.getComputedTiming().progress ?? this.scrollProgress);\n this.scrollBaseSpeed = this.getCurrentSpeed(this.clientWidth);\n const duration = this.distance / this.scrollBaseSpeed;\n\n this.setAttribute('data-marquee-content-mode', this.options.mode);\n this.toggleAttribute('data-marquee-content-pause-on-hover', this.options.pauseOnHover);\n this.toggleAttribute('data-marquee-content-reduced-motion', this.reducedMotion);\n\n if (this.distance > 0) {\n this.style.setProperty('--marquee-content-distance', `${this.distance}px`);\n this.style.setProperty('--marquee-content-duration', `${duration}s`);\n }\n\n if (progress != null) {\n this.scrollProgress = progress;\n }\n\n this.updateAnimationLoopState();\n\n if (progress != null && this.getEffectiveMode() === 'auto' && !this.reducedMotion) {\n const animation = this.getAutoAnimation();\n\n if (animation) {\n animation.currentTime =\n duration *\n 1000 *\n (this.track.style.animationDirection === 'reverse' ? 1 - progress : progress);\n }\n }\n }\n\n private getAutoAnimation(): Animation | undefined {\n return this.track\n .getAnimations()\n .find(\n (animation) =>\n 'animationName' in animation && animation.animationName === 'marquee-content-auto',\n );\n }\n\n private rebuild(): void {\n if (!this.mounted) {\n return;\n }\n\n this.options = this.resolveOptions();\n this.updateScrollListener();\n const progress = this.scrollAnimation\n ? this.getScrollAnimationProgress()\n : this.getAutoAnimation()?.effect?.getComputedTiming().progress;\n\n if (progress != null) {\n this.scrollProgress = progress;\n }\n\n this.distance = 0;\n this.layoutPending = false;\n this.updateAnimationLoopState();\n this.removeAttribute('data-marquee-content-ready');\n this.toggleAttribute('data-marquee-content-reduced-motion', this.reducedMotion);\n this.containerWidth = this.measureViewportWidth();\n\n if (this.group) {\n this.resizeObserver?.unobserve(this.group);\n this.group = null;\n }\n\n this.sourceNodes = this.getSourceNodes();\n\n if (this.containerWidth <= 0 || this.sourceNodes.length === 0) {\n this.distance = 0;\n this.track.replaceChildren();\n this.applyOptions();\n return;\n }\n\n this.group = this.createGroup();\n this.track.replaceChildren(this.group);\n this.layoutPending = true;\n this.completeLayout();\n }\n\n private completeLayout = (): void => {\n const group = this.group;\n\n if (!this.mounted || !group || !this.layoutPending) {\n return;\n }\n\n // Cached clones can load asynchronously. Keep the measured source period in place\n // and reconcile coverage again when loading finishes in case its dimensions changed.\n if (this.hasPendingImages(this.track)) {\n return;\n }\n\n if (!this.reducedMotion) {\n this.fillTrack(group);\n\n if (this.hasPendingImages(this.track)) {\n return;\n }\n }\n\n this.layoutPending = false;\n this.distance = this.measureGroup(group);\n this.resizeObserver?.observe(group);\n\n if (!Number.isFinite(this.distance) || this.distance <= 0) {\n this.track.replaceChildren();\n this.applyOptions();\n return;\n }\n\n this.setAttribute('data-marquee-content-ready', 'true');\n this.applyOptions();\n };\n\n private hasPendingImages(root: ParentNode): boolean {\n return Array.from(root.querySelectorAll('img')).some((image) => !image.complete);\n }\n\n private measureViewportWidth(): number {\n if (this.viewport.getClientRects().length === 0) {\n return 0;\n }\n\n const style = getComputedStyle(this.viewport);\n const width = Number.parseFloat(style.width);\n\n if (!Number.isFinite(width)) {\n return this.viewport.clientWidth;\n }\n\n // Preserve fractional layout pixels and ignore ancestor transforms.\n return style.boxSizing === 'border-box'\n ? width - Number.parseFloat(style.borderLeftWidth) - Number.parseFloat(style.borderRightWidth)\n : width + Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight);\n }\n\n private measureGroup(group: HTMLElement): number {\n const style = getComputedStyle(group);\n const width = Number.parseFloat(style.width);\n\n if (!Number.isFinite(width)) {\n return group.scrollWidth;\n }\n\n if (style.boxSizing === 'border-box') {\n return width;\n }\n\n return (\n width +\n Number.parseFloat(style.paddingLeft) +\n Number.parseFloat(style.paddingRight) +\n Number.parseFloat(style.borderLeftWidth) +\n Number.parseFloat(style.borderRightWidth)\n );\n }\n\n private createGroup(): HTMLElement {\n const group = document.createElement('div');\n\n group.className = 'marquee-content__group';\n group.setAttribute('part', 'group');\n\n this.appendSourceNodes(group);\n\n return group;\n }\n\n private fillTrack(group: HTMLElement): void {\n const period = this.measureGroup(group);\n\n if (!Number.isFinite(period) || period <= 0) {\n return;\n }\n\n // One period moves offscreen while the remaining copies cover the viewport.\n // Repeat whole groups so custom padding and borders recur at every seam.\n const groupCount = Math.ceil(this.containerWidth / period) + 1;\n\n while (this.track.childElementCount > groupCount) {\n this.track.lastElementChild?.remove();\n }\n\n const fragment = document.createDocumentFragment();\n\n for (let index = this.track.childElementCount; index < groupCount; index += 1) {\n fragment.appendChild(group.cloneNode(true));\n }\n\n this.track.appendChild(fragment);\n }\n\n private appendSourceNodes(target: HTMLElement): void {\n const fragment = document.createDocumentFragment();\n\n this.sourceNodes.forEach((node) => {\n fragment.append(this.cloneSourceNode(node));\n });\n\n target.appendChild(fragment);\n }\n\n private cloneSourceNode(node: Node): Node {\n const clone = node.cloneNode(true);\n\n if (clone instanceof Element) {\n const currentPart = clone.getAttribute('part');\n\n clone.setAttribute('part', currentPart ? `${currentPart} item` : 'item');\n\n // Offscreen lazy copies still need intrinsic dimensions before the loop can be measured.\n if (clone instanceof HTMLImageElement) {\n clone.loading = 'eager';\n }\n\n clone.querySelectorAll('img').forEach((image) => {\n image.loading = 'eager';\n });\n }\n\n return clone;\n }\n\n private getSourceNodes(): Node[] {\n return this.sourceSlot.assignedNodes({ flatten: true }).filter((node) => {\n if (node.nodeType === Node.TEXT_NODE) {\n return Boolean(node.textContent?.trim());\n }\n\n return node.nodeType === Node.ELEMENT_NODE;\n });\n }\n\n private watchSourceNodes(): void {\n this.mutationObserver?.disconnect();\n\n this.mutationObserver = new MutationObserver(this.scheduleRebuild);\n\n this.sourceSlot.assignedNodes({ flatten: true }).forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n this.mutationObserver?.observe(node, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n });\n\n return;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n this.mutationObserver?.observe(node, {\n characterData: true,\n });\n }\n });\n }\n\n private setupReducedMotionWatcher(): void {\n if (!('matchMedia' in window)) {\n return;\n }\n\n this.reducedMotionMediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');\n\n this.reducedMotion = this.reducedMotionMediaQuery.matches;\n this.reducedMotionMediaQuery.addEventListener('change', this.handleReducedMotionChange, {\n signal: this.abortController?.signal,\n });\n }\n\n private removeReducedMotionWatcher(): void {\n if (!this.reducedMotionMediaQuery) {\n return;\n }\n\n this.reducedMotionMediaQuery.removeEventListener('change', this.handleReducedMotionChange);\n\n this.reducedMotionMediaQuery = null;\n }\n\n private getEffectiveMode(): MarqueeContentMode {\n return this.touchInput ? 'auto' : this.options.mode;\n }\n\n private setupTouchInputWatcher(): void {\n if (!('matchMedia' in window)) {\n return;\n }\n\n this.touchInputMediaQuery = window.matchMedia(TOUCH_INPUT_QUERY);\n this.touchInput = this.touchInputMediaQuery.matches;\n this.touchInputMediaQuery.addEventListener('change', this.handleTouchInputChange, {\n signal: this.abortController?.signal,\n });\n }\n\n private removeTouchInputWatcher(): void {\n this.touchInputMediaQuery?.removeEventListener('change', this.handleTouchInputChange);\n this.touchInputMediaQuery = null;\n this.touchInput = false;\n }\n\n private handleTouchInputChange = (event: MediaQueryListEvent): void => {\n if (!this.mounted || event.matches === this.touchInput) {\n return;\n }\n\n this.touchInput = event.matches;\n this.stopAnimationLoop();\n this.cancelScrollAnimation();\n this.scrollMotionActive = false;\n this.scrollBoostStartValue = 0;\n this.scrollBoostStartedAt = 0;\n this.currentTimeScale = this.getDirectionFactor() * this.scrollDirectionFactor;\n this.updateScrollListener();\n this.applyOptions();\n };\n\n private updateAnimationLoopState(): void {\n if (!this.mounted || this.distance <= 0 || this.reducedMotion) {\n this.stopAnimationLoop();\n this.stopCssAnimation();\n this.cancelScrollAnimation();\n\n // A rebuild temporarily has no distance. Keep its phase and speed until layout\n // completes, while mode changes and reduced motion leave the active path.\n if (!this.mounted || this.getEffectiveMode() !== 'scroll' || this.reducedMotion) {\n this.scrollMotionActive = false;\n }\n\n this.track.style.transform = this.reducedMotion ? 'none' : '';\n return;\n }\n\n if (this.getEffectiveMode() === 'scroll') {\n this.stopCssAnimation();\n\n if (this.scrollMotionActive) {\n this.renderScrollProgress();\n\n if (this.canAnimate()) {\n this.startAnimationLoop();\n } else {\n this.stopAnimationLoop();\n }\n\n return;\n }\n\n this.currentTimeScale = this.getDirectionFactor() * this.scrollDirectionFactor;\n this.ensureScrollAnimation();\n\n if (!this.scrollAnimation || !this.canAnimate()) {\n this.scrollAnimation?.pause();\n this.stopAnimationLoop();\n return;\n }\n\n if (this.scrollBoostStartValue !== 0) {\n this.onScrollBoostChanged();\n } else {\n this.track.style.transform = '';\n\n if (this.scrollAnimation.playState !== 'running') {\n this.scrollAnimation.play();\n }\n }\n\n return;\n }\n\n this.stopAnimationLoop();\n this.cancelScrollAnimation();\n this.scrollMotionActive = false;\n this.startCssAnimation();\n this.track.style.animationPlayState = this.canAnimate() ? 'running' : 'paused';\n }\n\n private canAnimate(): boolean {\n if (this.options.pauseOnHover && this.isHovered) {\n return false;\n }\n\n if (this.isFocused) {\n return false;\n }\n\n if (this.options.pauseWhenOutOfView && !this.isInViewport) {\n return false;\n }\n\n return true;\n }\n\n private startAnimationLoop(): void {\n if (this.animationFrameId !== null) {\n return;\n }\n\n this.lastFrameTime = performance.now();\n this.animationFrameId = requestAnimationFrame(this.tick);\n }\n\n private stopAnimationLoop(): void {\n if (this.animationFrameId === null) {\n this.lastFrameTime = null;\n return;\n }\n\n cancelAnimationFrame(this.animationFrameId);\n this.animationFrameId = null;\n this.lastFrameTime = null;\n }\n\n private startCssAnimation(): void {\n const scrollDirection =\n this.touchInput && this.options.mode === 'scroll' ? this.scrollDirectionFactor : 1;\n const animationDirection =\n this.getDirectionFactor() * scrollDirection < 0 ? 'reverse' : 'normal';\n\n this.track.style.transform = '';\n\n if (this.track.style.animationName !== 'marquee-content-auto') {\n this.track.style.animationName = 'marquee-content-auto';\n this.track.style.animationDuration = 'var(--marquee-content-duration)';\n this.track.style.animationTimingFunction = 'linear';\n this.track.style.animationIterationCount = 'infinite';\n }\n\n if (this.track.style.animationDirection !== animationDirection) {\n this.track.style.animationDirection = animationDirection;\n }\n }\n\n private stopCssAnimation(): void {\n this.track.style.animationName = '';\n this.track.style.animationDuration = '';\n this.track.style.animationTimingFunction = '';\n this.track.style.animationIterationCount = '';\n this.track.style.animationDirection = '';\n this.track.style.animationPlayState = '';\n }\n\n private tick = (now: number): void => {\n this.animationFrameId = null;\n\n if (\n !this.mounted ||\n this.getEffectiveMode() !== 'scroll' ||\n this.distance <= 0 ||\n this.reducedMotion ||\n !this.canAnimate() ||\n !this.scrollMotionActive\n ) {\n return;\n }\n\n const settled = this.advanceScrollMotion(now);\n\n if (settled) {\n this.scrollMotionActive = false;\n this.ensureScrollAnimation();\n this.track.style.transform = '';\n this.lastFrameTime = null;\n return;\n }\n\n this.animationFrameId = requestAnimationFrame(this.tick);\n };\n\n private ensureScrollAnimation(): void {\n if (this.distance <= 0) {\n this.cancelScrollAnimation();\n return;\n }\n\n const currentSpeed = this.scrollBaseSpeed;\n const durationMs = currentSpeed > 0 ? (this.distance / currentSpeed) * 1000 : 0;\n const reversed = this.currentTimeScale < 0;\n\n if (durationMs <= 0) {\n this.cancelScrollAnimation();\n return;\n }\n\n if (\n this.scrollAnimation &&\n this.scrollAnimationDistance === this.distance &&\n this.scrollAnimationDuration === durationMs &&\n this.scrollAnimation.effect?.getTiming().direction === (reversed ? 'reverse' : 'normal')\n ) {\n return;\n }\n\n const progress = this.getScrollAnimationProgress();\n if (this.scrollAnimation) {\n this.scrollAnimation.cancel();\n this.scrollAnimation = null;\n }\n\n const animation = this.track.animate(\n [\n { transform: 'translate3d(0px, 0, 0)' },\n { transform: `translate3d(${-this.distance}px, 0, 0)` },\n ],\n {\n duration: durationMs,\n iterations: Number.POSITIVE_INFINITY,\n easing: 'linear',\n },\n );\n\n // Reverse the effect while keeping time positive, so long-running motion cannot end at zero.\n animation.effect?.updateTiming({ direction: reversed ? 'reverse' : 'normal' });\n animation.currentTime = durationMs * (reversed ? 1 - progress : progress);\n animation.playbackRate = Math.abs(this.currentTimeScale);\n\n this.scrollAnimation = animation;\n this.scrollAnimationDuration = durationMs;\n this.scrollAnimationDistance = this.distance;\n this.scrollProgress = progress;\n }\n\n private cancelScrollAnimation(): void {\n if (!this.scrollAnimation) {\n return;\n }\n\n this.scrollProgress = this.getScrollAnimationProgress();\n this.scrollAnimation.cancel();\n this.scrollAnimation = null;\n this.scrollAnimationDuration = 0;\n this.scrollAnimationDistance = 0;\n }\n\n private getScrollAnimationProgress(): number {\n const animation = this.scrollAnimation;\n\n if (!animation || this.scrollAnimationDuration <= 0) {\n return this.scrollProgress;\n }\n\n // currentTime can be rounded by the browser. Computed progress reflects the\n // rendered phase and already accounts for a reversed effect.\n const progress = animation.effect?.getComputedTiming().progress;\n\n if (progress != null) {\n return progress % 1;\n }\n\n const currentTime = animation.currentTime;\n\n if (typeof currentTime !== 'number') {\n return this.scrollProgress;\n }\n\n const fraction = (currentTime / this.scrollAnimationDuration) % 1;\n\n const normalized = fraction < 0 ? fraction + 1 : fraction;\n\n return animation.effect?.getTiming().direction === 'reverse'\n ? (1 - normalized) % 1\n : normalized;\n }\n\n private advanceScrollMotion(now: number): boolean {\n const target = this.getCurrentTimeScale(now);\n const previousTimeScale = this.currentTimeScale;\n const previousTime = this.lastFrameTime ?? now;\n const deltaTime = this.clamp((now - previousTime) / 1000, 0, 0.064);\n\n this.lastFrameTime = now;\n\n const smoothingFactor = 1 - Math.exp(-deltaTime / SCROLL_TIME_SCALE_SMOOTHING_SECONDS);\n\n this.currentTimeScale += (target - this.currentTimeScale) * smoothingFactor;\n\n const settled =\n this.scrollBoostStartValue === 0 && Math.abs(target - this.currentTimeScale) < 0.001;\n\n if (settled) {\n this.currentTimeScale = target;\n }\n\n // Keep changing speed on the frame clock, without resynchronizing an accelerated\n // WAAPI animation on every frame. Idle motion returns to WAAPI after settling.\n const averageTimeScale = (previousTimeScale + this.currentTimeScale) / 2;\n const progress =\n this.scrollProgress + (this.scrollBaseSpeed * averageTimeScale * deltaTime) / this.distance;\n\n this.scrollProgress = ((progress % 1) + 1) % 1;\n this.renderScrollProgress();\n\n return settled;\n }\n\n private renderScrollProgress(): void {\n this.track.style.transform = `translate3d(${-this.scrollProgress * this.distance}px, 0, 0)`;\n }\n\n private getCurrentTimeScale(now: number): number {\n const directionFactor = this.getDirectionFactor();\n\n if (this.getEffectiveMode() !== 'scroll') {\n return directionFactor;\n }\n\n const boost = this.getScrollBoost(now);\n const scrollTimeScale = this.scrollDirectionFactor + boost;\n\n return this.clamp(\n directionFactor * scrollTimeScale,\n -1 - this.options.scrollMaxExtraSpeed,\n 1 + this.options.scrollMaxExtraSpeed,\n );\n }\n\n private getDirectionFactor(): 1 | -1 {\n return this.options.direction === 'ltr' ? -1 : 1;\n }\n\n private getScrollBoost(now: number): number {\n if (this.scrollBoostStartValue === 0) {\n return 0;\n }\n\n const duration = this.options.scrollInertiaDuration;\n\n if (duration <= 0) {\n this.scrollBoostStartValue = 0;\n return 0;\n }\n\n const progress = this.clamp((now - this.scrollBoostStartedAt) / duration, 0, 1);\n\n if (progress >= 1) {\n this.scrollBoostStartValue = 0;\n return 0;\n }\n\n const easedProgress = this.easeOutCubic(progress);\n\n return this.scrollBoostStartValue * (1 - easedProgress);\n }\n\n private getCurrentSpeed(containerWidth: number): number {\n if (!this.options.responsiveSpeed) {\n return this.options.speed;\n }\n\n const factor = this.clamp(\n containerWidth / this.options.referenceWidth,\n this.options.minSpeedFactor,\n this.options.maxSpeedFactor,\n );\n\n return this.options.speed * factor;\n }\n\n private resolveOptions(): MarqueeContentResolvedOptions {\n return {\n ...DEFAULT_OPTIONS,\n speed: this.num('speed', DEFAULT_OPTIONS.speed, 10, 500),\n mode: this.parseMode(this.getAttribute('mode'), DEFAULT_OPTIONS.mode),\n direction: this.parseDirection(this.getAttribute('direction'), DEFAULT_OPTIONS.direction),\n pauseOnHover: this.parseBoolean(\n this.getAttribute('pause-on-hover'),\n DEFAULT_OPTIONS.pauseOnHover,\n ),\n responsiveSpeed: this.parseBoolean(\n this.getAttribute('responsive-speed'),\n DEFAULT_OPTIONS.responsiveSpeed,\n ),\n };\n }\n\n private num(attributeName: string, fallback: number, min: number, max: number): number {\n return this.clamp(this.parseNumber(this.getAttribute(attributeName), fallback), min, max);\n }\n\n private parseNumber(value: string | null, fallback: number): number {\n if (value === null || value.trim() === '') {\n return fallback;\n }\n\n const parsed = Number(value);\n\n return Number.isFinite(parsed) ? parsed : fallback;\n }\n\n private parseBoolean(value: string | null, fallback: boolean): boolean {\n if (value === null) {\n return fallback;\n }\n\n const normalizedValue = value.trim().toLowerCase();\n\n if (normalizedValue === '') {\n return true;\n }\n\n if (['true', '1', 'yes', 'on'].includes(normalizedValue)) {\n return true;\n }\n\n if (['false', '0', 'no', 'off'].includes(normalizedValue)) {\n return false;\n }\n\n return fallback;\n }\n\n private parseMode(value: string | null, fallback: MarqueeContentMode): MarqueeContentMode {\n if (value === 'auto' || value === 'scroll') {\n return value;\n }\n\n return fallback;\n }\n\n private parseDirection(\n value: string | null,\n fallback: MarqueeContentDirection,\n ): MarqueeContentDirection {\n if (value === 'rtl' || value === 'ltr') {\n return value;\n }\n\n return fallback;\n }\n\n private setNullableAttribute(\n name: string,\n value: string | number | boolean | null | undefined,\n ): void {\n if (value === null || value === undefined) {\n this.removeAttribute(name);\n return;\n }\n\n this.setAttribute(name, String(value));\n }\n\n private getScrollY(): number {\n const scrollY = window.scrollY || window.pageYOffset || 0;\n if (!this.touchInput) {\n return scrollY;\n }\n\n const scroller = document.scrollingElement ?? document.documentElement;\n const maxScroll = Math.max(0, scroller.scrollHeight - scroller.clientHeight);\n\n // Ignore rubber-band movement and subpixel jitter at either page edge.\n if (scrollY <= TOUCH_SCROLL_EDGE_THRESHOLD) {\n return 0;\n }\n if (scrollY >= maxScroll - TOUCH_SCROLL_EDGE_THRESHOLD) {\n return maxScroll;\n }\n return scrollY;\n }\n\n private clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n }\n\n private easeOutCubic(value: number): number {\n return 1 - (1 - value) ** 3;\n }\n\n private rebuildAfterFontsReady(): void {\n const fonts = (\n document as Document & {\n fonts?: { ready: Promise<unknown> };\n }\n ).fonts;\n\n if (!fonts?.ready) {\n return;\n }\n\n void fonts.ready.then(this.scheduleRebuild).catch(() => undefined);\n }\n}\n\nexport function defineMarqueeContent(\n tagName = MARQUEE_CONTENT_TAG,\n options: DefineMarqueeContentOptions = {},\n): void {\n if (typeof window === 'undefined' || !window.customElements) {\n return;\n }\n\n MarqueeContent.configureStyles(options);\n\n if (!window.customElements.get(tagName)) {\n const elementClass =\n tagName === MARQUEE_CONTENT_TAG ? MarqueeContent : class extends MarqueeContent {};\n window.customElements.define(tagName, elementClass);\n }\n}\n\nexport function initMarqueeContents(options: InitMarqueeContentsOptions = {}): void {\n const { tagName = MARQUEE_CONTENT_TAG, ...styleOptions } = options;\n\n defineMarqueeContent(tagName, styleOptions);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'marquee-content': MarqueeContent;\n }\n}\n","export type {\n DefineMarqueeContentOptions,\n InitMarqueeContentsOptions,\n MarqueeContentDirection,\n MarqueeContentMode,\n MarqueeContentOptions,\n} from './marquee-content';\nexport {\n defineMarqueeContent,\n initMarqueeContents,\n MARQUEE_CONTENT_TAG,\n MarqueeContent,\n} from './marquee-content';\nexport type {\n MarqueeContentStyleEntry,\n MarqueeContentStyleInput,\n} from './styles';\nexport {\n createConstructableStyleSheet,\n cssStyleSheetToText,\n marqueeContentCssText,\n normalizeStyleInput,\n} from './styles';\n\nimport { defineMarqueeContent } from './marquee-content';\n\ndefineMarqueeContent();\n"],"mappings":";;;;;AAUA,MAAa,wBAAgCA;AAE7C,SAAgB,8BAA8B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AgB,oBAAoB,UAAsC,CAAC,GAAS;CAClF,MAAM,EAAE,UAAU,qBAAqB,GAAG,iBAAiB;CAE3D,qBAAqB,SAAS,YAAY;AAC5C;;;;ACt6CA,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["DEFAULT_CSS_TEXT"],"sources":["../src/styles.ts","../src/marquee-content.ts","../src/index.ts"],"sourcesContent":["import './marquee-content.css';\nimport DEFAULT_CSS_TEXT from './marquee-content.css?inline';\n\nexport type MarqueeContentStyleInput = CSSStyleSheet | string | null | undefined;\n\nexport interface MarqueeContentStyleEntry {\n sheet: CSSStyleSheet | null;\n cssText: string;\n}\n\nexport const marqueeContentCssText: string = DEFAULT_CSS_TEXT;\n\nexport function createConstructableStyleSheet(cssText: string): CSSStyleSheet | null {\n if (\n typeof CSSStyleSheet === 'undefined' ||\n typeof CSSStyleSheet.prototype.replaceSync !== 'function'\n ) {\n return null;\n }\n\n try {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(cssText);\n return sheet;\n } catch {\n return null;\n }\n}\n\nexport function cssStyleSheetToText(sheet: CSSStyleSheet): string {\n try {\n return Array.from(sheet.cssRules)\n .map((rule) => rule.cssText)\n .join('\\n');\n } catch {\n return '';\n }\n}\n\nexport function normalizeStyleInput(input: MarqueeContentStyleInput): MarqueeContentStyleEntry {\n if (!input) {\n return {\n sheet: null,\n cssText: '',\n };\n }\n\n if (typeof input === 'string') {\n return {\n sheet: createConstructableStyleSheet(input),\n cssText: input,\n };\n }\n\n return {\n sheet: input,\n cssText: cssStyleSheetToText(input),\n };\n}\n\nexport function canUseAdoptedStyleSheets(root: ShadowRoot): boolean {\n return (\n typeof CSSStyleSheet !== 'undefined' &&\n 'adoptedStyleSheets' in root &&\n typeof CSSStyleSheet.prototype.replaceSync === 'function'\n );\n}\n","import {\n type MarqueeContentStyleEntry,\n type MarqueeContentStyleInput,\n marqueeContentCssText,\n normalizeStyleInput,\n} from './styles';\n\nexport type MarqueeContentDirection = 'rtl' | 'ltr';\nexport type MarqueeContentMode = 'auto' | 'scroll';\n\nexport interface MarqueeContentOptions {\n speed?: number | string | null;\n mode?: MarqueeContentMode | null;\n direction?: MarqueeContentDirection | null;\n pauseOnHover?: boolean | string | null;\n}\n\ninterface MarqueeContentResolvedOptions {\n speed: number;\n mode: MarqueeContentMode;\n direction: MarqueeContentDirection;\n\n pauseOnHover: boolean;\n pauseWhenOutOfView: boolean;\n recalculateAfterFontsReady: boolean;\n\n scrollVelocityFactor: number;\n scrollMinExtraSpeed: number;\n scrollMaxExtraSpeed: number;\n scrollInertiaDuration: number;\n}\n\nexport interface DefineMarqueeContentOptions {\n stylesheet?: MarqueeContentStyleInput;\n styleOverrides?: MarqueeContentStyleInput;\n}\n\nexport interface InitMarqueeContentsOptions extends DefineMarqueeContentOptions {\n tagName?: string;\n}\n\nexport const MARQUEE_CONTENT_TAG = 'marquee-content';\n\nconst DEFAULT_OPTIONS: MarqueeContentResolvedOptions = {\n speed: 90,\n mode: 'auto',\n direction: 'rtl',\n\n pauseOnHover: false,\n pauseWhenOutOfView: true,\n recalculateAfterFontsReady: true,\n\n scrollVelocityFactor: 150,\n scrollMinExtraSpeed: 0.05,\n scrollMaxExtraSpeed: 5,\n scrollInertiaDuration: 2500,\n};\n\nconst OBSERVED_ATTRIBUTES = ['speed', 'mode', 'direction', 'pause-on-hover'] as const;\n\nconst OPTION_ATTRIBUTE_MAP: Record<keyof MarqueeContentOptions, string> = {\n speed: 'speed',\n mode: 'mode',\n direction: 'direction',\n pauseOnHover: 'pause-on-hover',\n};\n\nconst MARQUEE_CONTENT_CSS_PROPS = [\n '--marquee-content-distance',\n '--marquee-content-duration',\n] as const;\n\nconst SCROLL_TIME_SCALE_SMOOTHING_SECONDS = 0.12;\nconst TOUCH_INPUT_QUERY = '(hover: none) and (pointer: coarse)';\nconst TOUCH_SCROLL_EDGE_THRESHOLD = 1;\nconst TOUCH_SCROLL_IDLE_DELAY = 250;\n\n// Server imports do not need a DOM; element construction still requires a browser.\nconst HTMLElementBase = (globalThis.HTMLElement ?? class {}) as typeof HTMLElement;\n\nconst MARQUEE_CONTENT_RUNTIME_CSS = `\n @keyframes marquee-content-auto {\n to {\n transform: translate3d(calc(-1 * var(--marquee-content-distance)), 0, 0);\n }\n }\n\n .marquee-content__source {\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n\n .marquee-content__source::slotted(*) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n`;\n\nconst TEMPLATE = `\n <slot class=\"marquee-content__source\"></slot>\n\n <div class=\"marquee-content__viewport\" part=\"viewport\">\n <div class=\"marquee-content__track\" part=\"track\" aria-hidden=\"true\" inert></div>\n </div>\n`;\n\nexport class MarqueeContent extends HTMLElementBase {\n static get observedAttributes(): string[] {\n return [...OBSERVED_ATTRIBUTES];\n }\n\n private static readonly instances = new Set<MarqueeContent>();\n\n private static readonly runtimeStylesheetEntry: MarqueeContentStyleEntry = normalizeStyleInput(\n MARQUEE_CONTENT_RUNTIME_CSS,\n );\n\n private static stylesheetEntry: MarqueeContentStyleEntry =\n normalizeStyleInput(marqueeContentCssText);\n\n private static styleOverridesEntry: MarqueeContentStyleEntry = normalizeStyleInput(null);\n\n static configureStyles(options: DefineMarqueeContentOptions = {}): void {\n if (!('stylesheet' in options) && !('styleOverrides' in options)) {\n return;\n }\n\n if ('stylesheet' in options) {\n MarqueeContent.stylesheetEntry = normalizeStyleInput(\n options.stylesheet ?? marqueeContentCssText,\n );\n }\n\n if ('styleOverrides' in options) {\n MarqueeContent.styleOverridesEntry = normalizeStyleInput(options.styleOverrides);\n }\n\n MarqueeContent.instances.forEach((instance) => {\n instance.applyAllStyles();\n instance.scheduleRebuild();\n });\n }\n\n static setStylesheet(stylesheet: MarqueeContentStyleInput): void {\n MarqueeContent.configureStyles({ stylesheet });\n }\n\n static setStyleOverrides(styleOverrides: MarqueeContentStyleInput): void {\n MarqueeContent.configureStyles({ styleOverrides });\n }\n\n private readonly shadow: ShadowRoot;\n private readonly sourceSlot: HTMLSlotElement;\n private readonly viewport: HTMLElement;\n private readonly track: HTMLElement;\n\n private options: MarqueeContentResolvedOptions = { ...DEFAULT_OPTIONS };\n private sourceNodes: Node[] = [];\n\n private resizeObserver: ResizeObserver | null = null;\n private mutationObserver: MutationObserver | null = null;\n private intersectionObserver: IntersectionObserver | null = null;\n private abortController: AbortController | null = null;\n private reducedMotionMediaQuery: MediaQueryList | null = null;\n private touchInputMediaQuery: MediaQueryList | null = null;\n\n private animationFrameId: number | null = null;\n private rebuildFrameId: number | null = null;\n private lastFrameTime: number | null = null;\n\n private mounted = false;\n private isHovered = false;\n private isFocused = false;\n private isInViewport = true;\n private reducedMotion = false;\n private touchInput = false;\n private isListeningToScroll = false;\n private isListeningToTouch = false;\n\n private distance = 0;\n private containerWidth = 0;\n private group: HTMLElement | null = null;\n private layoutPending = false;\n\n private scrollAnimation: Animation | null = null;\n private scrollAnimationDuration = 0;\n private scrollAnimationDistance = 0;\n private scrollProgress = 0;\n private scrollMotionActive = false;\n private scrollBaseSpeed = DEFAULT_OPTIONS.speed;\n\n private scrollDirectionFactor: 1 | -1 = 1;\n private currentTimeScale = 1;\n private scrollBoostStartValue = 0;\n private scrollBoostStartedAt = 0;\n private lastScrollY = 0;\n private lastScrollTime = 0;\n private lastTouchY: number | null = null;\n private touchScrollDirection: 1 | -1 | 0 = 0;\n private touchScrollResetTimer: number | null = null;\n\n constructor() {\n if (typeof HTMLElement === 'undefined') {\n throw new Error(\n '[MarqueeContent] Create elements in a browser, after client initialization.',\n );\n }\n\n super();\n\n this.shadow = this.attachShadow({ mode: 'open' });\n this.applyAllStyles();\n\n const template = document.createElement('template');\n template.innerHTML = TEMPLATE;\n this.shadow.appendChild(template.content.cloneNode(true));\n\n const sourceSlot = this.shadow.querySelector<HTMLSlotElement>('slot.marquee-content__source');\n const viewport = this.shadow.querySelector<HTMLElement>('.marquee-content__viewport');\n\n const track = this.shadow.querySelector<HTMLElement>('.marquee-content__track');\n\n if (!sourceSlot) {\n throw new Error('[MarqueeContent] Source slot was not found.');\n }\n\n if (!track) {\n throw new Error('[MarqueeContent] Track element was not found.');\n }\n\n if (!viewport) {\n throw new Error('[MarqueeContent] Viewport element was not found.');\n }\n\n this.sourceSlot = sourceSlot;\n this.viewport = viewport;\n this.track = track;\n }\n\n connectedCallback(): void {\n if (this.mounted) {\n return;\n }\n\n MarqueeContent.instances.add(this);\n\n this.mounted = true;\n this.applyAllStyles();\n this.abortController = new AbortController();\n this.options = this.resolveOptions();\n\n this.lastScrollY = this.getScrollY();\n this.lastScrollTime = performance.now();\n\n this.sourceSlot.addEventListener('slotchange', this.handleSlotChange, {\n signal: this.abortController.signal,\n });\n\n // Only source loads should rebuild the track, never loads from its decorative copies.\n for (const eventName of ['load', 'error']) {\n this.addEventListener(eventName, this.handleSourceLoad, {\n capture: true,\n signal: this.abortController.signal,\n });\n this.shadow.addEventListener(eventName, this.completeLayout, {\n capture: true,\n signal: this.abortController.signal,\n });\n }\n\n this.addEventListener('pointerenter', this.handlePointerEnter, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('pointerleave', this.handlePointerLeave, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('focusin', this.handleFocusIn, {\n signal: this.abortController.signal,\n });\n\n this.addEventListener('focusout', this.handleFocusOut, {\n signal: this.abortController.signal,\n });\n\n window.addEventListener('orientationchange', this.scheduleRebuild, {\n signal: this.abortController.signal,\n });\n\n this.resizeObserver = new ResizeObserver(this.handleResize);\n this.resizeObserver.observe(this);\n this.resizeObserver.observe(this.viewport);\n\n this.intersectionObserver = new IntersectionObserver(this.handleIntersectionChange);\n this.intersectionObserver.observe(this);\n\n this.setupReducedMotionWatcher();\n this.setupTouchInputWatcher();\n this.watchSourceNodes();\n this.updateScrollListener();\n this.rebuild();\n\n if (this.options.recalculateAfterFontsReady) {\n this.rebuildAfterFontsReady();\n }\n }\n\n disconnectedCallback(): void {\n this.teardown();\n MarqueeContent.instances.delete(this);\n }\n\n attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue) {\n return;\n }\n\n this.options = this.resolveOptions();\n\n if (!this.mounted) {\n return;\n }\n\n this.updateScrollListener();\n this.applyOptions();\n }\n\n get speed(): number {\n return this.options.speed;\n }\n\n set speed(value: number | string | null | undefined) {\n this.setNullableAttribute('speed', value);\n }\n\n get mode(): MarqueeContentMode {\n return this.options.mode;\n }\n\n set mode(value: MarqueeContentMode | null | undefined) {\n this.setNullableAttribute('mode', value);\n }\n\n get direction(): MarqueeContentDirection {\n return this.options.direction;\n }\n\n set direction(value: MarqueeContentDirection | null | undefined) {\n this.setNullableAttribute('direction', value);\n }\n\n get pauseOnHover(): boolean {\n return this.options.pauseOnHover;\n }\n\n set pauseOnHover(value: boolean | string | null | undefined) {\n this.setNullableAttribute('pause-on-hover', value);\n }\n\n update(options: MarqueeContentOptions = {}): void {\n Object.entries(options).forEach(([key, value]) => {\n const attributeName = OPTION_ATTRIBUTE_MAP[key as keyof MarqueeContentOptions];\n\n if (attributeName) {\n this.setNullableAttribute(attributeName, value);\n }\n });\n\n this.options = this.resolveOptions();\n this.updateScrollListener();\n this.applyOptions();\n }\n\n refresh(): void {\n this.scheduleRebuild();\n }\n\n private applyAllStyles(): void {\n const runtime = MarqueeContent.runtimeStylesheetEntry;\n const base = MarqueeContent.stylesheetEntry;\n const overrides = MarqueeContent.styleOverridesEntry;\n const sheets: CSSStyleSheet[] = [];\n\n if (runtime.sheet) {\n sheets.push(runtime.sheet);\n }\n\n if (base.sheet) {\n sheets.push(base.sheet);\n }\n\n if (overrides.sheet) {\n sheets.push(overrides.sheet);\n }\n\n this.shadow.adoptedStyleSheets = sheets;\n }\n\n private teardown(): void {\n if (!this.mounted) {\n return;\n }\n\n this.mounted = false;\n\n this.stopAnimationLoop();\n this.stopCssAnimation();\n this.cancelScrollAnimation();\n this.cancelScheduledRebuild();\n this.updateScrollListener(false);\n\n this.resizeObserver?.disconnect();\n this.mutationObserver?.disconnect();\n this.intersectionObserver?.disconnect();\n\n this.removeReducedMotionWatcher();\n this.removeTouchInputWatcher();\n\n this.abortController?.abort();\n\n this.group = null;\n this.layoutPending = false;\n this.containerWidth = 0;\n this.resizeObserver = null;\n this.mutationObserver = null;\n this.intersectionObserver = null;\n this.abortController = null;\n\n this.track.replaceChildren();\n this.removeAttribute('data-marquee-content-ready');\n this.removeAttribute('data-marquee-content-mode');\n this.removeAttribute('data-marquee-content-pause-on-hover');\n this.removeAttribute('data-marquee-content-reduced-motion');\n\n MARQUEE_CONTENT_CSS_PROPS.forEach((prop) => {\n this.style.removeProperty(prop);\n });\n\n this.distance = 0;\n this.isHovered = false;\n this.isFocused = false;\n this.isInViewport = true;\n this.scrollDirectionFactor = 1;\n this.scrollBoostStartValue = 0;\n this.scrollBoostStartedAt = 0;\n this.scrollProgress = 0;\n this.scrollMotionActive = false;\n this.scrollBaseSpeed = DEFAULT_OPTIONS.speed;\n this.currentTimeScale = 1;\n this.lastFrameTime = null;\n }\n\n private handleResize = (): void => {\n if (\n this.measureViewportWidth() !== this.containerWidth ||\n (this.group &&\n !this.layoutPending &&\n Math.abs(this.measureGroup(this.group) - this.distance) > 0.01)\n ) {\n this.scheduleRebuild();\n }\n };\n\n private handleSourceLoad = (event: Event): void => {\n // A shadow-tree event may be retargeted to the host; only authored descendants count.\n if (event.target instanceof Node && event.target !== this && this.contains(event.target)) {\n this.scheduleRebuild();\n }\n };\n\n private handleSlotChange = (): void => {\n this.watchSourceNodes();\n this.scheduleRebuild();\n };\n\n private handlePointerEnter = (): void => {\n this.isHovered = true;\n this.updateAnimationLoopState();\n };\n\n private handlePointerLeave = (): void => {\n this.isHovered = false;\n this.updateAnimationLoopState();\n };\n\n private handleFocusIn = (): void => {\n this.isFocused = true;\n this.updateAnimationLoopState();\n };\n\n private handleFocusOut = (): void => {\n this.isFocused = false;\n this.updateAnimationLoopState();\n };\n\n private handleIntersectionChange = (entries: IntersectionObserverEntry[]): void => {\n const entry = entries[0];\n\n if (!entry) {\n return;\n }\n\n this.isInViewport = entry.isIntersecting;\n this.updateAnimationLoopState();\n };\n\n private handleReducedMotionChange = (event: MediaQueryListEvent | MediaQueryList): void => {\n this.reducedMotion = event.matches;\n\n if (this.reducedMotion) {\n this.track.style.transform = 'none';\n } else if (this.getEffectiveMode() === 'scroll') {\n this.track.style.transform = '';\n }\n\n this.updateAnimationLoopState();\n this.scheduleRebuild();\n };\n\n private handleScroll = (): void => {\n if (this.options.mode !== 'scroll') {\n return;\n }\n\n const now = performance.now();\n const currentScrollY = this.getScrollY();\n\n const deltaY = currentScrollY - this.lastScrollY;\n const deltaTime = Math.max((now - this.lastScrollTime) / 1000, 0.016);\n\n this.lastScrollY = currentScrollY;\n this.lastScrollTime = now;\n\n if (this.touchInput) {\n this.scheduleTouchScrollReset();\n }\n\n if (Math.abs(deltaY) < 0.5) {\n return;\n }\n\n const velocity = deltaY / deltaTime;\n\n const direction = velocity >= 0 ? 1 : -1;\n // A rubber-band return can cross back inside the page bounds. Only accept\n // motion matching the finger, including its momentum after touchend.\n if (\n this.touchInput &&\n ((this.lastTouchY !== null && this.touchScrollDirection === 0) ||\n (this.touchScrollDirection !== 0 && direction !== this.touchScrollDirection))\n ) {\n return;\n }\n\n const directionChanged = direction !== this.scrollDirectionFactor;\n this.scrollDirectionFactor = direction;\n\n if (this.touchInput) {\n if (directionChanged) {\n this.applyOptions();\n }\n return;\n }\n\n const extraSpeed = this.clamp(\n velocity / this.options.scrollVelocityFactor,\n -this.options.scrollMaxExtraSpeed,\n this.options.scrollMaxExtraSpeed,\n );\n\n if (Math.abs(extraSpeed) >= this.options.scrollMinExtraSpeed) {\n this.scrollBoostStartValue = extraSpeed;\n this.scrollBoostStartedAt = now;\n } else {\n this.scrollBoostStartValue = 0;\n }\n\n this.onScrollBoostChanged();\n };\n\n private handleTouchStart = (event: TouchEvent): void => {\n this.resetTouchScroll();\n const touch = event.touches.length === 1 ? event.touches[0] : null;\n if (touch) {\n this.lastTouchY = touch.clientY;\n }\n };\n\n private handleTouchMove = (event: TouchEvent): void => {\n if (event.touches.length !== 1) {\n this.resetTouchScroll();\n return;\n }\n const touch = event.touches[0];\n if (!touch || this.lastTouchY === null) {\n return;\n }\n const deltaY = this.lastTouchY - touch.clientY;\n if (Math.abs(deltaY) < 0.5) {\n return;\n }\n this.lastTouchY = touch.clientY;\n this.touchScrollDirection = deltaY > 0 ? 1 : -1;\n };\n\n private handleTouchEnd = (event: TouchEvent): void => {\n if (event.touches.length > 0) {\n this.resetTouchScroll();\n return;\n }\n this.lastTouchY = null;\n this.scheduleTouchScrollReset();\n };\n\n private handleScrollEnd = (): void => {\n if (this.lastTouchY === null) {\n this.resetTouchScroll();\n }\n };\n\n private scheduleTouchScrollReset(): void {\n if (this.touchScrollResetTimer !== null) {\n window.clearTimeout(this.touchScrollResetTimer);\n this.touchScrollResetTimer = null;\n }\n if (this.lastTouchY === null && this.touchScrollDirection !== 0) {\n // Also release intent when a gesture scrolls a nested element, or on Safari\n // versions without scrollend. Every page scroll extends this idle window.\n this.touchScrollResetTimer = window.setTimeout(\n this.resetTouchScroll,\n TOUCH_SCROLL_IDLE_DELAY,\n );\n }\n }\n\n private resetTouchScroll = (): void => {\n if (this.touchScrollResetTimer !== null) {\n window.clearTimeout(this.touchScrollResetTimer);\n this.touchScrollResetTimer = null;\n }\n this.lastTouchY = null;\n this.touchScrollDirection = 0;\n };\n\n private onScrollBoostChanged(): void {\n if (!this.mounted || this.getEffectiveMode() !== 'scroll' || this.reducedMotion) {\n return;\n }\n\n if (!this.canAnimate() || this.distance <= 0) {\n return;\n }\n\n if (!this.scrollMotionActive) {\n this.cancelScrollAnimation();\n this.scrollMotionActive = true;\n this.renderScrollProgress();\n }\n\n this.startAnimationLoop();\n }\n\n private updateScrollListener(\n shouldListen = this.mounted && this.options.mode === 'scroll',\n ): void {\n if (shouldListen !== this.isListeningToScroll) {\n if (shouldListen) {\n this.lastScrollY = this.getScrollY();\n this.lastScrollTime = performance.now();\n window.addEventListener('scroll', this.handleScroll, { passive: true });\n } else {\n window.removeEventListener('scroll', this.handleScroll);\n }\n this.isListeningToScroll = shouldListen;\n }\n\n const shouldListenToTouch = shouldListen && this.touchInput;\n if (shouldListenToTouch !== this.isListeningToTouch) {\n if (shouldListenToTouch) {\n window.addEventListener('touchstart', this.handleTouchStart, {\n passive: true,\n capture: true,\n });\n window.addEventListener('touchmove', this.handleTouchMove, {\n passive: true,\n capture: true,\n });\n window.addEventListener('touchend', this.handleTouchEnd, { passive: true, capture: true });\n window.addEventListener('touchcancel', this.handleTouchEnd, {\n passive: true,\n capture: true,\n });\n window.addEventListener('scrollend', this.handleScrollEnd);\n } else {\n window.removeEventListener('touchstart', this.handleTouchStart, true);\n window.removeEventListener('touchmove', this.handleTouchMove, true);\n window.removeEventListener('touchend', this.handleTouchEnd, true);\n window.removeEventListener('touchcancel', this.handleTouchEnd, true);\n window.removeEventListener('scrollend', this.handleScrollEnd);\n this.resetTouchScroll();\n }\n this.isListeningToTouch = shouldListenToTouch;\n }\n }\n\n private scheduleRebuild = (): void => {\n if (!this.mounted) {\n return;\n }\n\n this.cancelScheduledRebuild();\n\n this.rebuildFrameId = requestAnimationFrame(() => {\n this.rebuildFrameId = null;\n this.rebuild();\n });\n };\n\n private cancelScheduledRebuild(): void {\n if (this.rebuildFrameId === null) {\n return;\n }\n\n cancelAnimationFrame(this.rebuildFrameId);\n this.rebuildFrameId = null;\n }\n\n private applyOptions(): void {\n if (!this.mounted) {\n return;\n }\n\n const progress = this.scrollAnimation\n ? this.getScrollAnimationProgress()\n : (this.getAutoAnimation()?.effect?.getComputedTiming().progress ?? this.scrollProgress);\n this.scrollBaseSpeed = this.options.speed;\n const duration = this.distance / this.scrollBaseSpeed;\n\n this.setAttribute('data-marquee-content-mode', this.options.mode);\n this.toggleAttribute('data-marquee-content-pause-on-hover', this.options.pauseOnHover);\n this.toggleAttribute('data-marquee-content-reduced-motion', this.reducedMotion);\n\n if (this.distance > 0) {\n this.style.setProperty('--marquee-content-distance', `${this.distance}px`);\n this.style.setProperty('--marquee-content-duration', `${duration}s`);\n }\n\n if (progress != null) {\n this.scrollProgress = progress;\n }\n\n this.updateAnimationLoopState();\n\n if (progress != null && this.getEffectiveMode() === 'auto' && !this.reducedMotion) {\n const animation = this.getAutoAnimation();\n\n if (animation) {\n animation.currentTime =\n duration *\n 1000 *\n (this.track.style.animationDirection === 'reverse' ? 1 - progress : progress);\n }\n }\n }\n\n private getAutoAnimation(): Animation | undefined {\n return this.track\n .getAnimations()\n .find(\n (animation) =>\n 'animationName' in animation && animation.animationName === 'marquee-content-auto',\n );\n }\n\n private rebuild(): void {\n if (!this.mounted) {\n return;\n }\n\n this.options = this.resolveOptions();\n this.updateScrollListener();\n const progress = this.scrollAnimation\n ? this.getScrollAnimationProgress()\n : this.getAutoAnimation()?.effect?.getComputedTiming().progress;\n\n if (progress != null) {\n this.scrollProgress = progress;\n }\n\n this.distance = 0;\n this.layoutPending = false;\n this.updateAnimationLoopState();\n this.removeAttribute('data-marquee-content-ready');\n this.toggleAttribute('data-marquee-content-reduced-motion', this.reducedMotion);\n this.containerWidth = this.measureViewportWidth();\n\n if (this.group) {\n this.resizeObserver?.unobserve(this.group);\n this.group = null;\n }\n\n this.sourceNodes = this.getSourceNodes();\n\n if (this.containerWidth <= 0 || this.sourceNodes.length === 0) {\n this.distance = 0;\n this.track.replaceChildren();\n this.applyOptions();\n return;\n }\n\n this.group = this.createGroup();\n this.track.replaceChildren(this.group);\n this.layoutPending = true;\n this.completeLayout();\n }\n\n private completeLayout = (): void => {\n const group = this.group;\n\n if (!this.mounted || !group || !this.layoutPending) {\n return;\n }\n\n // Cached clones can load asynchronously. Keep the measured source period in place\n // and reconcile coverage again when loading finishes in case its dimensions changed.\n if (this.hasPendingImages(this.track)) {\n return;\n }\n\n if (!this.reducedMotion) {\n this.fillTrack(group);\n\n if (this.hasPendingImages(this.track)) {\n return;\n }\n }\n\n this.layoutPending = false;\n this.distance = this.measureGroup(group);\n this.resizeObserver?.observe(group);\n\n if (!Number.isFinite(this.distance) || this.distance <= 0) {\n this.track.replaceChildren();\n this.applyOptions();\n return;\n }\n\n this.setAttribute('data-marquee-content-ready', 'true');\n this.applyOptions();\n };\n\n private hasPendingImages(root: ParentNode): boolean {\n return Array.from(root.querySelectorAll('img')).some((image) => !image.complete);\n }\n\n private measureViewportWidth(): number {\n if (this.viewport.getClientRects().length === 0) {\n return 0;\n }\n\n const style = getComputedStyle(this.viewport);\n const width = Number.parseFloat(style.width);\n\n if (!Number.isFinite(width)) {\n return this.viewport.clientWidth;\n }\n\n // Preserve fractional layout pixels and ignore ancestor transforms.\n return style.boxSizing === 'border-box'\n ? width - Number.parseFloat(style.borderLeftWidth) - Number.parseFloat(style.borderRightWidth)\n : width + Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight);\n }\n\n private measureGroup(group: HTMLElement): number {\n const style = getComputedStyle(group);\n const width = Number.parseFloat(style.width);\n\n if (!Number.isFinite(width)) {\n return group.scrollWidth;\n }\n\n if (style.boxSizing === 'border-box') {\n return width;\n }\n\n return (\n width +\n Number.parseFloat(style.paddingLeft) +\n Number.parseFloat(style.paddingRight) +\n Number.parseFloat(style.borderLeftWidth) +\n Number.parseFloat(style.borderRightWidth)\n );\n }\n\n private createGroup(): HTMLElement {\n const group = document.createElement('div');\n\n group.className = 'marquee-content__group';\n group.setAttribute('part', 'group');\n\n this.appendSourceNodes(group);\n\n return group;\n }\n\n private fillTrack(group: HTMLElement): void {\n const period = this.measureGroup(group);\n\n if (!Number.isFinite(period) || period <= 0) {\n return;\n }\n\n // One period moves offscreen while the remaining copies cover the viewport.\n // Repeat whole groups so custom padding and borders recur at every seam.\n const groupCount = Math.ceil(this.containerWidth / period) + 1;\n\n while (this.track.childElementCount > groupCount) {\n this.track.lastElementChild?.remove();\n }\n\n const fragment = document.createDocumentFragment();\n\n for (let index = this.track.childElementCount; index < groupCount; index += 1) {\n fragment.appendChild(group.cloneNode(true));\n }\n\n this.track.appendChild(fragment);\n }\n\n private appendSourceNodes(target: HTMLElement): void {\n const fragment = document.createDocumentFragment();\n\n this.sourceNodes.forEach((node) => {\n fragment.append(this.cloneSourceNode(node));\n });\n\n target.appendChild(fragment);\n }\n\n private cloneSourceNode(node: Node): Node {\n const clone = node.cloneNode(true);\n\n if (clone instanceof Element) {\n const currentPart = clone.getAttribute('part');\n\n clone.setAttribute('part', currentPart ? `${currentPart} item` : 'item');\n\n // Offscreen lazy copies still need intrinsic dimensions before the loop can be measured.\n if (clone instanceof HTMLImageElement) {\n clone.loading = 'eager';\n }\n\n clone.querySelectorAll('img').forEach((image) => {\n image.loading = 'eager';\n });\n }\n\n return clone;\n }\n\n private getSourceNodes(): Node[] {\n return this.sourceSlot.assignedNodes({ flatten: true }).filter((node) => {\n if (node.nodeType === Node.TEXT_NODE) {\n return Boolean(node.textContent?.trim());\n }\n\n return node.nodeType === Node.ELEMENT_NODE;\n });\n }\n\n private watchSourceNodes(): void {\n this.mutationObserver?.disconnect();\n\n this.mutationObserver = new MutationObserver(this.scheduleRebuild);\n\n this.sourceSlot.assignedNodes({ flatten: true }).forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n this.mutationObserver?.observe(node, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n });\n\n return;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n this.mutationObserver?.observe(node, {\n characterData: true,\n });\n }\n });\n }\n\n private setupReducedMotionWatcher(): void {\n if (!('matchMedia' in window)) {\n return;\n }\n\n this.reducedMotionMediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');\n\n this.reducedMotion = this.reducedMotionMediaQuery.matches;\n this.reducedMotionMediaQuery.addEventListener('change', this.handleReducedMotionChange, {\n signal: this.abortController?.signal,\n });\n }\n\n private removeReducedMotionWatcher(): void {\n if (!this.reducedMotionMediaQuery) {\n return;\n }\n\n this.reducedMotionMediaQuery.removeEventListener('change', this.handleReducedMotionChange);\n\n this.reducedMotionMediaQuery = null;\n }\n\n private getEffectiveMode(): MarqueeContentMode {\n return this.touchInput ? 'auto' : this.options.mode;\n }\n\n private setupTouchInputWatcher(): void {\n if (!('matchMedia' in window)) {\n return;\n }\n\n this.touchInputMediaQuery = window.matchMedia(TOUCH_INPUT_QUERY);\n this.touchInput = this.touchInputMediaQuery.matches;\n this.touchInputMediaQuery.addEventListener('change', this.handleTouchInputChange, {\n signal: this.abortController?.signal,\n });\n }\n\n private removeTouchInputWatcher(): void {\n this.touchInputMediaQuery?.removeEventListener('change', this.handleTouchInputChange);\n this.touchInputMediaQuery = null;\n this.touchInput = false;\n }\n\n private handleTouchInputChange = (event: MediaQueryListEvent): void => {\n if (!this.mounted || event.matches === this.touchInput) {\n return;\n }\n\n this.touchInput = event.matches;\n this.lastScrollY = this.getScrollY();\n this.lastScrollTime = performance.now();\n this.stopAnimationLoop();\n this.cancelScrollAnimation();\n this.scrollMotionActive = false;\n this.scrollBoostStartValue = 0;\n this.scrollBoostStartedAt = 0;\n this.currentTimeScale = this.getDirectionFactor() * this.scrollDirectionFactor;\n this.updateScrollListener();\n this.applyOptions();\n };\n\n private updateAnimationLoopState(): void {\n if (!this.mounted || this.distance <= 0 || this.reducedMotion) {\n this.stopAnimationLoop();\n this.stopCssAnimation();\n this.cancelScrollAnimation();\n\n // A rebuild temporarily has no distance. Keep its phase and speed until layout\n // completes, while mode changes and reduced motion leave the active path.\n if (!this.mounted || this.getEffectiveMode() !== 'scroll' || this.reducedMotion) {\n this.scrollMotionActive = false;\n }\n\n this.track.style.transform = this.reducedMotion ? 'none' : '';\n return;\n }\n\n if (this.getEffectiveMode() === 'scroll') {\n this.stopCssAnimation();\n\n if (this.scrollMotionActive) {\n this.renderScrollProgress();\n\n if (this.canAnimate()) {\n this.startAnimationLoop();\n } else {\n this.stopAnimationLoop();\n }\n\n return;\n }\n\n this.currentTimeScale = this.getDirectionFactor() * this.scrollDirectionFactor;\n this.ensureScrollAnimation();\n\n if (!this.scrollAnimation || !this.canAnimate()) {\n this.scrollAnimation?.pause();\n this.stopAnimationLoop();\n return;\n }\n\n if (this.scrollBoostStartValue !== 0) {\n this.onScrollBoostChanged();\n } else {\n this.track.style.transform = '';\n\n if (this.scrollAnimation.playState !== 'running') {\n this.scrollAnimation.play();\n }\n }\n\n return;\n }\n\n this.stopAnimationLoop();\n this.cancelScrollAnimation();\n this.scrollMotionActive = false;\n this.startCssAnimation();\n this.track.style.animationPlayState = this.canAnimate() ? 'running' : 'paused';\n }\n\n private canAnimate(): boolean {\n if (this.options.pauseOnHover && this.isHovered) {\n return false;\n }\n\n if (this.isFocused) {\n return false;\n }\n\n if (this.options.pauseWhenOutOfView && !this.isInViewport) {\n return false;\n }\n\n return true;\n }\n\n private startAnimationLoop(): void {\n if (this.animationFrameId !== null) {\n return;\n }\n\n this.lastFrameTime = performance.now();\n this.animationFrameId = requestAnimationFrame(this.tick);\n }\n\n private stopAnimationLoop(): void {\n if (this.animationFrameId === null) {\n this.lastFrameTime = null;\n return;\n }\n\n cancelAnimationFrame(this.animationFrameId);\n this.animationFrameId = null;\n this.lastFrameTime = null;\n }\n\n private startCssAnimation(): void {\n const scrollDirection =\n this.touchInput && this.options.mode === 'scroll' ? this.scrollDirectionFactor : 1;\n const animationDirection =\n this.getDirectionFactor() * scrollDirection < 0 ? 'reverse' : 'normal';\n\n this.track.style.transform = '';\n\n if (this.track.style.animationName !== 'marquee-content-auto') {\n this.track.style.animationName = 'marquee-content-auto';\n this.track.style.animationDuration = 'var(--marquee-content-duration)';\n this.track.style.animationTimingFunction = 'linear';\n this.track.style.animationIterationCount = 'infinite';\n }\n\n if (this.track.style.animationDirection !== animationDirection) {\n this.track.style.animationDirection = animationDirection;\n }\n }\n\n private stopCssAnimation(): void {\n this.track.style.animationName = '';\n this.track.style.animationDuration = '';\n this.track.style.animationTimingFunction = '';\n this.track.style.animationIterationCount = '';\n this.track.style.animationDirection = '';\n this.track.style.animationPlayState = '';\n }\n\n private tick = (now: number): void => {\n this.animationFrameId = null;\n\n if (\n !this.mounted ||\n this.getEffectiveMode() !== 'scroll' ||\n this.distance <= 0 ||\n this.reducedMotion ||\n !this.canAnimate() ||\n !this.scrollMotionActive\n ) {\n return;\n }\n\n const settled = this.advanceScrollMotion(now);\n\n if (settled) {\n this.scrollMotionActive = false;\n this.ensureScrollAnimation();\n this.track.style.transform = '';\n this.lastFrameTime = null;\n return;\n }\n\n this.animationFrameId = requestAnimationFrame(this.tick);\n };\n\n private ensureScrollAnimation(): void {\n if (this.distance <= 0) {\n this.cancelScrollAnimation();\n return;\n }\n\n const currentSpeed = this.scrollBaseSpeed;\n const durationMs = currentSpeed > 0 ? (this.distance / currentSpeed) * 1000 : 0;\n const reversed = this.currentTimeScale < 0;\n\n if (durationMs <= 0) {\n this.cancelScrollAnimation();\n return;\n }\n\n if (\n this.scrollAnimation &&\n this.scrollAnimationDistance === this.distance &&\n this.scrollAnimationDuration === durationMs &&\n this.scrollAnimation.effect?.getTiming().direction === (reversed ? 'reverse' : 'normal')\n ) {\n return;\n }\n\n const progress = this.getScrollAnimationProgress();\n if (this.scrollAnimation) {\n this.scrollAnimation.cancel();\n this.scrollAnimation = null;\n }\n\n const animation = this.track.animate(\n [\n { transform: 'translate3d(0px, 0, 0)' },\n { transform: `translate3d(${-this.distance}px, 0, 0)` },\n ],\n {\n duration: durationMs,\n iterations: Number.POSITIVE_INFINITY,\n easing: 'linear',\n },\n );\n\n // Reverse the effect while keeping time positive, so long-running motion cannot end at zero.\n animation.effect?.updateTiming({ direction: reversed ? 'reverse' : 'normal' });\n animation.currentTime = durationMs * (reversed ? 1 - progress : progress);\n animation.playbackRate = Math.abs(this.currentTimeScale);\n\n this.scrollAnimation = animation;\n this.scrollAnimationDuration = durationMs;\n this.scrollAnimationDistance = this.distance;\n this.scrollProgress = progress;\n }\n\n private cancelScrollAnimation(): void {\n if (!this.scrollAnimation) {\n return;\n }\n\n this.scrollProgress = this.getScrollAnimationProgress();\n this.scrollAnimation.cancel();\n this.scrollAnimation = null;\n this.scrollAnimationDuration = 0;\n this.scrollAnimationDistance = 0;\n }\n\n private getScrollAnimationProgress(): number {\n const animation = this.scrollAnimation;\n\n if (!animation || this.scrollAnimationDuration <= 0) {\n return this.scrollProgress;\n }\n\n // currentTime can be rounded by the browser. Computed progress reflects the\n // rendered phase and already accounts for a reversed effect.\n const progress = animation.effect?.getComputedTiming().progress;\n\n if (progress != null) {\n return progress % 1;\n }\n\n const currentTime = animation.currentTime;\n\n if (typeof currentTime !== 'number') {\n return this.scrollProgress;\n }\n\n const fraction = (currentTime / this.scrollAnimationDuration) % 1;\n\n const normalized = fraction < 0 ? fraction + 1 : fraction;\n\n return animation.effect?.getTiming().direction === 'reverse'\n ? (1 - normalized) % 1\n : normalized;\n }\n\n private advanceScrollMotion(now: number): boolean {\n const target = this.getCurrentTimeScale(now);\n const previousTimeScale = this.currentTimeScale;\n const previousTime = this.lastFrameTime ?? now;\n const deltaTime = this.clamp((now - previousTime) / 1000, 0, 0.064);\n\n this.lastFrameTime = now;\n\n const smoothingFactor = 1 - Math.exp(-deltaTime / SCROLL_TIME_SCALE_SMOOTHING_SECONDS);\n\n this.currentTimeScale += (target - this.currentTimeScale) * smoothingFactor;\n\n const settled =\n this.scrollBoostStartValue === 0 && Math.abs(target - this.currentTimeScale) < 0.001;\n\n if (settled) {\n this.currentTimeScale = target;\n }\n\n // Keep changing speed on the frame clock, without resynchronizing an accelerated\n // WAAPI animation on every frame. Idle motion returns to WAAPI after settling.\n const averageTimeScale = (previousTimeScale + this.currentTimeScale) / 2;\n const progress =\n this.scrollProgress + (this.scrollBaseSpeed * averageTimeScale * deltaTime) / this.distance;\n\n this.scrollProgress = ((progress % 1) + 1) % 1;\n this.renderScrollProgress();\n\n return settled;\n }\n\n private renderScrollProgress(): void {\n this.track.style.transform = `translate3d(${-this.scrollProgress * this.distance}px, 0, 0)`;\n }\n\n private getCurrentTimeScale(now: number): number {\n const directionFactor = this.getDirectionFactor();\n\n if (this.getEffectiveMode() !== 'scroll') {\n return directionFactor;\n }\n\n const boost = this.getScrollBoost(now);\n const scrollTimeScale = this.scrollDirectionFactor + boost;\n\n return this.clamp(\n directionFactor * scrollTimeScale,\n -1 - this.options.scrollMaxExtraSpeed,\n 1 + this.options.scrollMaxExtraSpeed,\n );\n }\n\n private getDirectionFactor(): 1 | -1 {\n return this.options.direction === 'ltr' ? -1 : 1;\n }\n\n private getScrollBoost(now: number): number {\n if (this.scrollBoostStartValue === 0) {\n return 0;\n }\n\n const duration = this.options.scrollInertiaDuration;\n\n if (duration <= 0) {\n this.scrollBoostStartValue = 0;\n return 0;\n }\n\n const progress = this.clamp((now - this.scrollBoostStartedAt) / duration, 0, 1);\n\n if (progress >= 1) {\n this.scrollBoostStartValue = 0;\n return 0;\n }\n\n const easedProgress = this.easeOutCubic(progress);\n\n return this.scrollBoostStartValue * (1 - easedProgress);\n }\n\n private resolveOptions(): MarqueeContentResolvedOptions {\n return {\n ...DEFAULT_OPTIONS,\n speed: this.num('speed', DEFAULT_OPTIONS.speed, 10, 500),\n mode: this.parseMode(this.getAttribute('mode'), DEFAULT_OPTIONS.mode),\n direction: this.parseDirection(this.getAttribute('direction'), DEFAULT_OPTIONS.direction),\n pauseOnHover: this.parseBoolean(\n this.getAttribute('pause-on-hover'),\n DEFAULT_OPTIONS.pauseOnHover,\n ),\n };\n }\n\n private num(attributeName: string, fallback: number, min: number, max: number): number {\n return this.clamp(this.parseNumber(this.getAttribute(attributeName), fallback), min, max);\n }\n\n private parseNumber(value: string | null, fallback: number): number {\n if (value === null || value.trim() === '') {\n return fallback;\n }\n\n const parsed = Number(value);\n\n return Number.isFinite(parsed) ? parsed : fallback;\n }\n\n private parseBoolean(value: string | null, fallback: boolean): boolean {\n if (value === null) {\n return fallback;\n }\n\n const normalizedValue = value.trim().toLowerCase();\n\n if (normalizedValue === '') {\n return true;\n }\n\n if (['true', '1', 'yes', 'on'].includes(normalizedValue)) {\n return true;\n }\n\n if (['false', '0', 'no', 'off'].includes(normalizedValue)) {\n return false;\n }\n\n return fallback;\n }\n\n private parseMode(value: string | null, fallback: MarqueeContentMode): MarqueeContentMode {\n if (value === 'auto' || value === 'scroll') {\n return value;\n }\n\n return fallback;\n }\n\n private parseDirection(\n value: string | null,\n fallback: MarqueeContentDirection,\n ): MarqueeContentDirection {\n if (value === 'rtl' || value === 'ltr') {\n return value;\n }\n\n return fallback;\n }\n\n private setNullableAttribute(\n name: string,\n value: string | number | boolean | null | undefined,\n ): void {\n if (value === null || value === undefined) {\n this.removeAttribute(name);\n return;\n }\n\n this.setAttribute(name, String(value));\n }\n\n private getScrollY(): number {\n const scrollY = window.scrollY || window.pageYOffset || 0;\n if (!this.touchInput) {\n return scrollY;\n }\n\n const scroller = document.scrollingElement ?? document.documentElement;\n const maxScroll = Math.max(0, scroller.scrollHeight - scroller.clientHeight);\n\n // Ignore rubber-band movement and subpixel jitter at either page edge.\n if (scrollY <= TOUCH_SCROLL_EDGE_THRESHOLD) {\n return 0;\n }\n if (scrollY >= maxScroll - TOUCH_SCROLL_EDGE_THRESHOLD) {\n return maxScroll;\n }\n return scrollY;\n }\n\n private clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n }\n\n private easeOutCubic(value: number): number {\n return 1 - (1 - value) ** 3;\n }\n\n private rebuildAfterFontsReady(): void {\n const fonts = (\n document as Document & {\n fonts?: { ready: Promise<unknown> };\n }\n ).fonts;\n\n if (!fonts?.ready) {\n return;\n }\n\n void fonts.ready.then(this.scheduleRebuild).catch(() => undefined);\n }\n}\n\nexport function defineMarqueeContent(\n tagName = MARQUEE_CONTENT_TAG,\n options: DefineMarqueeContentOptions = {},\n): void {\n if (typeof window === 'undefined' || !window.customElements) {\n return;\n }\n\n MarqueeContent.configureStyles(options);\n\n if (!window.customElements.get(tagName)) {\n const elementClass =\n tagName === MARQUEE_CONTENT_TAG ? MarqueeContent : class extends MarqueeContent {};\n window.customElements.define(tagName, elementClass);\n }\n}\n\nexport function initMarqueeContents(options: InitMarqueeContentsOptions = {}): void {\n const { tagName = MARQUEE_CONTENT_TAG, ...styleOptions } = options;\n\n defineMarqueeContent(tagName, styleOptions);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'marquee-content': MarqueeContent;\n }\n}\n","export type {\n DefineMarqueeContentOptions,\n InitMarqueeContentsOptions,\n MarqueeContentDirection,\n MarqueeContentMode,\n MarqueeContentOptions,\n} from './marquee-content';\nexport {\n defineMarqueeContent,\n initMarqueeContents,\n MARQUEE_CONTENT_TAG,\n MarqueeContent,\n} from './marquee-content';\nexport type {\n MarqueeContentStyleEntry,\n MarqueeContentStyleInput,\n} from './styles';\nexport {\n createConstructableStyleSheet,\n cssStyleSheetToText,\n marqueeContentCssText,\n normalizeStyleInput,\n} from './styles';\n\nimport { defineMarqueeContent } from './marquee-content';\n\ndefineMarqueeContent();\n"],"mappings":";;;;;AAUA,MAAa,wBAAgCA;AAE7C,SAAgB,8BAA8B,SAAuC;CACnF,IACE,OAAO,kBAAkB,eACzB,OAAO,cAAc,UAAU,gBAAgB,YAE/C,OAAO;CAGT,IAAI;EACF,MAAM,QAAQ,IAAI,cAAc;EAChC,MAAM,YAAY,OAAO;EACzB,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,oBAAoB,OAA8B;CAChE,IAAI;EACF,OAAO,MAAM,KAAK,MAAM,QAAQ,CAAC,CAC9B,KAAK,SAAS,KAAK,OAAO,CAAC,CAC3B,KAAK,IAAI;CACd,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,oBAAoB,OAA2D;CAC7F,IAAI,CAAC,OACH,OAAO;EACL,OAAO;EACP,SAAS;CACX;CAGF,IAAI,OAAO,UAAU,UACnB,OAAO;EACL,OAAO,8BAA8B,KAAK;EAC1C,SAAS;CACX;CAGF,OAAO;EACL,OAAO;EACP,SAAS,oBAAoB,KAAK;CACpC;AACF;;;;ACjBA,MAAa,sBAAsB;AAEnC,MAAM,kBAAiD;CACrD,OAAO;CAC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