- Added a keyboard typing sound effect that plays on character input in App.vue for enhanced user interaction. - Refactored the playSciFiTypingTick function in useLoginSounds.ts, replacing it with playKeyboardTypingSound for a more cohesive audio experience. - Removed unnecessary keydown event handlers from Login.vue to streamline the code and improve clarity. - Updated CLI store to play navigation sounds when toggling the CLI visibility.
30 lines
523 B
TypeScript
30 lines
523 B
TypeScript
import { defineStore } from 'pinia'
|
|
import { ref } from 'vue'
|
|
import { playNavSound } from '@/composables/useNavSounds'
|
|
|
|
export const useCLIStore = defineStore('cli', () => {
|
|
const isOpen = ref(false)
|
|
|
|
function open() {
|
|
isOpen.value = true
|
|
playNavSound('action')
|
|
}
|
|
|
|
function close() {
|
|
isOpen.value = false
|
|
}
|
|
|
|
function toggle() {
|
|
const wasOpen = isOpen.value
|
|
isOpen.value = !wasOpen
|
|
if (!wasOpen) playNavSound('action')
|
|
}
|
|
|
|
return {
|
|
isOpen,
|
|
open,
|
|
close,
|
|
toggle,
|
|
}
|
|
})
|