nox/src/App.svelte

52 lines
1.6 KiB
Svelte
Raw Normal View History

2023-08-11 18:06:00 +02:00
<script lang="ts">
2023-08-13 03:11:28 +02:00
import style from './App.module.scss';
2023-08-11 18:06:00 +02:00
import Load from './page/Load/Load.svelte';
2023-08-13 13:08:29 +02:00
import Greet from './page/Greet/Greet.svelte';
2023-08-23 09:16:55 +02:00
import SignIn from './page/SignIn/SignIn.svelte';
2023-08-13 03:09:34 +02:00
2023-08-11 18:06:00 +02:00
import Titlebar from './widget/Titlebar/Titlebar.svelte';
2023-08-13 03:09:34 +02:00
import { Router, Link, Route, navigate } from "svelte-routing";
2023-08-26 03:43:17 +02:00
import RouteStore, { route } from './store/RouteStore';
2023-08-13 03:30:08 +02:00
import Background from './widget/Background/Background.svelte';
2023-08-23 12:30:46 +02:00
import Explore from './page/Explore/Explore.svelte';
2023-08-23 15:53:09 +02:00
import Sidebar from './widget/Sidebar/Sidebar.svelte';
import { setCSSVariableFor } from './lib/css_var';
2023-08-13 03:09:34 +02:00
export let url = "/load";
2023-08-13 03:34:56 +02:00
let page_faded = false;
2023-08-13 03:09:34 +02:00
RouteStore.subscribe(() => {
2023-08-13 03:34:56 +02:00
let new_url = RouteStore.getState().path;
if (url == new_url) return;
2023-08-13 03:09:34 +02:00
url = RouteStore.getState().path;
2023-08-13 03:34:56 +02:00
page_faded = true;
setTimeout(() => {
navigate(url);
page_faded = false;
}, 550);
2023-08-13 03:09:34 +02:00
});
RouteStore.dispatch({ type: 'setPath', path: '/load' })
2023-08-26 03:43:17 +02:00
setTimeout(() => { route('/') }, 3000)
2023-08-23 15:53:09 +02:00
setCSSVariableFor('sidebar-width', '0px', 3000);
2023-08-11 18:06:00 +02:00
</script>
<Titlebar />
2023-08-13 03:30:08 +02:00
<Background />
2023-08-23 15:53:09 +02:00
<Sidebar />
2023-08-13 03:30:08 +02:00
2023-08-13 03:34:56 +02:00
<div class={style.backdrop} style={`opacity:${page_faded ? 0 : 1}`}>
2023-08-13 03:11:28 +02:00
<div class={style['delay-show']}>
2023-08-13 03:09:34 +02:00
<Router {url}>
2023-08-13 13:08:29 +02:00
<Route path='/' component={Greet} />
2023-08-13 03:09:34 +02:00
<Route path='/load' component={Load} />
2023-08-23 09:16:55 +02:00
<Route path='/sign-in' component={SignIn} />
2023-08-23 12:30:46 +02:00
<Route path='/explore' component={Explore} />
2023-08-13 03:09:34 +02:00
</Router>
2023-08-12 09:11:19 +02:00
</div>
2023-08-11 18:20:15 +02:00
</div>