Updated logo API
This commit is contained in:
@@ -1,24 +1,68 @@
|
||||
<script setup lang="ts">
|
||||
import { Link } from "@inertiajs/vue3";
|
||||
import { Link, useForm } from "@inertiajs/vue3";
|
||||
import { usePage } from '@inertiajs/vue3'
|
||||
import type { SharedProps } from '@/Types/types'
|
||||
import { ref } from 'vue'
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
|
||||
const props = usePage<SharedProps>().props
|
||||
const menuOpen = ref(false)
|
||||
const dropdownOpen = ref(false)
|
||||
const dropdownRef = ref<HTMLElement | null>(null)
|
||||
|
||||
const logoutForm = useForm({})
|
||||
const logout = () => logoutForm.post(route('logout'))
|
||||
|
||||
const handleClickOutside = (e: MouseEvent) => {
|
||||
if (dropdownRef.value && !dropdownRef.value.contains(e.target as Node)) {
|
||||
dropdownOpen.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => document.addEventListener('click', handleClickOutside))
|
||||
onUnmounted(() => document.removeEventListener('click', handleClickOutside))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header class="glass">
|
||||
<Link href="/" class="brand">FlightsGoneBy</Link>
|
||||
|
||||
<!-- Notification icon (always visible) -->
|
||||
<button v-if="props.auth.user" class="notif-btn" aria-label="Notifications">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" />
|
||||
<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />
|
||||
</svg>
|
||||
<span class="notif-dot" />
|
||||
</button>
|
||||
|
||||
<!-- Desktop nav -->
|
||||
<nav class="nav-desktop">
|
||||
<template v-if="!props.auth.user">
|
||||
<Link :href="route('login')" class="nav-link">Log In</Link>
|
||||
<Link :href="route('register')" class="nav-link nav-link--highlight">Register</Link>
|
||||
</template>
|
||||
<span v-else class="nav-link nav-link--greeting"><Link :href="route('dashboard')">Welcome, {{ props.auth.user.name }}</Link></span>
|
||||
<template v-else>
|
||||
<Link :href="route('flights.add')" class="nav-link">Add Flight</Link>
|
||||
<Link :href="route('profile.view', { user: props.auth.user.name })" class="nav-link">Profile</Link>
|
||||
<Link href="/feed" class="nav-link">Feed</Link>
|
||||
|
||||
<!-- User dropdown -->
|
||||
<div class="dropdown" ref="dropdownRef">
|
||||
<button class="nav-link dropdown-trigger" @click="dropdownOpen = !dropdownOpen">
|
||||
{{ props.auth.user.name }}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="m6 9 6 6 6-6"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div v-if="dropdownOpen" class="dropdown-menu">
|
||||
<Link :href="route('import.fr24')" class="dropdown-item">Import from FR24</Link>
|
||||
<div class="dropdown-divider" />
|
||||
<button class="dropdown-item dropdown-item--danger" @click="logout">Log Out</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</nav>
|
||||
|
||||
<!-- Hamburger (mobile only) -->
|
||||
@@ -33,7 +77,15 @@ const menuOpen = ref(false)
|
||||
<Link :href="route('login')" class="nav-link">Log In</Link>
|
||||
<Link :href="route('register')" class="nav-link nav-link--highlight">Register</Link>
|
||||
</template>
|
||||
<span v-else class="nav-link nav-link--greeting"><Link :href="route('dashboard')">Welcome, {{ props.auth.user.name }}</Link></span>
|
||||
<template v-else>
|
||||
<span class="nav-greeting">Welcome, {{ props.auth.user.name }}</span>
|
||||
<Link :href="route('flights.add')" class="nav-link">Add Flight</Link>
|
||||
<Link :href="route('profile.view', { username: props.auth.user.name })" class="nav-link">Profile</Link>
|
||||
<Link href="/feed" class="nav-link nav-link--highlight">Feed</Link>
|
||||
<Link :href="route('import.fr24')" class="nav-link">Import from FR24</Link>
|
||||
<div class="dropdown-divider" />
|
||||
<button class="nav-link nav-link--danger" @click="logout">Log Out</button>
|
||||
</template>
|
||||
</nav>
|
||||
</Transition>
|
||||
</header>
|
||||
@@ -48,6 +100,7 @@ header {
|
||||
padding: 0 1.25rem;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.brand {
|
||||
@@ -59,10 +112,51 @@ header {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav-greeting {
|
||||
font-size: 0.85rem;
|
||||
font-weight: 500;
|
||||
opacity: 0.6;
|
||||
padding: 0.3em 0.25rem;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
/* Notification button */
|
||||
.notif-btn {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
color: var(--text);
|
||||
border-radius: 4px;
|
||||
transition: color 0.15s ease, background 0.15s ease;
|
||||
}
|
||||
|
||||
.notif-btn:hover {
|
||||
color: var(--accent);
|
||||
background: rgba(56, 189, 248, 0.07);
|
||||
}
|
||||
|
||||
.notif-dot {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: 6px;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
background: var(--accent);
|
||||
border-radius: 50%;
|
||||
border: 1.5px solid var(--bg);
|
||||
}
|
||||
|
||||
/* Shared nav link base */
|
||||
.nav-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.3em;
|
||||
padding: 0.3em 0.75em;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
@@ -70,6 +164,9 @@ header {
|
||||
text-decoration: none;
|
||||
color: var(--text);
|
||||
border-radius: 4px;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
transition: color 0.15s ease, background 0.15s ease;
|
||||
}
|
||||
|
||||
@@ -82,7 +179,6 @@ header {
|
||||
background: rgba(56, 189, 248, 0.07);
|
||||
}
|
||||
|
||||
/* Highlighted CTA-style link */
|
||||
.nav-link--highlight {
|
||||
border: 1px solid rgba(56, 189, 248, 0.35);
|
||||
color: var(--accent);
|
||||
@@ -96,10 +192,75 @@ header {
|
||||
background: rgba(56, 189, 248, 0.12);
|
||||
}
|
||||
|
||||
.nav-link--greeting {
|
||||
opacity: 0.7;
|
||||
font-size: 0.85rem;
|
||||
cursor: default;
|
||||
.nav-link--danger {
|
||||
width: 100%;
|
||||
color: #f87171;
|
||||
}
|
||||
|
||||
.nav-link--danger:hover {
|
||||
color: #f87171;
|
||||
background: rgba(248, 113, 113, 0.08);
|
||||
}
|
||||
|
||||
/* Dropdown */
|
||||
.dropdown {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dropdown-trigger {
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
position: absolute;
|
||||
top: calc(100% + 0.4rem);
|
||||
right: 0;
|
||||
min-width: 180px;
|
||||
background: var(--bg);
|
||||
border: 1px solid rgba(56, 189, 248, 0.12);
|
||||
border-radius: 6px;
|
||||
padding: 0.35rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.1rem;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.dropdown-item {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0.4em 0.75em;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.03em;
|
||||
text-decoration: none;
|
||||
color: var(--text);
|
||||
border-radius: 4px;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
transition: color 0.15s ease, background 0.15s ease;
|
||||
}
|
||||
|
||||
.dropdown-item:hover {
|
||||
color: var(--accent);
|
||||
background: rgba(56, 189, 248, 0.07);
|
||||
}
|
||||
|
||||
.dropdown-item--danger {
|
||||
color: #f87171;
|
||||
}
|
||||
|
||||
.dropdown-item--danger:hover {
|
||||
color: #f87171;
|
||||
background: rgba(248, 113, 113, 0.08);
|
||||
}
|
||||
|
||||
.dropdown-divider {
|
||||
height: 1px;
|
||||
background: rgba(56, 189, 248, 0.1);
|
||||
margin: 0.25rem 0;
|
||||
}
|
||||
|
||||
/* Desktop nav */
|
||||
|
||||
Reference in New Issue
Block a user