chore: complete update
This commit is contained in:
33
resources/js/modules/scroll-timeline/steps.js
Normal file
33
resources/js/modules/scroll-timeline/steps.js
Normal file
@@ -0,0 +1,33 @@
|
||||
export const scrollSteps = {
|
||||
onEnter(index, el) {
|
||||
el.classList.add('active');
|
||||
document.body.dataset.activeScrollStep = index;
|
||||
console.log(`[ScrollStep] Enter: ${index}`);
|
||||
// Beispielaktionen
|
||||
if (index === 1) showIntro();
|
||||
if (index === 2) activateChart();
|
||||
if (index === 3) revealQuote();
|
||||
},
|
||||
|
||||
onLeave(index, el) {
|
||||
el.classList.remove('active');
|
||||
el.style.transitionDelay = '';
|
||||
console.log(`[ScrollStep] Leave: ${index}`);
|
||||
|
||||
if (document.body.dataset.activeScrollStep === String(index)) {
|
||||
delete document.body.dataset.activeScrollStep;
|
||||
}
|
||||
|
||||
if (index === 1) hideIntro();
|
||||
if (index === 2) deactivateChart();
|
||||
if (index === 3) hideQuote();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function showIntro() { console.log('Intro sichtbar'); }
|
||||
function hideIntro() { console.log('Intro ausgeblendet'); }
|
||||
function activateChart() { console.log('Chart aktiviert'); }
|
||||
function deactivateChart() { console.log('Chart deaktiviert'); }
|
||||
function revealQuote() { console.log('Zitat eingeblendet'); }
|
||||
function hideQuote() { console.log('Zitat ausgeblendet'); }
|
||||
Reference in New Issue
Block a user