Stellar-Junior-Dev / cocktailMasters-cosmin

0 stars 0 forks source link

Navigate to detailsPage using localStorage #16

Open emilianraduu opened 1 year ago

emilianraduu commented 1 year ago

Documentation:

To navigate to the "detailsPage" please modify the "divCard" element in the renderCard(item) function to be able to change window location to /detailsPage/detailsPage.html

To display the data, please before using window.location to navigate, add the localStorage.set("selectedCard", JSON.stringify(card)) to set the current selected card, and in the "detailsPage" use the .get method to get the data. The above tutorials are good for understanding the concepts.

CrayolaEater commented 1 year ago

Also you also have to make the navigation work for all the other drinks, for that you need to add in homePage/script.js the detail info to all the other drinks (like you did for 'oldFashioned'). The info can be the same for now and you can modify later to make it unique for each drink.