Newer
Older

ivelov-vm
committed
<div
class="sticky top-0 z-30 transition-all"
:class="{ 'bg-white': !transparent, 'shadow-14x28': withShadow }"
>
<header
v-if="width > 1000"
class="flex justify-around items-center py-3.5"

ivelov-vm
committed
:class="textWhite ? 'text-white' : 'text-dark'"

ivelov-vm
committed
<div class="flex-auto basis-[28.57%] h-[46px] flex justify-center">
<router-link to="/">
<LogoSvg :class="textWhite ? 'text-white' : 'text-blue'"></LogoSvg>
</router-link>
</div>
<nav class="flex justify-around flex-auto basis-[42.86%] text-xl">
<router-link

ivelov-vm
committed
class="transition-colors"
:class="[
currentPage === 'home' ? 'font-bold' : '',
textWhite ? 'hover:text-gray-bg' : 'hover:text-gray',
]"

ivelov-vm
committed
class="transition-colors"
:class="[
currentPage === 'services' ? 'font-bold' : '',
textWhite ? 'hover:text-gray-bg' : 'hover:text-gray',
]"
>Services</router-link
>
<router-link
to="/home"

ivelov-vm
committed
class="transition-colors"
:class="[
currentPage === 'about us' ? 'font-bold' : '',
textWhite ? 'hover:text-gray-bg' : 'hover:text-gray',
]"
>About us</router-link
>
<router-link
to="/home"

ivelov-vm
committed
class="transition-colors"
:class="[
currentPage === 'team' ? 'font-bold' : '',
textWhite ? 'hover:text-gray-bg' : 'hover:text-gray',
]"
>Team</router-link
>
<router-link
to="/home"

ivelov-vm
committed
class="transition-colors"
:class="[
currentPage === 'contact' ? 'font-bold' : '',
textWhite ? 'hover:text-gray-bg' : 'hover:text-gray',
]"

ivelov-vm
committed
class="transition-colors"
:class="[
currentPage === 'blog' ? 'font-bold' : '',
textWhite ? 'hover:text-gray-bg' : 'hover:text-gray',
]"
>Blog</router-link
>
</nav>
<div class="flex-auto basis-[28.57%] flex justify-center">
<button
class="rounded bg-blue text-white py-3.5 px-[42px] font-medium hover:bg-blue-700 transition-colors"
Book an online
</button>
</div>
</header>

ivelov-vm
committed
<header
v-else
class="flex justify-between items-center mx-[7%] py-3.5 text-white"
>
<div class="h-[46px] flex justify-center">
<router-link to="/">
<LogoSvg :class="textWhite ? 'text-white' : 'text-blue'"></LogoSvg>
</router-link>
</div>
<div class="relative">
<button @click="expand">
<BurgerSvg class="w-10 h-10"></BurgerSvg>
</button>
<div
v-if="dropdown"
class="absolute z-20 bg-white p-2 rounded-lg shadow-4x10 w-32 right-0"
>
<nav class="text-xl text-black">
<div>
<router-link
class="flex justify-between items-center gap-3"
>
<span
class="w-24"
:class="currentPage === 'home' ? 'font-bold' : ''"
>Home</span
>
<RightArrow class="w-[7px] h-3 inline"></RightArrow>
</router-link>
</div>
<div class="mt-2">
<router-link
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
class="flex justify-between items-center gap-3"
>
<span
class="w-24"
:class="currentPage === 'services' ? 'font-bold' : ''"
>Services</span
>
<RightArrow class="w-[7px] h-3 inline"></RightArrow>
</router-link>
</div>
<div class="mt-2">
<router-link
to="#"
class="flex justify-between items-center gap-3"
>
<span
class="w-24"
:class="currentPage === 'about us' ? 'font-bold' : ''"
>About us</span
>
<RightArrow class="w-[7px] h-3 inline"></RightArrow>
</router-link>
</div>
<div class="mt-2">
<router-link
to="#"
class="flex justify-between items-center gap-3"
>
<span
class="w-24"
:class="currentPage === 'team' ? 'font-bold' : ''"
>Team</span
>
<RightArrow class="w-[7px] h-3 inline"></RightArrow>
</router-link>
</div>
<div class="mt-2">
<router-link
to="#"
class="flex justify-between items-center gap-3"
>
<span
class="w-24"
:class="currentPage === 'contact' ? 'font-bold' : ''"
>Contact</span
>
<RightArrow class="w-[7px] h-3 inline"></RightArrow>
</router-link>
</div>
<div class="mt-2">
<router-link
class="flex justify-between items-center gap-3"
>
<span
class="w-24"
:class="currentPage === 'blog' ? 'font-bold' : ''"
>Blog</span
>
<RightArrow class="w-[7px] h-3 inline"></RightArrow>
</router-link>
</div>
<div class="mt-2">
<router-link
to="#"
class="flex justify-between items-center gap-3"
>

ivelov-vm
committed
<span class="w-24">Book an online</span>
<RightArrow class="w-[7px] h-3 inline"></RightArrow>
</router-link>
</div>
</nav>
</div>
</div>
</header>
</div>
import LogoSvg from "./svg/LogoSvg.vue";
import BurgerSvg from "./svg/BurgerSvg.vue";
import RightArrow from "./svg/RightArrow.vue";
export default {
name: "HeaderComponent",
data() {
return {
width: window.innerWidth,
dropdown: false,
firstClick: true,
};
},
props: {
currentPage: {
type: String,
},

ivelov-vm
committed
transparent: {

ivelov-vm
committed
default: false,

ivelov-vm
committed
withShadow: {

ivelov-vm
committed
default: false,
},
textWhite: {
type: Boolean,
default: false,
},
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
},
mounted() {
window.addEventListener("resize", this.onWidthChange);
this.onWidthChange();
},
beforeDestroy() {
window.removeEventListener("resize", this.onWidthChange);
},
methods: {
onWidthChange() {
this.width = window.innerWidth;
},
expand() {
this.dropdown = true;
this.firstClick = true;
this.$nextTick(() => {
document.addEventListener("click", this.hide);
});
},
hide() {
if (this.firstClick) {
this.firstClick = false;
return;
}
this.dropdown = false;
document.removeEventListener("click", this.hide);
},
scrollToContacts(){
this.$emit('onButtonClick')
}
components: { LogoSvg, BurgerSvg, RightArrow },