mirror of
https://github.com/JonasunderscoreJones/blog.jonasjones.dev.git
synced 2025-10-23 06:59:19 +02:00
part of skeleton
This commit is contained in:
parent
b550b19aae
commit
68f6de3e11
24 changed files with 2375 additions and 119 deletions
40
src/App.svelte
Normal file
40
src/App.svelte
Normal file
|
@ -0,0 +1,40 @@
|
|||
<script>
|
||||
import Router from 'svelte-spa-router';
|
||||
import routes from './routes';
|
||||
import Title from './components/Title.svelte';
|
||||
import Navbar from './components/Navbar.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
let showTitle = true;
|
||||
|
||||
function handleScroll() {
|
||||
if (window.scrollY > 50) {
|
||||
showTitle = false;
|
||||
} else {
|
||||
showTitle = true;
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
window.addEventListener('scroll', handleScroll);
|
||||
return () => window.removeEventListener('scroll', handleScroll);
|
||||
});
|
||||
</script>
|
||||
|
||||
<Title visible={showTitle} />
|
||||
<Navbar />
|
||||
|
||||
<main>
|
||||
<div class="content">
|
||||
<Router {routes} />
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
|
||||
@media (min-width: 640px) {
|
||||
main {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue