Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion stopwatch/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@

<div class="btn-row">
<button class="btn-primary" id="btn-create">Copy Share Link</button>
<button class="btn-secondary" id="btn-fullscreen">Start ↗</button>
<button class="btn-secondary" id="btn-fullscreen">Open ↗</button>
</div>

<footer class="footer">
Expand Down
12 changes: 11 additions & 1 deletion timer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ <h1 class="event-name" id="tm-name"></h1>
let finished = false;
let tickInterval = null;
let confettiActive = false;
let autoStart = false; // when the creator hits Start ↗, run the timer on arrival

const $ = (s) => document.querySelector(s);
const creator = $('#creator');
Expand Down Expand Up @@ -808,7 +809,10 @@ <h1 class="event-name" id="tm-name"></h1>
btnCreate.addEventListener('click', copyShareLink);
btnFullscreen.addEventListener('click', () => {
const url = buildShareURL();
if (url) window.location.hash = url.split('#')[1];
if (url) {
autoStart = true;
window.location.hash = url.split('#')[1];
}
});
btnToggle.addEventListener('click', onToggle);
btnReset.addEventListener('click', onReset);
Expand Down Expand Up @@ -932,6 +936,12 @@ <h1 class="event-name" id="tm-name"></h1>
btnToggle.textContent = 'Start';
btnReset.disabled = true;
renderTimer();

// Creator hit "Start ↗" — launch the running timer in one click.
if (autoStart) {
autoStart = false;
onToggle();
}
}

function renderTimer() {
Expand Down
Loading