1(function () { 2 'use strict'; 3 var reduce = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; 4 5 /* Inject floating orbs into every page hero (no template edits needed) */ 6 document.querySelectorAll('.page-hero').forEach(function (hero) { 7 if (hero.querySelector('.v2orbs')) return; 8 var wrap = document.createElement('div'); 9 wrap.className = 'v2orbs'; 10 wrap.setAttribute('aria-hidden', 'true'); 11 wrap.innerHTML = '<span class="v2orb v2orb--cyan" data-parallax="0.16"></span>' + 12 '<span class="v2orb v2orb--coral" data-parallax="0.28"></span>' + 13 '<span class="v2orb v2orb--sun" data-parallax="0.12"></span>'; 14 hero.insertBefore(wrap, hero.firstChild); 15 }); 16 17 /* Auto-tag elements for scroll reveal */ 18 var revealSel = '.section-head, .card, .prose > h2, .feature-group, .plan, .field, .flex-cta'; 19 document.querySelectorAll(revealSel).forEach(function (el) { 20 if (!el.classList.contains('reveal')) el.classList.add('reveal'); 21 }); 22 23 /* Reveal on scroll */ 24 var reveals = document.querySelectorAll('.reveal'); 25 if (reveals.length && 'IntersectionObserver' in window && !reduce) { 26 var io = new IntersectionObserver(function (entries) { 27 entries.forEach(function (e) { 28 if (e.isIntersecting) { e.target.classList.add('is-in'); io.unobserve(e.target); } 29 }); 30 }, { threshold: 0.12, rootMargin: '0px 0px -6% 0px' }); 31 reveals.forEach(function (el) { io.observe(el); }); 32 } else { 33 reveals.forEach(function (el) { el.classList.add('is-in'); }); 34 } 35 36 /* Parallax orbs */ 37 var orbs = Array.prototype.slice.call(document.querySelectorAll('[data-parallax]')); 38 if (orbs.length && !reduce) { 39 var ticking = false; 40 var onScroll = function () { 41 if (ticking) return; ticking = true; 42 window.requestAnimationFrame(function () { 43 var y = window.scrollY || window.pageYOffset; 44 orbs.forEach(function (o) { 45 var s = parseFloat(o.getAttribute('data-parallax')) || 0.2; 46 o.style.transform = 'translate3d(0,' + (y * s * -0.2) + 'px,0)'; 47 }); 48 ticking = false; 49 }); 50 }; 51 window.addEventListener('scroll', onScroll, { passive: true }); 52 onScroll(); 53 } 54 55 /* Hover tilt on cards (pointer devices only) */ 56 if (!reduce && window.matchMedia('(hover: hover)').matches) { 57 document.querySelectorAll('.card--hover, .feature-card').forEach(function (card) { 58 if (!card.classList.contains('tilt')) card.classList.add('tilt'); 59 card.addEventListener('mousemove', function (e) { 60 var r = card.getBoundingClientRect(); 61 var px = (e.clientX - r.left) / r.width - 0.5; 62 var py = (e.clientY - r.top) / r.height - 0.5; 63 card.style.transform = 'perspective(800px) rotateX(' + (py * -3.5) + 'deg) rotateY(' + (px * 4.5) + 'deg) translateY(-4px)'; 64 }); 65 card.addEventListener('mouseleave', function () { card.style.transform = ''; }); 66 }); 67 } 68})();
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.