diff --git a/assets/styles.css b/assets/styles.css index 4a34b36..5ea1c98 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -25,7 +25,7 @@ body { margin: 25px 100px; float: right; border: 1px solid #d8d8d8; - padding: 10px 30px; + padding: 30px 30px; background-color: white; -webkit-box-shadow: 0px 2px 15px -12px rgba(0, 0, 0, 0.57); -moz-box-shadow: 0px 2px 15px -12px rgba(0, 0, 0, 0.57); diff --git a/index.html b/index.html index 7918f28..318bb07 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,8 @@
+ +
Cart({{ cart }})
@@ -24,10 +26,8 @@
  • {{ detail }}
-
    -
  • {{ size }}
  • -
-
{{ variant.color }}
+
{{ variant.color }}
+
diff --git a/main.js b/main.js index f238d40..fe5f42b 100644 --- a/main.js +++ b/main.js @@ -1,15 +1,23 @@ const app = Vue.createApp({ data() { return { + cart:0, product: 'Socks', image: './assets/images/socks_blue.jpg', inStock: true, details: ['50% cotton', '30% wool', '20% polyester'], - sizes: ['S', 'M', 'L', 'XL'], variants: [ - { id: 2234, color: 'green' }, - { id: 2235, color: 'blue' }, + { id: 2234, color: 'green', image: './assets/images/socks_green.jpg' }, + { id: 2235, color: 'blue', image: './assets/images/socks_blue.jpg' }, ] } + }, + methods: { + addToCart() { + this.cart += 1 + }, + updateImage(variantImage) { + this.image = variantImage + } } })