This commit is contained in:
2023-05-10 22:18:22 +02:00
parent fed5006110
commit 9703d24784
14 changed files with 283 additions and 42 deletions

View File

@@ -1,42 +1,13 @@
<script setup lang="ts">
import { useThemeStore } from '~/store/theme'
const { getColor, getTheme, swapColor, nextTheme } = useThemeStore()
const { getThemeTextColor, getThemeBackgroundColor } = useTheme()
const { swapColor } = useThemeStore()
onMounted(() => swapColor())
const color = useColorMode()
const { query } = useRoute()
const { $trpc } = useNuxtApp()
const user = await $trpc.hello.query({ name: query.name?.toString() })
</script>
<template>
<section>
<h1 :class="`${getThemeTextColor}`" duration="1000">
Main page
</h1>
<h1 :class="`${getThemeBackgroundColor}`" duration="1000">
Main Page
</h1>
<div>
Current color : {{ getColor }}
</div>
<div my-12>
<div>Theme symbol : {{ getTheme.symbol }}</div>
<div>Theme Name : {{ getTheme.name }}</div>
<div>Theme colors : {{ getTheme.colors.map((color) => color.charAt(0).toUpperCase() + color.slice(1)).join(', ') }}</div>
</div>
<div @click="nextTheme()">
setNextTheme()
</div>
<div @click="color.preference = color.value === 'dark' ? 'light' : 'dark'">
toggleDarkMode()
</div>
<div>
{{ user.greeting }}
</div>
Hey
<Announcement />
</section>
</template>

42
src/pages/test.vue Normal file
View File

@@ -0,0 +1,42 @@
<script setup lang="ts">
import { useThemeStore } from '~/store/theme'
const { getColor, getTheme, swapColor, nextTheme } = useThemeStore()
const { getThemeTextColor, getThemeBackgroundColor } = useTheme()
onMounted(() => swapColor())
const color = useColorMode()
const { query } = useRoute()
const { $trpc } = useNuxtApp()
const user = await $trpc.hello.query({ name: query.name?.toString() })
</script>
<template>
<section>
<h1 mt-16 :class="`${getThemeTextColor}`" duration="1500">
Main page
</h1>
<h1 :class="`${getThemeBackgroundColor}`" duration="1500">
Main Page
</h1>
<div>
Current color : {{ getColor }}
</div>
<div my-12>
<div>Theme symbol : {{ getTheme.symbol }}</div>
<div>Theme Name : {{ getTheme.name }}</div>
<div>Theme colors : {{ getTheme.colors.map((color) => color.charAt(0).toUpperCase() + color.slice(1)).join(', ') }}</div>
</div>
<div @click="nextTheme()">
setNextTheme()
</div>
<div @click="color.preference = color.value === 'dark' ? 'light' : 'dark'">
toggleDarkMode()
</div>
<div my-48 h-32>
{{ user.greeting }}
</div>
</section>
</template>