From 9f3098e80c6b6c87e9bfbfe36239a39e5cafb29f Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Wed, 26 Oct 2022 21:02:31 -0400 Subject: init: add some stories and personas and begin layout out domain --- iridescence/src/App.vue | 102 ------ iridescence/src/api/dichroism.js | 81 ----- iridescence/src/api/error.js | 6 - iridescence/src/assets/logo.png | Bin 603239 -> 0 bytes iridescence/src/assets/logo_sm.png | Bin 98670 -> 0 bytes iridescence/src/components/BusyBar.vue | 20 - iridescence/src/components/CartCheckout.vue | 38 -- iridescence/src/components/Footer.vue | 53 --- iridescence/src/components/Navbar.vue | 114 ------ iridescence/src/components/ProductCard.vue | 74 ---- iridescence/src/components/ProductDetail.vue | 135 ------- iridescence/src/components/ProductFilter.vue | 52 --- iridescence/src/components/ProductList.vue | 32 -- iridescence/src/components/ProductSearch.vue | 88 ----- iridescence/src/components/admin/NewProduct.vue | 58 --- .../src/components/admin/ProductEditCard.vue | 282 --------------- .../src/components/admin/ProductEditList.vue | 32 -- iridescence/src/components/cart/CartItem.vue | 89 ----- iridescence/src/components/cart/Totals.vue | 28 -- .../src/components/checkout/CheckoutForm.vue | 301 ---------------- iridescence/src/main.js | 13 - iridescence/src/models/photo_set.js | 10 - iridescence/src/models/product.js | 16 - iridescence/src/router/index.js | 58 --- iridescence/src/store/index.js | 118 ------ iridescence/src/views/About.vue | 9 - iridescence/src/views/Admin.vue | 48 --- iridescence/src/views/Care.vue | 10 - iridescence/src/views/Cart.vue | 48 --- iridescence/src/views/Checkout.vue | 13 - iridescence/src/views/Faq.vue | 9 - iridescence/src/views/Home.vue | 39 -- iridescence/src/views/Privacy.vue | 401 --------------------- 33 files changed, 2377 deletions(-) delete mode 100644 iridescence/src/App.vue delete mode 100644 iridescence/src/api/dichroism.js delete mode 100644 iridescence/src/api/error.js delete mode 100644 iridescence/src/assets/logo.png delete mode 100644 iridescence/src/assets/logo_sm.png delete mode 100644 iridescence/src/components/BusyBar.vue delete mode 100644 iridescence/src/components/CartCheckout.vue delete mode 100644 iridescence/src/components/Footer.vue delete mode 100644 iridescence/src/components/Navbar.vue delete mode 100644 iridescence/src/components/ProductCard.vue delete mode 100644 iridescence/src/components/ProductDetail.vue delete mode 100644 iridescence/src/components/ProductFilter.vue delete mode 100644 iridescence/src/components/ProductList.vue delete mode 100644 iridescence/src/components/ProductSearch.vue delete mode 100644 iridescence/src/components/admin/NewProduct.vue delete mode 100644 iridescence/src/components/admin/ProductEditCard.vue delete mode 100644 iridescence/src/components/admin/ProductEditList.vue delete mode 100644 iridescence/src/components/cart/CartItem.vue delete mode 100644 iridescence/src/components/cart/Totals.vue delete mode 100644 iridescence/src/components/checkout/CheckoutForm.vue delete mode 100644 iridescence/src/main.js delete mode 100644 iridescence/src/models/photo_set.js delete mode 100644 iridescence/src/models/product.js delete mode 100644 iridescence/src/router/index.js delete mode 100644 iridescence/src/store/index.js delete mode 100644 iridescence/src/views/About.vue delete mode 100644 iridescence/src/views/Admin.vue delete mode 100644 iridescence/src/views/Care.vue delete mode 100644 iridescence/src/views/Cart.vue delete mode 100644 iridescence/src/views/Checkout.vue delete mode 100644 iridescence/src/views/Faq.vue delete mode 100644 iridescence/src/views/Home.vue delete mode 100644 iridescence/src/views/Privacy.vue (limited to 'iridescence/src') diff --git a/iridescence/src/App.vue b/iridescence/src/App.vue deleted file mode 100644 index 5cd436c..0000000 --- a/iridescence/src/App.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/iridescence/src/api/dichroism.js b/iridescence/src/api/dichroism.js deleted file mode 100644 index 93989c5..0000000 --- a/iridescence/src/api/dichroism.js +++ /dev/null @@ -1,81 +0,0 @@ -import Product from "../models/product"; -import PhotoSet from "../models/photo_set"; -import ApiError from "./error"; - -export default class Dichroism { - _base_addr = process.env.VUE_APP_API_BASE_ADDR; - - async createPhoto(file) { - const fd = new FormData(); - fd.append(file.name, file); - - const options = { - method: "POST", - body: fd - }; - - try { - const photos = await this._sendRequest("photos", options); - return photos.map(p => new PhotoSet(p)); - } catch (err) { - console.error("Dichroism: " + err.message); - return null; - } - } - - async getProducts() { - try { - const products = await this._sendRequest("products", null); - return products.map(p => new Product(p)); - } catch (err) { - console.error("Dichroism: " + err.message); - return []; - } - } - - async updateProduct(fieldDiff) { - const options = { - method: "PATCH", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(fieldDiff) - }; - - try { - const product = await this._sendRequest("products", options); - return new Product(product); - } catch (err) { - console.error("Dichroism: " + err.message); - return null; - } - } - - async createProduct(newProduct) { - const options = { - method: "POST", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(newProduct) - }; - - try { - const product = await this._sendRequest("products", options); - return new Product(product); - } catch (err) { - console.error("Dichroism: " + err.message); - return null; - } - } - - async _sendRequest(endpoint, options) { - const response = await fetch(this._base_addr + endpoint, options); - - if (response.ok) { - return await response.json(); - } else { - throw new ApiError(await response.text()); - } - } -} diff --git a/iridescence/src/api/error.js b/iridescence/src/api/error.js deleted file mode 100644 index 7c9320d..0000000 --- a/iridescence/src/api/error.js +++ /dev/null @@ -1,6 +0,0 @@ -export default class ApiError extends Error { - constructor(message) { - super(message); - this.name = "ApiError"; - } -} diff --git a/iridescence/src/assets/logo.png b/iridescence/src/assets/logo.png deleted file mode 100644 index 892376b..0000000 Binary files a/iridescence/src/assets/logo.png and /dev/null differ diff --git a/iridescence/src/assets/logo_sm.png b/iridescence/src/assets/logo_sm.png deleted file mode 100644 index b74ccfd..0000000 Binary files a/iridescence/src/assets/logo_sm.png and /dev/null differ diff --git a/iridescence/src/components/BusyBar.vue b/iridescence/src/components/BusyBar.vue deleted file mode 100644 index a38cefa..0000000 --- a/iridescence/src/components/BusyBar.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/iridescence/src/components/CartCheckout.vue b/iridescence/src/components/CartCheckout.vue deleted file mode 100644 index 1b327b2..0000000 --- a/iridescence/src/components/CartCheckout.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - diff --git a/iridescence/src/components/Footer.vue b/iridescence/src/components/Footer.vue deleted file mode 100644 index 8210c62..0000000 --- a/iridescence/src/components/Footer.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - diff --git a/iridescence/src/components/Navbar.vue b/iridescence/src/components/Navbar.vue deleted file mode 100644 index 3a3390c..0000000 --- a/iridescence/src/components/Navbar.vue +++ /dev/null @@ -1,114 +0,0 @@ - - - diff --git a/iridescence/src/components/ProductCard.vue b/iridescence/src/components/ProductCard.vue deleted file mode 100644 index 144dd9e..0000000 --- a/iridescence/src/components/ProductCard.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - diff --git a/iridescence/src/components/ProductDetail.vue b/iridescence/src/components/ProductDetail.vue deleted file mode 100644 index a67e39f..0000000 --- a/iridescence/src/components/ProductDetail.vue +++ /dev/null @@ -1,135 +0,0 @@ - - - diff --git a/iridescence/src/components/ProductFilter.vue b/iridescence/src/components/ProductFilter.vue deleted file mode 100644 index 6fdd461..0000000 --- a/iridescence/src/components/ProductFilter.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - diff --git a/iridescence/src/components/ProductList.vue b/iridescence/src/components/ProductList.vue deleted file mode 100644 index bed37b3..0000000 --- a/iridescence/src/components/ProductList.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/iridescence/src/components/ProductSearch.vue b/iridescence/src/components/ProductSearch.vue deleted file mode 100644 index f60931c..0000000 --- a/iridescence/src/components/ProductSearch.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - - - diff --git a/iridescence/src/components/admin/NewProduct.vue b/iridescence/src/components/admin/NewProduct.vue deleted file mode 100644 index a1d3304..0000000 --- a/iridescence/src/components/admin/NewProduct.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - diff --git a/iridescence/src/components/admin/ProductEditCard.vue b/iridescence/src/components/admin/ProductEditCard.vue deleted file mode 100644 index 603cb4f..0000000 --- a/iridescence/src/components/admin/ProductEditCard.vue +++ /dev/null @@ -1,282 +0,0 @@ - - - diff --git a/iridescence/src/components/admin/ProductEditList.vue b/iridescence/src/components/admin/ProductEditList.vue deleted file mode 100644 index 91c0929..0000000 --- a/iridescence/src/components/admin/ProductEditList.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/iridescence/src/components/cart/CartItem.vue b/iridescence/src/components/cart/CartItem.vue deleted file mode 100644 index 20ddec8..0000000 --- a/iridescence/src/components/cart/CartItem.vue +++ /dev/null @@ -1,89 +0,0 @@ - - - diff --git a/iridescence/src/components/cart/Totals.vue b/iridescence/src/components/cart/Totals.vue deleted file mode 100644 index 36c9e77..0000000 --- a/iridescence/src/components/cart/Totals.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/iridescence/src/components/checkout/CheckoutForm.vue b/iridescence/src/components/checkout/CheckoutForm.vue deleted file mode 100644 index 482baec..0000000 --- a/iridescence/src/components/checkout/CheckoutForm.vue +++ /dev/null @@ -1,301 +0,0 @@ - - - diff --git a/iridescence/src/main.js b/iridescence/src/main.js deleted file mode 100644 index 62e6485..0000000 --- a/iridescence/src/main.js +++ /dev/null @@ -1,13 +0,0 @@ -import Vue from "vue"; -import App from "./App.vue"; -import router from "./router"; -import store from "./store"; -import "animate.css"; - -Vue.config.productionTip = false; - -new Vue({ - router, - store, - render: h => h(App) -}).$mount("#app"); diff --git a/iridescence/src/models/photo_set.js b/iridescence/src/models/photo_set.js deleted file mode 100644 index 7d7213c..0000000 --- a/iridescence/src/models/photo_set.js +++ /dev/null @@ -1,10 +0,0 @@ -export default class PhotoSet { - id = 0; - fullsize = ""; - thumbnail = ""; - base = ""; - - constructor(json) { - Object.assign(this, json); - } -} diff --git a/iridescence/src/models/product.js b/iridescence/src/models/product.js deleted file mode 100644 index ded5434..0000000 --- a/iridescence/src/models/product.js +++ /dev/null @@ -1,16 +0,0 @@ -export default class Product { - constructor(json) { - if (json) { - this.id = json.id ? json.id : null; - this.name = json.name ? json.name : null; - this.description = json.description ? json.description : null; - this.cents = Number.isFinite(json.cents) ? json.cents : null; - this.quantity = Number.isFinite(json.quantity) ? json.quantity : null; - this.featured = json.featured ? json.featured : false; - this.category = json.category ? json.category : null; - this.photo_base = json.photo_base ? json.photo_base : null; - this.photo_thumbnail = json.photo_thumbnail ? json.photo_thumbnail : null; - this.photo_fullsize = json.photo_fullsize ? json.photo_fullsize : null; - } - } -} diff --git a/iridescence/src/router/index.js b/iridescence/src/router/index.js deleted file mode 100644 index 1dc6e63..0000000 --- a/iridescence/src/router/index.js +++ /dev/null @@ -1,58 +0,0 @@ -import Vue from "vue"; -import VueRouter from "vue-router"; -import Home from "../views/Home.vue"; -import Care from "../views/Care.vue"; -import Faq from "../views/Faq.vue"; -import Admin from "../views/Admin.vue"; -import Cart from "../views/Cart.vue"; -import Checkout from "../views/Checkout.vue"; -import Privacy from "../views/Privacy.vue"; - -Vue.use(VueRouter); - -const routes = [ - { - path: "/", - name: "Home", - component: Home - }, - { - path: "/admin", - name: "Administration", - component: Admin - }, - { - path: "/cart", - name: "Cart", - component: Cart - }, - { - path: "/checkout", - name: "Checkout", - component: Checkout - }, - { - path: "/faq", - name: "F.A.Q.", - component: Faq - }, - { - path: "/care", - name: "Care & Handling", - component: Care - }, - { - path: "/privacy", - name: "Privacy", - component: Privacy - } -]; - -const router = new VueRouter({ - mode: "history", - base: process.env.BASE_URL, - routes, - linkExactActiveClass: "is-active" -}); - -export default router; diff --git a/iridescence/src/store/index.js b/iridescence/src/store/index.js deleted file mode 100644 index 709dc79..0000000 --- a/iridescence/src/store/index.js +++ /dev/null @@ -1,118 +0,0 @@ -import Vue from "vue"; -import Vuex from "vuex"; -import Dichroism from "@/api/dichroism.js"; - -Vue.use(Vuex); - -let dichroism = new Dichroism(); - -export default new Vuex.Store({ - state: { - searchTerm: "", - products: [], - cart: {}, - busy: false, - compare: a => (a.featured ? -1 : 1), - productDetailId: 0 - }, - getters: { - products(state) { - let term = state.searchTerm.toLowerCase(); - return state.products - .filter(item => { - return [item.id, item.name, item.description, item.category] - .join("") - .toLowerCase() - .includes(term); - }) - .sort(state.compare); - }, - cartTotal(state) { - let cents = state.products - .filter(p => state.cart[p.id]) - .map(p => p.cents * state.cart[p.id]) - .reduce((acc, cur) => acc + cur, 0); - return "$ " + (cents / 100).toFixed(2); - } - }, - mutations: { - toggleBusy(state) { - state.busy = !state.busy; - }, - productDetailId(state, id) { - state.productDetailId = id; - }, - cartItem(state, { id, by }) { - let newCount = 1; - if (state.cart[id]) { - newCount = state.cart[id] += by; - //if (newCount <= 0) { - // // remove from cart entirely - // delete state.cart[id]; - // return; - //} - //state.cart = { - // ...state.cart, - // [id]: newCount - } - - let cart = { - ...state.cart - }; - - if (newCount) { - cart[id] = newCount; - } else { - // remove entirely - delete cart[id]; - } - state.cart = cart; - }, - removeItemFromCart(state, id) { - if (state.cart[id]) { - let cart = { - ...state.cart - }; - delete cart[id]; - state.cart = cart; - } - }, - compare(state, compare) { - state.compare = compare; - }, - searchTerm(state, term) { - state.searchTerm = term; - }, - setProducts(state, products) { - if (products) { - state.products = products; - } - } - }, - actions: { - async refreshProducts({ commit }) { - commit("toggleBusy"); - const products = await dichroism.getProducts(); - commit("setProducts", products); - commit("toggleBusy"); - }, - async updateProduct({ commit, dispatch }, product) { - commit("toggleBusy"); - await dichroism.updateProduct(product); - dispatch("refreshProducts"); - commit("toggleBusy"); - }, - async createProduct({ commit, dispatch }, product) { - commit("toggleBusy"); - await dichroism.createProduct(product); - dispatch("refreshProducts"); - commit("toggleBusy"); - }, - async createPhotoSet({ commit }, file) { - commit("toggleBusy"); - const photoSet = await dichroism.createPhoto(file); - commit("toggleBusy"); - return photoSet; - } - } -}); diff --git a/iridescence/src/views/About.vue b/iridescence/src/views/About.vue deleted file mode 100644 index 87c483a..0000000 --- a/iridescence/src/views/About.vue +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/iridescence/src/views/Admin.vue b/iridescence/src/views/Admin.vue deleted file mode 100644 index eedafc7..0000000 --- a/iridescence/src/views/Admin.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - diff --git a/iridescence/src/views/Care.vue b/iridescence/src/views/Care.vue deleted file mode 100644 index ba49786..0000000 --- a/iridescence/src/views/Care.vue +++ /dev/null @@ -1,10 +0,0 @@ - - diff --git a/iridescence/src/views/Cart.vue b/iridescence/src/views/Cart.vue deleted file mode 100644 index 26949f5..0000000 --- a/iridescence/src/views/Cart.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - diff --git a/iridescence/src/views/Checkout.vue b/iridescence/src/views/Checkout.vue deleted file mode 100644 index 01519ee..0000000 --- a/iridescence/src/views/Checkout.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/iridescence/src/views/Faq.vue b/iridescence/src/views/Faq.vue deleted file mode 100644 index 0497393..0000000 --- a/iridescence/src/views/Faq.vue +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/iridescence/src/views/Home.vue b/iridescence/src/views/Home.vue deleted file mode 100644 index b63f16f..0000000 --- a/iridescence/src/views/Home.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/iridescence/src/views/Privacy.vue b/iridescence/src/views/Privacy.vue deleted file mode 100644 index 61b0269..0000000 --- a/iridescence/src/views/Privacy.vue +++ /dev/null @@ -1,401 +0,0 @@ - -- cgit v1.2.3