feat(MeuCarrinho): Estiliza Meu Carrinho

This commit is contained in:
William Simão Cavalcante 2022-12-17 14:07:27 -03:00
parent 1b7b5f7edf
commit 98b612252c
4 changed files with 140 additions and 65 deletions

View File

@ -16,6 +16,7 @@ export default class CheckoutUI {
selectors() { selectors() {
this.title = $(".footerCheckout__title"); this.title = $(".footerCheckout__title");
this.contents = $(".footerCheckout__content"); this.contents = $(".footerCheckout__content");
this.entrega = $('.shipping-date');
} }
events() { events() {
@ -42,6 +43,7 @@ export default class CheckoutUI {
waitForEl(".product-image img", this.resizeImages.bind(this)); waitForEl(".product-image img", this.resizeImages.bind(this));
$(window).on("orderFormUpdated.vtex", this.resizeImages.bind(this)); $(window).on("orderFormUpdated.vtex", this.resizeImages.bind(this));
this.changeTitleChooseProduct(); this.changeTitleChooseProduct();
this.entregaCarrinho();
} }
configThumb() { configThumb() {
@ -67,5 +69,4 @@ export default class CheckoutUI {
); );
}); });
} }
} }

View File

@ -9,11 +9,13 @@ export default class Footer {
await this.selectors(); await this.selectors();
this.verificaPag(); this.verificaPag();
await this.onUpdate(); await this.onUpdate();
await this.addCarrossel();
this.addProdutos();
this.entregaCarrinho();
this.unidadeCarrinho();
this.creatPaymentsIcons(); this.creatPaymentsIcons();
this.creatVtexIconPci(); this.creatVtexIconPci();
this.creatDevIconsM3(); this.creatDevIconsM3();
this.addProdutos();
await this.addCarrossel();
} }
async selectors() { async selectors() {
@ -24,6 +26,9 @@ export default class Footer {
this.vtexIconPci = await waitElement('.footerCheckout__vtexpci'); this.vtexIconPci = await waitElement('.footerCheckout__vtexpci');
this.devIcons = await waitElement('.footerCheckout__developedBy'); this.devIcons = await waitElement('.footerCheckout__developedBy');
this.continuarComprando = await waitElement('.empty-cart-links'); this.continuarComprando = await waitElement('.empty-cart-links');
this.entrega = await waitElement('.shipping-date');
this.unidade = await waitElement('.product-price');
} }
async onUpdate() { async onUpdate() {
@ -102,22 +107,52 @@ export default class Footer {
}; };
async addCarrossel() { async addCarrossel() {
const prateleiraProd = await waitElement("#footerCheckout__prateleira-ul-id"); const prateleiraProd = await waitElement("#footerCheckout__prateleira-ul-id");
if(window.screen.width > 1024) {
$(prateleiraProd).slick({ $(prateleiraProd).slick({
slidesToShow: 4, slidesToShow: 4,
slidesToScroll: 1, slidesToScroll: 1,
infinite: false, infinite: false,
arrows: true, arrows: true,
// responsive: [
// {
// breackpoint: 992,
// settings: {
// slidesToScroll: 2,
// slidesToScroll: 1,
// },
// },
// {
// breackpoint: 1025,
// settings: {
// slidesToShow: 3,
// slidesToScroll: 1,
// }
// },
// {
// breackpoint: 1279,
// settings: {
// slidesToShow: 4,
// slidesToScroll: 1,
// }
// },
// ]
}); });
}
} }
addProdutos() { addProdutos() {
this.continuarComprando.innerHTML = `<a href="/" id="cart-choose-products" class="btn btn-large btn-success link-choose-products" data-i18n="cart.chooseProducts">continuar comprando</a>` this.continuarComprando.innerHTML = `<a href="/" id="cart-choose-products" class="btn btn-large btn-success link-choose-products" data-i18n="cart.chooseProducts">continuar comprando</a>`
} }
// removePrateleira() { removePrateleira() {
// this.divPrateleira.style.display = 'none' this.divPrateleira.style.display = 'none'
// }; };
entregaCarrinho () {
this.entrega.innerHTML = `Frete`;
}
unidadeCarrinho () {
this.unidade.innerHTML = `Unidade`;
}
creatPaymentsIcons () { creatPaymentsIcons () {
this.payments.innerHTML = ` this.payments.innerHTML = `
<ul class="footerCheckout__container-ul"> <ul class="footerCheckout__container-ul">

View File

@ -13,7 +13,7 @@
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;
@ -111,10 +111,11 @@
} }
th { th {
font-family: $font-family-secundary;
color: $color-black; color: $color-black;
padding: 0 0 16px; padding: 0 0 17px;
font-style: normal; font-style: normal;
font-weight: bold; font-weight: 400;
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
@ -155,9 +156,10 @@
} }
a { a {
color: $color-blue; font-family: $font-family-secundary;
color: $color-black-500;
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; transition: ease-in 0.22s all;
@ -179,9 +181,11 @@
} }
td.shipping-date { td.shipping-date {
color: $color-gray2; font-family: $font-family-secundary;
color: $color-gray6;
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 14px;
font-weight: 400;
@include mq(md, max) { @include mq(md, max) {
display: none; display: none;
@ -218,7 +222,7 @@
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;
@ -233,16 +237,19 @@
} }
input { input {
font-family: $font-family-secundary;
font-size: 14px;
font-weight: 400;
font-style: normal;
line-height: 16px;
color: $color-black-500;
background-color: $color-white; background-color: $color-white;
border: 1px solid $color-gray3; border: none;
border-radius: 0;
border-width: 0 1px;
display: block; display: block;
max-height: 38px; max-height: 38px;
margin: 0 !important; margin: 0 !important;
padding: 8px 0; padding: 0;
width: 38px; width: 5px;
color: $color-gray2;
box-shadow: none; box-shadow: none;
@include mq(lg, max) { @include mq(lg, max) {
@ -253,24 +260,23 @@
.icon-plus-sign, .icon-plus-sign,
.icon-minus-sign { .icon-minus-sign {
&::before { &::before {
color: $color-black; color: $color-blue-200;
display: block; display: block;
font-weight: 500; font-weight: 500;
padding: 1px 12px;
} }
} }
.icon-minus-sign { .icon-minus-sign {
&:before { &:before {
content: "-"; padding: 7px 20px 7px 9px;
font-size: 16px; font-size: 20px;
} }
} }
.icon-plus-sign { .icon-plus-sign {
&:before { &:before {
content: "+"; padding: 7px 9px 7px 20px;
font-size: 14px; font-size: 20px;
} }
} }
@ -296,12 +302,20 @@
display: none; display: none;
} }
span { span {
font-family: $font-family-secundary;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: 400;
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
color: $color-black; color: $color-black;
} }
.total-selling-price {
font-family: $font-family;
font-style: normal;
font-style: 14px;
line-height: 19px;
font-weight: 700;
}
} }
.quantity-price { .quantity-price {
@ -351,12 +365,13 @@
} }
.srp-main-title { .srp-main-title {
font-family: $font-family;
margin: 32px 0 12px; margin: 32px 0 12px;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: 400;
font-size: 24px; font-size: 24px;
line-height: 28px; line-height: 33px;
color: $color-gray2; color: $color-black-500;
@include mq(md, max) { @include mq(md, max) {
margin-top: 0; margin-top: 0;
@ -364,16 +379,19 @@
} }
.srp-description { .srp-description {
font-family: $font-family;
font-weight: 400;
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 12px;
max-width: 276px;
} }
button.shp-open-options { button.shp-open-options {
background-color: $color-gray5; background-color: $color-gray5;
border: none; border: none;
border-radius: 5px; border-radius: 8px;
color: $color-gray2; color: $color-gray2;
font-size: 16px; font-size: 16px;
letter-spacing: 0.05em; letter-spacing: 0.05em;
@ -466,15 +484,15 @@
label { label {
font-family: $font-family; font-family: $font-family;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: 400;
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 16px;
color: $color-black; color: $color-black-500;
margin-bottom: 12px; margin-bottom: 12px;
} }
input { input {
border: 1px solid $color-gray3; border: 1px solid $color-gray7;
border-radius: 5px; border-radius: 5px;
box-shadow: none; box-shadow: none;
color: $color-gray3; color: $color-gray3;
@ -482,41 +500,48 @@
height: 36px; height: 36px;
padding: 12px 8px; padding: 12px 8px;
width: 172px; width: 172px;
background-color: $color-white;
} }
& ~ button { & ~ button {
background-color: $color-black; background-color: $color-blue-200;
border: none; border: none;
border-radius: 5px; border-radius: 8px;
color: $color-white; color: $color-white;
font-size: 12px; font-size: 14px;
line-height: 19px;
font-style: normal;
height: 36px; height: 36px;
letter-spacing: 1px; letter-spacing: 0.05em;
outline: none; outline: none;
position: absolute; position: absolute;
text-align: center;
right: -150px; right: -150px;
top: 36px; top: 38px !important;
transition: all 0.2s linear; transition: all 0.2s linear;
width: 96px; width: 96px;
text-transform: uppercase; text-transform: uppercase;
display: flex;
align-items: center;
justify-content: center;
&:hover { &:hover {
background-color: lighten($color-black, 5); background-color: lighten($color-blue-100, 5);
} }
&:active { &:active {
background-color: darken($color-black, 5); background-color: darken($color-blue-100, 5);
} }
} }
small a { small a {
font-family: $font-family; font-family: $font-family-secundary;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: 400;
font-size: 10px; font-size: 10px;
line-height: 12px; line-height: 12px;
color: $color-blue; color: $color-black-500;
margin-top: 7px; margin-top: 7px;
text-decoration: underline;
} }
span.help.error { span.help.error {
@ -528,6 +553,9 @@
top: 17px; top: 17px;
} }
} }
.ship-country {
display: none;
}
} }
.srp-result { .srp-result {
@ -603,12 +631,12 @@
} }
} }
span { span {
font-family: $font-family; font-family: $font-family-secundary;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: 400;
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 14px;
color: $color-blue; color: $color-black-500;
text-decoration: none; text-decoration: none;
} }
} }
@ -712,16 +740,23 @@
&.info, &.info,
&.monetary { &.monetary {
font-family: $font-family-secundary;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: 400;
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
text-align: left;
color: $color-black; color: $color-black;
padding: 12px 0;
} }
&.info { &.info {
font-family: $font-family-secundary;
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 16px;
text-align: left; text-align: left;
color: $color-black
} }
&.monetary { &.monetary {
@ -733,10 +768,11 @@
tfoot { tfoot {
td.info, td.info,
td.monetary { td.monetary {
font-style: normal; font-family: $font-family;
font-weight: normal;
font-size: 18px; font-size: 18px;
line-height: 21px; line-height: 25px;
font-style: normal;
font-weight: 700;
color: $color-black; color: $color-black;
} }
} }
@ -771,36 +807,38 @@
} }
a { a {
font-family: $font-family; font-family: $font-family-secundary;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: 400;
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 14px;
color: $color-blue; color: $color-black-500;
} }
} }
.btn-place-order-wrapper { .btn-place-order-wrapper {
a { a {
background: $color-green; background: $color-blue-200;
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;
color: $color-black-500;
&:hover { &:hover {
background-color: darken($color-green, 5); background-color: darken($color-green, 5);
color: $color-white;
} }
&: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;
font-style: normal;
letter-spacing: 0.05em; letter-spacing: 0.05em;
color: $color-white;
text-transform: uppercase; text-transform: uppercase;
vertical-align: middle; vertical-align: middle;
line-height: 19px; line-height: 19px;

View File

@ -15,11 +15,12 @@ $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-100: #6fd5f2; $color-blue-100: #6fd5f2;
$color-blue-200: #00C8FF; $color-blue-200: #00C8FF;
$color-blue: #4267b2; $color-blue: #4267b2;
$color-green: #4caf50; $color-green: #4caf50;
/* Grid breakpoints */ /* Grid breakpoints */