PageSourceSearch

https://gamalogic.com/wp-content/themes/gamalogic/assets/js/animations/widget-2.js

js gamalogic.com collected 2026-09-24 13:25:15 UTC 1,768 bytes, 61 lines download raw bytes

1/* Animation Module: widget-2 */
2export function init(container) {
3  // Self-contained IIFE — inject markup then boot
4  if (!container) return;
5  // markup is rendered server-side via PHP template
6  // boot the animation logic:
7(function () {
8  'use strict';
9
10  var wwgCards       = Array.from(container.querySelectorAll('.wwg-icon-card'));
11  var wwgPulseTimer  = null;
12  var wwgEntered     = false;
13
14  function wwgRunEntrance() {
15    wwgCards.forEach(function (card, i) {
16      setTimeout(function () {
17        card.classList.add('wwg-visible');
18        if (i === wwgCards.length - 1) {
19          setTimeout(wwgStartPulse, 500);
20        }
21      }, 100 + i * 65);
22    });
23  }
24
25  function wwgStartPulse() {
26    wwgDoPulse();
27    wwgPulseTimer = setInterval(wwgDoPulse, 1600);
28  }
29
30  function wwgDoPulse() {
31    var idx  = Math.floor(Math.random() * wwgCards.length);
32    var card = wwgCards[idx];
33    card.classList.add('wwg-pulse');
34    setTimeout(function () { card.classList.remove('wwg-pulse'); }, 850);
35    var ripple = document.createElement('div');
36    ripple.className = 'wwg-ripple';
37    card.appendChild(ripple);
38    setTimeout(function () { ripple.remove(); }, 900);
39  }
40
41  var wwgObserver = new IntersectionObserver(function (entries) {
42    entries.forEach(function (entry) {
43      if (entry.isIntersecting && !wwgEntered) {
44        wwgEntered = true;
45        wwgRunEntrance();
46      }
47      if (wwgEntered) {
48        if (entry.isIntersecting) {
49          if (!wwgPulseTimer) wwgStartPulse();
50        } else {
51          clearInterval(wwgPulseTimer);
52          wwgPulseTimer = null;
53        }
54      }
55    });
56  }, { threshold: 0.15 });
57
58  var wwgSection = container.querySelector('.wwg-section');
59  if (wwgSection) wwgObserver.observe(wwgSection);
60})();
61}

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.