started refactoring (app) layout

This commit is contained in:
Eclypsed
2024-01-25 19:50:26 -05:00
parent 0ad1ace45b
commit 4fcfdc0ee6
7 changed files with 82 additions and 10 deletions
+38
View File
@@ -0,0 +1,38 @@
<script lang="ts">
import { fly, fade } from "svelte/transition";
import { goto } from "$app/navigation";
import { pageWidth } from "$lib/stores";
import type { LayoutServerData } from "../$types.js";
export let data: LayoutServerData
const contentTabs = {
'/': {
header: 'Home',
icon: 'fa-solid fa-house',
},
'/account': {
header: data.user.username,
icon: 'fa-solid fa-user',
},
'/search': {
header: 'Search',
icon: 'fa-solid fa-search',
},
'/library': {
header: 'Libray',
icon: 'fa-solid fa-bars-staggered',
},
}
const pageTransitionTime: number = 200
let previousPage = data.urlPathname
type PageTransitionDirection = 1 | -1
let direction: PageTransitionDirection = 1
const calculateDirection = (newPage: string): void => {
const contentLinks = Object.keys(contentTabs)
const newPageIndex = contentLinks.indexOf(newPage)
}
</script>