diff --git a/src/lib/navigation/NavigationBar.svelte b/src/lib/navigation/NavigationBar.svelte index 09b5e56..edb4e21 100644 --- a/src/lib/navigation/NavigationBar.svelte +++ b/src/lib/navigation/NavigationBar.svelte @@ -1,50 +1,10 @@ {#if !isHomePage} @@ -52,7 +12,7 @@ diff --git a/src/lib/shared/navigation.ts b/src/lib/shared/navigation.ts new file mode 100644 index 0000000..292ea27 --- /dev/null +++ b/src/lib/shared/navigation.ts @@ -0,0 +1,107 @@ +import HammerIcon from '$lib/icons/HammerIcon.svelte'; +import WalkieTalkieIcon from '$lib/icons/WalkieTalkieIcon.svelte'; +import ChartSimpleIcon from '$lib/icons/ChartSimpleIcon.svelte'; +import CircleRadiationIcon from '$lib/icons/CircleRadiationIcon.svelte'; +import VestIcon from '$lib/icons/VestIcon.svelte'; +import HearthPulseIcon from '$lib/icons/HearthPulseIcon.svelte'; +import BoltIcon from '$lib/icons/BoltIcon.svelte'; + +export type NavigationItem = { + name: string; + href: string; + external?: boolean; + icon?: any; + event?: string; +}; + +export type NavigationCategory = { + title: string; + description?: string; + items: NavigationItem[]; +}; + +export function getCurrentTitleByPath(path: string): string | undefined { + if (path.startsWith('/quiz/ga')) { + return 'Grundausbildungs-Quiz'; + } else if (path.startsWith('/quiz/agt')) { + return 'Atemschutz-Quiz'; + } else if (path.startsWith('/quiz/cbrn')) { + return 'CBRN-Quiz'; + } else if (path.startsWith('/quiz/radio')) { + return 'Sprechfunk-Quiz'; + } else if (path.startsWith('/cbrn/protective-suite')) { + return 'CBRN-Schutzanzug'; + } else if (path.startsWith('/clothing')) { + return 'Bekleidungsrechner'; + } else if (path === '/') { + return undefined; + } else { + return 'THW-Tools'; + } +} + +export const navigationItems: NavigationCategory[] = [ + { + title: 'Ausbildungs-Quiz', + description: 'Teste und verbessere dein Wissen in verschiedenen THW-Bereichen', + items: [ + { + name: 'Grundausbildungs-Quiz', + href: '/quiz/ga/listing/', + event: 'Open GA Quiz', + icon: HammerIcon + }, + { + name: 'Sprechfunk-Quiz', + href: '/quiz/radio/listing/', + event: 'Open Radio Quiz', + icon: WalkieTalkieIcon + }, + { + name: 'Atemschutz-Quiz', + href: '/quiz/agt/listing/', + event: 'Open AGT Quiz', + icon: ChartSimpleIcon + }, + { + name: 'CBRN-Quiz', + href: '/quiz/cbrn/listing/', + event: 'Open CBRN Quiz', + icon: CircleRadiationIcon + } + ] + }, + { + title: 'Tools', + description: 'Hilfreiche Werkzeuge für den THW-Alltag', + items: [ + { + name: 'Bekleidungsrechner', + href: '/clothing', + event: 'Open Clothing Calculator', + icon: VestIcon + }, + + { + name: 'Finnentest', + href: 'https://finnentest.thw-tools.de', + event: 'Open Finnentest', + external: true, + icon: HearthPulseIcon + }, + { + name: 'Elektro Spannungsfall', + href: 'https://elektro.thw-tools.de', + event: 'Open Elektro Spannungsfall', + external: true, + icon: BoltIcon + } + // { + // name: 'CBRN-Schutzanzug', + // href: '/cbrn/protective-suite', + // event: 'Open CBRN Protective Suite', + // icon: VestIcon + // } + ] + } +]; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index ad83ad4..08c54a9 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,17 +1,9 @@ @@ -157,9 +86,9 @@ - - {#each category.tools as tool} - + + {#each category.items as tool} +