Browse Source

Refactor AppHeader and AreaTabs components for improved layout and functionality

- Adjusted AppHeader.vue for better spacing and alignment of elements, enhancing the overall visual appeal.
- Updated AreaTabs.vue to include a new 'Start' tab with a home icon, improving navigation options.
- Modified route handling in AreaTabs.vue to dynamically determine the current area based on the route.
- Changed default redirect destination in useAuth.ts to the root path for a more intuitive user experience.
- Enhanced index.vue to provide a more welcoming message and improved content presentation.

These changes aim to enhance user navigation and overall experience within the application.
main
Bastian Masanek 2 months ago
parent
commit
860cd3ec9d
  1. 23
      app/components/navigation/AppHeader.vue
  2. 33
      app/components/navigation/AreaTabs.vue
  3. 2
      app/composables/useAuth.ts
  4. 16
      app/pages/index.vue

23
app/components/navigation/AppHeader.vue

@ -14,11 +14,8 @@ const { loggedIn } = useAuth()
<!-- Left: Logo + Role Switcher --> <!-- Left: Logo + Role Switcher -->
<div class="flex items-center gap-6 md:gap-8"> <div class="flex items-center gap-6 md:gap-8">
<NuxtLink to="/" class="flex-shrink-0 transition-transform hover:scale-105"> <NuxtLink to="/" class="flex-shrink-0 transition-transform hover:scale-105">
<img <img src="/img/experimenta-logo-white.svg" alt="experimenta Logo"
src="/img/experimenta-logo-white.svg" class="h-14 w-auto md:h-16 drop-shadow-lg" />
alt="experimenta Logo"
class="h-14 w-auto md:h-16 drop-shadow-lg"
/>
</NuxtLink> </NuxtLink>
<!-- Role Switcher (Desktop only) --> <!-- Role Switcher (Desktop only) -->
@ -56,21 +53,17 @@ const { loggedIn } = useAuth()
<style scoped> <style scoped>
/* Custom experimenta styling */ /* Custom experimenta styling */
header { header {
background: linear-gradient( background: linear-gradient(135deg,
135deg, rgba(46, 16, 101, 0.98) 0%,
rgba(46, 16, 101, 0.98) 0%, rgba(46, 16, 101, 0.95) 100%);
rgba(46, 16, 101, 0.95) 100%
);
color: white; color: white;
} }
/* Area tabs section with subtle gradient separator (no borders) */ /* Area tabs section with subtle gradient separator (no borders) */
.area-tabs-section { .area-tabs-section {
background: linear-gradient( background: linear-gradient(180deg,
180deg, rgba(255, 255, 255, 0.08) 0%,
rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
rgba(255, 255, 255, 0.03) 100%
);
} }
/* Mobile role section */ /* Mobile role section */

33
app/components/navigation/AreaTabs.vue

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { Wrench, FlaskConical, Ticket, Sparkles, GraduationCap } from 'lucide-vue-next' import { Wrench, FlaskConical, Ticket, Sparkles, GraduationCap, Home } from 'lucide-vue-next'
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs' import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { Badge } from '@/components/ui/badge' import { Badge } from '@/components/ui/badge'
@ -14,6 +14,14 @@ interface ProductArea {
} }
const areas: ProductArea[] = [ const areas: ProductArea[] = [
{
id: 'start',
label: 'Start',
icon: Home,
enabled: true,
visible: true,
route: '/',
},
{ {
id: 'makerspace', id: 'makerspace',
label: 'Makerspace Jahreskarte', label: 'Makerspace Jahreskarte',
@ -54,17 +62,20 @@ const areas: ProductArea[] = [
const route = useRoute() const route = useRoute()
const currentArea = computed(() => { const currentArea = computed(() => {
// Determine current area based on route // Determine current area based on route - check areas array dynamically
if (route.path.startsWith('/products') || route.path === '/') { const currentPath = route.path
return 'makerspace'
} else if (route.path.startsWith('/educator')) { // Exact match for root path
return 'educator' if (currentPath === '/') {
} else if (route.path.startsWith('/labs')) { return areas.find(area => area.route === '/')?.id || ''
return 'labs'
} else if (route.path.startsWith('/experimenta')) {
return 'experimenta'
} }
return 'makerspace'
// Find area where route path starts with area.route
const matchedArea = areas.find(area =>
area.route !== '/' && currentPath.startsWith(area.route)
)
return matchedArea?.id || ''
}) })
function navigateToArea(area: ProductArea) { function navigateToArea(area: ProductArea) {

2
app/composables/useAuth.ts

@ -39,7 +39,7 @@ export function useAuth() {
// Redirect to products page or saved destination // Redirect to products page or saved destination
const redirectAfterLogin = useCookie('redirect_after_login') const redirectAfterLogin = useCookie('redirect_after_login')
const destination = redirectAfterLogin.value || '/products' const destination = redirectAfterLogin.value || '/'
redirectAfterLogin.value = null // Clear cookie redirectAfterLogin.value = null // Clear cookie
navigateTo(destination) navigateTo(destination)

16
app/pages/index.vue

@ -11,18 +11,18 @@ const handleClick = () => {
<template> <template>
<NuxtLayout name="default"> <NuxtLayout name="default">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12"> <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<!-- Welcome Section --> <!-- Page Header -->
<div class="mb-8"> <div class="mx-auto mb-12 max-w-container-wide text-center">
<h1 class="text-4xl font-bold mb-4"> <h1 class="mb-4 text-4xl font-bold text-white md:text-5xl">
<template v-if="loggedIn"> <template v-if="loggedIn">
Willkommen zurück, {{ user?.firstName }}! Willkommen zurück, {{ user?.firstName }}!
</template> </template>
<template v-else> <template v-else>
Welcome to my.experimenta Willkommen!
</template> </template>
</h1> </h1>
<p class="text-lg text-white/90"> <p class="mx-auto max-w-2xl text-lg text-white/80">
Your gateway to Makerspace annual passes and more. Entdecke die vielfältigen Angebote der experimenta - wir freuen uns auf dich!
</p> </p>
</div> </div>
@ -44,8 +44,8 @@ const handleClick = () => {
<div class="card-info card-accent-border mb-8"> <div class="card-info card-accent-border mb-8">
<h2 class="text-xl font-semibold mb-2 text-experimenta-accent">MVP Development in Progress</h2> <h2 class="text-xl font-semibold mb-2 text-experimenta-accent">MVP Development in Progress</h2>
<p> <p>
This is a placeholder page. The full e-commerce functionality will be implemented in Dies ist eine Platzhalter-Seite. Die vollständige E-Commerce-Funktionalität wird in
upcoming phases. kommenden Phasen implementiert.
</p> </p>
</div> </div>

Loading…
Cancel
Save