Skip to content

Commit

Permalink
misc/seizure: fix useTime display
Browse files Browse the repository at this point in the history
  • Loading branch information
theonlypwner committed Dec 11, 2024
1 parent 646dae5 commit fbbcc65
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/misc/seizure/AppMiscSeizure.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ let winH = 0
$: winA = winW * winH
let windowIsBlurred = false
$: countUseTime = $colorMode < 4 || $imageMode
let strobe = false
let curColor: string = '#000'
let curOpacity = 1
Expand Down Expand Up @@ -59,7 +61,7 @@ function start (): void {
runTimeLast = Date.now()
runTimeInt = window.setInterval(() => {
const now = Date.now()
if (($colorMode < 4 || $imageMode) && winA >= MIN_WIN_AREA && !windowIsBlurred) {
if (countUseTime && winA >= MIN_WIN_AREA && !windowIsBlurred) {
useTime += now - runTimeLast
}
runTimeLast = now
Expand Down Expand Up @@ -140,7 +142,7 @@ updateWindowSize()
<div class="container">
<button on:click={stop} class="btn d-block w-100 btn-danger">Secondary Stop</button>
<div style="color: white; mix-blend-mode: difference">
{#if $colorMode < 4}
{#if countUseTime}
<p>You have lasted {formatSeconds(useTime)} seconds!</p>
{:else}
<p>Time is not counted in static color mode.</p>
Expand Down

0 comments on commit fbbcc65

Please sign in to comment.