-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathNavbar.vue
129 lines (125 loc) · 3.7 KB
/
Navbar.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<template>
<nav
:class="scrolled ? 'shadow-sm' : ''"
class="fixed font-sans antialiased bg-white flex justify-between items-center flex-wrap py-12 px-16 sm:py-8 sm:px-36 w-full z-30"
>
<div class="flex items-center flex-no-shrink">
<router-link to="/" class="block">
<img
alt="SDSLabs Logo"
class="h-14 -ml-6 sm-ml-0 sm:w-48 sm:h-12"
src="@/assets/images/logo.svg"
/>
</router-link>
</div>
<div class="block sm:hidden">
<button
@click="toggle"
class="flex items-center px-6 py-4 border rounded"
>
<img class="hamburger" src="@/assets/images/hamburger.svg" />
</button>
</div>
<div
:class="open ? 'block' : 'hidden'"
class="relative w-full flex-grow sm:flex sm:items-center sm:w-auto z-10 hidden"
>
<div
class="text-sm text-black leading-normal sm:flex justify-center sm:flex-grow"
>
<NavLink
v-bind:native="false"
v-bind:last="false"
url="/projects"
text="PROJECTS"
/>
<NavLink
v-bind:native="false"
v-bind:last="false"
url="/news"
text="NEWS"
/>
<NavLink
v-bind:native="true"
v-bind:last="false"
url="https://blog.sdslabs.co/"
text="BLOG"
/>
<NavLink
v-bind:native="false"
v-bind:last="false"
url="/about"
text="ABOUT US"
/>
<NavLink
v-bind:native="false"
v-bind:last="true"
url="/contact"
text="CONTACT"
/>
</div>
</div>
<!-- <div
:class="open ? 'block' : 'hidden'"
class="text-sm sm:flex mt-4 sm:mt-0 hidden"
>
<Button
v-if="!$store.state.login"
v-bind:native="true"
:url="url"
text="Login"
/>
<User class="sm:flex hidden" v-else />
</div> -->
<div class="fixed -ml-16 -mt-39">
<NavMobile :open="open" @click="toggle" />
</div>
</nav>
</template>
<script>
import NavLink from "@/components/navbar/NavLink.vue";
import NavMobile from "@/components/navbar/NavMobile.vue";
// import Button from "@/components/Button.vue";
// import User from "@/components/navbar/User.vue";
export default {
name: "TopNavbar",
data: function initData() {
return {
open: false,
scrolled: false,
url: `https://accounts.sdslabs.co/login?redirect=${
window.location.href
}`
};
},
methods: {
toggle: function toggle() {
this.open = !this.open;
},
handleScroll: function handleScroll() {
this.scrolled = window.scrollY > 0;
}
},
created() {
window.addEventListener("scroll", this.handleScroll);
},
destroyed() {
window.removeEventListener("scroll", this.handleScroll);
},
components: {
NavLink,
// Button,
NavMobile
// User
}
};
</script>
<style lang="scss" scoped>
button {
outline: none;
-webkit-tap-highlight-color: transparent;
}
button:active {
outline: none;
}
</style>