commit 392e9dec1221292f31ba3104ad94d11ddc55beef Author: Mars Date: Sun Aug 25 20:36:40 2024 -0400 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a7f73a --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Nuxt dev/build outputs +.output +.data +.nuxt +.nitro +.cache +dist + +# Node dependencies +node_modules + +# Logs +logs +*.log + +# Misc +.DS_Store +.fleet +.idea + +# Local env files +.env +.env.* +!.env.example diff --git a/README.md b/README.md new file mode 100644 index 0000000..f5db2a2 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +# Nuxt 3 Minimal Starter + +Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. + +## Setup + +Make sure to install the dependencies: + +```bash +# npm +npm install + +# pnpm +pnpm install + +# yarn +yarn install + +# bun +bun install +``` + +## Development Server + +Start the development server on `http://localhost:3000`: + +```bash +# npm +npm run dev + +# pnpm +pnpm run dev + +# yarn +yarn dev + +# bun +bun run dev +``` + +## Production + +Build the application for production: + +```bash +# npm +npm run build + +# pnpm +pnpm run build + +# yarn +yarn build + +# bun +bun run build +``` + +Locally preview production build: + +```bash +# npm +npm run preview + +# pnpm +pnpm run preview + +# yarn +yarn preview + +# bun +bun run preview +``` + +Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. diff --git a/app.vue b/app.vue new file mode 100644 index 0000000..d72377e --- /dev/null +++ b/app.vue @@ -0,0 +1,81 @@ + + + diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..34f8ae6 Binary files /dev/null and b/bun.lockb differ diff --git a/composables/useFont.ts b/composables/useFont.ts new file mode 100644 index 0000000..ee0bb09 --- /dev/null +++ b/composables/useFont.ts @@ -0,0 +1,24 @@ +import { ref, onMounted } from 'vue' + +export const useFont = () => { + const font = ref('JetBrains Mono') + + onMounted(() => { + const storedFont = localStorage.getItem('font') + if (storedFont) { + font.value = storedFont + document.body.style.fontFamily = storedFont + } + }) + + const setFont = (newFont: string) => { + font.value = newFont + document.body.style.fontFamily = newFont + localStorage.setItem('font', newFont) + } + + return { + font, + setFont, + } +} diff --git a/composables/useTheme.ts b/composables/useTheme.ts new file mode 100644 index 0000000..d09369b --- /dev/null +++ b/composables/useTheme.ts @@ -0,0 +1,28 @@ +import { ref, onMounted } from 'vue' + +const themes = ['catppuccin-latte', 'catppuccin-frappe', 'catppuccin-macchiato', 'catppuccin-mocha'] + +export const useTheme = () => { + const theme = ref('catppuccin-mocha') + + onMounted(() => { + const storedTheme = localStorage.getItem('theme') + if (storedTheme) { + theme.value = storedTheme + document.body.classList.remove(...themes) + document.body.classList.add(storedTheme) + } + }) + + const setTheme = (newTheme: string) => { + theme.value = newTheme + document.body.classList.remove(...themes) + document.body.classList.add(newTheme) + localStorage.setItem('theme', newTheme) + } + + return { + theme, + setTheme, + } +} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..a534f8b --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,10 @@ +// @ts-check +import withNuxt from './.nuxt/eslint.config.mjs' + +export default withNuxt( + // Your custom configs here +).override('nuxt/stylistic', { + rules: { + 'vue/html-quotes': ['error', 'single'], + }, +}) diff --git a/nuxt.config.ts b/nuxt.config.ts new file mode 100644 index 0000000..003968e --- /dev/null +++ b/nuxt.config.ts @@ -0,0 +1,45 @@ +export default defineNuxtConfig({ + compatibilityDate: '2024-04-03', + devtools: { enabled: true }, + modules: ['@unocss/nuxt', '@vueuse/nuxt', '@nuxt/eslint'], + eslint: { + config: { + stylistic: { + quoteProps: 'as-needed', + }, + }, + }, + app: { + head: { + link: [ + { + rel: 'stylesheet', + href: 'https://fonts.bunny.net/css?family=fira-code:300,400,500,600,700|jetbrains-mono:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i|source-code-pro:200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|ubuntu-mono:400,400i,700,700i', + }, + ], + script: [ + { + type: 'text/javascript', + innerHTML: /* js */ ` + const theme = localStorage.getItem('theme') + + if (theme === 'system' || !theme) + document.body.classList.add( + window.matchMedia('(prefers-color-scheme: dark)').matches + ? 'dark' + : 'light' + ) + else + document.body.classList.add(theme) + + const font = localStorage.getItem('font') + + if (font) + document.body.style.fontFamily = font + `, + tagPosition: 'bodyClose', + }, + ], + }, + }, +}) diff --git a/package.json b/package.json new file mode 100644 index 0000000..3f39709 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "nuxt-app", + "private": true, + "type": "module", + "scripts": { + "build": "nuxt build", + "dev": "nuxt dev", + "generate": "nuxt generate", + "preview": "nuxt preview", + "postinstall": "nuxt prepare" + }, + "dependencies": { + "@fontsource-variable/fira-code": "^5.0.19", + "@fontsource-variable/jetbrains-mono": "^5.0.22", + "@fontsource-variable/source-code-pro": "^5.0.20", + "@fontsource/ubuntu-mono": "^5.0.21", + "nuxt": "^3.13.0", + "unocss-preset-theme": "^0.13.0", + "vue": "^3.4.38" + }, + "devDependencies": { + "@nuxt/eslint": "^0.5.2", + "@unocss/nuxt": "^0.62.3", + "@vueuse/nuxt": "^11.0.3" + } +} diff --git a/pages/about.vue b/pages/about.vue new file mode 100644 index 0000000..4bff1e5 --- /dev/null +++ b/pages/about.vue @@ -0,0 +1,16 @@ + + + diff --git a/pages/index.vue b/pages/index.vue new file mode 100644 index 0000000..874943b --- /dev/null +++ b/pages/index.vue @@ -0,0 +1,14 @@ + + + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..18993ad Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1 @@ + diff --git a/server/tsconfig.json b/server/tsconfig.json new file mode 100644 index 0000000..b9ed69c --- /dev/null +++ b/server/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../.nuxt/tsconfig.server.json" +} diff --git a/shims.d.ts b/shims.d.ts new file mode 100644 index 0000000..40cf99f --- /dev/null +++ b/shims.d.ts @@ -0,0 +1,6 @@ +import type { AttributifyAttributes } from '@unocss/preset-attributify' + +declare module '@vue/runtime-dom' { + // eslint-disable-next-line @typescript-eslint/no-empty-object-type + interface HTMLAttributes extends AttributifyAttributes { } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..a746f2a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,4 @@ +{ + // https://nuxt.com/docs/guide/concepts/typescript + "extends": "./.nuxt/tsconfig.json" +} diff --git a/uno.config.ts b/uno.config.ts new file mode 100644 index 0000000..5da2743 --- /dev/null +++ b/uno.config.ts @@ -0,0 +1,61 @@ +import { defineConfig, type PresetFactory } from 'unocss' +import { + presetAttributify, + presetIcons, + presetTypography, + presetUno, + transformerCompileClass, + transformerDirectives, + transformerVariantGroup, +} from 'unocss' +import type { Theme } from 'unocss/preset-uno' +import presetTheme from 'unocss-preset-theme' + +export default defineConfig({ + theme: { + colors: { + text: '#4c4f69', + subtext: '#5c5f77', + bg: '#eff1f5', + }, + }, + presets: [ + presetUno(), + presetAttributify(), + presetTypography(), + presetIcons(), + presetTheme({ + theme: { + 'catppuccin-latte': { + colors: { + text: '#4c4f69', + subtext: '#5c5f77', + bg: '#eff1f5', + }, + }, + 'catppuccin-frappe': { + colors: { + text: '#c6d0f5', + subtext: '#b5bfe2', + bg: '#303446', + }, + }, + 'catppuccin-macchiato': { + colors: { + text: '#cad3f5', + subtext: '#b8c0e0', + bg: '#24273a', + }, + }, + 'catppuccin-mocha': { + colors: { + text: '#cdd6f4', + subtext: '#bac2de', + bg: '#1e1e2e', + }, + }, + }, + }) as PresetFactory, + ], + transformers: [transformerDirectives(), transformerVariantGroup(), transformerCompileClass()], +})