Add theme toggle with shortcuts

This commit is contained in:
2024-06-30 01:02:52 +02:00
parent 953c6cdc27
commit ae224396fc

View File

@@ -50,7 +50,8 @@ defineShortcuts({
h: () => router.push('/'),
u: () => router.push('/uses'),
w: () => router.push('/writings'),
r: () => window.open(config.public.cloud.resume, '_blank')
r: () => window.open(config.public.cloud.resume, '_blank'),
t: () => toggleTheme()
})
</script>
@@ -80,7 +81,10 @@ defineShortcuts({
/>
</UTooltip>
<ClientOnly>
<UTooltip text="switch theme">
<UTooltip
:shortcuts="['T']"
text="switch theme"
>
<UButton
:icon="isDark ? 'i-ph-moon-duotone' : 'i-ph-sun-duotone'"
color="white"