diff --git a/website/src/components/navbar/navbar.svelte b/website/src/components/navbar/navbar.svelte index 7164ce82..3d4f0ab3 100644 --- a/website/src/components/navbar/navbar.svelte +++ b/website/src/components/navbar/navbar.svelte @@ -1,21 +1,43 @@ - Spotube - + + + { + drawerStore.set({ id: 'navdrawer', width: '400px', open: !$drawerStore.open }); + }} + > + + + Spotube + + + + + Star us on GitHub + + + + {#each Object.entries(routes) as route} {#if route[1][1] !== null} diff --git a/website/src/components/navdrawer/navdrawer.svelte b/website/src/components/navdrawer/navdrawer.svelte new file mode 100644 index 00000000..409bd9af --- /dev/null +++ b/website/src/components/navdrawer/navdrawer.svelte @@ -0,0 +1,35 @@ + + + + + + + + + + {#each Object.entries(routes) as route} + { + goto(route[0]); + }} + > + + + {route[1][0]} + + + {/each} + + diff --git a/website/src/lib/index.ts b/website/src/lib/index.ts index 5f55577d..802d68bc 100644 --- a/website/src/lib/index.ts +++ b/website/src/lib/index.ts @@ -9,6 +9,14 @@ import { faRedhat } from '@fortawesome/free-brands-svg-icons'; import { type IconDefinition } from '@fortawesome/free-brands-svg-icons/index'; +import { Home, Newspaper, Download } from 'lucide-svelte'; + +export const routes: Record = { + '/': ['Home', Home], + '/blog': ['Blog', Newspaper], + '/downloads': ['Downloads', Download], + '/about': ['About', null] +}; const releasesUrl = 'https://github.com/KRTirtho/Spotube/releases/latest/download'; diff --git a/website/src/routes/+layout.svelte b/website/src/routes/+layout.svelte index 218794f5..5fd060b6 100644 --- a/website/src/routes/+layout.svelte +++ b/website/src/routes/+layout.svelte @@ -5,7 +5,7 @@ // Highlight JS import hljs from 'highlight.js/lib/core'; import 'highlight.js/styles/github-dark.css'; - import { storeHighlightJs } from '@skeletonlabs/skeleton'; + import { Drawer, getDrawerStore, storeHighlightJs } from '@skeletonlabs/skeleton'; import xml from 'highlight.js/lib/languages/xml'; // for HTML import css from 'highlight.js/lib/languages/css'; import javascript from 'highlight.js/lib/languages/javascript'; @@ -21,9 +21,20 @@ import { computePosition, autoUpdate, flip, shift, offset, arrow } from '@floating-ui/dom'; import { storePopup } from '@skeletonlabs/skeleton'; storePopup.set({ computePosition, autoUpdate, flip, shift, offset, arrow }); + + import { initializeStores } from '@skeletonlabs/skeleton'; + import NavDrawer from '../components/navdrawer/navdrawer.svelte'; + initializeStores(); + + const drawerStore = getDrawerStore(); + + {#if $drawerStore.id === 'navdrawer'} + + {/if} + diff --git a/website/src/routes/+page.svelte b/website/src/routes/+page.svelte index bc8d70db..a6f5a06e 100644 --- a/website/src/routes/+page.svelte +++ b/website/src/routes/+page.svelte @@ -7,27 +7,17 @@ faLinux } from '@fortawesome/free-brands-svg-icons/index'; import Fa from 'svelte-fa'; - import { ChevronDown } from 'lucide-svelte'; - import { popup, type PopupSettings } from '@skeletonlabs/skeleton'; - import { downloadLinks } from '$lib'; - - const popupFeatured: PopupSettings = { - // Represents the type of event that opens/closed the popup - event: 'click', - // Matches the data-popup value on your popup element - target: 'popupFeatured', - // Defines which side of your trigger the popup will appear - placement: 'bottom' - }; + import { Download } from 'lucide-svelte'; - + Spotube + - An Open Source Client for every platform + An Open Source Spotify Client for every platform - + @@ -38,29 +28,11 @@ built with Electron (web technologies) - + - - - {#each Object.entries(downloadLinks) as links} - - - - {#each links[1][1] as icon} - - {/each} - - - {links[0]} - - - - {/each} - - - + Download - - + +
{links[0]}