2022-12-27 23:03:50 +00:00
|
|
|
<script setup lang="ts">
|
2023-01-12 17:52:52 +00:00
|
|
|
import type { ColorMode } from '~/composables/settings'
|
2022-12-28 01:06:54 +00:00
|
|
|
|
2022-12-29 12:26:08 +00:00
|
|
|
const colorMode = useColorMode()
|
2022-12-28 01:06:54 +00:00
|
|
|
|
|
|
|
function setColorMode(mode: ColorMode) {
|
2022-12-29 12:26:08 +00:00
|
|
|
colorMode.preference = mode
|
2022-12-27 23:03:50 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-01-13 18:26:31 +00:00
|
|
|
<div flex="~ gap4 wrap" w-full>
|
2022-12-27 23:03:50 +00:00
|
|
|
<button
|
2023-01-13 18:26:31 +00:00
|
|
|
btn-text flex-1 flex="~ gap-1 center" p4 border="~ base rounded" bg-base ws-nowrap
|
2023-01-12 18:29:10 +00:00
|
|
|
:tabindex="colorMode.preference === 'dark' ? 0 : -1"
|
|
|
|
:class="colorMode.preference === 'dark' ? 'pointer-events-none' : 'filter-saturate-0'"
|
2022-12-28 01:06:54 +00:00
|
|
|
@click="setColorMode('dark')"
|
2022-12-27 23:03:50 +00:00
|
|
|
>
|
|
|
|
<div i-ri:moon-line />
|
2022-12-29 19:27:11 +00:00
|
|
|
{{ $t('settings.interface.dark_mode') }}
|
2022-12-27 23:03:50 +00:00
|
|
|
</button>
|
|
|
|
<button
|
2023-01-13 18:26:31 +00:00
|
|
|
btn-text flex-1 flex="~ gap-1 center" p4 border="~ base rounded" bg-base ws-nowrap
|
2023-01-12 18:29:10 +00:00
|
|
|
:tabindex="colorMode.preference === 'light' ? 0 : -1"
|
|
|
|
:class="colorMode.preference === 'light' ? 'pointer-events-none' : 'filter-saturate-0'"
|
2022-12-28 01:06:54 +00:00
|
|
|
@click="setColorMode('light')"
|
2022-12-27 23:03:50 +00:00
|
|
|
>
|
|
|
|
<div i-ri:sun-line />
|
2022-12-29 19:27:11 +00:00
|
|
|
{{ $t('settings.interface.light_mode') }}
|
2022-12-27 23:03:50 +00:00
|
|
|
</button>
|
2023-01-12 18:29:10 +00:00
|
|
|
<button
|
2023-01-13 18:26:31 +00:00
|
|
|
btn-text flex-1 flex="~ gap-1 center" p4 border="~ base rounded" bg-base ws-nowrap
|
2023-01-12 18:29:10 +00:00
|
|
|
:tabindex="colorMode.preference === 'system' ? 0 : -1"
|
|
|
|
:class="colorMode.preference === 'system' ? 'pointer-events-none' : 'filter-saturate-0'"
|
|
|
|
@click="setColorMode('system')"
|
|
|
|
>
|
|
|
|
<div i-ri:computer-line />
|
|
|
|
{{ $t('settings.interface.system_mode') }}
|
|
|
|
</button>
|
2022-12-27 23:03:50 +00:00
|
|
|
</div>
|
|
|
|
</template>
|