-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
NavMenu.vue
35 lines (28 loc) · 1.1 KB
/
NavMenu.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
<script setup lang="ts">
import { toggleDark } from '~/composables/dark'
const { t, availableLocales, locale } = useI18n()
function toggleLocales() {
// change to some real logic
const locales = availableLocales
locale.value = locales[(locales.indexOf(locale.value) + 1) % locales.length]
}
</script>
<template>
<nav text-xl my-4>
<RouterLink class="icon-btn mx-2" to="/" :title="t('button.home')">
<div i-ri-home-2-line />
</RouterLink>
<button class="icon-btn mx-2 !outline-none" :title="t('button.toggle_dark')" @click="toggleDark()">
<div i="ri-sun-line dark:ri-moon-line" />
</button>
<a class="icon-btn mx-2" :class="locale === 'en' ? '' : '-rotate-y-180'" :title="t('button.toggle_langs')" @click="toggleLocales()">
<div i-ri-translate />
</a>
<RouterLink class="icon-btn mx-2" to="/about" :title="t('button.about')">
<div i-ri-information-line />
</RouterLink>
<a class="icon-btn mx-2" rel="noreferrer" href="https://github.com/YunLeFun/vitesse-h5" target="_blank" title="GitHub">
<div i-ri-github-line />
</a>
</nav>
</template>