From e417faf49b954a8be437399ef7c82fac1a66c093 Mon Sep 17 00:00:00 2001 From: Jimmy Bell <jimmy.bell@polymtl.ca> Date: Sat, 5 Dec 2020 10:23:09 -0500 Subject: [PATCH] Ajout au panier WIP --- css/styles.css | 14 +++++++++++++- html/panier.html | 23 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/css/styles.css b/css/styles.css index fa794e7..048baa5 100644 --- a/css/styles.css +++ b/css/styles.css @@ -256,7 +256,7 @@ iframe { outline: none; } -.listeRepas{ +.listeRepas { height: 500px; overflow-y: scroll; } @@ -330,6 +330,18 @@ iframe { height: 307px; } +.panierOutline { + border-radius: 25px; + background-color: #F2F2F2; + padding-left: 67px; + padding-top: 17px; + padding-bottom: 17px; + width: 895px; + height: 66px; + margin-left: 119px; + margin-top:1em; +} + .search-button{ border-radius: 5px; border-width: 0px; diff --git a/html/panier.html b/html/panier.html index 157756b..c98623b 100644 --- a/html/panier.html +++ b/html/panier.html @@ -9,4 +9,27 @@ <br> <p class="titleSection">Mon panier</p> </body> +<script src="../scripts/readJson.js"></script> + +<script> + function retrievePanier(){ + var panierElems = sessionStorage.getItem('panier'); + console.log(index) + if(panierElems != null){ + var obj = httpGetJson(); + var items = panierElems.split(" "); + for (let i = 0; i < items.length; i++){ + var repasCombFrigo = items[i].split("-"); + builtUpHTML += '<div class="panierOutline">' + + '<span class="bold">' + obj.array[repasCombFrigo[0]].repas[repasCombFrigo[1]].nom + '</span><br>' + + 'Provenance: '+obj.array[repasCombFrigo[0]] + '<br>' + + '</div>'; + } + builtUpHTML += '</div>'; + document.getElementById('listeRepas').innerHTML = builtUpHTML; + sessionStorage.removeItem('frigoIndex'); + } + } +</script> + </html> \ No newline at end of file -- GitLab