diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 0fea456..3a9fd66 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -16,6 +16,36 @@ // Merge base meta tags with page-specific meta tags let metaTags = $derived(deepMerge(data.baseMetaTags, page.data.pageMetaTags || {})); + // Helper function to check if a path is active + function isActivePath(path: string): boolean { + if (path === '/') { + return page.url.pathname === '/'; + } + return page.url.pathname.startsWith(path); + } + + // Helper function to get navigation link classes + function getNavLinkClasses(path: string): string { + const isActive = isActivePath(path); + const baseClasses = 'btn flex items-center gap-2'; + + if (isActive) { + return `${baseClasses} preset-filled-primary-500 cursor-default`; + } + return `${baseClasses} preset-ghost-surface-200-800`; + } + + // Helper function to get mobile navigation link classes + function getMobileNavLinkClasses(path: string): string { + const isActive = isActivePath(path); + const baseClasses = 'btn flex items-center justify-start gap-2'; + + if (isActive) { + return `${baseClasses} preset-filled-primary-500 cursor-default`; + } + return `${baseClasses} preset-ghost-surface-200-800`; + } + onMount(() => { // Sync client-side session with server-side on mount const { data } = supabase.auth.onAuthStateChange((event, newSession) => { @@ -51,24 +81,55 @@ @@ -104,11 +165,24 @@ {:else}
- - - Sign In - - + {#if isActivePath('/auth')} + + + Sign In + + {:else} + + + Sign In + + {/if} + Get Started
@@ -119,33 +193,55 @@
- - - Home - - - - Pricing - - - - Blog - - {#if session} - - - Dashboard + {#if isActivePath('/')} + + + Home + + {:else} + + + Home {/if} + + {#if isActivePath('/pricing')} + + + Pricing + + {:else} + + + Pricing + + {/if} + + {#if isActivePath('/blog')} + + + Blog + + {:else} + + + Blog + + {/if} + + {#if session} + {#if isActivePath('/app/dashboard')} + + + Dashboard + + {:else} + + + Dashboard + + {/if} + {/if}
@@ -193,15 +289,18 @@

Support

- Documentation - Contact - Help Center + GitHub + + + Contact + + + Help Center +
@@ -209,15 +308,15 @@

Legal

- Privacy Policy - Terms of Service - Cookie Policy + + Privacy Policy + + + Terms of Service + + + Cookie Policy +