Skip to content

Commit

Permalink
Add Pinia store; preload fonts/icons; refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kuroji-fusky committed Jan 16, 2023
1 parent 0143860 commit 9b923dc
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 59 deletions.
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"semi": false
}
4 changes: 1 addition & 3 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>

<style></style>
</template>
56 changes: 29 additions & 27 deletions components/Container.vue
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
<script lang="ts" setup>
const route = useRoute();
const urlPath = `https://www.myfursona.art${route.fullPath}`;
const route = useRoute()
const urlPath = `https://www.myfursona.art${route.fullPath}`
const props = defineProps<{
title: string;
description: string;
class?: string;
nowrap?: boolean;
}>();
title: string
description: string
className?: string
nowrap?: boolean
}>()
const detectWrap = !props.nowrap ? "wrap-contents" : "";
const detectClass = !props.class ? detectWrap : `${detectWrap} ${props.class}`;
const detectWrap = !props.nowrap ? "wrap-contents" : ""
const detectClass = !props.className
? detectWrap
: `${detectWrap} ${props.className}`
useHead({
title: props.title,
meta: [
{ name: "description", content: props.description },
{ property: "og:title", content: props.title },
{ property: "og:description", content: props.description },
{ property: "og:type", content: "website" },
{ property: "og:url", content: urlPath },
{ name: "twitter:title", content: props.title },
{ name: "twitter:description", content: props.description },
{ name: "twitter:card", content: "summary_large_image" },
{ name: "twitter:url", content: urlPath },
],
link: [{ rel: "canonical", href: urlPath }],
});
title: props.title,
meta: [
{ name: "description", content: props.description },
{ property: "og:title", content: props.title },
{ property: "og:description", content: props.description },
{ property: "og:type", content: "website" },
{ property: "og:url", content: urlPath },
{ name: "twitter:title", content: props.title },
{ name: "twitter:description", content: props.description },
{ name: "twitter:card", content: "summary_large_image" },
{ name: "twitter:url", content: urlPath },
],
link: [{ rel: "canonical", href: urlPath }],
})
</script>

<template>
<main id="page-container" :class="detectClass">
<slot />
</main>
<main id="page-container" :class="detectClass">
<slot />
</main>
</template>

<style>
.wrap-contents {
@apply mx-auto max-w-screen-2xl px-6;
@apply mx-auto max-w-screen-2xl px-6;
}
</style>
12 changes: 12 additions & 0 deletions components/Layout/LayoutHero.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template>
<div id="hero">
<article>
<h1>MyFursona</h1>
<p>
MyFursona is an open-source platform where you can show off your fluffy
characters and show them off to your friends! Manage, store, and show
your fursonas in one place
</p>
</article>
</div>
</template>
33 changes: 21 additions & 12 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: ["@nuxtjs/color-mode"],
modules: [
"@nuxtjs/color-mode",
[
"@pinia/nuxt",
{
autoImports: ["defineStore", ["defineStore", "definePiniaStore"]],
},
],
],
css: ["~/assets/css/main.scss"],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
typescript: {
shim: false,
strict: true,
},
app: {
head: {
link: [
Expand All @@ -23,14 +42,4 @@ export default defineNuxtConfig({
],
},
},
css: ["~/assets/css/main.scss"],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
typescript: {
shim: false,
},
});
})
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@
"postinstall": "nuxt prepare"
},
"devDependencies": {
"@fontsource/inter": "^4.5.14",
"@fontsource/open-sans": "^4.5.13",
"@iconify-prerendered/vue-fa6-brands": "^0.18.1662097805",
"@nuxtjs/color-mode": "^3.2.0",
"@pinia/nuxt": "^0.4.6",
"autoprefixer": "^10.4.13",
"gsap": "^3.11.4",
"nuxt": "3.0.0",
"pinia": "^2.0.29",
"postcss": "^8.4.20",
"sass": "^1.57.1",
"tailwindcss": "^3.2.4"
Expand Down
16 changes: 1 addition & 15 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@

<template>
<Container title="Home">
<div id="hero">
<article>
<h1>MyFursona</h1>
<p>
MyFursona is an open-source platform where you can show off your fluffy
characters and show them off to your friends!

Manage, store, and show your fursonas in one place
</p>
</article>
</div>
<LayoutHero />
</Container>
</template>

<style lang="scss">
</style>
17 changes: 17 additions & 0 deletions stores/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineStore } from "pinia"

interface UserSettingsStore {
theme: "light" | "dark" | "system"
colorProfile: string
nsfwEnabled: boolean
}

export const useUserSettingsStore = defineStore("settings", () => {
state: (): UserSettingsStore => {
return {
theme: "system",
colorProfile: "#fff",
nsfwEnabled: true,
}
}
})
4 changes: 2 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('tailwindcss').Config} */
const defaultTheme = require("tailwindcss/defaultTheme");
const plugin = require("tailwindcss/plugin");
const pluginBaseStyles = require("tailwindcss/plugin");

module.exports = {
content: [
Expand All @@ -12,7 +12,7 @@ module.exports = {
"./app.vue",
],
plugins: [
plugin(({ addBase, theme }) => {
pluginBaseStyles(({ addBase, theme }) => {
addBase({
html: {
scrollBehavior: "smooth",
Expand Down
41 changes: 41 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,21 @@
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.16.11.tgz#d22803ed921396fca698334cf593a0f428c87304"
integrity sha512-7NcClJIctrO3iRu5CCqwdSBePm8bL2Iu1DYsuOnxuYJ+a1Kv3Wn3MzNdJIrUPLi1yADVwRliRUU/jtMC/tJnJA==

"@fontsource/inter@^4.5.14":
version "4.5.14"
resolved "https://registry.yarnpkg.com/@fontsource/inter/-/inter-4.5.14.tgz#3944b809aa7bf27dacd20bdc04a49fb738959724"
integrity sha512-JDC9AocdPLuGsASkvWw9hS5gtHE7K9dOwL98XLrk5yjYqxy4uVnScG58NUvFMJDVJRl/7c8Wnap6PEs+7Zvj1Q==

"@fontsource/open-sans@^4.5.13":
version "4.5.13"
resolved "https://registry.yarnpkg.com/@fontsource/open-sans/-/open-sans-4.5.13.tgz#2c99e4c055d129a75f14c11b77d040282e0388b8"
integrity sha512-/UzqP7ZFk145XAq8KG4pvFPP7UQhtreDGXgqXZjagCDreKxcrhwn/x7DYz9rPcycWkLUVApIybcoczGZiM0cRg==

"@iconify-prerendered/vue-fa6-brands@^0.18.1662097805":
version "0.18.1662097805"
resolved "https://registry.yarnpkg.com/@iconify-prerendered/vue-fa6-brands/-/vue-fa6-brands-0.18.1662097805.tgz#f0604ec9cd73cbce9ac6ab571e076f09ecae4aee"
integrity sha512-e2848kSlyrH1nrlJtioBqye+57mttoB6K3cDfynAp6BBewnKlDBDA1RNDsW8Zk/VFnn7laEavLnx/aa7fpLqLw==

"@ioredis/commands@^1.1.1":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@ioredis/commands/-/commands-1.2.0.tgz#6d61b3097470af1fdbbe622795b8921d42018e11"
Expand Down Expand Up @@ -618,6 +633,14 @@
lodash.template "^4.5.0"
pathe "^1.0.0"

"@pinia/nuxt@^0.4.6":
version "0.4.6"
resolved "https://registry.yarnpkg.com/@pinia/nuxt/-/nuxt-0.4.6.tgz#ce83714f700594187d8a29e8f4bdaf31abe0bef1"
integrity sha512-HjrYEfLdFpmsjhicPJgL36jVhzHWukIQPFFHGTSF84Cplu+f2nY2XHKqe9ToHzE9rLee2RjLOwAzOnXa/I/u6A==
dependencies:
"@nuxt/kit" "^3.0.0"
pinia ">=2.0.27"

"@rollup/plugin-alias@^4.0.2":
version "4.0.2"
resolved "https://registry.yarnpkg.com/@rollup/plugin-alias/-/plugin-alias-4.0.2.tgz#fec6c6aff8dd6fce580ae6bc5345084cd702bb62"
Expand Down Expand Up @@ -2231,6 +2254,11 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4,
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==

gsap@^3.11.4:
version "3.11.4"
resolved "https://registry.yarnpkg.com/gsap/-/gsap-3.11.4.tgz#e6d972d3509a7431b86d81d6fc3bbeb6862e5ff1"
integrity sha512-McHhEguHyExMMnjqKA8G+7TvxmlKQGMbjgwAilnFe1e4id7V/tFveRQ2YMZhTYu0oxHGWvbPltdVYQOu3z1SCA==

gzip-size@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-7.0.0.tgz#9f9644251f15bc78460fccef4055ae5a5562ac60"
Expand Down Expand Up @@ -3255,6 +3283,14 @@ pify@^2.3.0:
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==

pinia@>=2.0.27, pinia@^2.0.29:
version "2.0.29"
resolved "https://registry.yarnpkg.com/pinia/-/pinia-2.0.29.tgz#b7e672980fdb14e03839e8139ce55ca97843679d"
integrity sha512-5z/KpFecq/cIgfeTnulJXldiLcTITRkTe3N58RKYSj0Pc1EdR6oyCdnf5A9jLoVwBqX5LtHhd0kGlpzWvk9oiQ==
dependencies:
"@vue/devtools-api" "^6.4.5"
vue-demi "*"

pkg-types@^1.0.0, pkg-types@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.0.1.tgz#25234407f9dc63409af45ced9407625ff446a761"
Expand Down Expand Up @@ -4381,6 +4417,11 @@ vue-bundle-renderer@^1.0.0:
dependencies:
ufo "^1.0.0"

vue-demi@*:
version "0.13.11"
resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.13.11.tgz#7d90369bdae8974d87b1973564ad390182410d99"
integrity sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==

vue-devtools-stub@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/vue-devtools-stub/-/vue-devtools-stub-0.1.0.tgz#a65b9485edecd4273cedcb8102c739b83add2c81"
Expand Down

0 comments on commit 9b923dc

Please sign in to comment.