Open delindell opened 4 years ago
Bootstrap card info:
Example object:
const merchItems = [{type: 'album', imgUrl: 'https://images.unsplash.com/photo-1566518447972-1fa5bbf1a909?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80', price: 5000}];
User Story:
When the page loads I want to see cards, printed from the domString, containing an image of the item, description and price.
AC:
WHEN the merchandise page loads THEN I should see all the merchandise AND all the merchandise should appear on individual cards AND the cards should appear three to a row
Dev Notes:
<div>
that contains anid="merchCards"
and aclass="d-flex flex-wrap"
merchItems
that contains 3 objects of each item with the typealbum
,tShirt
,hat
.merchPrinter
function that takes in themerchItems
, loops over the array and builds adomString
that contains the image, title in<h2>
tag, description, price and purchase button for the items in their own individual<p>
tags.<div>
container should have a class ofmerch-card col-4
and callsprintToDom
function.purchaseButton
function that has analert()
. Thealert()
should say"This item has been added to your cart!"