commit final

This commit is contained in:
Nathalia Sardou 2022-12-18 23:36:15 -03:00
parent 101a190c15
commit 05e1c0cb83
7 changed files with 170 additions and 96 deletions

View File

@ -8,22 +8,22 @@ export default class Footer {
async init() {
await this.selectors();
this.createPaymentsIcons();
this.createVtexpciIcon();
this.createDevIcons();
this.onUpdate();
this.Icons();
this.vtexIcons();
this.devIcons();
this.update();
this.events();
}
events() {
window.addEventListener("hashchange", () => {
this.onUpdate();
if (window.location.hash == "#/cart" && this.checkoutVazio.style.display == "none") {
this.listaPrateleira.style.display = "flex";
this.update();
if (window.location.hash == "#/cart" && this.cktVazio.style.display == "none") {
this.prateleira.style.display = "flex";
this.titleSlick.style.display = "block";
}
if (window.location.hash != "#/cart") {
this.listaPrateleira.style.display = "none";
this.prateleira.style.display = "none";
this.titleSlick.style.display = "none";
}
});
@ -33,36 +33,36 @@ export default class Footer {
}
async selectors() {
this.checkoutVazio = await waitElement(".empty-cart-content");
this.checkoutAtivo = await waitElement(".checkout-container");
this.cktVazio = await waitElement(".empty-cart-content");
this.cktAtivo = await waitElement(".checkout-container");
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.titulo = await waitElement(".transactions-container");
this.cartTitulo = await waitElement("#cart-title");
this.iconsDev = await waitElement(".footerCheckout__developedBy");
this.prateleira = await waitElement(".footerCheckout__prateleira");
this.title = await waitElement(".transactions-container");
this.carttitle = await waitElement("#cart-title");
this.titleSlick = await waitElement(".transactions-container");
}
onUpdate() {
let target = this.checkoutVazio;
let list = this.listaPrateleira;
let cartTitle = this.cartTitulo;
update() {
let target = this.cktVazio;
let list = this.prateleira;
let cartTitle = this.carttitle;
let slickTitle = this.titleSlick;
if (target.style.display == "none" && window.location.hash == "#/cart") {
list.style.display = "flex";
list.style.display = "block";
if (!this.listaPrateleira.classList.contains("fetch")) {
if (!this.prateleira.classList.contains("fetch")) {
this.fetchApi();
}
} else {
this.cartTitulo.style.display = "none";
this.carttitle.style.display = "none";
list.style.display = "none";
}
let config = { childList: true, attributes: true };
let observer = new MutationObserver((mutations) => {
if (!this.listaPrateleira.classList.contains("fetch")) {
if (!this.prateleira.classList.contains("fetch")) {
this.fetchApi();
}
mutations.forEach(function (mutation) {
@ -106,7 +106,7 @@ export default class Footer {
}
}
createPaymentsIcons() {
Icons() {
this.payments.innerHTML = `
<ul class="payments-icons-wrapper">
<li>
@ -169,7 +169,7 @@ export default class Footer {
`;
}
createVtexpciIcon() {
vtexIcons() {
this.vtexpci.innerHTML = `
<figure class="vtex-icon">
<img
@ -180,8 +180,8 @@ export default class Footer {
`;
}
createDevIcons() {
this.devIncons.innerHTML = `
devIcons() {
this.iconsDev.innerHTML = `
<li>
<a href="https://vtex.com/br-pt/">
<span>Powered By</span>
@ -203,7 +203,7 @@ export default class Footer {
}
async fetchApi() {
this.titulo.innerHTML = `
this.title.innerHTML = `
<h3 class="title_slick">Você também pode gostar:</h3>
`;
@ -214,7 +214,7 @@ export default class Footer {
.then((data) => {
const ul = document.createElement("ul");
ul.classList.add("slick-list");
this.listaPrateleira.appendChild(ul);
this.prateleira.appendChild(ul);
data.map((item) => {
let cores = "";
@ -236,7 +236,7 @@ export default class Footer {
<a class="itemLink" type="button" href="${item.link}">VER PRODUTO</a>
`;
ul.appendChild(li);
this.listaPrateleira.classList.add("fetch");
this.prateleira.classList.add("fetch");
});
})
.then(() => {

View File

@ -1,4 +1,4 @@
// import waitForEl from "../helpers/waitForEl";
import waitForEl from "../helpers/waitForEl";
import { waitElement } from "m3-utils";
export default class Header {

View File

@ -191,6 +191,9 @@
border-radius: 0;
border: 1px solid $color-gray7;
box-shadow: none;
display: flex;
min-width: 80%;
padding: 10px;
}
@ -241,9 +244,11 @@
}
.shp-lean {
border: 1px solid $color-gray4;
border-radius: 0;
border: 1px solid $color-gray2;
border-radius: 8px;
width: 100%;
height: 100%;
color: $color-gray8;
label {
background-color: $color-white;
box-shadow: none;
@ -251,7 +256,7 @@
padding: 8px 12px;
svg path {
fill: #d8c8ac;
fill: $color-black;
}
}
}
@ -269,9 +274,9 @@
.address-summary {
background: none;
border-color: $color-gray4;
border-radius: 0;
color: #303030;
border-color: $color-gray2;
border-radius: 8px;
color: $color-gray8;
padding: 12px;
@include mq(md, max) {

View File

@ -76,9 +76,6 @@
#go-to-cart-button a {
color: #303030;
position: relative;
bottom: 30px;
right: 5px;
text-decoration: none;
}
@ -494,7 +491,7 @@
}
.blue {
color: $color-blue;
color: $color-black;
}
label {
@ -752,11 +749,10 @@
border-color: #e5e5e5;
font-family: $font-family;
font-weight: 700;
border-bottom: 1px solid #e5e5e5;
&:last-child{
border-bottom: none;
border-top: 1px solid #e5e5e5;
&:nth-child(0){
border-top: none;
}
td {
&.empty {
display: none;
@ -830,7 +826,8 @@
font-weight: normal;
font-size: 12px;
line-height: 14px;
color: $color-blue;
color: $color-black;
text-decoration: none;
}
}

View File

@ -1,11 +1,49 @@
body .container-main.container-order-form .orderform-template.active {
.mini-cart {
width: 32.3242%;
margin-left: unset;
margin-right: 0;
float: right;
}
.orderform-template-holder {
width: 66.1132%;
}
.payment-group{
.payment-group-item-text {
background-position: right center;
background-repeat: no-repeat;
font-size: 12px;
line-height: 28px;
margin-bottom: -2px;
padding: 8px 0;
padding-right: 40px;
border: 1px solid #000;
border-radius: 8px;
color: #000;
text-align: center;
}
a{
display: none;
a:first-child{
display: none;
}
}
a[data-name='Depósito']{
display:block;
}
a[data-name='American Express']{
display:block;
}
a[data-name='Pix']{
display:block;
}
a[data-name='Boleto Bancário']{
display:block;
}
}
}

View File

@ -18,69 +18,101 @@
img {
height: 38px;
width:156px;
}
}
.progress-container{
display: flex;
justify-content: space-between;
position: relative;
margin-bottom: 25px;
margin-top: 20px;
max-width: 100%;
width: 360px;
align-items: flex-start;
align-content: flex-start;
bottom: 10px;
}
}
.progress-bar {
display: flex;
right: 31.5%;
top: 33%;
.progress-container::before{
content: '';
background-color: $color-black;
position:absolute;
top: 50%;
/*left: 0;*/
transform: translateY(-50%);
height: 1px;
width: 100.01%;
z-index: -1;
transition: 0.4s ease;
@media (max-width: 1024px) {
display: none;
}
.progress{
background-color: $color-black;
position:absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
height: 4px;
width: 0%;
z-index: -1;
transition: 0.4s ease;
@media (min-width: 2500px) {
right: 41%;
}
.containerLi {
display: flex;
position: relative;
align-items: center;
}
ul {
display: flex;
margin: 0;
gap: 100px;
list-style: none;
}
p {
margin-bottom: 60px;
margin-bottom: 0;
}
.circle{
background-color: #fff;
color: #999;
border-radius: 50%;
height: 12px;
width: 12px;
&-text {
font-family: $font-family-secundary;
font-weight: 400;
font-size: 12px;
line-height: 14px;
@media (min-width: 2500px) {
font-size: 24px;
line-height: 28px;
}
}
&-line-1,
&-line-2 {
position: absolute;
width: 169px;
top: 82%;
left: 55%;
border: 1px solid $color-black;
@media (min-width: 2500px) {
width: 240px;
top: 79%;
left: 55%;
}
}
&-line-2 {
width: 166px;
left: -223%;
@media (min-width: 2500px) {
width: 230px;
left: -143%;
}
}
&-circle-1,
&-circle-2,
&-circle-3 {
display: flex;
align-items: center;
justify-content: center;
border: 1.5px solid $color-black;
transition: 0.4 ease;
height: 10px;
width: 10px;
align-self: center;
background: $color-white;
border: 1px solid $color-black;
border-radius: 50%;
margin-left: 40%;
margin-top: 9px;
padding: 0;
@media (min-width: 2500px) {
height: 22px;
width: 22px;
}
}
.circle.active{
background-color: $color-black;
.active {
background: $color-black;
}
}
&__safeBuy {
display: flex;

View File

@ -16,6 +16,8 @@ $color-gray4: #8d8d8d;
$color-gray5: #e5e5e5;
$color-gray6: #c4c4c4;
$color-gray7: #ededed;
$color-gray8: #e0e0e0;
$color-gray9: #f0f0f0;
$color-blue: #4267b2;