Acceleration sounds
This commit is contained in:
parent
99b57bbec0
commit
6014469513
@ -4,6 +4,7 @@ import { Subscription, catchError, of, tap } from 'rxjs';
|
|||||||
import { StorageService } from '../../services/storage.service';
|
import { StorageService } from '../../services/storage.service';
|
||||||
import { Transaction } from '../../interfaces/electrs.interface';
|
import { Transaction } from '../../interfaces/electrs.interface';
|
||||||
import { nextRoundNumber } from '../../shared/common.utils';
|
import { nextRoundNumber } from '../../shared/common.utils';
|
||||||
|
import { AudioService } from '../../services/audio.service';
|
||||||
|
|
||||||
export type AccelerationEstimate = {
|
export type AccelerationEstimate = {
|
||||||
txSummary: TxSummary;
|
txSummary: TxSummary;
|
||||||
@ -63,6 +64,7 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
|
|||||||
constructor(
|
constructor(
|
||||||
private apiService: ApiService,
|
private apiService: ApiService,
|
||||||
private storageService: StorageService,
|
private storageService: StorageService,
|
||||||
|
private audioService: AudioService,
|
||||||
private cd: ChangeDetectorRef
|
private cd: ChangeDetectorRef
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
@ -186,6 +188,7 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
|
|||||||
this.userBid
|
this.userBid
|
||||||
).subscribe({
|
).subscribe({
|
||||||
next: () => {
|
next: () => {
|
||||||
|
this.audioService.playSound('ascend-chime-cartoon');
|
||||||
this.showSuccess = true;
|
this.showSuccess = true;
|
||||||
this.scrollToPreviewWithTimeout('successAlert', 'center');
|
this.scrollToPreviewWithTimeout('successAlert', 'center');
|
||||||
this.estimateSubscription.unsubscribe();
|
this.estimateSubscription.unsubscribe();
|
||||||
|
@ -439,7 +439,11 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
block_time: block.timestamp,
|
block_time: block.timestamp,
|
||||||
};
|
};
|
||||||
this.stateService.markBlock$.next({ blockHeight: block.height });
|
this.stateService.markBlock$.next({ blockHeight: block.height });
|
||||||
this.audioService.playSound('magic');
|
if (this.accelerationInfo && ['accelerating', 'mined', 'completed'].includes(this.accelerationInfo.status)) {
|
||||||
|
this.audioService.playSound('wind-chimes-harp-ascend');
|
||||||
|
} else {
|
||||||
|
this.audioService.playSound('magic');
|
||||||
|
}
|
||||||
this.fetchAcceleration$.next(block.id);
|
this.fetchAcceleration$.next(block.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -13,7 +13,7 @@ export class AudioService {
|
|||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
public playSound(name: 'magic' | 'chime' | 'cha-ching' | 'bright-harmony') {
|
public playSound(name: 'magic' | 'chime' | 'cha-ching' | 'bright-harmony' | 'wind-chimes-harp-ascend' | 'ascend-chime-cartoon') {
|
||||||
if (this.isPlaying || !this.audio) {
|
if (this.isPlaying || !this.audio) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
BIN
frontend/src/resources/sounds/ascend-chime-cartoon.mp3
Normal file
BIN
frontend/src/resources/sounds/ascend-chime-cartoon.mp3
Normal file
Binary file not shown.
BIN
frontend/src/resources/sounds/wind-chimes-harp-ascend.mp3
Normal file
BIN
frontend/src/resources/sounds/wind-chimes-harp-ascend.mp3
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user