This commit is contained in:
2025-10-15 01:23:05 +02:00
parent 8ac5ac0770
commit e492c03f15
15 changed files with 484 additions and 330 deletions

View File

@ -0,0 +1,64 @@
type PanelPosition = 'left' | 'right' | 'bottom';
class UIState {
sidePanelVisible = $state(true);
sidePanelPosition = $state<PanelPosition>('right');
scopePopupVisible = $state(false);
spectrogramPopupVisible = $state(false);
sharePopupVisible = $state(false);
audioPermissionPopupVisible = $state(true);
unsavedChangesDialogVisible = $state(false);
saveAsDialogVisible = $state(false);
shareUrl = $state('');
toggleSidePanel() {
this.sidePanelVisible = !this.sidePanelVisible;
}
cyclePanelPosition() {
if (this.sidePanelPosition === 'right') {
this.sidePanelPosition = 'left';
} else if (this.sidePanelPosition === 'left') {
this.sidePanelPosition = 'bottom';
} else {
this.sidePanelPosition = 'right';
}
}
openScope() {
this.scopePopupVisible = true;
}
openSpectrogram() {
this.spectrogramPopupVisible = true;
}
showShare(url: string) {
this.shareUrl = url;
this.sharePopupVisible = true;
}
closeAudioPermission() {
this.audioPermissionPopupVisible = false;
}
showUnsavedChangesDialog() {
this.unsavedChangesDialogVisible = true;
}
hideUnsavedChangesDialog() {
this.unsavedChangesDialogVisible = false;
}
showSaveAsDialog() {
this.saveAsDialogVisible = true;
}
hideSaveAsDialog() {
this.saveAsDialogVisible = false;
}
}
export const uiState = new UIState();