Enhance audio and UI interactions for improved user experience
- Added a prebuild script in package.json to copy audio assets for smoother audio playback. - Updated App.vue to ensure the router is ready before displaying content, addressing issues with hard refreshes. - Introduced a "Tap to start" feature in SplashScreen.vue to comply with browser autoplay policies for audio. - Enhanced playLoopStart function in useLoginSounds.ts to utilize the Web Audio API for better audio control. - Removed unnecessary redirect in router index.ts for cleaner routing logic. - Improved Dashboard.vue and Login.vue styles for better visual hierarchy and user engagement during transitions.
This commit is contained in:
@@ -96,7 +96,7 @@ const isReady = ref(false)
|
||||
* - User has already seen the intro
|
||||
* - User is on a direct route (refresh/bookmark)
|
||||
*/
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
window.addEventListener('keydown', onKeyDown)
|
||||
const seenIntro = localStorage.getItem('neode_intro_seen') === '1'
|
||||
const isDirectRoute = route.path !== '/'
|
||||
@@ -104,8 +104,8 @@ onMounted(() => {
|
||||
if (seenIntro || isDirectRoute) {
|
||||
showSplash.value = false
|
||||
document.body.classList.add('splash-complete')
|
||||
// Set isReady immediately for direct routes or when intro is already seen
|
||||
// Router will handle navigation
|
||||
// Wait for router to finish initial navigation before showing content (fixes hard refresh)
|
||||
await router.isReady()
|
||||
isReady.value = true
|
||||
}
|
||||
// If splash should show, wait for it to complete
|
||||
|
||||
Reference in New Issue
Block a user