add: button to start all players
This commit is contained in:
parent
b00a936c6c
commit
6517d381af
1 changed files with 19 additions and 1 deletions
18
index.html
18
index.html
|
@ -59,6 +59,18 @@
|
|||
const nameInput = document.getElementById("nameInput");
|
||||
const addButton = document.getElementById("addButton");
|
||||
const resultsTable = document.getElementById("resultsTable");
|
||||
const startAllButton = document.getElementById("startAllButton");
|
||||
|
||||
startAllButton.addEventListener("click", () => {
|
||||
Object.keys(players).forEach((id) => {
|
||||
if (players[id].length === 0) {
|
||||
players[id].push(Date.now());
|
||||
}
|
||||
});
|
||||
setCookies(players);
|
||||
renderPlayers();
|
||||
reloadResultsTable();
|
||||
});
|
||||
|
||||
const getCookies = () => {
|
||||
const cookies = document.cookie.split("; ").reduce((acc, cookie) => {
|
||||
|
@ -214,6 +226,12 @@
|
|||
</button>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<button id="startAllButton" class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">
|
||||
Lancer tous les chronos
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
const exportToCSV = () => {
|
||||
|
|
Loading…
Reference in a new issue