it-tools/src/components/NavbarButtons.vue

76 lines
2 KiB
Vue
Raw Normal View History

2022-04-16 11:13:30 +02:00
<template>
<n-tooltip trigger="hover">
<template #trigger>
<n-button
size="large"
circle
quaternary
tag="a"
href="https://github.com/CorentinTh/it-tools"
rel="noopener"
target="_blank"
aria-label="IT-Tools' github repository"
2022-04-16 11:13:30 +02:00
>
2022-04-22 23:31:40 +02:00
<n-icon size="25" :component="BrandGithub" />
2022-04-16 11:13:30 +02:00
</n-button>
</template>
Github repository
</n-tooltip>
<n-tooltip trigger="hover">
<template #trigger>
<n-button
size="large"
circle
quaternary
tag="a"
href="https://twitter.com/ittoolsdottech"
2022-04-16 11:13:30 +02:00
rel="noopener"
target="_blank"
aria-label="IT Tools' twitter account"
2022-04-16 11:13:30 +02:00
>
2022-04-22 23:31:40 +02:00
<n-icon size="25" :component="BrandTwitter" />
2022-04-16 11:13:30 +02:00
</n-button>
</template>
IT Tools' twitter account
2022-04-16 11:13:30 +02:00
</n-tooltip>
2022-04-22 23:31:40 +02:00
<router-link to="/about" #="{ navigate, href }" custom>
2022-04-16 11:13:30 +02:00
<n-tooltip trigger="hover">
<template #trigger>
<n-button tag="a" :href="href" circle quaternary size="large" aria-label="About" @click="navigate">
2022-04-22 23:31:40 +02:00
<n-icon size="25" :component="InfoCircle" />
2022-04-16 11:13:30 +02:00
</n-button>
</template>
About
</n-tooltip>
</router-link>
<n-tooltip trigger="hover">
<template #trigger>
<n-button size="large" circle quaternary aria-label="Toggle dark/light mode" @click="isDarkTheme = !isDarkTheme">
2022-04-22 23:31:40 +02:00
<n-icon v-if="isDarkTheme" size="25" :component="Sun" />
<n-icon v-else size="25" :component="Moon" />
2022-04-16 11:13:30 +02:00
</n-button>
</template>
<span v-if="isDarkTheme">Light mode</span>
<span v-else>Dark mode</span>
</n-tooltip>
</template>
<script setup lang="ts">
import { useStyleStore } from '@/stores/style.store';
import { BrandGithub, BrandTwitter, InfoCircle, Moon, Sun } from '@vicons/tabler';
2022-04-16 11:13:30 +02:00
import { toRefs } from 'vue';
2022-04-22 23:31:40 +02:00
const styleStore = useStyleStore();
const { isDarkTheme } = toRefs(styleStore);
</script>
2022-04-16 11:13:30 +02:00
<style lang="less" scoped>
.n-button {
2022-04-22 23:31:40 +02:00
&:not(:last-child) {
margin-right: 5px;
}
2022-04-16 11:13:30 +02:00
}
2022-04-22 23:31:40 +02:00
</style>