feat: Add location change to intro

This commit is contained in:
sthag 2026-03-08 20:50:25 +01:00
parent 30fcd22a7b
commit f2ff20ce73
3 changed files with 26 additions and 12 deletions

View file

@ -539,6 +539,11 @@ function mapRange(value, inMin, inMax, outMin, outMax, reverse = false, clamp =
return mapped;
}
// Source - https://stackoverflow.com/a/47480429
// Posted by Etienne Martin, modified by community. See post 'Timeline' for change history
// Retrieved 2026-03-08, License - CC BY-SA 4.0
const delay = ms => new Promise(res => setTimeout(res, ms));
// CONCEPTS
// NOTE: Benutzt private Zuweisungen

View file

@ -119,7 +119,7 @@ function init() {
// Set all steps to not receive pointer events
document.querySelectorAll('.step').forEach(element => {
console.log(element);
element.style.pointerEvents = 'none';
});
@ -158,7 +158,7 @@ function showIntro() {
reject('No intro available.');
}
})
});
}
function showAgreement() {
@ -197,7 +197,7 @@ function showAgreement() {
resolve(steps.agreement.msgOut);
});
}
})
});
}
function showIdle() {
@ -212,16 +212,24 @@ function showIdle() {
el.classList.replace('op_hide', 'op_show');
el.style.pointerEvents = '';
el.addEventListener('click', idleStart, false);
resolve('Idle.');
el.addEventListener('contextmenu', (event) => {
event.preventDefault();
});
el.addEventListener('click', (event) => {
if (checkButtonAndTarget(event, event.target)) {
console.log('OK go', event.target);
resolve('Idle fin.');
} else {
event.preventDefault();
}
}, false);
} else {
document.removeEventListener('mouseleave', idleStart);
document.removeEventListener('mouseenter', idleStop);
reject();
}
})
});
}
function loadCore() {
@ -289,9 +297,9 @@ function idleStop() {
/**
* Blendet einen Schritt aus.
*
* @param {*} e
* @returns
*
* @param {*} e
* @returns
*/
function stepHandler(e) {
const el = e.target;
@ -303,8 +311,8 @@ function stepHandler(e) {
console.info(msg);
el.removeEventListener('transitionend', endListener);
resolve(msg);
});
})
});
}

View file

@ -132,6 +132,7 @@ tags:
.finally(() => {
console.debug('Init end.', isAgree);
// location = 'demo/examples/ui/new.html';
window.location.href = './menu.html';
});
</script>
{% endblock %}