2024-08-25 20:36:40 -04:00
|
|
|
<template>
|
|
|
|
<select
|
|
|
|
v-model='selectedFont'
|
|
|
|
:disabled='loading'
|
|
|
|
@change='updateFont'
|
|
|
|
>
|
|
|
|
<option
|
2024-08-26 23:24:28 -04:00
|
|
|
v-for='(value, key) in fonts'
|
|
|
|
:key='key'
|
|
|
|
:value='key'
|
2024-08-25 20:36:40 -04:00
|
|
|
>
|
2024-08-26 23:24:28 -04:00
|
|
|
{{ value.name }}
|
2024-08-25 20:36:40 -04:00
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
<select
|
|
|
|
v-model='selectedTheme'
|
|
|
|
:disabled='loading'
|
|
|
|
@change='updateTheme'
|
|
|
|
>
|
|
|
|
<option
|
2024-08-26 23:24:28 -04:00
|
|
|
v-for='(value, key) in themes'
|
|
|
|
:key='key'
|
|
|
|
:value='key'
|
2024-08-25 20:36:40 -04:00
|
|
|
>
|
2024-08-26 23:24:28 -04:00
|
|
|
{{ value.name }}
|
2024-08-25 20:36:40 -04:00
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
<NuxtRouteAnnouncer />
|
|
|
|
<NuxtPage />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
2024-08-26 23:24:28 -04:00
|
|
|
import { themes } from '~/types/themes'
|
|
|
|
import { fonts } from '~/types/fonts'
|
|
|
|
|
2024-08-25 20:36:40 -04:00
|
|
|
const { theme, setTheme } = useTheme()
|
|
|
|
const selectedTheme = ref('')
|
|
|
|
|
|
|
|
const { font, setFont } = useFont()
|
|
|
|
const selectedFont = ref('')
|
|
|
|
const loading = ref(true)
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
selectedTheme.value = theme.value
|
|
|
|
selectedFont.value = font.value
|
|
|
|
loading.value = false
|
|
|
|
})
|
|
|
|
|
|
|
|
const updateTheme = () => {
|
|
|
|
setTheme(selectedTheme.value)
|
|
|
|
}
|
|
|
|
|
|
|
|
const updateFont = () => {
|
|
|
|
setFont(selectedFont.value)
|
|
|
|
}
|
|
|
|
|
|
|
|
useHead({
|
|
|
|
bodyAttrs: {
|
|
|
|
class: 'bg-bg',
|
|
|
|
},
|
|
|
|
})
|
|
|
|
</script>
|