feat(ui): align top navigation capsules with GL glass header
This commit is contained in:
@@ -9,7 +9,6 @@ const route = useRoute();
|
||||
|
||||
const leftCapsule: NavItem[] = [
|
||||
{ to: '/profile', label: 'Профиль', icon: 'user' },
|
||||
{ to: '/notifications', label: 'Каналы', icon: 'bell' },
|
||||
];
|
||||
|
||||
const centerCapsule: NavItem[] = [
|
||||
@@ -22,39 +21,41 @@ const rightCapsule: NavItem[] = [
|
||||
];
|
||||
|
||||
function isActive(path: string) {
|
||||
if (path === '/orders') {
|
||||
return route.path === '/orders' || route.path.startsWith('/orders/');
|
||||
}
|
||||
return route.path === path;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header class="sticky top-0 z-20 border-b border-white/35 bg-[#0d854a]/90 backdrop-blur-xl">
|
||||
<div class="mx-auto flex w-full max-w-7xl flex-col gap-3 px-4 py-3 md:px-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<NuxtLink to="/" class="inline-flex items-center gap-2 rounded-full bg-white/15 px-4 py-2 text-sm font-bold text-white">
|
||||
<span class="h-2.5 w-2.5 rounded-full bg-[#ff5600]" />
|
||||
Fregat LK
|
||||
</NuxtLink>
|
||||
</div>
|
||||
<header class="fregat-header-glass fixed inset-x-0 top-0 z-50 border-0">
|
||||
<div class="fregat-header-backdrop" aria-hidden="true" />
|
||||
|
||||
<nav class="flex flex-wrap items-center justify-between gap-2 md:flex-nowrap md:gap-4">
|
||||
<div class="glass-capsule flex w-full items-center gap-1 rounded-full p-1 md:w-auto">
|
||||
<div class="relative mx-auto max-w-[2200px] px-4 py-2 md:px-6">
|
||||
<div class="fregat-header-row relative flex min-h-[3rem] items-center">
|
||||
<NuxtLink
|
||||
to="/"
|
||||
class="fregat-pill-glass fregat-pill-shell fregat-pill-brand hidden items-center rounded-full px-4 py-2 text-sm font-extrabold text-base-content lg:inline-flex"
|
||||
>
|
||||
Fregat
|
||||
</NuxtLink>
|
||||
|
||||
<div class="fregat-pill-glass fregat-pill-shell fregat-pill-left flex min-w-0 items-center gap-1 rounded-full p-1 lg:absolute lg:left-0 lg:w-auto">
|
||||
<NuxtLink
|
||||
v-for="item in leftCapsule"
|
||||
:key="item.to"
|
||||
:to="item.to"
|
||||
:class="['lk-nav-link', { 'lk-nav-link-active': isActive(item.to) }]"
|
||||
>
|
||||
<svg v-if="item.icon === 'user'" class="h-4 w-4" viewBox="0 0 24 24" fill="none">
|
||||
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M12 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4Zm0 2c-4.42 0-8 2.24-8 5v1h16v-1c0-2.76-3.58-5-8-5Z" fill="currentColor" />
|
||||
</svg>
|
||||
<svg v-else class="h-4 w-4" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M12 22a2.5 2.5 0 0 0 2.45-2h-4.9A2.5 2.5 0 0 0 12 22Zm7-6V11a7 7 0 1 0-14 0v5l-2 2v1h18v-1l-2-2Z" fill="currentColor" />
|
||||
</svg>
|
||||
{{ item.label }}
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
<div class="glass-capsule flex w-full items-center gap-1 rounded-full p-1 md:w-auto">
|
||||
<div class="fregat-pill-glass fregat-pill-shell fregat-pill-center flex min-w-0 flex-1 items-center gap-1 rounded-full p-1 lg:absolute lg:left-1/2 lg:w-auto lg:-translate-x-1/2">
|
||||
<NuxtLink
|
||||
v-for="item in centerCapsule"
|
||||
:key="item.to"
|
||||
@@ -71,7 +72,7 @@ function isActive(path: string) {
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
<div class="glass-capsule flex w-full items-center gap-1 rounded-full p-1 md:w-auto">
|
||||
<div class="fregat-pill-glass fregat-pill-shell fregat-pill-right flex min-w-0 items-center gap-1 rounded-full p-1 lg:absolute lg:right-0 lg:w-auto">
|
||||
<NuxtLink
|
||||
v-for="item in rightCapsule"
|
||||
:key="item.to"
|
||||
@@ -84,7 +85,7 @@ function isActive(path: string) {
|
||||
{{ item.label }}
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user