accessify-widget 0.2.15 → 0.2.17

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.
@@ -1,726 +0,0 @@
1
- function createAnimationStopModule() {
2
- let enabled = false;
3
- const STYLE_ID = "accessify-animation-stop";
4
- const STORAGE_KEY = "accessify-animation-stop";
5
- const DATA_ORIG = "data-accessify-orig-style";
6
- const DATA_FIXED = "data-accessify-fixed";
7
- const DATA_FROZEN_TRANSFORM = "data-a11y-frozen-transform";
8
- let pausedVideos = [];
9
- let gifOriginals = /* @__PURE__ */ new Map();
10
- let mutationObserver = null;
11
- let scrollStyleObserver = null;
12
- let scrollHandler = null;
13
- let originalVideoPlay = null;
14
- let originalIntersectionObserver = null;
15
- let originalElementAnimate = null;
16
- let originalMatchMedia = null;
17
- let originalClassListAdd = null;
18
- let originalClassListRemove = null;
19
- let interactionTimer = null;
20
- let styleEl = null;
21
- let scanTimers = [];
22
- function sharedCSS() {
23
- return `
24
- html {
25
- scroll-behavior: auto !important;
26
- }
27
- marquee {
28
- -moz-binding: none !important;
29
- overflow: hidden !important;
30
- }
31
-
32
- /* Kill CSS scroll-driven animations */
33
- *, *::before, *::after {
34
- animation-timeline: auto !important;
35
- scroll-timeline: none !important;
36
- }
37
- `;
38
- }
39
- const INTERACTIVE_SELECTORS = [
40
- "details > *",
41
- "[data-accordion] > *",
42
- '[role="tabpanel"]',
43
- "dialog",
44
- "dialog *",
45
- "[aria-expanded] + *",
46
- ".accordion *",
47
- ".collapse *",
48
- ".dropdown-menu *",
49
- ".faq *",
50
- "[data-dropdown] *",
51
- '[data-framer-component-type="CollapsibleContent"] *',
52
- '[data-framer-name="Accordion"] *',
53
- '[data-framer-name="FAQ"] *',
54
- '[data-framer-component-type="NavigationContainer"] *',
55
- ".nav *",
56
- ".navbar *",
57
- ".menu *"
58
- ].join(",\n ");
59
- function strictCSS() {
60
- return `
61
- /* Accessify animation-stop — strict mode */
62
- *, *::before, *::after {
63
- animation-fill-mode: forwards !important;
64
- animation-duration: 0.01ms !important;
65
- animation-delay: 0s !important;
66
- animation-iteration-count: 1 !important;
67
- transition-duration: 0.01ms !important;
68
- transition-delay: 0s !important;
69
- }
70
-
71
- /* Hover & focus transitions — explicitly killed even on interactive elements */
72
- *:hover, *:focus, *:focus-within,
73
- *:hover *, *:focus *, *:focus-within * {
74
- transition-duration: 0.01ms !important;
75
- transition-delay: 0s !important;
76
- }
77
-
78
- ${sharedCSS()}
79
-
80
- /* Interactive elements keep a short functional transition for CLICK state-changes.
81
- Hover is still killed by the :hover rule above (higher specificity combo). */
82
- ${INTERACTIVE_SELECTORS} {
83
- transition-duration: 0.15s !important;
84
- animation-duration: 0.15s !important;
85
- }
86
-
87
- /* But re-kill hover even on interactive elements */
88
- ${INTERACTIVE_SELECTORS.split(",").map((s) => s.trim() + ":hover").join(",\n ")} {
89
- transition-duration: 0.01ms !important;
90
- }
91
- `;
92
- }
93
- function relaxedCSS() {
94
- return `
95
- /* Accessify animation-stop — relaxed (post-interaction, 350ms window) */
96
- *, *::before, *::after {
97
- animation-fill-mode: forwards !important;
98
- animation-duration: 0.01ms !important;
99
- animation-delay: 0s !important;
100
- animation-iteration-count: 1 !important;
101
- transition-duration: 0.15s !important;
102
- transition-delay: 0s !important;
103
- }
104
- ${sharedCSS()}
105
- `;
106
- }
107
- function injectStyles() {
108
- if (document.getElementById(STYLE_ID)) return;
109
- styleEl = document.createElement("style");
110
- styleEl.id = STYLE_ID;
111
- styleEl.textContent = strictCSS();
112
- document.head.appendChild(styleEl);
113
- }
114
- function removeStyles() {
115
- document.getElementById(STYLE_ID)?.remove();
116
- styleEl = null;
117
- }
118
- function onUserInteraction() {
119
- if (!enabled || !styleEl) return;
120
- styleEl.textContent = relaxedCSS();
121
- if (interactionTimer) clearTimeout(interactionTimer);
122
- interactionTimer = setTimeout(() => {
123
- if (enabled && styleEl) styleEl.textContent = strictCSS();
124
- }, 350);
125
- }
126
- function onKeyInteraction(e) {
127
- if (e.key === "Enter" || e.key === " ") onUserInteraction();
128
- }
129
- function addInteractionListeners() {
130
- document.addEventListener("click", onUserInteraction, true);
131
- document.addEventListener("keydown", onKeyInteraction, true);
132
- }
133
- function removeInteractionListeners() {
134
- document.removeEventListener("click", onUserInteraction, true);
135
- document.removeEventListener("keydown", onKeyInteraction, true);
136
- if (interactionTimer) {
137
- clearTimeout(interactionTimer);
138
- interactionTimer = null;
139
- }
140
- }
141
- function patchIntersectionObserver() {
142
- if (originalIntersectionObserver) return;
143
- originalIntersectionObserver = window.IntersectionObserver;
144
- const FakeObserver = class {
145
- constructor(callback, _options) {
146
- this.callback = callback;
147
- this._entries = [];
148
- }
149
- observe(target) {
150
- const entry = {
151
- target,
152
- isIntersecting: true,
153
- intersectionRatio: 1,
154
- boundingClientRect: target.getBoundingClientRect(),
155
- intersectionRect: target.getBoundingClientRect(),
156
- rootBounds: null,
157
- time: performance.now()
158
- };
159
- this._entries.push(entry);
160
- setTimeout(() => {
161
- try {
162
- this.callback([entry], this);
163
- } catch {
164
- }
165
- }, 0);
166
- }
167
- unobserve(_target) {
168
- this._entries = this._entries.filter((e) => e.target !== _target);
169
- }
170
- disconnect() {
171
- this._entries = [];
172
- }
173
- takeRecords() {
174
- return this._entries;
175
- }
176
- get root() {
177
- return null;
178
- }
179
- get rootMargin() {
180
- return "0px 0px 0px 0px";
181
- }
182
- get thresholds() {
183
- return [0];
184
- }
185
- };
186
- window.IntersectionObserver = FakeObserver;
187
- }
188
- function restoreIntersectionObserver() {
189
- if (originalIntersectionObserver) {
190
- window.IntersectionObserver = originalIntersectionObserver;
191
- originalIntersectionObserver = null;
192
- }
193
- }
194
- function patchElementAnimate() {
195
- if (originalElementAnimate) return;
196
- originalElementAnimate = Element.prototype.animate;
197
- Element.prototype.animate = function(keyframes, options) {
198
- if (!enabled) {
199
- return originalElementAnimate.call(this, keyframes, options);
200
- }
201
- try {
202
- if (Array.isArray(keyframes) && keyframes.length > 0) {
203
- const lastFrame = keyframes[keyframes.length - 1];
204
- applyKeyframeStyles(this, lastFrame);
205
- } else if (keyframes && !Array.isArray(keyframes)) {
206
- const endStyles = {};
207
- for (const [prop, values] of Object.entries(keyframes)) {
208
- if (Array.isArray(values) && values.length > 0) {
209
- const lastVal = values[values.length - 1];
210
- if (lastVal != null) endStyles[prop] = String(lastVal);
211
- } else if (values != null) {
212
- endStyles[prop] = String(values);
213
- }
214
- }
215
- applyKeyframeStyles(this, endStyles);
216
- }
217
- } catch {
218
- }
219
- const opts = typeof options === "number" ? { duration: 0.01, fill: "forwards" } : { ...options || {}, duration: 0.01, delay: 0, iterations: 1, fill: "forwards" };
220
- const anim = originalElementAnimate.call(this, keyframes, opts);
221
- try {
222
- anim.finish();
223
- } catch {
224
- }
225
- return anim;
226
- };
227
- }
228
- function applyKeyframeStyles(el, frame) {
229
- for (const [prop, val] of Object.entries(frame)) {
230
- if (val == null || prop === "offset" || prop === "easing" || prop === "composite") continue;
231
- try {
232
- const cssProp = prop.replace(/([A-Z])/g, "-$1").toLowerCase();
233
- el.style.setProperty(cssProp, String(val));
234
- } catch {
235
- }
236
- }
237
- }
238
- function restoreElementAnimate() {
239
- if (originalElementAnimate) {
240
- Element.prototype.animate = originalElementAnimate;
241
- originalElementAnimate = null;
242
- }
243
- }
244
- function emulateReducedMotion() {
245
- if (originalMatchMedia) return;
246
- originalMatchMedia = window.matchMedia;
247
- window.matchMedia = function(query) {
248
- if (query === "(prefers-reduced-motion: reduce)" || query === "(prefers-reduced-motion)") {
249
- return {
250
- matches: true,
251
- media: query,
252
- onchange: null,
253
- addListener: () => {
254
- },
255
- removeListener: () => {
256
- },
257
- addEventListener: () => {
258
- },
259
- removeEventListener: () => {
260
- },
261
- dispatchEvent: () => true
262
- };
263
- }
264
- return originalMatchMedia.call(window, query);
265
- };
266
- }
267
- function restoreMatchMedia() {
268
- if (originalMatchMedia) {
269
- window.matchMedia = originalMatchMedia;
270
- originalMatchMedia = null;
271
- }
272
- }
273
- const BLOCKED_HOVER_CLASSES = /* @__PURE__ */ new Set(["hover", "pressed"]);
274
- function patchClassList() {
275
- if (originalClassListAdd) return;
276
- originalClassListAdd = DOMTokenList.prototype.add;
277
- originalClassListRemove = DOMTokenList.prototype.remove;
278
- DOMTokenList.prototype.add = function(...tokens) {
279
- if (enabled) {
280
- tokens = tokens.filter((t) => !BLOCKED_HOVER_CLASSES.has(t));
281
- if (tokens.length === 0) return;
282
- }
283
- return originalClassListAdd.apply(this, tokens);
284
- };
285
- DOMTokenList.prototype.remove = function(...tokens) {
286
- if (enabled) {
287
- tokens = tokens.filter((t) => !BLOCKED_HOVER_CLASSES.has(t));
288
- if (tokens.length === 0) return;
289
- }
290
- return originalClassListRemove.apply(this, tokens);
291
- };
292
- }
293
- function restoreClassList() {
294
- if (originalClassListAdd) {
295
- DOMTokenList.prototype.add = originalClassListAdd;
296
- originalClassListAdd = null;
297
- }
298
- if (originalClassListRemove) {
299
- DOMTokenList.prototype.remove = originalClassListRemove;
300
- originalClassListRemove = null;
301
- }
302
- document.querySelectorAll(".hover, .pressed").forEach((el) => {
303
- el.classList.remove("hover", "pressed");
304
- });
305
- }
306
- function isInsideWidget(el) {
307
- return !!el.closest("#accessify-root");
308
- }
309
- function bruteForceVisibilityScan() {
310
- const all = document.querySelectorAll("*");
311
- for (const el of all) {
312
- if (isInsideWidget(el)) continue;
313
- if (el.hasAttribute(DATA_FIXED)) continue;
314
- fixElementIfHidden(el);
315
- }
316
- }
317
- function fixElementIfHidden(el) {
318
- if (isInsideWidget(el)) return;
319
- if (el.hasAttribute(DATA_FIXED)) return;
320
- if (el.tagName === "SCRIPT" || el.tagName === "STYLE" || el.tagName === "LINK" || el.tagName === "META") return;
321
- const computed = window.getComputedStyle(el);
322
- const inlineStyle = el.getAttribute("style") || "";
323
- let needsFix = false;
324
- const fixes = [];
325
- const isFramerAppear = el.hasAttribute("data-framer-appear-id");
326
- const isAnimatedEl = isFramerAppear || el.hasAttribute("data-aos") || el.hasAttribute("data-scroll") || el.hasAttribute("data-sr-id") || el.classList.contains("gsap-reveal") || inlineStyle.includes("will-change") && inlineStyle.includes("transform");
327
- const opacityThreshold = isAnimatedEl ? 0.95 : 0.1;
328
- if (computed.display !== "none") {
329
- const opacityVal = parseFloat(computed.opacity);
330
- if (!isNaN(opacityVal) && opacityVal < opacityThreshold) {
331
- const rect = el.getBoundingClientRect();
332
- if (rect.width > 0 || rect.height > 0 || el.children.length > 0) {
333
- fixes.push("opacity:1");
334
- needsFix = true;
335
- }
336
- }
337
- }
338
- if (computed.visibility === "hidden" && el.children.length > 0) {
339
- const rect = el.getBoundingClientRect();
340
- if (rect.width > 1 && rect.height > 1) {
341
- fixes.push("visibility:visible");
342
- needsFix = true;
343
- }
344
- }
345
- const clipPath = computed.clipPath || computed.webkitClipPath || "";
346
- if (clipPath && clipPath !== "none" && (clipPath.includes("inset(100") || clipPath.includes("circle(0") || clipPath.includes("polygon(0") || clipPath === "inset(50%)")) {
347
- fixes.push("clip-path:none");
348
- needsFix = true;
349
- }
350
- if (inlineStyle && /translate/i.test(inlineStyle)) {
351
- const transformMatch = inlineStyle.match(/transform\s*:\s*([^;]+)/i);
352
- if (transformMatch) {
353
- const t = transformMatch[1];
354
- const translateYMatch = t.match(/translateY\(\s*(-?[\d.]+)/);
355
- const translateXMatch = t.match(/translateX\(\s*(-?[\d.]+)/);
356
- const threshold = isAnimatedEl ? 1 : 20;
357
- let shouldFixTransform = false;
358
- if (translateYMatch && Math.abs(parseFloat(translateYMatch[1])) >= threshold) shouldFixTransform = true;
359
- if (translateXMatch && Math.abs(parseFloat(translateXMatch[1])) >= threshold) shouldFixTransform = true;
360
- if (shouldFixTransform) {
361
- fixes.push("translate-zero");
362
- needsFix = true;
363
- }
364
- }
365
- }
366
- if (needsFix) {
367
- el.setAttribute(DATA_ORIG, inlineStyle);
368
- el.setAttribute(DATA_FIXED, "true");
369
- for (const fix of fixes) {
370
- if (fix === "translate-zero") {
371
- const currentTransform = el.style.transform || computed.transform || "";
372
- const zeroed = currentTransform.replace(/translateY\([^)]+\)/gi, "translateY(0px)").replace(/translateX\([^)]+\)/gi, "translateX(0px)");
373
- el.style.setProperty("transform", zeroed, "important");
374
- } else {
375
- const [prop, val] = fix.split(":");
376
- el.style.setProperty(prop, val, "important");
377
- }
378
- }
379
- }
380
- }
381
- function restoreFixedElements() {
382
- const fixed = document.querySelectorAll(`[${DATA_FIXED}]`);
383
- for (const el of fixed) {
384
- const orig = el.getAttribute(DATA_ORIG);
385
- if (orig !== null) {
386
- el.setAttribute("style", orig);
387
- } else {
388
- el.removeAttribute("style");
389
- }
390
- el.removeAttribute(DATA_ORIG);
391
- el.removeAttribute(DATA_FIXED);
392
- }
393
- }
394
- function forceFramerAppearElements() {
395
- const appearEls = document.querySelectorAll("[data-framer-appear-id]");
396
- for (const el of appearEls) {
397
- if (isInsideWidget(el)) continue;
398
- if (el.hasAttribute(DATA_FIXED)) continue;
399
- const inlineStyle = el.getAttribute("style") || "";
400
- el.setAttribute(DATA_ORIG, inlineStyle);
401
- el.setAttribute(DATA_FIXED, "true");
402
- el.style.setProperty("opacity", "1", "important");
403
- const current = el.style.transform || "";
404
- if (/translate/i.test(current)) {
405
- const zeroed = current.replace(/translateY\([^)]+\)/gi, "translateY(0px)").replace(/translateX\([^)]+\)/gi, "translateX(0px)");
406
- el.style.setProperty("transform", zeroed, "important");
407
- }
408
- }
409
- }
410
- function finishAllAnimations() {
411
- try {
412
- const animations = document.getAnimations?.();
413
- if (animations) {
414
- for (const anim of animations) {
415
- try {
416
- anim.finish();
417
- } catch {
418
- try {
419
- anim.cancel();
420
- } catch {
421
- }
422
- }
423
- }
424
- }
425
- } catch {
426
- }
427
- }
428
- function pauseAllVideos() {
429
- document.querySelectorAll("video").forEach((video) => {
430
- if (!video.paused) {
431
- video.pause();
432
- video.dataset.accessifyPaused = "true";
433
- pausedVideos.push(video);
434
- }
435
- });
436
- }
437
- function interceptVideoPlay() {
438
- if (originalVideoPlay) return;
439
- originalVideoPlay = HTMLVideoElement.prototype.play;
440
- HTMLVideoElement.prototype.play = function() {
441
- if (enabled) return Promise.resolve();
442
- return originalVideoPlay.call(this);
443
- };
444
- }
445
- function restoreVideoPlay() {
446
- if (originalVideoPlay) {
447
- HTMLVideoElement.prototype.play = originalVideoPlay;
448
- originalVideoPlay = null;
449
- }
450
- }
451
- function resumeAllVideos() {
452
- restoreVideoPlay();
453
- pausedVideos.forEach((video) => {
454
- try {
455
- delete video.dataset.accessifyPaused;
456
- video.play();
457
- } catch {
458
- }
459
- });
460
- pausedVideos = [];
461
- }
462
- function freezeGif(img) {
463
- const src = (img.src || img.getAttribute("src") || "").toLowerCase();
464
- if (!src.includes(".gif")) return;
465
- if (gifOriginals.has(img)) return;
466
- const doFreeze = () => {
467
- try {
468
- const w = img.naturalWidth || img.width;
469
- const h = img.naturalHeight || img.height;
470
- if (w === 0 || h === 0) return;
471
- const c = document.createElement("canvas");
472
- c.width = w;
473
- c.height = h;
474
- const ctx = c.getContext("2d");
475
- if (!ctx) return;
476
- ctx.drawImage(img, 0, 0);
477
- gifOriginals.set(img, img.src);
478
- img.src = c.toDataURL("image/png");
479
- } catch {
480
- }
481
- };
482
- if (img.complete && img.naturalWidth > 0) doFreeze();
483
- else img.addEventListener("load", doFreeze, { once: true });
484
- }
485
- function freezeAllGifs() {
486
- document.querySelectorAll("img").forEach(freezeGif);
487
- }
488
- function restoreAllGifs() {
489
- for (const [img, src] of gifOriginals) {
490
- try {
491
- img.src = src;
492
- } catch {
493
- }
494
- }
495
- gifOriginals.clear();
496
- }
497
- function pauseSVG() {
498
- document.querySelectorAll("svg").forEach((s) => {
499
- try {
500
- s.pauseAnimations?.();
501
- } catch {
502
- }
503
- });
504
- }
505
- function resumeSVG() {
506
- document.querySelectorAll("svg").forEach((s) => {
507
- try {
508
- s.unpauseAnimations?.();
509
- } catch {
510
- }
511
- });
512
- }
513
- function stopMarquees() {
514
- document.querySelectorAll("marquee").forEach((m) => {
515
- try {
516
- m.stop?.();
517
- } catch {
518
- }
519
- });
520
- }
521
- function startMarquees() {
522
- document.querySelectorAll("marquee").forEach((m) => {
523
- try {
524
- m.start?.();
525
- } catch {
526
- }
527
- });
528
- }
529
- function freezeScrollAnimations() {
530
- const all = document.querySelectorAll("*");
531
- for (const el of all) {
532
- if (isInsideWidget(el)) continue;
533
- if (el.hasAttribute(DATA_FROZEN_TRANSFORM)) continue;
534
- const computed = window.getComputedStyle(el);
535
- const t = computed.transform;
536
- if (t && t !== "none") {
537
- el.setAttribute(DATA_FROZEN_TRANSFORM, t);
538
- el.style.transform = t;
539
- }
540
- }
541
- scrollHandler = () => {
542
- if (!enabled) return;
543
- const frozen = document.querySelectorAll(`[${DATA_FROZEN_TRANSFORM}]`);
544
- for (const el of frozen) {
545
- const saved = el.getAttribute(DATA_FROZEN_TRANSFORM);
546
- if (saved && el.style.transform !== saved) {
547
- el.style.transform = saved;
548
- }
549
- }
550
- };
551
- window.addEventListener("scroll", scrollHandler, { passive: true, capture: true });
552
- scrollStyleObserver = new MutationObserver((mutations) => {
553
- if (!enabled) return;
554
- for (const m of mutations) {
555
- if (m.type !== "attributes" || m.attributeName !== "style") continue;
556
- const el = m.target;
557
- if (!el.hasAttribute(DATA_FROZEN_TRANSFORM)) continue;
558
- const saved = el.getAttribute(DATA_FROZEN_TRANSFORM);
559
- if (saved && el.style.transform !== saved) {
560
- el.style.transform = saved;
561
- }
562
- }
563
- });
564
- scrollStyleObserver.observe(document.body, {
565
- attributes: true,
566
- attributeFilter: ["style"],
567
- subtree: true
568
- });
569
- }
570
- function unfreezeScrollAnimations() {
571
- if (scrollHandler) {
572
- window.removeEventListener("scroll", scrollHandler, true);
573
- scrollHandler = null;
574
- }
575
- if (scrollStyleObserver) {
576
- scrollStyleObserver.disconnect();
577
- scrollStyleObserver = null;
578
- }
579
- const frozen = document.querySelectorAll(`[${DATA_FROZEN_TRANSFORM}]`);
580
- for (const el of frozen) {
581
- if (!el.hasAttribute(DATA_FIXED)) {
582
- el.style.removeProperty("transform");
583
- }
584
- el.removeAttribute(DATA_FROZEN_TRANSFORM);
585
- }
586
- }
587
- function setupObserver() {
588
- if (mutationObserver) return;
589
- mutationObserver = new MutationObserver((mutations) => {
590
- if (!enabled) return;
591
- for (const mutation of mutations) {
592
- for (const node of mutation.addedNodes) {
593
- if (!(node instanceof HTMLElement)) continue;
594
- if (isInsideWidget(node)) continue;
595
- if (node.tagName === "VIDEO") {
596
- const v = node;
597
- if (!v.paused) {
598
- v.pause();
599
- v.dataset.accessifyPaused = "true";
600
- pausedVideos.push(v);
601
- }
602
- }
603
- node.querySelectorAll?.("video")?.forEach((v) => {
604
- if (!v.paused) {
605
- v.pause();
606
- v.dataset.accessifyPaused = "true";
607
- pausedVideos.push(v);
608
- }
609
- });
610
- if (node.tagName === "IMG") freezeGif(node);
611
- node.querySelectorAll?.("img")?.forEach((i) => freezeGif(i));
612
- if (node.tagName === "SVG") {
613
- try {
614
- node.pauseAnimations?.();
615
- } catch {
616
- }
617
- }
618
- node.querySelectorAll?.("svg")?.forEach((s) => {
619
- try {
620
- s.pauseAnimations?.();
621
- } catch {
622
- }
623
- });
624
- fixElementIfHidden(node);
625
- node.querySelectorAll?.("*")?.forEach((child) => {
626
- fixElementIfHidden(child);
627
- });
628
- try {
629
- const anims = node.getAnimations?.() || [];
630
- for (const a of anims) {
631
- try {
632
- a.finish();
633
- } catch {
634
- }
635
- }
636
- } catch {
637
- }
638
- }
639
- }
640
- });
641
- mutationObserver.observe(document.body, { childList: true, subtree: true });
642
- }
643
- function teardownObserver() {
644
- mutationObserver?.disconnect();
645
- mutationObserver = null;
646
- }
647
- function scheduleScans() {
648
- for (const delay of [100, 500, 1500, 3e3, 5e3]) {
649
- scanTimers.push(setTimeout(() => {
650
- if (!enabled) return;
651
- finishAllAnimations();
652
- forceFramerAppearElements();
653
- bruteForceVisibilityScan();
654
- freezeScrollAnimations();
655
- pauseAllVideos();
656
- freezeAllGifs();
657
- pauseSVG();
658
- }, delay));
659
- }
660
- }
661
- function clearScans() {
662
- scanTimers.forEach(clearTimeout);
663
- scanTimers = [];
664
- }
665
- function activate() {
666
- if (enabled) return;
667
- enabled = true;
668
- patchElementAnimate();
669
- emulateReducedMotion();
670
- injectStyles();
671
- patchClassList();
672
- document.querySelectorAll(".hover, .pressed").forEach((el) => {
673
- el.classList.remove("hover", "pressed");
674
- });
675
- patchIntersectionObserver();
676
- finishAllAnimations();
677
- forceFramerAppearElements();
678
- bruteForceVisibilityScan();
679
- freezeScrollAnimations();
680
- pauseAllVideos();
681
- interceptVideoPlay();
682
- freezeAllGifs();
683
- pauseSVG();
684
- stopMarquees();
685
- addInteractionListeners();
686
- setupObserver();
687
- scheduleScans();
688
- localStorage.setItem(STORAGE_KEY, "true");
689
- }
690
- function deactivate() {
691
- enabled = false;
692
- clearScans();
693
- teardownObserver();
694
- removeInteractionListeners();
695
- unfreezeScrollAnimations();
696
- restoreClassList();
697
- restoreElementAnimate();
698
- restoreMatchMedia();
699
- startMarquees();
700
- resumeSVG();
701
- restoreAllGifs();
702
- resumeAllVideos();
703
- restoreFixedElements();
704
- restoreIntersectionObserver();
705
- removeStyles();
706
- localStorage.removeItem(STORAGE_KEY);
707
- }
708
- return {
709
- id: "animation-stop",
710
- name: () => "Stop Animations",
711
- description: "Pause all animations, transitions, and auto-playing videos (WCAG 2.3.1)",
712
- icon: "animation-stop",
713
- category: "visual",
714
- activate,
715
- deactivate,
716
- getState: () => ({ id: "animation-stop", enabled }),
717
- setState: (state) => {
718
- if (state.enabled) activate();
719
- else deactivate();
720
- }
721
- };
722
- }
723
- export {
724
- createAnimationStopModule as default
725
- };
726
- //# sourceMappingURL=animation-stop-D5cuDr0z.js.map