Files
michaelschiemer/public/assets/js/modules-scroll-timeline-B7a-0WYx.js
Michael Schiemer 55a330b223 Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug
- Add DISCOVERY_SHOW_PROGRESS=true
- Temporary changes for debugging InitializerProcessor fixes on production
2025-08-11 20:13:26 +02:00

2 lines
1.4 KiB
JavaScript

import{L as t,r as e,u as i}from"./core-CJ4hMzNX.js";const o={onEnter(e,i){i.classList.add("active"),document.body.dataset.activeScrollStep=e,t.info(`[ScrollStep] Enter: ${e}`),1===e&&t.info("Intro sichtbar"),2===e&&t.info("Chart aktiviert"),3===e&&t.info("Zitat eingeblendet")},onLeave(e,i){i.classList.remove("active"),i.style.transitionDelay="",t.info(`[ScrollStep] Leave: ${e}`),document.body.dataset.activeScrollStep===String(e)&&delete document.body.dataset.activeScrollStep,1===e&&t.info("Intro ausgeblendet"),2===e&&t.info("Chart deaktiviert"),3===e&&t.info("Zitat ausgeblendet")}};const n=Object.freeze(Object.defineProperty({__proto__:null,destroy:function(){i("scroll-timeline")},init:function(i={}){t.info("ScrollTimeline init");const n={attribute:"data-scroll-step",triggerPoint:.4,once:!0,...i},a=Array.from(document.querySelectorAll(`[${n.attribute}]`)).map(t=>({el:t,index:parseInt(t.getAttribute(n.attribute),10),active:!1}));e("scroll-timeline",function(){const e=window.innerHeight*n.triggerPoint;a.forEach(i=>{var a,l;const r=i.el.getBoundingClientRect(),c=r.top<e&&r.bottom>0;c&&!i.active&&(i.active=!0,i.el.classList.add("active"),t.log(`➡️ ENTER step ${i.index}`),null==(a=o.onEnter)||a.call(o,i.index,i.el)),!c&&i.active&&(i.active=!1,i.el.classList.remove("active"),t.log(`⬅️ LEAVE step ${i.index}`),n.once||null==(l=o.onLeave)||l.call(o,i.index,i.el))})},{autoStart:!0})}},Symbol.toStringTag,{value:"Module"}));export{n as _};