fix: Erro na pratileira consertado e Otimização CSS

This commit is contained in:
José Carlos Lins 2022-12-16 19:02:40 -03:00
parent fc17bf1786
commit 6f6e8e79d1
7 changed files with 31 additions and 62 deletions

View File

@ -3,7 +3,6 @@ import { Container } from "m3-utils";
import "slick-carousel";
import Header from "./components/Header";
import Footer from "./components/Footer";
import Content from "./components/content";
const m3Checkout = new Container({
appName: "m3-checkout",

View File

@ -1,43 +0,0 @@
import { hasData } from "jquery";
import { waitElement } from "m3-utils";
export default class Content {
constructor() {
this.init();
}
async selectors() {
this.titleMyCart = await waitElement("#cart-title");
this.h2CartEmpty = await waitElement(".empty-cart-title", {
timeout: 5000,
interval: 1000,
});
this.btnCartEmpty = await waitElement("#cart-choose-products", {
timeout: 5000,
interval: 1000,
});
this.cartContent = await waitElement(".cart");
}
async init() {
await this.selectors();
await this.insertHTML();
await this.modificadedHTML();
}
async insertHTML() {
this.h2CartEmpty.innerHTML = `Seu carrinho está vazio`;
this.btnCartEmpty.innerHTML = `Continuar Comprando`;
}
// async modificadedHTML() {
// let monitorDisplay = this.cartContent.style.display;
// window.sty
// if (this.cartContent.style.display === "none") {
// console.log("oioioi");
// this.titleMyCart.classList.add("cartTitleInvisible");
// } else if (this.titleMyCart.classList.contains("cartTitleInvisible")) {
// this.titleMyCart.classList.remove("cartTitleInvisible");
// }
// }
}

View File

@ -33,14 +33,19 @@ export default class Footer {
if (window.location.href != "https://m3academy.myvtex.com/checkout/#/cart") {
pratileira.classList.add("elementInvisible");
} else {
pratileira.classList.remove("elementInvisible");
}
window.addEventListener("hashchange", () => {
if (window.location.hash == "#/cart") {
this.pratileira.classList.remove("elementInvisible");
if (window.location.hash == "#/cart" && target.style.display === "block") {
this.pratileira.classList.add("elementInvisible");
titleCart.classList.add("elementInvisible");
this.api();
} else {
} else if (window.location.hash != "#/cart") {
pratileira.classList.add("elementInvisible");
} else {
pratileira.classList.remove("elementInvisible");
}
});
@ -108,9 +113,11 @@ export default class Footer {
<h4 class="title-item-pratileira">${dataItem.productName}</h4>
</figure>
<ol class="wrapper-list-variables">
${dataItem.items.map((variableItem) => {
${dataItem.items
.map((variableItem) => {
return `<li class="variable-pratileira">${variableItem.name}</li>`;
})}
})
.join("")}
</ol>
<button class="btn-pratileira">Ver Produto</button>
</li>`;

View File

@ -1235,10 +1235,6 @@
box-shadow: none;
color: #303030;
padding: 14px 12px;
// svg path {
// fill: #d8c8ac;
// }
}
label.vtex-omnishipping-1-x-leanShippingOption {

View File

@ -1212,10 +1212,6 @@
color: $color-black-neutra;
text-decoration: none;
}
@media screen and (max-width: 1024px) {
// margin-top: 48px;
}
}
.coupon-column {

View File

@ -40,10 +40,6 @@ body {
@media screen and (max-width: 1024px) {
width: 100%;
}
.checkout-container {
// padding-top: 11px;
}
}
@media screen and (max-width: 1024px) {

View File

@ -324,6 +324,24 @@
font-size: 0;
@media (min-width: 1025px) and (max-width: 1220px) {
.card-list-pratileira {
.wrapper-list-variables {
width: 100%;
height: 61px;
display: inline-block;
text-align: center;
.variable-pratileira {
display: inherit;
word-wrap: normal;
max-height: auto;
min-width: max-content;
}
}
}
}
@media (max-width: 1024px) {
width: 100%;
padding: 0 8px;