diff --git a/Shop/img/default.jpg b/Shop/img/default.jpg new file mode 100644 index 0000000..af3ffa7 Binary files /dev/null and b/Shop/img/default.jpg differ diff --git a/Shop/index.html b/Shop/index.html new file mode 100644 index 0000000..c10c206 --- /dev/null +++ b/Shop/index.html @@ -0,0 +1,18 @@ + + + + + Интернет-магазин + + + +
+ +
+
+
+
+ + + + diff --git a/Shop/js/main.js b/Shop/js/main.js new file mode 100644 index 0000000..9f6b832 --- /dev/null +++ b/Shop/js/main.js @@ -0,0 +1,25 @@ +const products = [ + {id: 1, title: 'Notebook', price: 20000}, + {id: 2, title: 'Mouse', price: 1500}, + {id: 3, title: 'Keyboard', price: 5000}, + {id: 4, title: 'Gamepad', price: 4500}, +]; + +const renderProduct = ({title, price} , img = 'img/default.jpg') => { + return `
+ ${title} +

${title}

+

${price}

+ +
`; +}; + +const renderProducts = list => { + //const productList = list.map( product => renderProduct(product) ); + const productList = list.map( product => { + return renderProduct(product); + }); + document.querySelector('.products').innerHTML = productList.join(' '); +} + +renderProducts(products); diff --git a/Shop/styles/main.css b/Shop/styles/main.css new file mode 100644 index 0000000..3f0cb14 --- /dev/null +++ b/Shop/styles/main.css @@ -0,0 +1,61 @@ +* { + margin: 0; + padding: 0; +} + +header { + min-height: 60px; + background-color: aqua; + position: relative; +} + +.btn-cart { + position: absolute; + display: block; + right: 12px; + top: 10px; + width: 90px; + height: 40px; + +} + +.products { + min-height: 100px; + border: 1px solid black; +} + +.product-item { + margin: 15px 15px; + background-color: azure; + border: 1px solid black; + box-shadow: 0 0 10px rgba(0,0,0,0.5); +} + +.product-item img { + display: block; + max-height: 100px; + margin: 10px 10px; + float: left; + border-radius: 10%; +} + +.product-item h3 { + text-align: center; + margin-top: 10px; + font-style: oblique; +} + +.product-item p { + text-align: center; + margin-top: 10px; + color: royalblue; + font-style: italic; +} + +.product-item .by-btn { + display: block; + text-align: center; + height: 40px; + width: 150px; + margin: 10px auto; +} \ No newline at end of file