feature/optimization #1

Merged
josecarloslins merged 16 commits from feature/optimization into main 2022-12-17 01:38:19 +00:00
5 changed files with 186 additions and 127 deletions
Showing only changes of commit 6c00ea59fc - Show all commits

View File

@ -8,7 +8,7 @@ export default class Footer {
async init() { async init() {
await this.selectors(); await this.selectors();
await this.addImagesFooter(); await this.addImagesFooter();
// this.onUpdate(); await this.onUpdate();
} }
async selectors() { async selectors() {
@ -17,17 +17,23 @@ export default class Footer {
this.checkoutVazio = await waitElement(".empty-cart-content"); this.checkoutVazio = await waitElement(".empty-cart-content");
this.checkoutPayments = await waitElement(".footerCheckout__stamps"); this.checkoutPayments = await waitElement(".footerCheckout__stamps");
this.developBy = await waitElement(".footerCheckout__developedBy"); this.developBy = await waitElement(".footerCheckout__developedBy");
this.titleMyCart = await waitElement("#cart-title");
} }
onUpdate() { async onUpdate() {
//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; let target = this.checkoutVazio;
let titleCart = this.titleMyCart;
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) { mutations.forEach(function (mutation) {
console.log(mutation.type); if (target.style.display === "block") {
titleCart.classList.add("cartTitleInvisible");
} else {
titleCart.classList.remove("cartTitleInvisible");
}
}); });
}); });

View File

@ -13,10 +13,11 @@
display: none; display: none;
} }
.cart { .cart {
border: 3px solid $color-gray3; border: 1px solid $color-gray3;
box-sizing: border-box; box-sizing: border-box;
border-radius: 5px; border-radius: 5px;
padding: 16px; padding: 16px;
margin-bottom: 48px;
@include mq(md, max) { @include mq(md, max) {
margin: 0px 0 25px 0; margin: 0px 0 25px 0;
@ -107,14 +108,21 @@
.cart-items { .cart-items {
.product-item { .product-item {
padding: 16px 0; padding: 0;
}
th,
td {
padding: 0;
text-align: left;
} }
th { th {
color: $color-black; color: $color-black;
padding: 0 0 16px; padding: 0 0 16px;
font-family: $font-family-secundary;
font-style: normal; font-style: normal;
font-weight: bold; font-weight: 400;
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
@ -126,10 +134,37 @@
} }
} }
th.shipping-date {
&::before {
content: "Frete";
}
}
th.product-price {
&::before {
content: "Unidade";
}
}
th.shipping-date,
th.product-price {
font-size: 0;
line-height: 0;
&::before {
color: $color-black;
font-family: $font-family-secundary;
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 16px;
}
}
.product-image { .product-image {
height: auto; height: 60px;
padding: 0; padding: 0;
width: 60px; width: 60px;
padding-right: 16px;
@include mq(sm, max) { @include mq(sm, max) {
width: 72px; width: 72px;
@ -138,7 +173,7 @@
img { img {
height: 60px; height: 60px;
max-width: 100%; max-width: 100%;
width: auto; width: 60px;
@include mq(sm, max) { @include mq(sm, max) {
height: 72px; height: 72px;
@ -155,17 +190,12 @@
} }
a { a {
color: $color-blue; font-family: $font-family-secundary;
color: $color-black-neutra;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: 400;
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 14px;
transition: ease-in 0.22s all;
&:hover {
color: darken($color-blue, 10);
text-decoration: none;
}
@media (max-width: 490px) { @media (max-width: 490px) {
margin-left: 23px; margin-left: 23px;
@ -179,7 +209,8 @@
} }
td.shipping-date { td.shipping-date {
color: $color-gray2; color: $color-gray6;
font-family: $font-family-secundary;
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 14px;
@ -189,7 +220,7 @@
} }
.product-price { .product-price {
min-width: 100px; // min-width: 100px;
@include mq(md, max) { @include mq(md, max) {
min-width: 78px; min-width: 78px;
} }
@ -218,12 +249,12 @@
td.quantity { td.quantity {
align-items: center; align-items: center;
border: 1px solid $color-gray3; border: 1px solid $color-gray3;
border-radius: 0; border-radius: 8px;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
justify-content: center; justify-content: center;
margin: 6px auto 0; margin: 6px 0 0;
max-height: 38px; max-height: 34px;
max-width: 118px; max-width: 118px;
padding: 0; padding: 0;
width: max-content !important; width: max-content !important;
@ -234,17 +265,24 @@
input { input {
background-color: $color-white; background-color: $color-white;
border: 1px solid $color-gray3; border: 0;
border-radius: 0; border-radius: 0;
border-width: 0 1px; border-top: 1px solid $color-gray3;
border-bottom: 1px solid $color-gray3;
display: block; display: block;
max-height: 38px; max-height: 38px;
margin: 0 !important; margin: 0 !important;
padding: 8px 0; padding: 5px 0;
width: 38px; width: 31px;
color: $color-gray2; color: $color-black-neutra;
box-shadow: none; box-shadow: none;
font-family: $font-family;
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 16px;
@include mq(lg, max) { @include mq(lg, max) {
width: 24px !important; width: 24px !important;
} }
@ -253,24 +291,10 @@
.icon-plus-sign, .icon-plus-sign,
.icon-minus-sign { .icon-minus-sign {
&::before { &::before {
color: $color-black; color: $color-blue-light;
display: block; display: block;
font-weight: 500; font-weight: 500;
padding: 1px 12px; padding: 1px 9px;
}
}
.icon-minus-sign {
&:before {
content: "-";
font-size: 16px;
}
}
.icon-plus-sign {
&:before {
content: "+";
font-size: 14px;
} }
} }
@ -296,6 +320,7 @@
display: none; display: none;
} }
span { span {
font-family: $font-family-secundary;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 14px; font-size: 14px;
@ -304,6 +329,14 @@
} }
} }
.quantity-price {
.total-selling-price {
font-family: $font-family;
font-weight: 700;
line-height: 19px;
}
}
.quantity-price { .quantity-price {
@include mq(md, max) { @include mq(md, max) {
display: none; display: none;
@ -314,8 +347,13 @@
@media (max-width: 490px) { @media (max-width: 490px) {
top: 0; top: 0;
} }
.icon {
display: flex;
align-items: center;
}
.icon::before { .icon::before {
color: $color-gray4; color: $color-gray7;
font-size: 15px; font-size: 15px;
@include mq(md, max) { @include mq(md, max) {
@ -351,12 +389,13 @@
} }
.srp-main-title { .srp-main-title {
margin: 32px 0 12px; font-family: $font-family;
margin: 0 0 11px;
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: $color-black-neutra;
@include mq(md, max) { @include mq(md, max) {
margin-top: 0; margin-top: 0;
@ -364,24 +403,28 @@
} }
.srp-description { .srp-description {
font-family: $font-family;
color: $color-gray2; color: $color-gray2;
font-size: 12px; font-size: 14px;
line-height: 18px; line-height: 18px;
margin: 0 0 12px; margin: 0 0 10px;
max-width: 18rem;
} }
button.shp-open-options { button.shp-open-options {
background-color: $color-gray5; font-family: $font-family;
background-color: #ededed;
border: none; border: none;
border-radius: 5px; border-radius: 5px;
color: $color-gray2; color: $color-black-neutra;
font-size: 16px; font-size: 14px;
letter-spacing: 0.05em; letter-spacing: 0.05em;
line-height: 19px; line-height: 19px;
font-weight: 500; font-weight: 500;
outline: none; outline: none;
padding: 12px 40px; padding: 12px 41px;
transition: all 0.2s linear; transition: all 0.2s linear;
margin: 0;
&:hover { &:hover {
background-color: lighten($color-gray5, 5); background-color: lighten($color-gray5, 5);
@ -393,6 +436,10 @@
} }
} }
.srp-data.mt4 {
margin: 0;
}
.srp-data { .srp-data {
width: 280px; width: 280px;
@ -592,9 +639,10 @@
&-totalizers { &-totalizers {
padding: 0; padding: 0;
width: 346px; width: 354px;
.coupon-data { .coupon-data {
text-align: center;
#cart-link-coupon-add { #cart-link-coupon-add {
text-decoration: none; text-decoration: none;
&:hover { &:hover {
@ -603,12 +651,12 @@
} }
} }
span { span {
font-family: $font-family; font-family: $font-family-secundary;
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: $color-black-neutra;
text-decoration: none; text-decoration: none;
} }
} }
@ -657,14 +705,18 @@
} }
input { input {
border: 2px solid $color-gray3; border: 1px solid $color-gray5;
border-radius: 5px; border-radius: 5px;
box-shadow: none; box-shadow: none;
color: $color-gray4; color: $color-gray7;
font-size: 12px; font-size: 12px;
height: 34px; height: 36px;
padding: 0 12px; padding: 0 16px 0;
max-width: 160px; width: 48.1%;
&::placeholder {
color: $color-gray7;
}
@include mq(sm, max) { @include mq(sm, max) {
max-width: 100%; max-width: 100%;
@ -673,30 +725,26 @@
} }
button { button {
background: $color-black; background: $color-blue-light;
border: none; border: none;
border-radius: 5px; border-radius: 8px;
color: $color-white; color: $color-black-neutra;
font-size: 12px; font-family: $font-family;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 19px;
height: 36px; height: 36px;
letter-spacing: 1px; letter-spacing: 0.05em;
margin-left: 6px;
outline: none;
transition: all 0.2s linear;
width: 94px;
text-transform: uppercase; text-transform: uppercase;
margin-left: 15px;
outline: none;
width: 37.1%;
text-shadow: none;
@include mq(md, max) { @include mq(md, max) {
width: 138px; width: 138px;
} }
&:hover {
background-color: lighten($color-black, 5);
}
&:active {
background-color: darken($color-black, 5);
}
} }
} }
} }
@ -712,12 +760,13 @@
&.info, &.info,
&.monetary { &.monetary {
font-family: $font-family-secundary;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
color: $color-black; color: $color-black;
padding: 12px 0; padding: 10px 0;
} }
&.info { &.info {
@ -733,11 +782,14 @@
tfoot { tfoot {
td.info, td.info,
td.monetary { td.monetary {
font-family: $font-family;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: 700;
font-size: 18px; font-size: 18px;
line-height: 21px; line-height: 24px;
color: $color-black; color: $color-black;
padding: 0;
padding: 14px 0 3px;
} }
} }
} }
@ -747,7 +799,7 @@
.cart-links-bottom { .cart-links-bottom {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 343px; width: 352px;
@include mq(md, max) { @include mq(md, max) {
padding: 0 16px; padding: 0 16px;
@ -764,43 +816,39 @@
.link-choose-more-products-wrapper { .link-choose-more-products-wrapper {
display: block; display: block;
text-align: center; text-align: center;
margin-bottom: 16px; margin-bottom: 15px;
@include mq(md, max) { @include mq(md, max) {
margin-bottom: 0px; margin-bottom: 0px;
} }
a { a {
font-family: $font-family; font-family: $font-family-secundary;
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: $color-black-neutra;
} }
} }
.btn-place-order-wrapper { .btn-place-order-wrapper {
a { a {
background: $color-green; background: $color-blue-light;
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: 12px 19px;
&:hover {
background-color: darken($color-green, 5);
}
&: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: $color-black-neutra;
text-transform: uppercase; text-transform: uppercase;
vertical-align: middle; vertical-align: middle;
line-height: 19px; line-height: 19px;
@ -810,3 +858,7 @@
} }
} }
} }
.forms.coupon-column.summary-coupon-wrap.text-center {
text-align: left;
}

View File

@ -69,13 +69,13 @@ body {
#cart-title, #cart-title,
#orderform-title { #orderform-title {
color: $color-gray2; color: $color-black;
font-family: $font-family; font-family: $font-family;
font-weight: 500; font-weight: 700;
font-size: 36px; font-size: 24px;
line-height: 42px; line-height: 33px;
margin: 40px 0 30px; margin: 17px 0 16px;
letter-spacing: 0.1em; letter-spacing: 0.05em;
text-transform: uppercase; text-transform: uppercase;
@include mq(md, max) { @include mq(md, max) {

View File

@ -2,7 +2,6 @@
.headerCheckout { .headerCheckout {
.container { .container {
width: 79.53125%; width: 79.53125%;
height: 96px;
display: flex; display: flex;
align-items: center; align-items: center;
} }
@ -11,9 +10,10 @@
align-items: center; align-items: center;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 29px 0;
#progressBar { #progressBar {
width: 43.1237%; width: 439px;
position: relative; position: relative;
} }
@ -26,7 +26,7 @@
&::after { &::after {
content: ""; content: "";
position: absolute; position: absolute;
width: 80%; width: 81%;
height: 1px; height: 1px;
background-color: #000000; background-color: #000000;
top: 29px; top: 29px;
@ -34,33 +34,33 @@
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
z-index: -1; z-index: -1;
@media (min-width: 1140px) { // @media (min-width: 1140px) {
width: 82%; // width: 82%;
} // }
@media (min-width: 1270px) { // @media (min-width: 1270px) {
width: 84%; // width: 84%;
} // }
@media (min-width: 1440px) { // @media (min-width: 1440px) {
width: 87%; // width: 87%;
} // }
@media (min-width: 1810px) { // @media (min-width: 1810px) {
width: 89%; // width: 89%;
} // }
@media (min-width: 2160px) { // @media (min-width: 2160px) {
width: 91%; // width: 91%;
} // }
@media (min-width: 2880px) { // @media (min-width: 2880px) {
width: 93%; // width: 93%;
} // }
@media (min-width: 3510px) { // @media (min-width: 3510px) {
width: 95%; // width: 95%;
} // }
} }
.ProgressBar-step { .ProgressBar-step {
list-style: none; list-style: none;
@ -112,9 +112,8 @@
} }
&__logo { &__logo {
width: 155.58px; width: 15.2829%;
img { img {
height: 37.14px;
width: 100%; width: 100%;
} }
} }
@ -135,7 +134,7 @@
} }
img { img {
height: 15px; width: 10.1694%;
margin-right: 8px; margin-right: 8px;
} }

View File

@ -15,9 +15,11 @@ $color-gray2: #7d7d7d;
$color-gray3: #f0f0f0; $color-gray3: #f0f0f0;
$color-gray4: #8d8d8d; $color-gray4: #8d8d8d;
$color-gray5: #e5e5e5; $color-gray5: #e5e5e5;
$color-gray6: #989898;
$color-gray7: #c4c4c4;
$color-blue: #4267b2; $color-blue: #4267b2;
$color-blue-light: #00c8ff;
$color-green: #4caf50; $color-green: #4caf50;
/* Grid breakpoints */ /* Grid breakpoints */