feat: use nuxt 4 structure

This commit is contained in:
Anthony Fu committed 2024-08-14 14:29:01 +02:00
1 parent 3f192323d8
commit fe3b8ce1c1
18 files changed
+7 -3

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
<script setup lang="ts">
const color = useColorMode()
useHead({
meta: [{
id: 'theme-color',
name: 'theme-color',
content: () => color.value === 'dark' ? '#222222' : '#ffffff',
}],
})
function toggleDark() {
color.preference = color.value === 'dark' ? 'light' : 'dark'
}
</script>
<template>
<button class="!outline-none" @click="toggleDark">
<div class="i-carbon-sun dark:i-carbon-moon" />
</button>
</template>