From c696de33f3d6cd7a4ec39c55b82778cfa79ca94d Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Fri, 23 Feb 2024 19:02:10 -0700 Subject: [PATCH] add page to take a picture and upload to an image server --- package-lock.json | 6 +++ package.json | 1 + project.task.yaml | 3 +- src/components/GiftedDialog.vue | 12 ++++- src/main.ts | 4 ++ src/router/index.ts | 6 +++ src/views/GiftedPhoto.vue | 89 +++++++++++++++++++++++++++++++++ 7 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 src/views/GiftedPhoto.vue diff --git a/package-lock.json b/package-lock.json index 2ab5803db..213d10b34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,6 +53,7 @@ "readable-stream": "^4.4.2", "reflect-metadata": "^0.1.13", "register-service-worker": "^1.7.2", + "simple-vue-camera": "^1.1.3", "three": "^0.156.1", "ua-parser-js": "^1.0.37", "util": "^0.12.5", @@ -25432,6 +25433,11 @@ "node": ">= 5.10.0" } }, + "node_modules/simple-vue-camera": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/simple-vue-camera/-/simple-vue-camera-1.1.3.tgz", + "integrity": "sha512-GVAYq1BMI9cHt+h24tu2dfIFFvhjVQ1M8IkK5LmrKcYoBA8FZlLNlhrHC2NnTPbMAXIvJn1Bqx8X6Q31+Y2+jA==" + }, "node_modules/sirv": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.3.tgz", diff --git a/package.json b/package.json index cfab56ec9..80b5bb21a 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "readable-stream": "^4.4.2", "reflect-metadata": "^0.1.13", "register-service-worker": "^1.7.2", + "simple-vue-camera": "^1.1.3", "three": "^0.156.1", "ua-parser-js": "^1.0.37", "util": "^0.12.5", diff --git a/project.task.yaml b/project.task.yaml index a63e09b73..489b84e97 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -20,7 +20,7 @@ tasks : - 32 image on give : - Show a camera to take a picture - Scale the image to a reasonable size - - Upload to a public readable place + - Upload to a public readable place - restrict size, catch all errors, multiple file types - check the rate limits - use CID (hash?) - put the image URL in the claim @@ -40,6 +40,7 @@ tasks : - show previous on "Your" screen - checkboxes - randomize vs show in order, show non-person-oriented messages, show only contacts, show only projects +- .5 add a notice on the front page if their notifications are off - 08 allow user to add a time when they want their daily notification - .5 prompt for the name directly when they visit the QR scan page diff --git a/src/components/GiftedDialog.vue b/src/components/GiftedDialog.vue index 3edb081cd..fbc103d9e 100644 --- a/src/components/GiftedDialog.vue +++ b/src/components/GiftedDialog.vue @@ -36,8 +36,16 @@ -
- +
+ + + + + + diff --git a/src/main.ts b/src/main.ts index c97e44dd8..ca8cf213b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,6 +18,7 @@ import { faBitcoinSign, faBurst, faCalendar, + faCamera, faChevronLeft, faChevronRight, faCircle, @@ -76,6 +77,7 @@ library.add( faBitcoinSign, faBurst, faCalendar, + faCamera, faChevronLeft, faChevronRight, faCircle, @@ -127,9 +129,11 @@ library.add( ); import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; +import Camera from "simple-vue-camera"; createApp(App) .component("fa", FontAwesomeIcon) + .component("camera", Camera) .use(createPinia()) .use(VueAxios, axios) .use(router) diff --git a/src/router/index.ts b/src/router/index.ts index 68da028fc..9830eb37d 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -84,6 +84,12 @@ const routes: Array = [ component: () => import(/* webpackChunkName: "discover" */ "../views/DiscoverView.vue"), }, + { + path: "/gifted-photo", + name: "gifted-photo", + component: () => + import(/* webpackChunkName: "gifted-photo" */ "../views/GiftedPhoto.vue"), + }, { path: "/help", name: "help", diff --git a/src/views/GiftedPhoto.vue b/src/views/GiftedPhoto.vue new file mode 100644 index 000000000..6af183ba9 --- /dev/null +++ b/src/views/GiftedPhoto.vue @@ -0,0 +1,89 @@ + + +