diff --git a/checkout/src/arquivos/js/components/Footer.js b/checkout/src/arquivos/js/components/Footer.js index ddbfee7..a0b42cd 100644 --- a/checkout/src/arquivos/js/components/Footer.js +++ b/checkout/src/arquivos/js/components/Footer.js @@ -7,13 +7,69 @@ export default class Footer { async init() { await this.selectors(); + this.footerCheckoutInnerHTML(); + this.footerCheckoutDevelopedInnerHTML(); + this.events(); + this.onUpdate(); + this.createPaymentsIcons(); + this.createVtexpciIcon(); + this.createDevIcons(); // this.onUpdate(); } + events() { + window.addEventListener("hashchange", () => { + if (window.location.hash == "#/cart" && this.checkoutVazio.style.display == "none") { + this.list.style.display = "block"; + } + if (window.location.hash != "#/cart") { + this.list.style.display = "none"; + } + }); + addEventListener("resize", () => { + this.addCarrossel(); + }); + } async selectors() { //Para verificar se o carrinho está vazio e remover a prateleira de produtos: // vocês devem olhar a doc fornecida no Desafio para aprender a usar o waitElement + this.list = await waitElement(".footerCheckout__prateleira", { + timeout: 5000, + interval: 1000, + }); this.checkoutVazio = await waitElement(".empty-cart-content"); + this.footerCheckout = document.querySelector(".footerCheckout__stamps"); + this.footerCheckoutDeveloped = document.querySelector(".footerCheckout__developedBy"); + this.payments = await waitElement(".footerCheckout__payments"); + this.vtexpci = await waitElement(".footerCheckout__vtexpci"); + this.devIncons = await waitElement(".footerCheckout__developedBy"); + this.listaPrateleira = await waitElement(".footerCheckout__prateleira"); + this.cartTitulo = await waitElement("#cart-title") + } + async footerCheckoutInnerHTML(){ + this.footerCheckout.innerHTML = ` +
Powered by
+ +Developed by
+ +${item.items[i].name}
`; + } + const li = document.createElement("li"); + li.setAttribute("name", item.itemId); + li.classList.add("itemList"); + li.innerHTML = ` +${item.productName}
+Meu carrinho
+ + +Dados Pessoais
+ +Pagamento
+ + +