BrainBlast/ui/src/components/BrainBlastBar.vue

28 lines
715 B
Vue
Raw Normal View History

2024-02-23 17:34:31 +01:00
<template>
2024-02-25 12:55:12 +01:00
<v-app-bar :elevation="5">
<RouterMenu />
2024-02-23 17:34:31 +01:00
<v-app-bar-title>Brain Blast</v-app-bar-title>
<template v-slot:append>
<v-btn icon @click="toggleTheme">
<v-icon>{{ darkTheme ? 'mdi-white-balance-sunny' : 'mdi-moon-waning-crescent' }}</v-icon>
</v-btn>
2024-02-23 17:34:31 +01:00
</template>
</v-app-bar>
</template>
<script setup>
import { ref } from 'vue'
2024-02-23 17:34:31 +01:00
import { useTheme } from 'vuetify'
import RouterMenu from '@/components/RouterMenu.vue'
2024-02-23 17:34:31 +01:00
const theme = useTheme()
const darkTheme = ref(true)
2024-02-23 17:34:31 +01:00
function toggleTheme() {
darkTheme.value = !darkTheme.value
theme.global.name.value = theme.global.current.value.dark ? 'CustomThemeLight' : 'CustomThemeDark'
2024-02-23 17:34:31 +01:00
}
2024-02-23 17:34:31 +01:00
</script>