/* See-through headlines. * * Hold the pointer over any section title and a hole opens around the cursor, * so whatever is moving behind it shows through — the treatment section 1 has * always had. It lives in its own file because every page has titles, but only * the front page has the reel this used to be bundled with. * * Touch gets nothing: with no cursor to move, the hole would open once and * stay there, which reads as a broken title rather than an effect. */ (function () { if (matchMedia('(prefers-reduced-motion: reduce)').matches) return; if (matchMedia('(hover: none)').matches) return; var SEL = '[data-torch], .slide__title, .grain__heading, .pack__title, ' + '.prow__title, .overtitle, .blk__h'; new Set(document.querySelectorAll(SEL)).forEach(function (title) { title.addEventListener('pointerenter', function () { title.classList.add('is-lit'); }); title.addEventListener('pointermove', function (e) { var r = title.getBoundingClientRect(); title.style.setProperty('--tx', (e.clientX - r.left) + 'px'); title.style.setProperty('--ty', (e.clientY - r.top) + 'px'); }); title.addEventListener('pointerleave', function () { title.classList.remove('is-lit'); title.style.removeProperty('--tx'); title.style.removeProperty('--ty'); }); }); })();