feat(progressBar): Adiciona barra de progresso ao header

This commit is contained in:
amanda almeida 2022-12-10 21:44:49 -03:00
parent 2dab582c69
commit 06a863c0ff
8 changed files with 296 additions and 10950 deletions

10970
checkout/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,14 +8,53 @@ export default class Header {
async init() {
await this.selectors();
console.log(this.item);
this.progressBarHtml();
}
async selectors() {
this.item = await waitElement("#my-element", {
//#my-element pode ser a class ou o id do elemento html qeu vocÊ quer pegar
timeout: 5000, // vai esperar 5 segundos antes de rejeitar a promise
interval: 1000, // vai verificar a cada 1 segundo se o elemento existe
});
this.progressBar = await waitElement("#progressBar");
}
progressBarHtml() {
if (this.progressBar && window.innerWidth > 1024) {
this.progressBar.innerHTML = `
<div class="progress-bar__container">
<ul class="progress-bar__container-text">
<li class="progress-bar__list justify-start">
<p class="progress-bar__text">Meu carrinho</p>
</li>
<li class="progress-bar__list justify-center">
<p class="progress-bar__text">Dados Pessoais</p>
</li>
<li class="progress-bar__list justify-end">
<p class="progress-bar__text">Pagamento</p>
</li>
</ul>
<ul class="progress-bar__items">
<li class="progress-bar__item">
<p class="progress-bar__circle-1" id="progress-bar__circle">
</p>
<p class="progress-bar__line">
</p>
</li>
<li class="progress-bar__item">
<p class="progress-bar__circle-2" id="progress-bar__circle"></p>
</li>
<li class="progress-bar__item">
<p class="progress-bar__line"></p>
<p class="progress-bar__circle-3" id="progress-bar__circle"></p>
</li></ul>
</div>
`
}
if (this.progressBar && window.innerWidth <= 1024) {
this.progressBar.innerHTML = ""
}
}
}

View File

@ -6,11 +6,11 @@
.link-cart {
a {
color: $color-black;
color: $color-black-400;
font-size: 14px;
&:hover {
color: lighen($color-black, 10);
color: lighen($color-black-400, 10);
}
}
}
@ -40,7 +40,7 @@
input {
box-shadow: none;
color: $color-black;
color: $color-black-400;
font-family: $font-family;
padding: 0 16px;
border: 2px solid $color-gray3;
@ -53,7 +53,7 @@
}
button {
background-color: $color-black;
background-color: $color-black-400;
border-radius: 5px;
border: none;
font-family: $font-family;
@ -89,11 +89,11 @@
li {
span {
color: $color-black;
color: $color-black-400;
}
i::before {
color: $color-black;
color: $color-black-400;
font-size: 1rem;
opacity: 1;
}
@ -101,7 +101,7 @@
}
i::before {
color: $color-black;
color: $color-black-400;
font-size: 6rem;
opacity: 0.5;
}
@ -146,12 +146,12 @@
/* General configurations */
.client-notice {
color: $color-black;
color: $color-black-400;
}
p {
label {
color: $color-black;
color: $color-black-400;
font-weight: 500;
}
@ -168,9 +168,10 @@
}
.box-client-info-pj {
.link a#is-corporate-client,
.link a#not-corporate-client {
color: $color-black;
color: $color-black-400;
font-weight: 500;
text-decoration: underline;
}
@ -183,17 +184,17 @@
button.submit {
border: none;
border-radius: 5px;
background: $color-black;
background: $color-black-400;
margin-top: 8px;
outline: none;
transition: all 0.2s linear;
&:hover {
background: lighten($color-black, 5);
background: lighten($color-black-400, 5);
}
&:active {
background: darken($color-black, 5);
background: darken($color-black-400, 5);
}
}
@ -281,7 +282,7 @@
}
.vtex-omnishipping-1-x-deliveryOptionActive {
text-shadow: 1.3px 1px lighten($color-black, 50);
text-shadow: 1.3px 1px lighten($color-black-400, 50);
}
}
}

View File

@ -6,12 +6,15 @@
.cart-template {
font-family: $font-family;
@include mq(md, max) {
padding: 0 0;
}
.item-unit-label {
display: none;
}
.cart {
border: 3px solid $color-gray3;
box-sizing: border-box;
@ -25,12 +28,15 @@
border-radius: 0;
}
}
.cart-fixed.affix {
position: relative !important;
}
.cart-fixed {
font-family: $font-family;
width: 100%;
h2 {
background: $color-white;
border: none;
@ -85,18 +91,19 @@
}
#payment-data-submit {
background: $color-black;
background: $color-black-400;
border: none;
border-radius: 0;
color: $color-white;
outline: none;
transition: all 0.2s linear;
&:hover {
background: lighten($color-black, 5);
background: lighten($color-black-400, 5);
}
&:active {
background: darken($color-black, 5);
background: darken($color-black-400, 5);
}
}
}
@ -111,7 +118,7 @@
}
th {
color: $color-black;
color: $color-black-400;
padding: 0 0 16px;
font-style: normal;
font-weight: bold;
@ -119,6 +126,7 @@
line-height: 16px;
@include mq(md, max) {
&.quantity-price,
&.shipping-date {
display: none;
@ -190,9 +198,11 @@
.product-price {
min-width: 100px;
@include mq(md, max) {
min-width: 78px;
}
@media (max-width: 490px) {
position: absolute;
bottom: 0;
@ -204,6 +214,7 @@
font-size: 12px;
line-height: 14px;
text-decoration-line: line-through;
@include mq(sm, max) {
font-size: 12px;
line-height: 14px;
@ -253,7 +264,7 @@
.icon-plus-sign,
.icon-minus-sign {
&::before {
color: $color-black;
color: $color-black-400;
display: block;
font-weight: 500;
padding: 1px 12px;
@ -295,12 +306,13 @@
.icon-question-sign {
display: none;
}
span {
font-style: normal;
font-weight: normal;
font-size: 14px;
line-height: 16px;
color: $color-black;
color: $color-black-400;
}
}
@ -314,6 +326,7 @@
@media (max-width: 490px) {
top: 0;
}
.icon::before {
color: $color-gray4;
font-size: 15px;
@ -405,7 +418,7 @@
}
.srp-pickup-my-location__button {
background-color: $color-black;
background-color: $color-black-400;
border: none;
border-radius: 5px;
color: $color-white;
@ -419,11 +432,11 @@
letter-spacing: 0.05em;
&:hover {
background-color: lighten($color-black, 5);
background-color: lighten($color-black-400, 5);
}
&:active {
background-color: darken($color-black, 5);
background-color: darken($color-black-400, 5);
}
}
}
@ -469,7 +482,7 @@
font-weight: normal;
font-size: 12px;
line-height: 14px;
color: $color-black;
color: $color-black-400;
margin-bottom: 12px;
}
@ -484,8 +497,8 @@
width: 172px;
}
& ~ button {
background-color: $color-black;
&~button {
background-color: $color-black-400;
border: none;
border-radius: 5px;
color: $color-white;
@ -501,11 +514,11 @@
text-transform: uppercase;
&:hover {
background-color: lighten($color-black, 5);
background-color: lighten($color-black-400, 5);
}
&:active {
background-color: darken($color-black, 5);
background-color: darken($color-black-400, 5);
}
}
@ -531,6 +544,7 @@
}
.srp-result {
strong,
.srp-items {
color: #303030;
@ -597,11 +611,13 @@
.coupon-data {
#cart-link-coupon-add {
text-decoration: none;
&:hover {
text-decoration: underline;
cursor: pointer;
}
}
span {
font-family: $font-family;
font-style: normal;
@ -648,6 +664,7 @@
display: flex;
flex-direction: row;
justify-content: space-between;
i {
position: absolute;
right: 91px;
@ -673,7 +690,7 @@
}
button {
background: $color-black;
background: $color-black-400;
border: none;
border-radius: 5px;
color: $color-white;
@ -691,11 +708,11 @@
}
&:hover {
background-color: lighten($color-black, 5);
background-color: lighten($color-black-400, 5);
}
&:active {
background-color: darken($color-black, 5);
background-color: darken($color-black-400, 5);
}
}
}
@ -716,7 +733,7 @@
font-weight: normal;
font-size: 14px;
line-height: 16px;
color: $color-black;
color: $color-black-400;
padding: 12px 0;
}
@ -731,13 +748,14 @@
}
tfoot {
td.info,
td.monetary {
font-style: normal;
font-weight: normal;
font-size: 18px;
line-height: 21px;
color: $color-black;
color: $color-black-400;
}
}
}

View File

@ -1,7 +1,8 @@
.empty-cart {
font-family: $font-family;
&-content {
color: $color-black;
color: $color-black-400;
text-align: center;
@include mq(md, max) {
@ -15,7 +16,7 @@
&-links {
.link-choose-products {
background: $color-black;
background: $color-black-400;
border: none;
border-radius: 5px;
transition: ease-in 0.22s all;
@ -31,7 +32,7 @@
text-transform: uppercase;
&:hover {
background: lighten($color-black, 5);
background: lighten($color-black-400, 5);
}
}
}

View File

@ -12,11 +12,12 @@ footer .footerCheckout__wrapper {
width: 94.9734%;
margin: auto auto 0 auto;
}
footer .footerCheckout__prateleira,
header {
width: 79.53125%;
margin: 0 auto;
}
// footer .footerCheckout__prateleira,
// header {
// width: 79.53125%;
// margin: 0 auto;
// }
body {
display: flex;
@ -47,6 +48,7 @@ body {
padding-left: 0;
}
}
.container-order-form,
.container-cart {
width: 80%;
@ -54,16 +56,16 @@ body {
}
.btn-success {
background: $color-black;
background: $color-black-400;
text-shadow: none;
&:hover {
background: lighten($color-black, 15%);
background: lighten($color-black-400, 15%);
}
}
.emailInfo h3 {
color: $color-black !important;
color: $color-black-400 !important;
}
#cart-title,

View File

@ -2,7 +2,9 @@
.headerCheckout {
.container {
width: auto !important;
padding: 30px 131px;
}
&__wrapper {
align-items: center;
display: flex;
@ -12,11 +14,14 @@
&__logo {
img {
height: 52px;
width: auto;
}
}
&__safeBuy {
width: 100%;
max-width: 119px;
span {
align-items: center;
display: flex;
@ -33,4 +38,83 @@
margin-right: 8px;
}
}
.progress-bar {
display: flex;
justify-content: center;
width: 100%;
p {
margin: 0;
padding: 0;
}
&__container {
width: 439px;
}
&__container-text {
display: flex;
margin: 0 0 9px;
}
&__list {
flex: 1;
font-family: $font-family-secundary;
font-size: 12px;
line-height: 14px;
list-style: none;
display: flex;
}
.justify-start {
justify-content: flex-start;
}
.justify-center {
justify-content: center;
}
.justify-end {
justify-content: flex-end;
}
&__items {
display: flex;
justify-content: center;
margin: 0;
}
&__item {
display: flex;
align-items: center;
list-style: none;
}
&__text {
display: grid;
grid-auto-columns: max-content;
}
#progress-bar__circle {
width: 12px;
height: 12px;
border: 1px solid $color-black;
border-radius: 50%;
}
.active {
background: $color-black;
}
&__line {
width: 173px;
height: 1px;
background: $color-black;
}
}
}

View File

@ -2,10 +2,11 @@
@import url("https://fonts.googleapis.com/css2?family=Tenor+Sans&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&display=swap");
$font-family: "Open Sans", sans-serif;
$font-family-secundary:"Tenor Sans", sans-serif;
$font-family-secundary: "Tenor Sans", sans-serif;
/* Colors */
$color-black: #292929;
$color-black: #000000;
$color-black-400: #292929;
$color-white: #fff;
@ -21,18 +22,16 @@ $color-green: #4caf50;
/* Grid breakpoints */
$grid-breakpoints: (
xs: 0,
cstm: 400,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px
) !default;
xs: 0,
cstm: 400,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px) !default;
$z-index: (
level1: 5,
level2: 10,
level3: 15,
level4: 20,
level5: 25
) !default;
level1: 5,
level2: 10,
level3: 15,
level4: 20,
level5: 25) !default;