|
| 1 | +<script lang="ts"> |
| 2 | + import { Icon } from '@steeze-ui/svelte-icon'; |
| 3 | + import { Bars3 } from '@steeze-ui/heroicons'; |
| 4 | +
|
| 5 | + // BlackCatUI |
| 6 | + import { AppBar, LightSwitch, drawerStore, type DrawerSettings } from '@codingcatdev/blackcatui'; |
| 7 | + import AJAlt from '$lib/components/global/icons/AJAlt.svelte'; |
| 8 | +
|
| 9 | + // Drawer Handler |
| 10 | + function drawerOpen(): void { |
| 11 | + const s: DrawerSettings = { id: 'doc-sidenav' }; |
| 12 | + drawerStore.open(s); |
| 13 | + } |
| 14 | +
|
| 15 | + import { storeCurrentUrl } from '../(layout-partials)/stores'; |
| 16 | +
|
| 17 | + $: classesActive = (href: string) => |
| 18 | + $storeCurrentUrl?.split('/').at(-1) === href ? 'bg-primary-active-token' : ''; |
| 19 | +</script> |
| 20 | + |
| 21 | +<!-- NOTE: using stopPropagation to override Chrome for Windows search shortcut --> |
| 22 | +<!-- <svelte:window on:keydown|stopPropagation={onWindowKeydown} /> --> |
| 23 | + |
| 24 | +<AppBar shadow="shadow-xl"> |
| 25 | + <svelte:fragment slot="bcu-app-bar-lead"> |
| 26 | + <div class="flex items-center gap-2"> |
| 27 | + <!-- Hamburger Menu --> |
| 28 | + <button on:click={drawerOpen} class="w-10 lg:!hidden" aria-label="Open Drawer"> |
| 29 | + <Icon src={Bars3} theme="solid" /> |
| 30 | + </button> |
| 31 | + <!-- Logo --> |
| 32 | + <!-- <a class="lg:!ml-0 w-12 lg:w-16 overflow-hidden" href="/" title="Go to Homepage"> |
| 33 | + <AjAlt /> |
| 34 | + </a> --> |
| 35 | + <!-- Title --> |
| 36 | + <a href="/"> |
| 37 | + <div class="w-12"> |
| 38 | + <AJAlt /> |
| 39 | + </div> |
| 40 | + </a> |
| 41 | + <a class="hidden hover:brightness-110 xl:flex xl:gap-1 sm:text-xl md:text-3xl" href="/"> |
| 42 | + CodingCat.dev |
| 43 | + </a> |
| 44 | + </div> |
| 45 | + </svelte:fragment> |
| 46 | + <svelte:fragment slot="bcu-app-bar-trail"> |
| 47 | + <div class="hidden lg:block"> |
| 48 | + <a |
| 49 | + href="/courses" |
| 50 | + class={`bcu-button hover:variant-soft-primary capitalize ${classesActive('courses')}`} |
| 51 | + > |
| 52 | + courses |
| 53 | + </a> |
| 54 | + <a |
| 55 | + href="/tutorials" |
| 56 | + class={`bcu-button hover:variant-soft-primary capitalize ${classesActive('tutorials')}`} |
| 57 | + > |
| 58 | + tutorials |
| 59 | + </a> |
| 60 | + <a |
| 61 | + href="/podcasts" |
| 62 | + class={`bcu-button hover:variant-soft-primary capitalize ${classesActive('podcasts')}`} |
| 63 | + > |
| 64 | + podcasts |
| 65 | + </a> |
| 66 | + <a |
| 67 | + href="/schedule" |
| 68 | + class={`bcu-button hover:variant-soft-primary capitalize ${classesActive('schedule')}`} |
| 69 | + > |
| 70 | + schedule |
| 71 | + </a> |
| 72 | + <a |
| 73 | + href="/blog" |
| 74 | + class={`bcu-button hover:variant-soft-primary capitalize ${classesActive('blog')}`} |
| 75 | + > |
| 76 | + blog |
| 77 | + </a> |
| 78 | + </div> |
| 79 | + <!-- Theme --> |
| 80 | + <div> |
| 81 | + <LightSwitch /> |
| 82 | + </div> |
| 83 | + |
| 84 | + <!-- Social --> |
| 85 | + <!-- prettier-ignore --> |
| 86 | + <!-- <section class="hidden sm:inline-flex sm:gap-2"> |
| 87 | + <a class="bcu-button-icon hover:variant-soft-primary" href="https://gdggr.org" target="_blank" rel="noreferrer"> |
| 88 | + <Icon src={GlobeAmericas} theme="solid" /> |
| 89 | + </a> |
| 90 | + </section> --> |
| 91 | + </svelte:fragment> |
| 92 | +</AppBar> |
0 commit comments