develop #11

Merged
HenriqueSantosSantana merged 37 commits from develop into main 2022-12-26 17:04:35 +00:00
5 changed files with 141 additions and 36 deletions
Showing only changes of commit 9020914b33 - Show all commits

View File

@ -15,15 +15,16 @@ export default class Footer {
await this.selectors(); await this.selectors();
this.innerToPayments(); this.innerToPayments();
this.innerDevelopedBy(); this.innerDevelopedBy();
// this.onUpdate(); this.onUpdate();
} }
async selectors() { async selectors() {
//Para verificar se o carrinho está vazio e remover a prateleira de produtos: //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 // vocês devem olhar a doc fornecida no Desafio para aprender a usar o waitElement
this.checkoutVazio = await waitElement(".empty-cart-content"); this.checkoutEmpty = await waitElement(".empty-cart-content");
this.paymentContainer = await waitElement(".footerCheckout__stamps"); this.paymentContainer = await waitElement(".footerCheckout__stamps");
this.developedByContainer = await waitElement(".footerCheckout__developedBy"); this.developedByContainer = await waitElement(".footerCheckout__developedBy");
this.checkoutContainer = await waitElement(".container-main");
} }
innerToPayments() { innerToPayments() {
@ -83,16 +84,33 @@ export default class Footer {
//Função qeu fará a verificação se o carrinho está vazio para remover a prateleira de produtos: //Função qeu fará a verificação se o carrinho está vazio para remover a prateleira de produtos:
// vocês devem olhar a doc fornecida no Desafio para aprender a usar a MutationObserver // vocês devem olhar a doc fornecida no Desafio para aprender a usar a MutationObserver
// sempre que o carrinho estiver vazio o elemento chcekoutVazio fica display: none e isso pode ser usado como atributo para a MutationObserver // sempre que o carrinho estiver vazio o elemento chcekoutVazio fica display: none e isso pode ser usado como atributo para a MutationObserver
let target = this.checkoutVazio;
if (this.checkoutEmpty && this.checkoutContainer) {
if (this.checkoutContainer.classList.contains("container-cart-fill")) {
this.checkoutContainer.classList.remove("container-cart-fill");
} else {
this.checkoutContainer.classList.add("container-cart-fill");
}
let target = this.checkoutEmpty;
let config = { childList: true, attributes: true }; let config = { childList: true, attributes: true };
let observer = new MutationObserver((mutations) => { let observer = new MutationObserver((mutations) => {
mutations.forEach(function (mutation) { for (let i = 0; i < mutations.length; i++) {
console.log(mutation.type); if (mutations[i].attributeName === "style") {
}); if (this.checkoutContainer.classList.contains("container-cart-fill")) {
this.checkoutContainer.classList.remove("container-cart-fill");
} else {
this.checkoutContainer.classList.add("container-cart-fill");
}
break;
}
}
}); });
observer.observe(target, config); observer.observe(target, config);
} }
}
async addCarrossel() { async addCarrossel() {
const elemento = await waitElement("#my-element"); const elemento = await waitElement("#my-element");
$(elemento).slick({ $(elemento).slick({

View File

@ -1,34 +1,116 @@
@mixin btn-secondary {
display: flex;
align-items: center;
justify-content: center;
border: 1px solid $clr-common-black;
border-radius: 0;
font-weight: 400;
font-family: $font-family-200;
color: $clr-common-black;
background-color: $clr-common-white;
}
.container-cart {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
#cart-title {
display: none !important;
}
.cart-template,
.checkout-container {
min-height: auto;
}
.checkout-container {
padding: 0 16px;
}
.cart-template {
margin: 0;
}
@media screen and (min-width: 375px) {
.checkout-container {
width: fluid(300px, 375px);
margin: 0 auto;
}
.link-choose-products {
width: fluid(250px, 300px);
max-width: 250px;
margin: 0 auto;
}
}
@media screen and (min-width: 1025px) {
.checkout-container {
width: fluid(400px, 1280px);
padding: 0;
}
.link-choose-products {
width: fluid(327px, 400px);
max-width: none;
}
}
}
.empty-cart {
&-message {
display: none;
}
}
.empty-cart { .empty-cart {
font-family: $font-family-100; font-family: $font-family-100;
&-content { &-content {
color: $clr-gray-600; color: $clr-gray-600;
text-align: center; text-align: center;
@include mq(md, max) { .empty-cart-title {
padding: 0 16px; font-size: 0px;
&::before {
content: "Seu carrinho está vazio.";
text-align: center;
font-size: 18px;
text-transform: uppercase;
} }
} }
&-title { @media screen and (min-width: 1024px) {
font-size: 20px; padding: 0;
}
@media screen and (min-width: 1280px) {
.empty-cart-title {
&::before {
font-size: 24px;
}
}
}
} }
&-links { &-links {
.link-choose-products { .link-choose-products {
background: $clr-gray-600; @include btn-secondary();
border: none;
border-radius: 5px;
transition: ease-in 0.22s all; transition: ease-in 0.22s all;
outline: none; font-size: 0px;
font-family: $font-family-100; padding: 16px 0;
font-style: normal;
font-weight: 500; &::before {
content: "Continuar Comprando";
font-size: 14px; font-size: 14px;
font-style: normal;
line-height: 16px; line-height: 16px;
text-align: center;
letter-spacing: 0.05em; letter-spacing: 0.05em;
color: $clr-common-white;
text-transform: uppercase; text-transform: uppercase;
}
&:hover { &:hover {
background: lighten($clr-gray-600, 5); background: lighten($clr-gray-600, 5);

View File

@ -3,8 +3,6 @@
@import "./checkout-pagamento"; @import "./checkout-pagamento";
@import "./checkout-autenticacao"; @import "./checkout-autenticacao";
body { body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -34,10 +32,6 @@ body {
padding-left: 0; padding-left: 0;
} }
} }
.container-order-form,
.container-cart {
width: 80%;
}
} }
.btn-success { .btn-success {

View File

@ -1,4 +1,15 @@
/* _header.scss */ /* _header.scss */
body {
margin: 0;
padding: 0;
}
body * {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body :where(ul, li, ol) { body :where(ul, li, ol) {
list-style: none; list-style: none;
margin: 0; margin: 0;

View File

@ -27,7 +27,7 @@ $grid-breakpoints: (
xs: 280, xs: 280,
sm: 375px, sm: 375px,
md: 600px, md: 600px,
lg: 1024px, lg: 1025px,
xl: 1280px, xl: 1280px,
xxl: 2500px, xxl: 2500px,
) !default; ) !default;