diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-10-18 15:16:23 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-10-18 15:16:23 +0200 |
| commit | ebaec1ad662c2050726d0d43ba60db63a3f10d26 (patch) | |
| tree | 8ff888d5adccd43eb37289a8dda1ffbfedc5c05a /src/views/Intro.js | |
| parent | 526f2d2c9f6c5ff8867cb0c645326e0a8f7991ae (diff) | |
Diffstat (limited to 'src/views/Intro.js')
| -rw-r--r-- | src/views/Intro.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/views/Intro.js b/src/views/Intro.js index 3a20cde..72a53a4 100644 --- a/src/views/Intro.js +++ b/src/views/Intro.js @@ -25,11 +25,24 @@ export default function Intro({ onComplete }) { } catch (error) { console.error(error); } - footprint("egress"); setDone(true); setTimeout(() => { onComplete(); }, 200); + footprint("escape"); + }, []); + + const handleEnd = useCallback(() => { + try { + audio.play(); + } catch (error) { + console.error(error); + } + setDone(true); + setTimeout(() => { + onComplete(); + }, 200); + footprint("egress"); }, []); const handleStart = useCallback(() => { @@ -40,10 +53,10 @@ export default function Intro({ onComplete }) { console.error(error); } setStarted(true); - footprint("ingress"); if (player) { player.play(); } + footprint("ingress"); }, [player]); const handleReady = useCallback((player) => { @@ -66,7 +79,7 @@ export default function Intro({ onComplete }) { muted={false} volume={1} onReady={handleReady} - onEnd={handleClose} + onEnd={handleEnd} /> <div style={{ backgroundImage: "url(assets/img/no6092start.jpg)" }} |
