Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
30 lines
739 B
Svelte
30 lines
739 B
Svelte
<script lang="ts">
|
|
import { onMount } from 'svelte'
|
|
import Main from './routes/Main.svelte'
|
|
import Prompt from './routes/Prompt.svelte'
|
|
import Recorder from './routes/Recorder.svelte'
|
|
import Settings from './routes/Settings.svelte'
|
|
|
|
let route = $state(currentRoute())
|
|
|
|
function currentRoute(): string {
|
|
return window.location.hash.replace(/^#/, '') || '/'
|
|
}
|
|
|
|
onMount(() => {
|
|
const update = () => (route = currentRoute())
|
|
window.addEventListener('hashchange', update)
|
|
return () => window.removeEventListener('hashchange', update)
|
|
})
|
|
</script>
|
|
|
|
{#if route === '/recorder'}
|
|
<Recorder />
|
|
{:else if route === '/settings'}
|
|
<Settings />
|
|
{:else if route === '/prompt'}
|
|
<Prompt />
|
|
{:else}
|
|
<Main />
|
|
{/if}
|