diff --git a/src/routes/tools/stopwatch-timer/+page.svelte b/src/routes/tools/stopwatch-timer/+page.svelte new file mode 100644 index 00000000..6d8794ac --- /dev/null +++ b/src/routes/tools/stopwatch-timer/+page.svelte @@ -0,0 +1,421 @@ + + +
+ + + + + Stopwatch + + + + Timer + + + + + + + + + + Stopwatch + + + + +
+
+ {formatTime(stopwatchTime)} +
+ {#if stopwatchRunning} + +
+ Running +
+ {:else} + Stopped + {/if} +
+ + +
+ {#if !stopwatchRunning} + + {:else} + + {/if} + + + + {#if stopwatchRunning} + + {/if} +
+
+
+ + + {#if stopwatchLaps.length > 0} + + + Lap Times ({stopwatchLaps.length}) + + +
+ {#each stopwatchLaps.toReversed() as lap, index} + {@const lapIndex = stopwatchLaps.length - index} + {@const previousLap = stopwatchLaps[stopwatchLaps.length - index - 2]} + {@const splitTime = previousLap ? lap - previousLap : lap} +
+
Lap {lapIndex}
+
+ + +{formatTime(splitTime)} + + {formatTime(lap)} + +
+
+ {/each} +
+
+
+ {/if} +
+ + + + + + + + Timer + + + + + {#if !timerRunning && timerCurrentTime === 0} +
+
+ + +
+
+ + +
+
+ + +
+ +
+ {#each [{ label: '1 min', minutes: 1, seconds: 0 }, { label: '5 min', minutes: 5, seconds: 0 }, { label: '10 min', minutes: 10, seconds: 0 }, { label: '15 min', minutes: 15, seconds: 0 }, { label: '25 min', minutes: 25, seconds: 0 }, { label: '30 min', minutes: 30, seconds: 0 }, { label: '45 min', minutes: 45, seconds: 0 }, { label: '1 hour', minutes: 60, seconds: 0 }] as preset} + + {/each} +
+
+ {/if} + + +
+ {#if timerCurrentTime > 0 || timerRunning} +
+ {formatTime(timerCurrentTime, false)} +
+ {#if timerTotalTime > 0} +
+
+
+ {/if} + {:else} +
+ {String(timerMinutes).padStart(2, '0')}:{String(timerSeconds).padStart(2, '0')} +
+ {/if} + + {#if timerFinished} + + + Time's Up! + + {:else if timerRunning} + +
+ Running +
+ {:else if timerCurrentTime > 0} + Paused + {:else} + Ready + {/if} +
+ + +
+ {#if !timerRunning} + + {:else} + + {/if} + + +
+ + {#if timerFinished} +
+ +

Timer completed!

+

+ Your {formatTime(timerTotalTime, false)} timer has finished. +

+
+ {/if} +
+
+
+
+
+ +