sound on finishing time
This commit is contained in:
@@ -17,12 +17,15 @@ export class FocusPage implements OnInit, OnDestroy {
|
|||||||
private timerStarted: number | null = null;
|
private timerStarted: number | null = null;
|
||||||
state: FocusState = FocusState.STOPPED;
|
state: FocusState = FocusState.STOPPED;
|
||||||
|
|
||||||
|
private endOfTimerChime: HTMLAudioElement;
|
||||||
|
|
||||||
pathD: string = 'M100 10 A90 90 0 1 1 0 0';
|
pathD: string = 'M100 10 A90 90 0 1 1 0 0';
|
||||||
|
|
||||||
dashOffset = 0;
|
dashOffset = 0;
|
||||||
|
|
||||||
constructor(private renderer: Renderer2) {}
|
constructor(private renderer: Renderer2) {
|
||||||
|
this.endOfTimerChime = new Audio('../../../assets/race-start-beeps-125125.mp3');
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.updateTimeDisplay(this.duration * 60, 0, 1);
|
this.updateTimeDisplay(this.duration * 60, 0, 1);
|
||||||
@@ -55,6 +58,9 @@ export class FocusPage implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
if (progress >= 1) {
|
if (progress >= 1) {
|
||||||
progress = 1;
|
progress = 1;
|
||||||
|
this.endOfTimerChime.play().catch(error => {
|
||||||
|
console.error('Error playing audio:', error);
|
||||||
|
});
|
||||||
clearInterval(this.interval);
|
clearInterval(this.interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +102,7 @@ export class FocusPage implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
this.state = FocusState.SHORT_BREAK;
|
this.state = FocusState.SHORT_BREAK;
|
||||||
this.startTimer(5);
|
this.startTimer(0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
recharge() {
|
recharge() {
|
||||||
|
|||||||
BIN
src/assets/race-start-beeps-125125.mp3
Normal file
BIN
src/assets/race-start-beeps-125125.mp3
Normal file
Binary file not shown.
Reference in New Issue
Block a user