feat(ui): fade in client only elements
This commit is contained in:
@@ -4,7 +4,8 @@
|
|||||||
>
|
>
|
||||||
<h1 class="text-4xl font-bold">Simple QRCode Generator</h1>
|
<h1 class="text-4xl font-bold">Simple QRCode Generator</h1>
|
||||||
|
|
||||||
<div class="flex gap-x-1">
|
<ClientOnly>
|
||||||
|
<div class="flex gap-x-1 animate-fadeIn">
|
||||||
<UButton
|
<UButton
|
||||||
color="gray"
|
color="gray"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
@@ -17,5 +18,21 @@
|
|||||||
|
|
||||||
<ThemeSwitcher />
|
<ThemeSwitcher />
|
||||||
</div>
|
</div>
|
||||||
|
</ClientOnly>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-fadeIn {
|
||||||
|
animation: fadeIn 200ms ease-in-out forwards;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ const isDark = computed({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ClientOnly>
|
|
||||||
<UButton
|
<UButton
|
||||||
:icon="isDark ? 'i-heroicons-moon-20-solid' : 'i-heroicons-sun-20-solid'"
|
:icon="isDark ? 'i-heroicons-moon-20-solid' : 'i-heroicons-sun-20-solid'"
|
||||||
color="gray"
|
color="gray"
|
||||||
@@ -21,8 +20,4 @@ const isDark = computed({
|
|||||||
class="w-8 h-8"
|
class="w-8 h-8"
|
||||||
@click="isDark = !isDark"
|
@click="isDark = !isDark"
|
||||||
/>
|
/>
|
||||||
<template #fallback>
|
|
||||||
<div class="w-8 h-8" />
|
|
||||||
</template>
|
|
||||||
</ClientOnly>
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user