From 8fde053afb1536dc93273294ae0e3b9268cfa88c Mon Sep 17 00:00:00 2001 From: Josue Benjamin Date: Wed, 4 Jan 2023 17:20:45 -0300 Subject: [PATCH 1/7] SleepOutside first commit --- package-lock.json | 4 +-- package.json | 1 - src/cart/index.html | 26 +--------------- src/checkout/index.html | 23 +------------- src/json/sleeping-bags.json | 60 ++++++++++--------------------------- src/json/tents.json | 2 +- 6 files changed, 20 insertions(+), 96 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ff6702c..fc11712d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "outside", - "version": "1.1.0", + "version": "2.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "outside", - "version": "1.1.0", + "version": "2.0.0", "license": "ISC", "devDependencies": { "eslint": "^8.26.0", diff --git a/package.json b/package.json index 829e444f..1e71840a 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "lint": "eslint *.js src/**/*.js", "format": "prettier --ignore-path ./.gitignore --write \"./**/*.{html,json,js,ts,css}\"", "test": "jest" - }, "author": "Shane Thompson", "license": "ISC", diff --git a/src/cart/index.html b/src/cart/index.html index 659c2bb4..7f01e305 100644 --- a/src/cart/index.html +++ b/src/cart/index.html @@ -1,9 +1,7 @@ - - @@ -13,31 +11,22 @@ - -
- -
-
-

My Cart

    - -
-
-
- - - diff --git a/src/checkout/index.html b/src/checkout/index.html index 87645865..60615e73 100644 --- a/src/checkout/index.html +++ b/src/checkout/index.html @@ -1,9 +1,7 @@ - - @@ -11,30 +9,22 @@ Sleep Outside | Checkout - -
- -
-
-

Review & Place your Order

-
-
- - - diff --git a/src/json/sleeping-bags.json b/src/json/sleeping-bags.json index 6bf7a124..5d015123 100644 --- a/src/json/sleeping-bags.json +++ b/src/json/sleeping-bags.json @@ -35,9 +35,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -93,9 +91,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "LH" - ] + "ZIPPER": ["LH"] }, "Colors": [ { @@ -196,12 +192,8 @@ ] }, "SizesAvailable": { - "LENGTH": [ - "REG" - ], - "ZIPPER": [ - "R" - ] + "LENGTH": ["REG"], + "ZIPPER": ["R"] }, "Colors": [ { @@ -323,9 +315,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -370,9 +360,7 @@ "ExtraImages": null }, "SizesAvailable": { - "HAND": [ - "LH" - ] + "HAND": ["LH"] }, "Colors": [ { @@ -422,9 +410,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -474,9 +460,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -526,9 +510,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -578,9 +560,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -630,9 +610,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -730,9 +708,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -1018,9 +994,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "L" - ] + "ZIPPER": ["L"] }, "Colors": [ { @@ -1070,9 +1044,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "R" - ] + "ZIPPER": ["R"] }, "Colors": [ { @@ -1122,9 +1094,7 @@ ] }, "SizesAvailable": { - "ZIPPER": [ - "RH" - ] + "ZIPPER": ["RH"] }, "Colors": [ { diff --git a/src/json/tents.json b/src/json/tents.json index 98029223..d24bd8bc 100644 --- a/src/json/tents.json +++ b/src/json/tents.json @@ -99,7 +99,7 @@ { "ColorCode": "01", "ColorName": "Pale Pumpkin/Terracotta" - } + } ], "DescriptionHtmlSimple": "Excess. Get out and enjoy nature with Marmot's Ajax tent, featuring a smart design with durable, waterproof construction and two doors for easy access.", "SuggestedRetailPrice": 275.0, From d6665fd777be01414a375e4f811c8b40ab489000 Mon Sep 17 00:00:00 2001 From: Josue Benjamin Date: Wed, 4 Jan 2023 17:32:52 -0300 Subject: [PATCH 2/7] fixing semicolons for single colons --- src/index.html | 96 ++++++++++++++++++++++++++--------------------- src/js/cart.js | 24 ++++++------ src/js/product.js | 12 +++--- vite.config.js | 22 +++++------ 4 files changed, 82 insertions(+), 72 deletions(-) diff --git a/src/index.html b/src/index.html index 35ac63ce..1b84b061 100644 --- a/src/index.html +++ b/src/index.html @@ -9,20 +9,31 @@
@@ -55,48 +66,47 @@

Top Products

diff --git a/src/js/cart.js b/src/js/cart.js index a2fb3d8e..ea1a081c 100644 --- a/src/js/cart.js +++ b/src/js/cart.js @@ -1,25 +1,25 @@ -import { getLocalStorage } from "./utils.mjs"; +import { getLocalStorage } from './utils.mjs'; function renderCartContents() { - const cartItems = getLocalStorage("so-cart"); + const cartItems = getLocalStorage('so-cart'); const htmlItems = cartItems.map((item) => cartItemTemplate(item)); - document.querySelector(".product-list").innerHTML = htmlItems.join(""); + document.querySelector('.product-list').innerHTML = htmlItems.join(''); } function cartItemTemplate(item) { - const newItem = `
  • - + const newItem = `
  • + ${item.Name} - -

    ${item.Name}

    +
    +

    ${item.Name}

    -

    ${item.Colors[0].ColorName}

    -

    qty: 1

    -

    $${item.FinalPrice}

    +

    ${item.Colors[0].ColorName}

    +

    qty: 1

    +

    $${item.FinalPrice}

  • `; return newItem; diff --git a/src/js/product.js b/src/js/product.js index 0b8d0aa6..85042984 100644 --- a/src/js/product.js +++ b/src/js/product.js @@ -1,10 +1,10 @@ -import { setLocalStorage } from "./utils.mjs"; -import ProductData from "./ProductData.mjs"; +import { setLocalStorage } from './utils.mjs'; +import ProductData from './ProductData.mjs'; -const dataSource = new ProductData("tents"); +const dataSource = new ProductData('tents'); function addProductToCart(product) { - setLocalStorage("so-cart", product); + setLocalStorage('so-cart', product); } // add to cart button event handler async function addToCartHandler(e) { @@ -14,5 +14,5 @@ async function addToCartHandler(e) { // add listener to Add to Cart button document - .getElementById("addToCart") - .addEventListener("click", addToCartHandler); + .getElementById('addToCart') + .addEventListener('click', addToCartHandler); diff --git a/vite.config.js b/vite.config.js index 4a5eef38..e10d027a 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,28 +1,28 @@ -import { resolve } from "path"; -import { defineConfig } from "vite"; +import { resolve } from 'path'; +import { defineConfig } from 'vite'; export default defineConfig({ - root: "src/", + root: 'src/', build: { - outDir: "../dist", + outDir: '../dist', rollupOptions: { input: { - main: resolve(__dirname, "src/index.html"), - cart: resolve(__dirname, "src/cart/index.html"), - checkout: resolve(__dirname, "src/checkout/index.html"), + main: resolve(__dirname, 'src/index.html'), + cart: resolve(__dirname, 'src/cart/index.html'), + checkout: resolve(__dirname, 'src/checkout/index.html'), product1: resolve( __dirname, - "src/product_pages/cedar-ridge-rimrock-2.html" + 'src/product_pages/cedar-ridge-rimrock-2.html' ), - product2: resolve(__dirname, "src/product_pages/marmot-ajax-3.html"), + product2: resolve(__dirname, 'src/product_pages/marmot-ajax-3.html'), product3: resolve( __dirname, - "src/product_pages/northface-alpine-3.html" + 'src/product_pages/northface-alpine-3.html' ), product4: resolve( __dirname, - "src/product_pages/northface-talus-4.html" + 'src/product_pages/northface-talus-4.html' ), }, }, From 21f8adf5342eb4d714c9871d9c4363ce087d73ed Mon Sep 17 00:00:00 2001 From: IMUST1995 Date: Wed, 4 Jan 2023 13:50:44 -0700 Subject: [PATCH 3/7] first commit Zeir --- src/js/cart.js | 6 +++--- src/js/product.js | 12 ++++++------ vite.config.js | 22 +++++++++++----------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/js/cart.js b/src/js/cart.js index ea1a081c..09eb7f8a 100644 --- a/src/js/cart.js +++ b/src/js/cart.js @@ -1,9 +1,9 @@ -import { getLocalStorage } from './utils.mjs'; +import { getLocalStorage } from "./utils.mjs"; function renderCartContents() { - const cartItems = getLocalStorage('so-cart'); + const cartItems = getLocalStorage("so-cart"); const htmlItems = cartItems.map((item) => cartItemTemplate(item)); - document.querySelector('.product-list').innerHTML = htmlItems.join(''); + document.querySelector(".product-list").innerHTML = htmlItems.join(""); } function cartItemTemplate(item) { diff --git a/src/js/product.js b/src/js/product.js index 85042984..0b8d0aa6 100644 --- a/src/js/product.js +++ b/src/js/product.js @@ -1,10 +1,10 @@ -import { setLocalStorage } from './utils.mjs'; -import ProductData from './ProductData.mjs'; +import { setLocalStorage } from "./utils.mjs"; +import ProductData from "./ProductData.mjs"; -const dataSource = new ProductData('tents'); +const dataSource = new ProductData("tents"); function addProductToCart(product) { - setLocalStorage('so-cart', product); + setLocalStorage("so-cart", product); } // add to cart button event handler async function addToCartHandler(e) { @@ -14,5 +14,5 @@ async function addToCartHandler(e) { // add listener to Add to Cart button document - .getElementById('addToCart') - .addEventListener('click', addToCartHandler); + .getElementById("addToCart") + .addEventListener("click", addToCartHandler); diff --git a/vite.config.js b/vite.config.js index e10d027a..4a5eef38 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,28 +1,28 @@ -import { resolve } from 'path'; -import { defineConfig } from 'vite'; +import { resolve } from "path"; +import { defineConfig } from "vite"; export default defineConfig({ - root: 'src/', + root: "src/", build: { - outDir: '../dist', + outDir: "../dist", rollupOptions: { input: { - main: resolve(__dirname, 'src/index.html'), - cart: resolve(__dirname, 'src/cart/index.html'), - checkout: resolve(__dirname, 'src/checkout/index.html'), + main: resolve(__dirname, "src/index.html"), + cart: resolve(__dirname, "src/cart/index.html"), + checkout: resolve(__dirname, "src/checkout/index.html"), product1: resolve( __dirname, - 'src/product_pages/cedar-ridge-rimrock-2.html' + "src/product_pages/cedar-ridge-rimrock-2.html" ), - product2: resolve(__dirname, 'src/product_pages/marmot-ajax-3.html'), + product2: resolve(__dirname, "src/product_pages/marmot-ajax-3.html"), product3: resolve( __dirname, - 'src/product_pages/northface-alpine-3.html' + "src/product_pages/northface-alpine-3.html" ), product4: resolve( __dirname, - 'src/product_pages/northface-talus-4.html' + "src/product_pages/northface-talus-4.html" ), }, }, From 7ec1b51e061f034918ba679bb738591b02d44e9c Mon Sep 17 00:00:00 2001 From: Josue Benjamin Date: Wed, 4 Jan 2023 18:02:20 -0300 Subject: [PATCH 4/7] josue's name --- team.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 team.txt diff --git a/team.txt b/team.txt new file mode 100644 index 00000000..87be67b6 --- /dev/null +++ b/team.txt @@ -0,0 +1,3 @@ +Trello link: https://trello.com/b/KflaqxFD/wdd-330 + +Josue Centurion \ No newline at end of file From 4a0573f6920adbaaefd0ab4a63e8a7e835006f03 Mon Sep 17 00:00:00 2001 From: diannaqui Date: Wed, 4 Jan 2023 14:03:14 -0700 Subject: [PATCH 5/7] DQ --- team.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/team.txt b/team.txt index 87be67b6..1ec39183 100644 --- a/team.txt +++ b/team.txt @@ -1,3 +1,4 @@ Trello link: https://trello.com/b/KflaqxFD/wdd-330 -Josue Centurion \ No newline at end of file +Josue Centurion +Diana Quispe \ No newline at end of file From 8ee888873c882ab7a2307f7654c672cbb00e0069 Mon Sep 17 00:00:00 2001 From: IMUST1995 Date: Wed, 4 Jan 2023 14:04:31 -0700 Subject: [PATCH 6/7] adding my name zeir --- team.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/team.txt b/team.txt index 1ec39183..c974df46 100644 --- a/team.txt +++ b/team.txt @@ -1,4 +1,5 @@ Trello link: https://trello.com/b/KflaqxFD/wdd-330 Josue Centurion -Diana Quispe \ No newline at end of file +Diana Quispe +Zeir Braidi \ No newline at end of file From a6c348b70ff3724307a41de4d32c143e1b696aac Mon Sep 17 00:00:00 2001 From: IMUST1995 Date: Wed, 4 Jan 2023 14:27:20 -0700 Subject: [PATCH 7/7] zeirbraidi.txt branch_test --- zeirbraidi.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 zeirbraidi.txt diff --git a/zeirbraidi.txt b/zeirbraidi.txt new file mode 100644 index 00000000..992e2de1 --- /dev/null +++ b/zeirbraidi.txt @@ -0,0 +1 @@ +Zeir Braidi \ No newline at end of file