33 <nuxt-link
44 v-for =" (link, index) in links"
55 :key =" index"
6- :class =" { active: $nuxt.$route.path === link.link }"
7- :to =" link.link"
6+ :class =" { active: $nuxt.$route.name.includes( link.link) }"
7+ :to =" localePath( link.link) "
88 >
9- <span class =" link-icon" >{{ link.icon }}</span > {{ link.text }}
9+ <span class =" link-icon" >{{ link.icon }}</span > {{ $t( link.text) }}
1010 </nuxt-link >
11+ <LocaleDropdown />
1112 </div >
1213</template >
1314
1415<script >
16+ import LocaleDropdown from " ./LocaleDropdown.vue" ;
17+
1518export default {
19+ components: {
20+ LocaleDropdown,
21+ },
1622 data () {
1723 return {
1824 links: [
1925 {
2026 icon: " 🏡" ,
21-
22- text: " Home" ,
23-
24- link: " /" ,
27+ text: " header.links.home" ,
28+ link: " index" ,
2529 },
2630
2731 {
2832 icon: " 📚" ,
29-
30- text: " Blog" ,
31-
32- link: " /blog" ,
33+ text: " header.links.blog" ,
34+ link: " blog" ,
3335 },
3436
3537 {
3638 icon: " 💡" ,
37-
38- text: " Projects" ,
39-
40- link: " /projects" ,
39+ text: " header.links.projects" ,
40+ link: " projects" ,
4141 },
4242
4343 {
4444 icon: " 💻" ,
45-
46- text: " Tools" ,
47-
48- link: " /tools" ,
45+ text: " header.links.tools" ,
46+ link: " tools" ,
4947 },
5048
5149 {
5250 icon: " 📝" ,
53-
54- text: " About" ,
55-
56- link: " /about" ,
51+ text: " header.links.about" ,
52+ link: " about" ,
5753 },
5854 ],
5955 };
@@ -64,29 +60,17 @@ export default {
6460<style lang="scss" scoped>
6561#container {
6662 width : 100% ;
67-
6863 height : 70px ;
69-
7064 background-color : $dark-transparent ;
71-
7265 backdrop-filter : blur (10px );
73-
7466 position : fixed ;
75-
7667 z-index : 5 ;
77-
7868 top : 0 ;
79-
8069 left : 0 ;
81-
8270 display : flex ;
83-
8471 flex-direction : row ;
85-
8672 justify-content : center ;
87-
8873 align-items : center ;
89-
9074 column-gap : 12px ;
9175
9276 @include xs-screen {
@@ -95,28 +79,20 @@ export default {
9579
9680 & a {
9781 color : $light ;
98-
9982 text-decoration : none ;
100-
10183 font-size : 16px ;
102-
10384 padding : 8px 12px ;
104-
10585 border-radius : 6px ;
106-
107- transition : background-color 0.12s ease-in-out ;
86+ transition : background-color 0.3s ease-in-out ;
10887
10988 @include xs-screen {
11089 font-size : 14px ;
111-
11290 padding : 6px 8px ;
113-
11491 border-radius : 4px ;
11592 }
11693
11794 & :hover {
11895 background-color : $semi-dark-transparent ;
119-
12096 transition : background-color 0.3s ease-in-out ;
12197 }
12298
@@ -129,12 +105,10 @@ export default {
129105
130106 & a .active {
131107 color : $accent ;
132-
133108 transition : background-color 0.3s ease-in-out ;
134109
135110 & :hover {
136111 background-color : $accent-semi-transparent ;
137-
138112 transition : background-color 0.3s ease-in-out ;
139113 }
140114 }
0 commit comments