PageSourceSearch

https://7mountainsmedia.com/wp-content/plugins/universal-consent-p…?ver=0.1.33-alpha.2222.82036f90.1789048956

js 7mountainsmedia.com collected 2026-10-02 14:34:09 UTC 2,222 bytes, 67 lines download raw bytes

1/**
2 * Consent banner motion (CSS). Loads after consent.js.
3 * Does not own Accept/Reject — inline boot + consent.js remain authoritative.
4 * Skips class toggles when prefers-reduced-motion: reduce.
5 */
6(function () {
7  'use strict';
8
9  var reduce =
10    window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
11  if (reduce) return;
12
13  function animatePanel(root) {
14    if (!root || root.hasAttribute('hidden')) return;
15    var p =
16      root.querySelector('.ucpf-banner__panel') ||
17      root.querySelector('.ucpf-prefs__dialog') ||
18      root;
19    p.classList.remove('ucpf-motion-enter');
20    // Force reflow so re-adding the class restarts the animation.
21    void p.offsetWidth;
22    p.classList.add('ucpf-motion-enter');
23  }
24
25  function staggerActions(banner) {
26    var actions = banner.querySelectorAll('.ucpf-banner__actions .ucpf-btn');
27    if (!actions.length) return;
28    actions.forEach(function (btn, i) {
29      btn.style.setProperty('--ucpf-motion-delay', 0.05 * i + 's');
30      btn.classList.remove('ucpf-motion-stagger');
31      void btn.offsetWidth;
32      btn.classList.add('ucpf-motion-stagger');
33    });
34  }
35
36  function watch() {
37    var banner = document.getElementById('ucpf-banner');
38    var prefs = document.getElementById('ucpf-prefs');
39    if (banner) {
40      var wasVisible = banner.classList.contains('ucpf-banner--visible');
41      new MutationObserver(function () {
42        var now = banner.classList.contains('ucpf-banner--visible');
43        if (now && !wasVisible) {
44          animatePanel(banner);
45          staggerActions(banner);
46        }
47        wasVisible = now;
48      }).observe(banner, { attributes: true, attributeFilter: ['class', 'hidden'] });
49    }
50    if (prefs) {
51      var wasHidden = prefs.hasAttribute('hidden');
52      new MutationObserver(function () {
53        var nowHidden = prefs.hasAttribute('hidden');
54        if (wasHidden && !nowHidden) {
55          animatePanel(prefs);
56        }
57        wasHidden = nowHidden;
58      }).observe(prefs, { attributes: true, attributeFilter: ['hidden', 'class'] });
59    }
60  }
61
62  if (document.readyState === 'loading') {
63    document.addEventListener('DOMContentLoaded', watch);
64  } else {
65    watch();
66  }
67})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.