|
1 | 1 | <template>
|
2 |
| - <chakra.div |
3 |
| - :bg=" |
4 |
| - useColorModeValue( |
5 |
| - `${selectedColor.color}.50`, |
6 |
| - `${selectedColor.color}.900` |
7 |
| - ).value |
8 |
| - " |
9 |
| - min-h="100vh" |
10 |
| - transition="background-color 0.2s ease-in-out" |
11 |
| - layer-style="home.container" |
12 |
| - > |
13 |
| - <c-stack spacing="8" align-items="flex-start"> |
14 |
| - <c-stack |
15 |
| - :color=" |
16 |
| - useColorModeValue( |
17 |
| - `${selectedColor.color}.900`, |
18 |
| - `${selectedColor.color}.50` |
19 |
| - ).value |
20 |
| - " |
21 |
| - > |
22 |
| - <c-heading text-style="home.subheading"> Welcome to </c-heading> |
23 |
| - <c-heading as="h1" text-style="home.heading"> |
24 |
| - Chakra UI Nuxt |
25 |
| - </c-heading> |
26 |
| - <chakra.h4 |
27 |
| - font-weight="bold" |
28 |
| - :font-size="['xl', '2xl', '3xl']" |
29 |
| - display="flex" |
30 |
| - :flex-direction="['column', 'column', 'row']" |
31 |
| - :align-items="['flex-start', 'flex-start', 'center']" |
32 |
| - > |
33 |
| - <chakra.span |
34 |
| - >Build Beautiful Accessible Components - Powered by</chakra.span |
35 |
| - > |
36 |
| - |
37 |
| - <chakra.a |
38 |
| - text-decoration="underline" |
39 |
| - text-decoration-style="dashed" |
40 |
| - cursor="pointer" |
41 |
| - href="https://nuxt.com" |
42 |
| - target="_blank" |
43 |
| - display="inline-flex" |
44 |
| - justify-content="flex-start" |
45 |
| - align-items="center" |
46 |
| - > |
47 |
| - <NuxtLogo h="1em" d="inline-flex" /> |
48 |
| - <ExternalLinkIcon /> |
49 |
| - </chakra.a> |
50 |
| - </chakra.h4> |
51 |
| - </c-stack> |
52 |
| - <c-wrap |
53 |
| - :bg="useColorModeValue('blackAlpha.50', 'whiteAlpha.50').value" |
54 |
| - :px="[5, 3]" |
55 |
| - :py="[4, 3]" |
56 |
| - :rounded="{ base: '2xl', md: '2xl', lg: 'full' }" |
57 |
| - spacing="3" |
58 |
| - > |
59 |
| - <c-wrap-item v-for="(color, i) in colors" :key="color"> |
60 |
| - <c-circle |
61 |
| - box-size="8" |
62 |
| - :bg="`${color}.400`" |
63 |
| - cursor="pointer" |
64 |
| - :_hover="{ |
65 |
| - bg: `${color}.500`, |
66 |
| - transform: 'scale(1.1)', |
67 |
| - transition: 'all 0.2s', |
68 |
| - }" |
69 |
| - @mouseenter="selectedColor.color = color" |
70 |
| - /> |
71 |
| - </c-wrap-item> |
72 |
| - </c-wrap> |
73 |
| - <c-badge |
74 |
| - :color-scheme="selectedColor.color" |
75 |
| - text-transform="unset" |
76 |
| - :px="[5, 2]" |
77 |
| - :py="[4, 1]" |
78 |
| - font-size="md" |
79 |
| - :rounded="{ base: '2xl', md: '2xl', lg: 'full' }" |
80 |
| - white-space="break-spaces" |
81 |
| - > |
82 |
| - Chakra UI Vue is currently still in early beta. Explore the |
83 |
| - documentation and join our Discord! |
84 |
| - </c-badge> |
85 |
| - <c-wrap spacing="5" :color-scheme="selectedColor.color"> |
86 |
| - <c-wrap-item> |
87 |
| - <c-button |
88 |
| - size="lg" |
89 |
| - :color-scheme="selectedColor.color" |
90 |
| - :right-icon="ExternalLinkIcon" |
91 |
| - > |
92 |
| - Get Started |
93 |
| - </c-button> |
94 |
| - </c-wrap-item> |
95 |
| - <c-wrap-item> |
96 |
| - <c-button |
97 |
| - size="lg" |
98 |
| - :color-scheme="selectedColor.color" |
99 |
| - :right-icon="DocumentationIcon" |
100 |
| - variant="outline" |
101 |
| - > |
102 |
| - Documentation |
103 |
| - </c-button> |
104 |
| - </c-wrap-item> |
105 |
| - </c-wrap> |
106 |
| - <c-button-group :color-scheme="selectedColor.color" variant="outline"> |
107 |
| - <c-icon-button |
108 |
| - aria-label="Toggle color mode" |
109 |
| - :icon="useColorModeValue('moon', 'sun').value" |
110 |
| - @click="changeColorMode" |
111 |
| - rounded="none" |
112 |
| - /> |
113 |
| - <c-icon-button |
114 |
| - as="a" |
115 |
| - href="https://nuxt.com" |
116 |
| - target="_blank" |
117 |
| - aria-label="Join Discord" |
118 |
| - rounded="none" |
119 |
| - > |
120 |
| - <DiscordIcon /> |
121 |
| - </c-icon-button> |
122 |
| - </c-button-group> |
123 |
| - <c-stack> |
124 |
| - <c-heading as="h3" size="md"> Avatars </c-heading> |
125 |
| - <c-avatar-group :max="3" size="md"> |
126 |
| - <c-avatar |
127 |
| - name="Sarah Drasner" |
128 |
| - src="https://avatars.githubusercontent.com/u/2281088?v=4" |
129 |
| - alt="Sarah Drasner" |
130 |
| - :border-color=" |
131 |
| - useColorModeValue( |
132 |
| - `${selectedColor.color}.50`, |
133 |
| - `${selectedColor.color}.900` |
134 |
| - ).value |
135 |
| - " |
136 |
| - > |
137 |
| - <c-avatar-badge |
138 |
| - bg="green.400" |
139 |
| - border-width="2px" |
140 |
| - box-size="0.8em" |
141 |
| - /> |
142 |
| - </c-avatar> |
143 |
| - <c-avatar |
144 |
| - name="Evan You" |
145 |
| - alt="Evan You" |
146 |
| - src="https://www.github.com/yyx990803.png" |
147 |
| - :border-color=" |
148 |
| - useColorModeValue( |
149 |
| - `${selectedColor.color}.50`, |
150 |
| - `${selectedColor.color}.900` |
151 |
| - ).value |
152 |
| - " |
153 |
| - > |
154 |
| - <c-avatar-badge |
155 |
| - bg="green.400" |
156 |
| - border-width="2px" |
157 |
| - box-size="0.8em" |
158 |
| - /> |
159 |
| - </c-avatar> |
160 |
| - <c-avatar |
161 |
| - name="Anthony Fu" |
162 |
| - src="https://avatars.githubusercontent.com/u/11247099?v=4" |
163 |
| - alt="Anthony Fu" |
164 |
| - :border-color=" |
165 |
| - useColorModeValue( |
166 |
| - `${selectedColor.color}.50`, |
167 |
| - `${selectedColor.color}.900` |
168 |
| - ).value |
169 |
| - " |
170 |
| - > |
171 |
| - <c-avatar-badge |
172 |
| - bg="green.400" |
173 |
| - border-width="2px" |
174 |
| - box-size="0.8em" |
175 |
| - /> |
176 |
| - </c-avatar> |
177 |
| - <c-avatar |
178 |
| - name="Maya Shavin" |
179 |
| - src="https://avatars.githubusercontent.com/u/6650139?v=4" |
180 |
| - alt="Maya Shavin" |
181 |
| - ></c-avatar> |
182 |
| - </c-avatar-group> |
183 |
| - </c-stack> |
184 |
| - </c-stack> |
185 |
| - </chakra.div> |
| 2 | + <NuxtLayout> |
| 3 | + <NuxtPage /> |
| 4 | + </NuxtLayout> |
186 | 5 | </template>
|
187 |
| - |
188 |
| -<script setup lang="ts"> |
189 |
| -import { |
190 |
| - chakra, |
191 |
| - useColorMode, |
192 |
| - useColorModeValue, |
193 |
| - useTheme, |
194 |
| -} from "@chakra-ui/vue-next" |
195 |
| -import { useStorage } from "@vueuse/core" |
196 |
| -import DocumentationIcon from "./components/icons/documentation-icon" |
197 |
| -import ExternalLinkIcon from "./components/icons/external-link" |
198 |
| -import DiscordIcon from "./components/icons/discord-icon" |
199 |
| -import NuxtLogo from "./components/icons/nuxt-logo" |
200 |
| -
|
201 |
| -const { toggleColorMode } = useColorMode() |
202 |
| -
|
203 |
| -const themeConfig = { |
204 |
| - color: "whatsapp", |
205 |
| -} |
206 |
| -const selectedColor = useStorage("theme.color", themeConfig) |
207 |
| -
|
208 |
| -const theme = useTheme() |
209 |
| -
|
210 |
| -const colors = computed( |
211 |
| - () => |
212 |
| - new Set( |
213 |
| - Object.keys(theme.colors) |
214 |
| - .filter((color) => typeof theme.colors[color] === "object") |
215 |
| - .filter((color) => !["blackAlpha", "whiteAlpha"].includes(color)) |
216 |
| - ) |
217 |
| -) |
218 |
| -
|
219 |
| -function changeColorMode() { |
220 |
| - toggleColorMode() |
221 |
| -} |
222 |
| -</script> |
0 commit comments