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; 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 // CONCEPTS
// NOTE: Benutzt private Zuweisungen // NOTE: Benutzt private Zuweisungen

View file

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

View file

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