From e432d9ac7e2e8821cf58296a02e8da16dbda575b Mon Sep 17 00:00:00 2001 From: mwinter Date: Sun, 11 Jun 2023 23:53:56 +0200 Subject: [PATCH] analytics and sliders working --- .../components/{button.vue => IconButton.vue} | 9 +- portfolio-nuxt/components/ImageSlider.vue | 29 + portfolio-nuxt/nuxt.config.ts | 12 +- portfolio-nuxt/package-lock.json | 26 +- portfolio-nuxt/package.json | 4 +- portfolio-nuxt/pages/index.vue | 20 +- portfolio-nuxt/yarn.lock | 9932 ++++++++--------- 7 files changed, 4985 insertions(+), 5047 deletions(-) rename portfolio-nuxt/components/{button.vue => IconButton.vue} (82%) create mode 100644 portfolio-nuxt/components/ImageSlider.vue diff --git a/portfolio-nuxt/components/button.vue b/portfolio-nuxt/components/IconButton.vue similarity index 82% rename from portfolio-nuxt/components/button.vue rename to portfolio-nuxt/components/IconButton.vue index dcea0ed..c27d7d2 100644 --- a/portfolio-nuxt/components/button.vue +++ b/portfolio-nuxt/components/IconButton.vue @@ -21,8 +21,15 @@ - diff --git a/portfolio-nuxt/components/ImageSlider.vue b/portfolio-nuxt/components/ImageSlider.vue new file mode 100644 index 0000000..9d13ddc --- /dev/null +++ b/portfolio-nuxt/components/ImageSlider.vue @@ -0,0 +1,29 @@ + + + \ No newline at end of file diff --git a/portfolio-nuxt/nuxt.config.ts b/portfolio-nuxt/nuxt.config.ts index 832c205..dea80b1 100644 --- a/portfolio-nuxt/nuxt.config.ts +++ b/portfolio-nuxt/nuxt.config.ts @@ -1,10 +1,20 @@ +//import { defineNuxtConfig } from 'nuxt3' + // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ - modules: ['@nuxtjs/tailwindcss', '@nuxt/image', 'nuxt-icon', '@pinia/nuxt'], + modules: ['@nuxtjs/tailwindcss', '@nuxt/image', 'nuxt-icon', '@pinia/nuxt', 'nuxt-headlessui', 'nuxt-swiper'], + extends: ['nuxt-umami'], image: { domains: ['unboundedpress.org'] }, app: { pageTransition: { name: 'page', mode: 'out-in' } + }, + appConfig: { + umami: { + id: '51f4f246-9c2e-4a86-9ffb-7a7967d9013d', + host: 'https://analytics.umami.is/', + version: 2 + }, } }) diff --git a/portfolio-nuxt/package-lock.json b/portfolio-nuxt/package-lock.json index 0aa1f0b..1f50e58 100644 --- a/portfolio-nuxt/package-lock.json +++ b/portfolio-nuxt/package-lock.json @@ -7,7 +7,6 @@ "name": "nuxt-app", "hasInstallScript": true, "dependencies": { - "@headlessui/vue": "^1.7.14", "@pinia/nuxt": "^0.4.11", "pinia": "^2.1.3" }, @@ -16,6 +15,7 @@ "@nuxtjs/tailwindcss": "^6.7.0", "@types/node": "^18", "nuxt": "^3.5.2", + "nuxt-headlessui": "^1.1.4", "nuxt-icon": "^0.4.1" } }, @@ -727,6 +727,7 @@ "version": "1.7.14", "resolved": "https://registry.npmjs.org/@headlessui/vue/-/vue-1.7.14.tgz", "integrity": "sha512-aL9U9Sa7wdOzlrfjx6EjMIYNRCma5mngWcWzQBcHFwznpRZ8g/QZ/AYFtRDrZZUw22Ttttja4D7ZRXFwhONewA==", + "dev": true, "engines": { "node": ">=10" }, @@ -6563,6 +6564,17 @@ } } }, + "node_modules/nuxt-headlessui": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/nuxt-headlessui/-/nuxt-headlessui-1.1.4.tgz", + "integrity": "sha512-/8C1w/nfBJBFzWvD/WUxwHFviPECO6owj8JgmwOK348E0IE7ZKhpFuEuy8rZ2hSm/JWexvz3QbmMRfndfzl3qw==", + "dev": true, + "dependencies": { + "@headlessui/vue": "^1.0.0", + "@nuxt/kit": "^3.4.1", + "pathe": "^1.1.0" + } + }, "node_modules/nuxt-icon": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/nuxt-icon/-/nuxt-icon-0.4.1.tgz", @@ -10671,6 +10683,7 @@ "version": "1.7.14", "resolved": "https://registry.npmjs.org/@headlessui/vue/-/vue-1.7.14.tgz", "integrity": "sha512-aL9U9Sa7wdOzlrfjx6EjMIYNRCma5mngWcWzQBcHFwznpRZ8g/QZ/AYFtRDrZZUw22Ttttja4D7ZRXFwhONewA==", + "dev": true, "requires": {} }, "@iconify/types": { @@ -14782,6 +14795,17 @@ } } }, + "nuxt-headlessui": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/nuxt-headlessui/-/nuxt-headlessui-1.1.4.tgz", + "integrity": "sha512-/8C1w/nfBJBFzWvD/WUxwHFviPECO6owj8JgmwOK348E0IE7ZKhpFuEuy8rZ2hSm/JWexvz3QbmMRfndfzl3qw==", + "dev": true, + "requires": { + "@headlessui/vue": "^1.0.0", + "@nuxt/kit": "^3.4.1", + "pathe": "^1.1.0" + } + }, "nuxt-icon": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/nuxt-icon/-/nuxt-icon-0.4.1.tgz", diff --git a/portfolio-nuxt/package.json b/portfolio-nuxt/package.json index 105f6b2..d6656be 100644 --- a/portfolio-nuxt/package.json +++ b/portfolio-nuxt/package.json @@ -13,11 +13,13 @@ "@nuxtjs/tailwindcss": "^6.7.0", "@types/node": "^18", "nuxt": "^3.5.2", + "nuxt-headlessui": "^1.1.4", "nuxt-icon": "^0.4.1" }, "dependencies": { - "@headlessui/vue": "^1.7.14", "@pinia/nuxt": "^0.4.11", + "nuxt-swiper": "^1.1.0", + "nuxt-umami": "^2.4.2", "pinia": "^2.1.3" } } diff --git a/portfolio-nuxt/pages/index.vue b/portfolio-nuxt/pages/index.vue index 802ebc0..b591ab0 100644 --- a/portfolio-nuxt/pages/index.vue +++ b/portfolio-nuxt/pages/index.vue @@ -9,13 +9,13 @@

{{ work.title }}

- + - + - + - +
@@ -46,8 +46,19 @@ const groupBy = (x,f)=>x.reduce((a,b,i)=>((a[f(b,i,x)]||=[]).push(b),a),{}); + const { data: images } = await useFetch('https://unboundedpress.org/api/images.files?pagesize=200') + const { data: works } = await useFetch('https://unboundedpress.org/api/works?pagesize=200', { transform: (works) => { + for (const work of works) { + if(work.images){ + let image_ids = []; + for (const image of work.images){ + image_ids.push(images.value.find(obj => {return obj.filename === image.filename})._id.$oid) + } + work.image_ids = image_ids + } + } let res = groupBy(works, work => new Date(work.date.$date).getFullYear()) res = Object.keys(res).map((year) => { return { @@ -98,7 +109,6 @@ */ -