-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from cmavelis/dev
Release v0.3.1
- Loading branch information
Showing
9 changed files
with
155 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ref } from 'vue'; | ||
|
||
export const useWindowFocus = () => { | ||
const windowHasFocus = ref(document.hasFocus()); | ||
|
||
setInterval(function () { | ||
windowHasFocus.value = document.hasFocus(); | ||
}, 500); | ||
|
||
return windowHasFocus; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// import sound from '../assets/zug-zug.mp3'; | ||
// import benSound from '../assets/zug-a-zug-ah.mp3'; | ||
|
||
export const getNotificationSound = async (isBen: boolean) => { | ||
let sound; | ||
if (isBen) { | ||
sound = await import('../assets/zug-a-zug-ah.mp3'); | ||
} else { | ||
sound = await import('../assets/zug-zug.mp3'); | ||
} | ||
return sound.default; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const originalDocumentTitle = document.title; | ||
let interval1: string | number | NodeJS.Timeout | undefined, | ||
interval2: string | number | NodeJS.Timeout | undefined; | ||
|
||
export const startTitleNotification = (newTitle: string) => { | ||
interval1 = setInterval(() => { | ||
document.title = newTitle; | ||
}, 2500); | ||
setTimeout(() => { | ||
interval2 = setInterval(() => { | ||
document.title = originalDocumentTitle; | ||
}, 2500); | ||
}, 1250); | ||
}; | ||
|
||
export const stopTitleNotification = () => { | ||
clearInterval(interval1); | ||
clearInterval(interval2); | ||
document.title = originalDocumentTitle; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters