Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions alpha/webapps/reseau_de_tri.html
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ <h1>Réseau de tri</h1>
</div>

<div class="action-row">
<button class="btn-primary" id="btn-next-step">
<button class="btn btn-primary" id="btn-next-step">
Valider l'étape <i data-fa="arrow-right"></i>
</button>
<button class="btn btn-success" id="btn-start-race" style="display: none;">
Expand Down Expand Up @@ -654,6 +654,7 @@ <h1>Réseau de tri</h1>
let levelInitialValues = [];

let raceInterval = null;
let raceTimeout = null;

// UI Elements
const gridContainer = document.getElementById('network-grid');
Expand Down Expand Up @@ -974,6 +975,10 @@ <h1>Réseau de tri</h1>
clearInterval(raceInterval);
raceInterval = null;
}
if (raceTimeout) {
clearTimeout(raceTimeout);
raceTimeout = null;
}

networkDef = NETWORKS[numWires];
currentStageIndex = 0;
Expand Down Expand Up @@ -1050,7 +1055,6 @@ <h1>Réseau de tri</h1>

btnNextStep.style.display = 'none';
btnStartRace.style.display = 'inline-flex';
btnStartRace.onclick = startRace;

}, 500); // Wait for the transition to finish
} else {
Expand Down Expand Up @@ -1229,7 +1233,7 @@ <h1>Réseau de tri</h1>
if (!activityHappened) {
clearInterval(raceInterval);
raceInterval = null;
setTimeout(() => {
raceTimeout = setTimeout(() => {
startNewLevel();
}, 3000);
}
Expand Down
Loading