Skip to content
Open
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
8 changes: 5 additions & 3 deletions src/components/CountdownTimer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
const toggleTimer = () => $timerConfig[timer.index].enabled = !timer.enabled;
</script>

<button class="timerContainer" class:flash={timer.flash} class:disabled={!timer.enabled} on:click={toggleTimer}>
<button class="timerContainer" class:flash={timer.flash} class:disabled={!timer.enabled} on:click={toggleTimer} style="--flash-color: {timer.flashColor}">
<p class="countdown">{timer.remainingFormatted}</p>
{#if timer.icon}
<img class="iconImage" src={timer.icon} alt="icon" />
Expand All @@ -29,7 +29,7 @@
right: 0px;
}
.flash .iconImage {
animation: blink 3s infinite;
animation: blink 0.5s ease alternate infinite;
}
.timerContainer {
background: rgb(133, 133, 133);
Expand Down Expand Up @@ -58,7 +58,7 @@
}

.timerContainer.flash {
animation: colorSwap 3s infinite;
animation: colorSwap 0.5s ease alternate infinite;
}
.title {
color: white;
Expand All @@ -69,9 +69,11 @@
@keyframes colorSwap {
from {
background-color: white;
box-shadow: inset 0 0 0px 0px var(--flash-color);
}
to {
background-color: grey;
box-shadow: inset 0 0 8px 2px var(--flash-color);
}
}
@keyframes reverseColorSwap {
Expand Down
19 changes: 13 additions & 6 deletions src/stores/timerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface TimerConfig {
audioSrc: string;
audio?: HTMLAudioElement;
notifySecondsBefore: number;
flashColor: string;
}

const initialTimers: TimerConfig[] = [
Expand All @@ -20,7 +21,8 @@ const initialTimers: TimerConfig[] = [
initialSkip: 2,
icon: "powerRune.webp",
audioSrc: "powerRuneSpawn.mp3",
notifySecondsBefore: 15
notifySecondsBefore: 15,
flashColor: "#7149C6"
},
{
enabled: false,
Expand All @@ -29,7 +31,8 @@ const initialTimers: TimerConfig[] = [
initialSkip: 0,
icon: "Bountyrune.png",
audioSrc: "bountyRuneSpawn.mp3",
notifySecondsBefore: 15
notifySecondsBefore: 15,
flashColor: "#FC2947"
},
{
enabled: false,
Expand All @@ -38,7 +41,8 @@ const initialTimers: TimerConfig[] = [
initialSkip: 1,
icon: "Centaurcreep.webp",
audioSrc: "timeToStack.mp3",
notifySecondsBefore: 15
notifySecondsBefore: 15,
flashColor: "#FE6244"
},
{
enabled: false,
Expand All @@ -47,7 +51,8 @@ const initialTimers: TimerConfig[] = [
initialSkip: 0,
icon: "Catapult.webp",
audioSrc: "catapultWave.mp3",
notifySecondsBefore: 15
notifySecondsBefore: 15,
flashColor: "#FFDEB9"
},
{
enabled: false,
Expand All @@ -56,7 +61,8 @@ const initialTimers: TimerConfig[] = [
initialSkip: 0,
icon: "Catapult.webp",
audioSrc: "catapultWave.mp3",
notifySecondsBefore: 15
notifySecondsBefore: 15,
flashColor: "hotpink"
},
{
enabled: false,
Expand All @@ -65,7 +71,8 @@ const initialTimers: TimerConfig[] = [
initialSkip: 0,
icon: "Catapult.webp",
audioSrc: "catapultWave.mp3",
notifySecondsBefore: 15
notifySecondsBefore: 15,
flashColor: "gold"
}
].map(timer => typeof window === "undefined"
? timer
Expand Down