start putting things in better spots
This commit is contained in:
parent
48d073a1de
commit
28fc33cd82
51
app.vue
51
app.vue
|
@ -1,59 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<select
|
<NavBar />
|
||||||
v-model='selectedFont'
|
|
||||||
:disabled='loading'
|
|
||||||
@change='updateFont'
|
|
||||||
>
|
|
||||||
<option
|
|
||||||
v-for='(value, key) in fonts'
|
|
||||||
:key='key'
|
|
||||||
:value='key'
|
|
||||||
>
|
|
||||||
{{ value.name }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<select
|
|
||||||
v-model='selectedTheme'
|
|
||||||
:disabled='loading'
|
|
||||||
@change='updateTheme'
|
|
||||||
>
|
|
||||||
<option
|
|
||||||
v-for='(value, key) in themes'
|
|
||||||
:key='key'
|
|
||||||
:value='key'
|
|
||||||
>
|
|
||||||
{{ value.name }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<NuxtRouteAnnouncer />
|
<NuxtRouteAnnouncer />
|
||||||
<NuxtPage />
|
<NuxtPage />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { themes } from '~/types/themes'
|
|
||||||
import { fonts } from '~/types/fonts'
|
|
||||||
|
|
||||||
const { theme, setTheme } = useTheme()
|
|
||||||
const selectedTheme = ref('')
|
|
||||||
|
|
||||||
const { font, setFont } = useFont()
|
|
||||||
const selectedFont = ref('')
|
|
||||||
const loading = ref(true)
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
selectedTheme.value = theme.value
|
|
||||||
selectedFont.value = font.value
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
|
|
||||||
const updateTheme = () => {
|
|
||||||
setTheme(selectedTheme.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
const updateFont = () => {
|
|
||||||
setFont(selectedFont.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
bodyAttrs: {
|
bodyAttrs: {
|
||||||
class: 'bg-bg',
|
class: 'bg-bg',
|
||||||
|
|
28
components/FontSwitcher.vue
Normal file
28
components/FontSwitcher.vue
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
<template>
|
||||||
|
<select
|
||||||
|
v-model='selectedFont'
|
||||||
|
:disabled='loading'
|
||||||
|
@change='updateFont'
|
||||||
|
>
|
||||||
|
<option
|
||||||
|
v-for='(value, key) in fonts'
|
||||||
|
:key='key'
|
||||||
|
:value='key'
|
||||||
|
>
|
||||||
|
{{ value.name }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const { font, setFont } = useFont()
|
||||||
|
const selectedFont = ref('')
|
||||||
|
const loading = ref(true)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
selectedFont.value = font.value
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
|
||||||
|
const updateFont = () => setFont(selectedFont.value)
|
||||||
|
</script>
|
4
components/NavBar.vue
Normal file
4
components/NavBar.vue
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<template>
|
||||||
|
<FontSwitcher />
|
||||||
|
<ThemeSwitcher />
|
||||||
|
</template>
|
30
components/ThemeSwitcher.vue
Normal file
30
components/ThemeSwitcher.vue
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<template>
|
||||||
|
<select
|
||||||
|
v-model='selectedTheme'
|
||||||
|
:disabled='loading'
|
||||||
|
@change='updateTheme'
|
||||||
|
>
|
||||||
|
<option
|
||||||
|
v-for='(value, key) in themes'
|
||||||
|
:key='key'
|
||||||
|
:value='key'
|
||||||
|
>
|
||||||
|
{{ value.name }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const { theme, setTheme } = useTheme()
|
||||||
|
const selectedTheme = ref('')
|
||||||
|
const loading = ref(true)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
selectedTheme.value = theme.value
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
|
||||||
|
const updateTheme = () => {
|
||||||
|
setTheme(selectedTheme.value)
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1,5 +1,4 @@
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { fonts } from '~/types/fonts'
|
|
||||||
|
|
||||||
const fontNames = Object.keys(fonts)
|
const fontNames = Object.keys(fonts)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { themes } from '~/types/themes'
|
|
||||||
|
|
||||||
const themeNames = Object.keys(themes)
|
const themeNames = Object.keys(themes)
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
import withNuxt from './.nuxt/eslint.config.mjs'
|
import withNuxt from './.nuxt/eslint.config.mjs'
|
||||||
|
|
||||||
export default withNuxt(
|
export default withNuxt().overrideRules({
|
||||||
// Your custom configs here
|
'vue/html-quotes': ['error', 'single'],
|
||||||
).override('nuxt/stylistic', {
|
|
||||||
rules: {
|
|
||||||
'vue/html-quotes': ['error', 'single'],
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { fonts } from './types/fonts'
|
import { fonts } from './utils/fonts'
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
compatibilityDate: '2024-04-03',
|
compatibilityDate: '2024-04-03',
|
||||||
|
|
|
@ -4,9 +4,7 @@ const route = useRoute()
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h1>
|
<h1>Nuxt Routing set up successfully!</h1>
|
||||||
Nuxt Routing set up successfully!
|
|
||||||
</h1>
|
|
||||||
<p>Current route: {{ route.path }}</p>
|
<p>Current route: {{ route.path }}</p>
|
||||||
<a
|
<a
|
||||||
href='https://nuxt.com/docs/getting-started/routing'
|
href='https://nuxt.com/docs/getting-started/routing'
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
<script setup lang="ts">
|
|
||||||
const route = useRoute()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h1 c-text>
|
<h1 c-text>
|
||||||
Nuxt Routing set up successfully!
|
hi im mard
|
||||||
</h1>
|
</h1>
|
||||||
<p c-subtext>
|
|
||||||
Current route: {{ route.path }}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
} from 'unocss'
|
} from 'unocss'
|
||||||
import type { Theme } from 'unocss/preset-uno'
|
import type { Theme } from 'unocss/preset-uno'
|
||||||
import presetTheme from 'unocss-preset-theme'
|
import presetTheme from 'unocss-preset-theme'
|
||||||
import { themesWithoutName } from '~/types/themes'
|
import { themesWithoutName } from '~/utils/themes'
|
||||||
|
|
||||||
export default defineConfig<Theme>({
|
export default defineConfig<Theme>({
|
||||||
theme: themesWithoutName['catppuccin-mocha'],
|
theme: themesWithoutName['catppuccin-mocha'],
|
||||||
|
|
Loading…
Reference in a new issue