feat: carrinho vazio estilizado e responsivo

This commit is contained in:
Matheus Mariosa 2022-12-23 20:26:15 -03:00
parent 0bb7296ad5
commit 639cd513fb
4 changed files with 184 additions and 57 deletions

View File

@ -78,21 +78,29 @@ export default class Footer {
// 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; let target = this.checkoutVazio;
const title = document.getElementById("cart-title");
title.style.color = 'white';
title.style['margin-bottom'] = '110px';
let config = { childList: true, attributes: true }; let config = { childList: true, attributes: true };
let observer = new MutationObserver((mutations) => { let observer = new MutationObserver((mutations) => {
let removeClassh3 = document.getElementById("removeClassh3"); let removeClassh3 = document.getElementById("removeClassh3");
let removeClassul = document.getElementById("removeClassul"); let removeClassul = document.getElementById("removeClassul");
mutations.forEach(function (mutation) { mutations.forEach(function (mutation) {
const checkoutTarget = mutation.target.attributes.style.nodeValue; const checkoutTarget = mutation.target.attributes.style.nodeValue;
if(checkoutTarget === "display: none;"){ if(checkoutTarget === "display: none;"){
removeClassh3.classList.remove("displayNone") title.style.color = 'black';
removeClassul.classList.remove('displayNone') title.style.marginBottom = '16px';
$(removeClassul).slick("refresh") removeClassh3.classList.remove("displayNone");
removeClassul.classList.remove('displayNone');
$(removeClassul).slick("refresh");
}else if(checkoutTarget === "display: block;"){ }else if(checkoutTarget === "display: block;"){
removeClassh3.classList.add("displayNone") title.style.color = 'white';
removeClassul.classList.add("displayNone") title.style.marginBottom = '110px';
removeClassh3.classList.add("displayNone");
removeClassul.classList.add("displayNone");
} }
}); });
}); });

View File

@ -16,7 +16,7 @@
border: 3px solid $color-gray3; border: 3px solid $color-gray3;
box-sizing: border-box; box-sizing: border-box;
border-radius: 5px; border-radius: 5px;
padding: 16px; padding: 0 16px 16px;
@include mq(md, max) { @include mq(md, max) {
margin: 0px 0 25px 0; margin: 0px 0 25px 0;
@ -112,11 +112,13 @@
th { th {
color: $color-black; color: $color-black;
padding: 0 0 16px; padding: 0 0 7px;
font-style: normal; font-style: normal;
font-weight: bold; font-weight: 100;
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
font-family: 'Tenor Sans';
height: 32px;
@include mq(md, max) { @include mq(md, max) {
&.quantity-price, &.quantity-price,
@ -124,6 +126,20 @@
display: none; display: none;
} }
} }
}
td {
padding: 0;
}
.shipping-date{
font-size: 0;
}
th.shipping-date::after{
content: "Frete";
font-size: 14px;
display: flex;
flex-direction: column;
} }
.product-image { .product-image {
@ -136,8 +152,10 @@
} }
img { img {
transform: scaleX(-1);
height: 60px; height: 60px;
max-width: 100%; min-width: 60px;
max-width: 60px;
width: auto; width: auto;
@include mq(sm, max) { @include mq(sm, max) {
@ -148,14 +166,17 @@
} }
.product-name { .product-name {
padding-right: 0; width: 300px;
padding: 0 0 0 16px;
@include mq(lg, max) { @include mq(lg, max) {
width: 250px; width: 250px;
} }
a { a {
color: $color-blue; font-family: 'Tenor Sans';
color: black;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 12px; font-size: 12px;
@ -179,6 +200,7 @@
} }
td.shipping-date { td.shipping-date {
width: 94;
color: $color-gray2; color: $color-gray2;
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 14px;
@ -189,7 +211,10 @@
} }
.product-price { .product-price {
font-size: 0;
min-width: 100px; min-width: 100px;
@include mq(md, max) { @include mq(md, max) {
min-width: 78px; min-width: 78px;
} }
@ -214,6 +239,16 @@
} }
} }
} }
th.product-price::after {
content: "Unidade";
font-size: 14px;
display: flex;
flex-direction: column;
}
td.product-price{
padding-top: 8px;
}
td.quantity { td.quantity {
align-items: center; align-items: center;
@ -222,11 +257,13 @@
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
justify-content: center; justify-content: center;
margin: 6px auto 0; margin: 23px auto 0;
max-height: 38px; max-height: 38px;
max-width: 118px; max-width: 118px;
padding: 0; padding: 0;
width: max-content !important; width: max-content !important;
height: 34px;
border-radius: 8px;
@media (max-width: 490px) { @media (max-width: 490px) {
margin-left: 84px !important; margin-left: 84px !important;
@ -296,6 +333,7 @@
display: none; display: none;
} }
span { span {
text-transform: lowercase;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 14px; font-size: 14px;
@ -355,8 +393,9 @@
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 24px; font-size: 24px;
line-height: 28px; line-height: 33px;
color: $color-gray2; color: black;
font-family: 'Open Sans';
@include mq(md, max) { @include mq(md, max) {
margin-top: 0; margin-top: 0;
@ -374,7 +413,7 @@
background-color: $color-gray5; background-color: $color-gray5;
border: none; border: none;
border-radius: 5px; border-radius: 5px;
color: $color-gray2; color: black;
font-size: 16px; font-size: 16px;
letter-spacing: 0.05em; letter-spacing: 0.05em;
line-height: 19px; line-height: 19px;
@ -382,6 +421,7 @@
outline: none; outline: none;
padding: 12px 40px; padding: 12px 40px;
transition: all 0.2s linear; transition: all 0.2s linear;
cursor: pointer;
&:hover { &:hover {
background-color: lighten($color-gray5, 5); background-color: lighten($color-gray5, 5);
@ -444,12 +484,13 @@
} }
&__current { &__current {
border: 1px solid $color-blue; border: 1px solid black;
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
border-radius: 100px; border-radius: 100px;
} }
.blue { .blue {
color: $color-blue; color: black;
} }
label { label {
@ -592,23 +633,25 @@
&-totalizers { &-totalizers {
padding: 0; padding: 0;
width: 346px; width: 356px;
margin-top: 33px;
.coupon-data { .coupon-data {
#cart-link-coupon-add { #cart-link-coupon-add {
text-decoration: none; text-decoration: none;
cursor: pointer;
&:hover { &:hover {
text-decoration: underline; text-decoration: underline;
cursor: pointer; cursor: pointer;
} }
} }
span { span {
font-family: $font-family; font-family: 'Tenor Sans';
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 14px;
color: $color-blue; color: black;
text-decoration: none; text-decoration: none;
} }
} }
@ -629,8 +672,10 @@
text-decoration: underline; text-decoration: underline;
} }
.coupon-label label { .coupon-label{
margin-bottom: 12px; margin-bottom: 0;
label {
font-family: $font-family; font-family: $font-family;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
@ -638,10 +683,15 @@
line-height: 14px; line-height: 14px;
color: $color-gray2; color: $color-gray2;
cursor: none; cursor: none;
display: flex;
align-items: initial;
}
} }
.coupon-fields { .coupon-fields {
display: flex;
margin-bottom: 32px; margin-bottom: 32px;
width: 362px;
@include mq(sm, max) { @include mq(sm, max) {
span { span {
@ -657,14 +707,14 @@
} }
input { input {
border: 2px solid $color-gray3; border: 1px solid $color-gray3;
border-radius: 5px; border-radius: 5px;
box-shadow: none; box-shadow: none;
color: $color-gray4; color: $color-gray4;
font-size: 12px; font-size: 12px;
height: 34px; height: 34px;
padding: 0 12px; padding: 0 16px;
max-width: 160px; width: 170px;
@include mq(sm, max) { @include mq(sm, max) {
max-width: 100%; max-width: 100%;
@ -673,18 +723,21 @@
} }
button { button {
background: $color-black; font-family: 'Open Sans';
background: #00C8FF;
border: none; border: none;
border-radius: 5px; border-radius: 8px;
color: $color-white; color: black;
font-size: 12px; font-size: 14px;
line-height: 19px;
height: 36px; height: 36px;
letter-spacing: 1px; letter-spacing: 1px;
margin-left: 6px; margin-left: 12px;
outline: none; outline: none;
transition: all 0.2s linear; transition: all 0.2s linear;
width: 94px; width: 134px;
text-transform: uppercase; text-transform: uppercase;
cursor: pointer;
@include mq(md, max) { @include mq(md, max) {
width: 138px; width: 138px;
@ -717,7 +770,8 @@
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
color: $color-black; color: $color-black;
padding: 12px 0; padding: 10px 0;
font-family: 'Tenor Sans';
} }
&.info { &.info {
@ -733,10 +787,11 @@
tfoot { tfoot {
td.info, td.info,
td.monetary { td.monetary {
font-family: 'Open Sans';
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 18px; font-size: 18px;
line-height: 21px; line-height: 25px;
color: $color-black; color: $color-black;
} }
} }
@ -747,7 +802,7 @@
.cart-links-bottom { .cart-links-bottom {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 343px; width: 356px;
@include mq(md, max) { @include mq(md, max) {
padding: 0 16px; padding: 0 16px;
@ -755,6 +810,9 @@
float: none; float: none;
margin-bottom: 50px; margin-bottom: 50px;
} }
.cart-template .cart-links-bottom {
width: 354px;
}
@include mq(md, min) { @include mq(md, min) {
margin: 0; margin: 0;
@ -771,24 +829,25 @@
} }
a { a {
font-family: $font-family; font-family: 'Tenor Sans';
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 14px;
color: $color-blue; color: black;
} }
} }
.btn-place-order-wrapper { .btn-place-order-wrapper {
a { a {
background: $color-green; background: #00C8FF;
border: none; border: none;
border-radius: 5px; border-radius: 8px;
display: block; display: block;
font-size: 0; font-size: 0;
transition: ease-in 0.22s all; transition: ease-in 0.22s all;
padding: 12px 19px; padding: 10.5px 19px;
cursor: pointer;
&:hover { &:hover {
background-color: darken($color-green, 5); background-color: darken($color-green, 5);
@ -797,10 +856,10 @@
&:after { &:after {
content: "finalizar compra"; content: "finalizar compra";
font-family: $font-family; font-family: $font-family;
font-weight: 500; font-weight: 700;
font-size: 13px; font-size: 14px;
letter-spacing: 0.05em; letter-spacing: 0.05em;
color: $color-white; color: black;
text-transform: uppercase; text-transform: uppercase;
vertical-align: middle; vertical-align: middle;
line-height: 19px; line-height: 19px;

View File

@ -7,32 +7,84 @@
@include mq(md, max) { @include mq(md, max) {
padding: 0 16px; padding: 0 16px;
} }
.empty-cart-message{
display: none;
}
} }
&-title { &-title {
font-size: 20px; font-family: 'Open Sans';
height: 30px;
text-transform: uppercase;
font-size: 24px;
font-weight: 700;
line-height: 33px;
text-align: center;
@media only screen and (max-width: 1024px){
font-size: 18px;
line-height: 25px;
}
@media only screen and (min-width: 2500px){
height: 60px;
font-size: 48px;
line-height: 65px;
}
} }
&-links { &-links {
.link-choose-products { .link-choose-products {
background: $color-black; width: 28.614%;
border: none; background: white;
border-radius: 5px; border: 1px solid black;
transition: ease-in 0.22s all; transition: ease-in 0.22s all;
outline: none; outline: none;
font-family: $font-family; font-family: $font-family;
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 400;
font-size: 14px; font-size: 0px;
line-height: 16px; line-height: 16px;
text-align: center; text-align: center;
letter-spacing: 0.05em;
color: $color-white;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.05em;
color: black;
text-transform: uppercase;
margin: 22px 0 0;
padding: 15px;
cursor: pointer;
height: 16px;
border-radius: 0;
@media only screen and (max-width: 1024px){
line-height: 16px;
margin: 12px 0 0;
width: 26.8557966%
};
@media only screen and (max-width: 375px){
width: auto;
};
@media only screen and (min-width: 2500px){
width: 31.9335%;
line-height: 33px;
height: 36px;
};
&:hover { &:hover {
background: lighten($color-black, 5); background: lighten($color-black, 5);
} }
&::after{
content: 'continuar comprando';
font-size: 14px;
@media only screen and (min-width: 2500px){
font-size: 28px;
};
}
} }
} }
} }

View File

@ -54,6 +54,14 @@ body {
.container-order-form, .container-order-form,
.container-cart { .container-cart {
width: 80%; width: 80%;
height: 488px;
@media only screen and (max-width: 1024px){
height: 478px;
};
@media only screen and (min-width: 2500px){
height: 536.8px;
}
} }
} }