From 70f17365a729fd53574559fa187bf6f2eb427ac1 Mon Sep 17 00:00:00 2001 From: Mike Conrad Date: Thu, 8 May 2025 21:00:30 -0400 Subject: [PATCH] Fix tailwind config --- app/app.vue | 16 +++- app/components/Header.vue | 2 + app/layouts/default.vue | 9 +-- nuxt.config.ts | 9 ++- package.json | 2 + plugins/cls.ts | 15 ++++ plugins/parallax/index.ts | 11 +++ scripts/fetch.js | 33 ++++++++ tailwind.config.js | 63 ++++++++++++++- yarn.lock | 162 +++++++++++++++++++++++++++++++++++++- 10 files changed, 306 insertions(+), 16 deletions(-) create mode 100644 plugins/cls.ts create mode 100644 plugins/parallax/index.ts create mode 100644 scripts/fetch.js diff --git a/app/app.vue b/app/app.vue index f8eacfa..3a2f639 100644 --- a/app/app.vue +++ b/app/app.vue @@ -1,5 +1,19 @@ + + \ No newline at end of file diff --git a/app/components/Header.vue b/app/components/Header.vue index 802a236..4e215e4 100644 --- a/app/components/Header.vue +++ b/app/components/Header.vue @@ -51,6 +51,8 @@ const onScroll = () => {
+ + diff --git a/app/layouts/default.vue b/app/layouts/default.vue index 4f0db5f..a0c853c 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -13,14 +13,7 @@
-
diff --git a/nuxt.config.ts b/nuxt.config.ts index 9ad99de..a32698d 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -3,6 +3,7 @@ import tailwindcss from "@tailwindcss/vite"; export default defineNuxtConfig({ compatibilityDate: '2024-11-01', + devtools: { enabled: true }, // css: ['./assets/css/main.css'], tailwindcss: { @@ -20,8 +21,12 @@ export default defineNuxtConfig({ '@nuxt/scripts', 'vuetify-nuxt-module', '@nuxtjs/tailwindcss', - ], + "@nuxtjs/color-mode", + ], + colorMode: { + classSuffix: '', + }, ssr: true, // when enabling ssr option you need to disable inlineStyles and maybe devLogs @@ -43,6 +48,7 @@ export default defineNuxtConfig({ css: [], vuetify: { + moduleOptions: { // check https://nuxt.vuetifyjs.com/guide/server-side-rendering.html ssrClientHints: { @@ -62,4 +68,5 @@ export default defineNuxtConfig({ }, }, }, + }) \ No newline at end of file diff --git a/package.json b/package.json index 964aa78..8b431d1 100644 --- a/package.json +++ b/package.json @@ -20,11 +20,13 @@ "@nuxt/icon": "1.12.0", "@nuxt/image": "1.10.0", "@nuxt/scripts": "0.11.6", + "@nuxtjs/color-mode": "^3.5.2", "@nuxtjs/tailwindcss": "^6.14.0", "@tailwindcss/typography": "^0.5.16", "@unhead/vue": "^2.0.3", "eslint": "^9.0.0", "nuxt": "^3.17.2", + "sharp": "^0.34.1", "vue": "latest", "vuetify": "^3.8.1" }, diff --git a/plugins/cls.ts b/plugins/cls.ts new file mode 100644 index 0000000..ddf5d25 --- /dev/null +++ b/plugins/cls.ts @@ -0,0 +1,15 @@ +/** + * A custom Nuxt plugin to merge all arguments into a single classname string. + */ +export default defineNuxtPlugin(() => { + return { + provide: { + /** + * Merge all arguments into a single classname string. + */ + cls: (...args: any[]) => { + return args.filter((x) => x).join(' ') + } + } + } + }) \ No newline at end of file diff --git a/plugins/parallax/index.ts b/plugins/parallax/index.ts new file mode 100644 index 0000000..6c2899a --- /dev/null +++ b/plugins/parallax/index.ts @@ -0,0 +1,11 @@ +import Rellax from "rellax"; + +export default defineNuxtPlugin((nuxtApp) => { + nuxtApp.vueApp.directive("parallax", { + mounted(el, binding, vnode, prevVnode) { + Rellax(el, { + round: true, + }); + }, + }); +}); diff --git a/scripts/fetch.js b/scripts/fetch.js new file mode 100644 index 0000000..7c67864 --- /dev/null +++ b/scripts/fetch.js @@ -0,0 +1,33 @@ +const fs = require("fs"); +const path = require("path"); +const sharp = require("sharp"); + +const dir = path.join(__dirname, "public/img/galleries/gal6"); +const files = fs.readdirSync(dir); + +const getImages = async (files) => { + const images = []; + for (const file of files) { + const { width, height } = await sharp(path.join(dir, file)).metadata(); + images.push({ + src: `/img/galleries/gal6/${file}`, + alt: file, + width, + height, + }); + } + return images; +}; + +const printYaml = async files => { + const images = await getImages(files); + console.log('images:'); + images.forEach(image => { + console.log(`- src: "${image.src}"`); + console.log(` alt: "${image.alt}"`); + console.log(` width: ${image.width}`); + console.log(` height: ${image.height}`); + }); +}; + +printYaml(files); \ No newline at end of file diff --git a/tailwind.config.js b/tailwind.config.js index 2a0aefb..1c19824 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,9 +1,21 @@ +/** @type {import('tailwindcss').Config} */ +const plugin = require("tailwindcss/plugin"); + +const srcDir = "."; + module.exports = { + darkMode: 'class', content: [ - './pages/**/*.{js,ts,vue}', - './components/**/*.{js,ts,vue}', - './layouts/**/*.{js,ts,vue}', - './plugins/**/*.{js,ts,vue}', + `${srcDir}/components/**/*.{vue,js,ts}`, + `${srcDir}/layouts/**/*.vue`, + `${srcDir}/pages/**/*.vue`, + `${srcDir}/composables/**/*.{js,ts}`, + `${srcDir}/plugins/**/*.{js,ts}`, + `${srcDir}/App.{js,ts,vue}`, + `${srcDir}/app.{js,ts,vue}`, + `${srcDir}/Error.{js,ts,vue}`, + `${srcDir}/error.{js,ts,vue}`, + `${srcDir}/nuxt.config.{js,ts}`, ], theme: { fontFamily: { @@ -33,6 +45,49 @@ module.exports = { }, plugins: [ require('@tailwindcss/typography'), + /** + * The following plugin adds support for the `content-visibility` property + * https://web.dev/content-visibility/ + * https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility + * https://developer.mozilla.org/en-US/docs/Web/CSS/contain-intrinsic-size + */ + plugin( + function ({ matchUtilities, theme }) { + matchUtilities( + { + "content-visibility": (value) => { + return { + "content-visibility": value, + }; + }, + }, + { + values: theme("contentVisibility"), + } + ); + matchUtilities( + { + "contain-intrinsic-size": (value) => { + return { + "contain-intrinsic-size": value, + }; + }, + }, + { + values: theme("containIntrinsicSize"), + } + ); + }, + { + theme: { + contentVisibility: { + auto: "auto", + hidden: "hidden", + visible: "visible", + }, + }, + } + ), ], }; diff --git a/yarn.lock b/yarn.lock index 5bf2c0e..70d6de5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -777,6 +777,124 @@ dependencies: "@iconify/types" "^2.0.0" +"@img/sharp-darwin-arm64@0.34.1": + version "0.34.1" + resolved "https://registry.yarnpkg.com/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.1.tgz#e79a4756bea9a06a7aadb4391ee53cb154a4968c" + integrity sha512-pn44xgBtgpEbZsu+lWf2KNb6OAf70X68k+yk69Ic2Xz11zHR/w24/U49XT7AeRwJ0Px+mhALhU5LPci1Aymk7A== + optionalDependencies: + "@img/sharp-libvips-darwin-arm64" "1.1.0" + +"@img/sharp-darwin-x64@0.34.1": + version "0.34.1" + resolved "https://registry.yarnpkg.com/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.1.tgz#f1f1d386719f6933796415d84937502b7199a744" + integrity sha512-VfuYgG2r8BpYiOUN+BfYeFo69nP/MIwAtSJ7/Zpxc5QF3KS22z8Pvg3FkrSFJBPNQ7mmcUcYQFBmEQp7eu1F8Q== + optionalDependencies: + "@img/sharp-libvips-darwin-x64" "1.1.0" + +"@img/sharp-libvips-darwin-arm64@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.1.0.tgz#843f7c09c7245dc0d3cfec2b3c83bb08799a704f" + integrity sha512-HZ/JUmPwrJSoM4DIQPv/BfNh9yrOA8tlBbqbLz4JZ5uew2+o22Ik+tHQJcih7QJuSa0zo5coHTfD5J8inqj9DA== + +"@img/sharp-libvips-darwin-x64@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.1.0.tgz#1239c24426c06a8e833815562f78047a3bfbaaf8" + integrity sha512-Xzc2ToEmHN+hfvsl9wja0RlnXEgpKNmftriQp6XzY/RaSfwD9th+MSh0WQKzUreLKKINb3afirxW7A0fz2YWuQ== + +"@img/sharp-libvips-linux-arm64@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.1.0.tgz#20d276cefd903ee483f0441ba35961679c286315" + integrity sha512-IVfGJa7gjChDET1dK9SekxFFdflarnUB8PwW8aGwEoF3oAsSDuNUTYS+SKDOyOJxQyDC1aPFMuRYLoDInyV9Ew== + +"@img/sharp-libvips-linux-arm@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.1.0.tgz#067c0b566eae8063738cf1b1db8f8a8573b5465c" + integrity sha512-s8BAd0lwUIvYCJyRdFqvsj+BJIpDBSxs6ivrOPm/R7piTs5UIwY5OjXrP2bqXC9/moGsyRa37eYWYCOGVXxVrA== + +"@img/sharp-libvips-linux-ppc64@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.1.0.tgz#682334595f2ca00e0a07a675ba170af165162802" + integrity sha512-tiXxFZFbhnkWE2LA8oQj7KYR+bWBkiV2nilRldT7bqoEZ4HiDOcePr9wVDAZPi/Id5fT1oY9iGnDq20cwUz8lQ== + +"@img/sharp-libvips-linux-s390x@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.1.0.tgz#82fcd68444b3666384235279c145c2b28d8ee302" + integrity sha512-xukSwvhguw7COyzvmjydRb3x/09+21HykyapcZchiCUkTThEQEOMtBj9UhkaBRLuBrgLFzQ2wbxdeCCJW/jgJA== + +"@img/sharp-libvips-linux-x64@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.1.0.tgz#65b2b908bf47156b0724fde9095676c83a18cf5a" + integrity sha512-yRj2+reB8iMg9W5sULM3S74jVS7zqSzHG3Ol/twnAAkAhnGQnpjj6e4ayUz7V+FpKypwgs82xbRdYtchTTUB+Q== + +"@img/sharp-libvips-linuxmusl-arm64@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.1.0.tgz#72accf924e80b081c8db83b900b444a67c203f01" + integrity sha512-jYZdG+whg0MDK+q2COKbYidaqW/WTz0cc1E+tMAusiDygrM4ypmSCjOJPmFTvHHJ8j/6cAGyeDWZOsK06tP33w== + +"@img/sharp-libvips-linuxmusl-x64@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.1.0.tgz#1fa052737e203f46bf44192acd01f9faf11522d7" + integrity sha512-wK7SBdwrAiycjXdkPnGCPLjYb9lD4l6Ze2gSdAGVZrEL05AOUJESWU2lhlC+Ffn5/G+VKuSm6zzbQSzFX/P65A== + +"@img/sharp-linux-arm64@0.34.1": + version "0.34.1" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.1.tgz#c36ef964499b8cfc2d2ed88fe68f27ce41522c80" + integrity sha512-kX2c+vbvaXC6vly1RDf/IWNXxrlxLNpBVWkdpRq5Ka7OOKj6nr66etKy2IENf6FtOgklkg9ZdGpEu9kwdlcwOQ== + optionalDependencies: + "@img/sharp-libvips-linux-arm64" "1.1.0" + +"@img/sharp-linux-arm@0.34.1": + version "0.34.1" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.1.tgz#c96e38ff028d645912bb0aa132a7178b96997866" + integrity sha512-anKiszvACti2sGy9CirTlNyk7BjjZPiML1jt2ZkTdcvpLU1YH6CXwRAZCA2UmRXnhiIftXQ7+Oh62Ji25W72jA== + optionalDependencies: + "@img/sharp-libvips-linux-arm" "1.1.0" + +"@img/sharp-linux-s390x@0.34.1": + version "0.34.1" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.1.tgz#8ac58d9a49dcb08215e76c8d450717979b7815c3" + integrity sha512-7s0KX2tI9mZI2buRipKIw2X1ufdTeaRgwmRabt5bi9chYfhur+/C1OXg3TKg/eag1W+6CCWLVmSauV1owmRPxA== + optionalDependencies: + "@img/sharp-libvips-linux-s390x" "1.1.0" + +"@img/sharp-linux-x64@0.34.1": + version "0.34.1" + resolved "https://registry.yarnpkg.com/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.1.tgz#3d8652efac635f0dba39d5e3b8b49515a2b2dee1" + integrity sha512-wExv7SH9nmoBW3Wr2gvQopX1k8q2g5V5Iag8Zk6AVENsjwd+3adjwxtp3Dcu2QhOXr8W9NusBU6XcQUohBZ5MA== + optionalDependencies: + "@img/sharp-libvips-linux-x64" "1.1.0" + +"@img/sharp-linuxmusl-arm64@0.34.1": + version "0.34.1" + resolved "https://registry.yarnpkg.com/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.1.tgz#b267e6a3e06f9e4d345cde471e5480c5c39e6969" + integrity sha512-DfvyxzHxw4WGdPiTF0SOHnm11Xv4aQexvqhRDAoD00MzHekAj9a/jADXeXYCDFH/DzYruwHbXU7uz+H+nWmSOQ== + optionalDependencies: + "@img/sharp-libvips-linuxmusl-arm64" "1.1.0" + +"@img/sharp-linuxmusl-x64@0.34.1": + version "0.34.1" + resolved "https://registry.yarnpkg.com/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.1.tgz#a8dee4b6227f348c4bbacaa6ac3dc584a1a80391" + integrity sha512-pax/kTR407vNb9qaSIiWVnQplPcGU8LRIJpDT5o8PdAx5aAA7AS3X9PS8Isw1/WfqgQorPotjrZL3Pqh6C5EBg== + optionalDependencies: + "@img/sharp-libvips-linuxmusl-x64" "1.1.0" + +"@img/sharp-wasm32@0.34.1": + version "0.34.1" + resolved "https://registry.yarnpkg.com/@img/sharp-wasm32/-/sharp-wasm32-0.34.1.tgz#f7dfd66b6c231269042d3d8750c90f28b9ddcba1" + integrity sha512-YDybQnYrLQfEpzGOQe7OKcyLUCML4YOXl428gOOzBgN6Gw0rv8dpsJ7PqTHxBnXnwXr8S1mYFSLSa727tpz0xg== + dependencies: + "@emnapi/runtime" "^1.4.0" + +"@img/sharp-win32-ia32@0.34.1": + version "0.34.1" + resolved "https://registry.yarnpkg.com/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.1.tgz#4bc293705df76a5f0a02df66ca3dc12e88f61332" + integrity sha512-WKf/NAZITnonBf3U1LfdjoMgNO5JYRSlhovhRhMxXVdvWYveM4kM3L8m35onYIdh75cOMCo1BexgVQcCDzyoWw== + +"@img/sharp-win32-x64@0.34.1": + version "0.34.1" + resolved "https://registry.yarnpkg.com/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.1.tgz#8a7922fec949f037c204c79f6b83238d2482384b" + integrity sha512-hw1iIAHpNE8q3uMIRCgGOeDoz9KtFNarFLQclLxr/LK1VBkj8nby18RjFvr6aP7USRYAjTZW6yisnBWMX571Tw== + "@ioredis/commands@^1.1.1": version "1.2.0" resolved "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz" @@ -1290,7 +1408,7 @@ optionalDependencies: ipx "^2.1.0" -"@nuxt/kit@3.17.2", "@nuxt/kit@^3.12.4", "@nuxt/kit@^3.15.4", "@nuxt/kit@^3.16.0", "@nuxt/kit@^3.16.1", "@nuxt/kit@^3.16.2": +"@nuxt/kit@3.17.2", "@nuxt/kit@^3.12.4", "@nuxt/kit@^3.13.2", "@nuxt/kit@^3.15.4", "@nuxt/kit@^3.16.0", "@nuxt/kit@^3.16.1", "@nuxt/kit@^3.16.2": version "3.17.2" resolved "https://registry.npmjs.org/@nuxt/kit/-/kit-3.17.2.tgz" integrity sha512-Mz2Ni8iUwty5LBs3LepUL43rI2xXbuAz3Cqq37L9frOD2QI2tQUtasYaSoKk6U7nvYzuW2z/2b3YOLkMNi/k2w== @@ -1422,6 +1540,16 @@ vite-plugin-checker "^0.9.2" vue-bundle-renderer "^2.1.1" +"@nuxtjs/color-mode@^3.5.2": + version "3.5.2" + resolved "https://registry.yarnpkg.com/@nuxtjs/color-mode/-/color-mode-3.5.2.tgz#4f2cbdd44009068b746e3bb0964b761b90969b73" + integrity sha512-cC6RfgZh3guHBMLLjrBB2Uti5eUoGM9KyauOaYS9ETmxNWBMTvpgjvSiSJp1OFljIXPIqVTJ3xtJpSNZiO3ZaA== + dependencies: + "@nuxt/kit" "^3.13.2" + pathe "^1.1.2" + pkg-types "^1.2.1" + semver "^7.6.3" + "@nuxtjs/tailwindcss@^6.14.0": version "6.14.0" resolved "https://registry.yarnpkg.com/@nuxtjs/tailwindcss/-/tailwindcss-6.14.0.tgz#c2feffc4ea4f5c4bd8d60218841d8bae84f70271" @@ -3680,7 +3808,7 @@ detect-libc@^1.0.3: resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz" integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== -detect-libc@^2.0.0, detect-libc@^2.0.2: +detect-libc@^2.0.0, detect-libc@^2.0.2, detect-libc@^2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz" integrity sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA== @@ -7941,6 +8069,36 @@ sharp@^0.32.6: tar-fs "^3.0.4" tunnel-agent "^0.6.0" +sharp@^0.34.1: + version "0.34.1" + resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.34.1.tgz#e5922894b0cc7ddf159eeabc6d5668e4e8b11d61" + integrity sha512-1j0w61+eVxu7DawFJtnfYcvSv6qPFvfTaqzTQ2BLknVhHTwGS8sc63ZBF4rzkWMBVKybo4S5OBtDdZahh2A1xg== + dependencies: + color "^4.2.3" + detect-libc "^2.0.3" + semver "^7.7.1" + optionalDependencies: + "@img/sharp-darwin-arm64" "0.34.1" + "@img/sharp-darwin-x64" "0.34.1" + "@img/sharp-libvips-darwin-arm64" "1.1.0" + "@img/sharp-libvips-darwin-x64" "1.1.0" + "@img/sharp-libvips-linux-arm" "1.1.0" + "@img/sharp-libvips-linux-arm64" "1.1.0" + "@img/sharp-libvips-linux-ppc64" "1.1.0" + "@img/sharp-libvips-linux-s390x" "1.1.0" + "@img/sharp-libvips-linux-x64" "1.1.0" + "@img/sharp-libvips-linuxmusl-arm64" "1.1.0" + "@img/sharp-libvips-linuxmusl-x64" "1.1.0" + "@img/sharp-linux-arm" "0.34.1" + "@img/sharp-linux-arm64" "0.34.1" + "@img/sharp-linux-s390x" "0.34.1" + "@img/sharp-linux-x64" "0.34.1" + "@img/sharp-linuxmusl-arm64" "0.34.1" + "@img/sharp-linuxmusl-x64" "0.34.1" + "@img/sharp-wasm32" "0.34.1" + "@img/sharp-win32-ia32" "0.34.1" + "@img/sharp-win32-x64" "0.34.1" + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz"