234 lines
11 KiB
Vue
234 lines
11 KiB
Vue
<template>
|
|
<div>
|
|
<!-- xl -->
|
|
<div class="w-full border-b border-border">
|
|
<UiContainer class="relative">
|
|
<div class="hidden h-[120px] w-full items-center gap-[145px] xl:flex">
|
|
<ul class="flex items-center justify-between whitespace-nowrap w-full">
|
|
<li v-for="(item, index) in menuStore.menu" @click="menuStore.navigateToItem(item)" :key="item.id"
|
|
:class="['hover:text-accent-green-light dark:hover:text-accent-green-dark cursor-pointer text-lg transition-all text-inter',
|
|
route.params.id == item.id ? 'text-accent-green-light dark:text-accent-green-dark font-bold underline' : false]">
|
|
0{{ index + 1 }} <br />
|
|
{{ item.front_menu_lang[0].name }}
|
|
</li>
|
|
</ul>
|
|
<ClientOnly v-if="!colorMode?.forced">
|
|
<img class="cursor-pointer" :src="isDark ? '/logo-dark.svg' : '/logo.svg'" alt="logo"
|
|
@click="menuStore.navigateToItem()" />
|
|
</ClientOnly>
|
|
<div class="w-full flex items-center justify-between">
|
|
<div class="flex items-center gap-[30px]">
|
|
<i class="uil uil-user text-[31px] cursor-pointer"></i>
|
|
<CartPopup />
|
|
</div>
|
|
<div class="flex">
|
|
<LangSwitcher />
|
|
<CountryCurrencySelector />
|
|
</div>
|
|
<ThemeSwitcher />
|
|
<button @click="menuStore.navigateToShop" :class="[
|
|
'cursor-pointer transition-all text-inter',
|
|
route.params.id == '5'
|
|
? 'text-accent-green-light dark:text-accent-green-dark font-bold pb-1 border-b-2 bg-accented px-6 py-3 rounded-xl'
|
|
: 'hover:bg-button-hover bg-button text-white font-medium rounded-xl px-6 py-3'
|
|
]">
|
|
{{ $t('eshop') }}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</UiContainer>
|
|
</div>
|
|
|
|
<!-- md -->
|
|
<div class="hidden w-full md:flex md:flex-col xl:hidden items-center justify-center">
|
|
<div class="w-full border-border border-b">
|
|
<UiContainer class="h-[116px] flex items-center justify-between">
|
|
<ClientOnly v-if="!colorMode?.forced">
|
|
<img class="cursor-pointer" :src="isDark ? '/logo-dark.svg' : '/logo.svg'" alt="logo"
|
|
@click="menuStore.navigateToItem()" />
|
|
</ClientOnly>
|
|
<div class="flex items-center gap-6">
|
|
<div class="flex items-center gap-[30px]">
|
|
<i class="uil uil-user text-[31px] cursor-pointer"></i>
|
|
<CartPopup />
|
|
</div>
|
|
<div class="flex">
|
|
<LangSwitcher />
|
|
<CountryCurrencySelector />
|
|
</div>
|
|
<ThemeSwitcher />
|
|
<i variant="subtle" block class="uil uil-apps text-[33px] cursor-pointer" @click="open = !open"></i>
|
|
</div>
|
|
</UiContainer>
|
|
</div>
|
|
<UCollapsible :ui="{ content: 'w-full' }" v-model:open="open" class="w-full">
|
|
<template #content>
|
|
<div class="w-full border-border border-b pt-6 pb-8">
|
|
<UiContainer class="flex flex-col gap-[30px]">
|
|
<div v-for="(item, index) in menuStore.menu" :key="index"
|
|
:class="['flex items-center justify-between transition-all hover:text-accent-green-light dark:hover:text-accent-green-dark cursor-pointer', route.params.slug === item.front_menu_lang[0].link_rewrite && 'text-accent-green-light dark:text-accent-green-dark font-bold underline']"
|
|
@click="() => { menuStore.navigateToItem(item); open = false; }">
|
|
<div class="leading-[70%] text-inter">
|
|
<span class="mr-4">0{{ index + 1 }}</span>
|
|
{{ item.front_menu_lang[0].name }}
|
|
</div>
|
|
<!-- <i class="uil uil-arrow-up-right text-[35px]"></i> -->
|
|
<svg class="" width="20" height="20" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M25.1274 1.87258C25.1274 1.3203 24.6797 0.872582 24.1274 0.872584L15.1274 0.872583C14.5751 0.872583 14.1274 1.3203 14.1274 1.87258C14.1274 2.42487 14.5751 2.87258 15.1274 2.87258L23.1274 2.87258L23.1274 10.8726C23.1274 11.4249 23.5751 11.8726 24.1274 11.8726C24.6797 11.8726 25.1274 11.4249 25.1274 10.8726L25.1274 1.87258ZM1.5 24.5L2.20711 25.2071L24.8345 2.57969L24.1274 1.87258L23.4203 1.16548L0.792893 23.7929L1.5 24.5Z"
|
|
fill="currentColor" />
|
|
</svg>
|
|
</div>
|
|
</UiContainer>
|
|
</div>
|
|
</template>
|
|
</UCollapsible>
|
|
</div>
|
|
|
|
<!-- sm -->
|
|
<div class="hidden w-full items-center justify-between sm:flex sm:flex-col md:hidden">
|
|
<div class="w-full border-border border-b">
|
|
<UiContainer class="h-[84px] flex items-center justify-between">
|
|
<ClientOnly v-if="!colorMode?.forced">
|
|
<img class="cursor-pointer" :src="isDark ? '/logo-dark.svg' : '/logo.svg'" alt="logo"
|
|
@click="menuStore.navigateToItem()" />
|
|
</ClientOnly>
|
|
<div class="flex items-center gap-6">
|
|
<div class="flex items-center gap-[30px]">
|
|
<i class="uil uil-user text-[31px] cursor-pointer"></i>
|
|
<CartPopup />
|
|
</div>
|
|
<i variant="subtle" block class="uil uil-apps text-[30px] cursor-pointer" @click="open = !open"></i>
|
|
</div>
|
|
</UiContainer>
|
|
</div>
|
|
<UCollapsible :ui="{ content: 'w-full' }" v-model:open="open" class="w-full">
|
|
<template #content>
|
|
<div class="w-full border-border border-b pt-6 pb-8">
|
|
<UiContainer class="flex flex-col gap-[30px]">
|
|
<div v-for="(item, index) in menuStore.menu" @click="
|
|
() => {
|
|
menuStore.navigateToItem(item);
|
|
open = false;
|
|
}
|
|
" :key="index"
|
|
:class="['flex items-center justify-between transition-all hover:text-accent-green-light dark:hover:text-accent-green-dark cursor-pointer', route.params.slug === item.link_rewrite && 'text-accent-green-light dark:text-accent-green-dark font-bold underline']">
|
|
<div class="leading-[70%] text-inter">
|
|
<span class="mr-4">0{{ index + 1 }}</span>
|
|
{{ item.name }}
|
|
</div>
|
|
<!-- <i class="uil uil-arrow-up-right text-[35px]"></i> -->
|
|
<svg class="" width="20" height="20" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M25.1274 1.87258C25.1274 1.3203 24.6797 0.872582 24.1274 0.872584L15.1274 0.872583C14.5751 0.872583 14.1274 1.3203 14.1274 1.87258C14.1274 2.42487 14.5751 2.87258 15.1274 2.87258L23.1274 2.87258L23.1274 10.8726C23.1274 11.4249 23.5751 11.8726 24.1274 11.8726C24.6797 11.8726 25.1274 11.4249 25.1274 10.8726L25.1274 1.87258ZM1.5 24.5L2.20711 25.2071L24.8345 2.57969L24.1274 1.87258L23.4203 1.16548L0.792893 23.7929L1.5 24.5Z"
|
|
fill="currentColor" />
|
|
</svg>
|
|
</div>
|
|
<div class="flex items-center justify-between">
|
|
<p class="leading-[70%] text-inter">
|
|
{{ $t("change_language") }}
|
|
</p>
|
|
<LangSwitcher />
|
|
</div>
|
|
<div class="flex items-center justify-between">
|
|
<p class="leading-[70%] text-inter">
|
|
{{ $t("change_currency_country") }}
|
|
</p>
|
|
<CountryCurrencySelector />
|
|
</div>
|
|
<div class="flex items-center justify-between">
|
|
<p class="leading-[70%] text-inter">
|
|
{{ $t("change_theme") }}
|
|
</p>
|
|
<ThemeSwitcher />
|
|
</div>
|
|
</UiContainer>
|
|
</div>
|
|
</template>
|
|
</UCollapsible>
|
|
</div>
|
|
|
|
<!-- smallest one -->
|
|
<div class="w-full items-center justify-between flex flex-col sm:hidden">
|
|
<div class="w-full border-border border-b">
|
|
<UiContainer class="h-[84px] flex items-center justify-between">
|
|
<ClientOnly v-if="!colorMode?.forced">
|
|
<img class="cursor-pointer" :src="isDark ? '/logo-dark.svg' : '/logo.svg'" alt="logo"
|
|
@click="menuStore.navigateToItem()" />
|
|
</ClientOnly>
|
|
<div class="flex items-center gap-6">
|
|
<CartPopup />
|
|
<i variant="subtle" block class="uil uil-apps text-[30px] cursor-pointer" @click="open = !open"></i>
|
|
</div>
|
|
</UiContainer>
|
|
</div>
|
|
<UCollapsible :ui="{ content: 'w-full' }" v-model:open="open" class="w-full">
|
|
<template #content>
|
|
<div class="w-full border-border border-b pt-6 pb-8">
|
|
<UiContainer class="flex flex-col gap-[30px]">
|
|
<div v-for="(item, index) in menuStore.menu" @click="
|
|
() => {
|
|
menuStore.navigateToItem(item);
|
|
open = false;
|
|
}
|
|
" :key="index"
|
|
:class="['flex items-center justify-between transition-all hover:text-accent-green-light dark:hover:text-accent-green-dark cursor-pointer', route.params.slug === item.link_rewrite && 'text-accent-green-light dark:text-accent-green-dark font-bold underline']">
|
|
<div class="leading-[70%] text-inter">
|
|
<span class="mr-4">0{{ index + 1 }}</span>
|
|
{{ item.name }}
|
|
</div>
|
|
<!-- <i class="uil uil-arrow-up-right text-[35px]"></i> -->
|
|
<svg class="" width="20" height="20" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M25.1274 1.87258C25.1274 1.3203 24.6797 0.872582 24.1274 0.872584L15.1274 0.872583C14.5751 0.872583 14.1274 1.3203 14.1274 1.87258C14.1274 2.42487 14.5751 2.87258 15.1274 2.87258L23.1274 2.87258L23.1274 10.8726C23.1274 11.4249 23.5751 11.8726 24.1274 11.8726C24.6797 11.8726 25.1274 11.4249 25.1274 10.8726L25.1274 1.87258ZM1.5 24.5L2.20711 25.2071L24.8345 2.57969L24.1274 1.87258L23.4203 1.16548L0.792893 23.7929L1.5 24.5Z"
|
|
fill="currentColor" />
|
|
</svg>
|
|
</div>
|
|
<div class="flex items-center justify-between">
|
|
<p class="leading-[70%] text-lg text-inter">
|
|
{{ $t("change_language") }}
|
|
</p>
|
|
<LangSwitcher />
|
|
</div>
|
|
<div class="flex items-center justify-between">
|
|
<p class="leading-[70%] text-lg text-inter">
|
|
{{ $t("change_currency_country") }}
|
|
</p>
|
|
<CountryCurrencySelector />
|
|
</div>
|
|
<div class="flex items-center justify-between">
|
|
<p class="leading-[70%] text-lg text-inter">
|
|
{{ $t("change_theme") }}
|
|
</p>
|
|
<ThemeSwitcher />
|
|
</div>
|
|
</UiContainer>
|
|
</div>
|
|
</template>
|
|
</UCollapsible>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import CartPopup from "./CartPopup.vue";
|
|
import CountryCurrencySelector from "./CountryCurrencySelector.vue";
|
|
import LangSwitcher from "./LangSwitcher.vue";
|
|
|
|
const menuStore = useMenuStore();
|
|
const productStore = useProductStore();
|
|
const open = ref(false);
|
|
const colorMode = useColorMode();
|
|
|
|
productStore.getCart()
|
|
|
|
const route = useRoute()
|
|
const isDark = computed({
|
|
get() {
|
|
return colorMode.value === "dark";
|
|
},
|
|
set(_isDark) {
|
|
colorMode.preference = _isDark ? "dark" : "light";
|
|
},
|
|
});
|
|
</script>
|