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

View File

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

View File

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