feature/header #1

Merged
Vitor_soares merged 5 commits from feature/header into main 2022-12-14 14:09:38 +00:00
8 changed files with 326 additions and 10951 deletions

10970
checkout/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,8 @@ import { waitElement } from "m3-utils";
export default class Header {
constructor() {
this.init();
this.progressBar();
this.progressUpdate();
}
async init() {
@ -18,4 +20,58 @@ export default class Header {
interval: 1000, // vai verificar a cada 1 segundo se o elemento existe
});
}
progressBar() {
const progress = document.querySelector(".progress-bar");
progress.innerHTML = '';
let progressBarHtml = `
<div class="progress-bar__container">
<div class="progress-bar__wrapper">
<div class="progress-bar__div" id="progress"></div>
<div class="progress-bar__items"><span>Meu Carrinho</span><div class="progress-bar__circle1"></div></div>
<div class="progress-bar__items"><span>Dados Pessoais</span><div class="progress-bar__circle2"></div></div>
<div class="progress-bar__items"><span>Pagamento</span><div class="progress-bar__circle3"></div></div>
</div>
</div>`;
$(".progress-bar").prepend(progressBarHtml);
}
progressUpdate() {
this.caseUpdate();
window.addEventListener("hashchange", () => {
this.caseUpdate();
});
}
caseUpdate() {
const myCart = document.querySelector(".progress-bar__circle1");
const personalData = document.querySelector(".progress-bar__circle2");
const payment = document.querySelector(".progress-bar__circle3");
switch(location.hash) {
case "#/cart":
myCart.classList.add("active-bar");
personalData.classList.remove("active-bar");
payment.classList.remove("active-bar");
break
case "#/email":
case "#/profile":
case "#/shipping":
personalData.classList.add("active-bar");
myCart.classList.remove("active-bar");
payment.classList.remove("active-bar");
break
case "#/payment":
payment.classList.add("active-bar");
myCart.classList.remove("active-bar");
personalData.classList.remove("active-bar");
};
}
}

View File

@ -6,11 +6,11 @@
.link-cart {
a {
color: $color-black;
color: $color-black-100;
font-size: 14px;
&:hover {
color: lighen($color-black, 10);
color: lighen($color-black-100, 10);
}
}
}
@ -40,7 +40,7 @@
input {
box-shadow: none;
color: $color-black;
color: $color-black-100;
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-100;
border-radius: 5px;
border: none;
font-family: $font-family;
@ -75,7 +75,7 @@
.emailInfo {
padding: 16px;
background-color: $color-white;
background-color: $color-white-500;
border: 1px solid $color-gray4;
border-radius: 0;
@ -89,11 +89,11 @@
li {
span {
color: $color-black;
color: $color-black-100;
}
i::before {
color: $color-black;
color: $color-black-100;
font-size: 1rem;
opacity: 1;
}
@ -101,7 +101,7 @@
}
i::before {
color: $color-black;
color: $color-black-100;
font-size: 6rem;
opacity: 0.5;
}
@ -133,7 +133,7 @@
background-color: #303030;
border-radius: 8px;
border: none;
color: $color-white;
color: $color-white-500;
display: flex;
justify-content: center;
padding: 6px 5px 6px 8px;
@ -146,12 +146,12 @@
/* General configurations */
.client-notice {
color: $color-black;
color: $color-black-100;
}
p {
label {
color: $color-black;
color: $color-black-100;
font-weight: 500;
}
@ -170,7 +170,7 @@
.box-client-info-pj {
.link a#is-corporate-client,
.link a#not-corporate-client {
color: $color-black;
color: $color-black-100;
font-weight: 500;
text-decoration: underline;
}
@ -183,17 +183,17 @@
button.submit {
border: none;
border-radius: 5px;
background: $color-black;
background: $color-black-100;
margin-top: 8px;
outline: none;
transition: all 0.2s linear;
&:hover {
background: lighten($color-black, 5);
background: lighten($color-black-100, 5);
}
&:active {
background: darken($color-black, 5);
background: darken($color-black-100, 5);
}
}
@ -217,7 +217,7 @@
border-radius: 0;
label {
background-color: $color-white;
background-color: $color-white-500;
box-shadow: none;
color: #303030;
padding: 8px 12px;
@ -281,7 +281,7 @@
}
.vtex-omnishipping-1-x-deliveryOptionActive {
text-shadow: 1.3px 1px lighten($color-black, 50);
text-shadow: 1.3px 1px lighten($color-black-100, 50);
}
}
}

View File

@ -32,7 +32,7 @@
font-family: $font-family;
width: 100%;
h2 {
background: $color-white;
background: $color-white-500;
border: none;
color: #303030;
font-size: 14px;
@ -70,7 +70,7 @@
.summary-template-holder {
border-top: none;
background: $color-white;
background: $color-white-500;
}
#go-to-cart-button a {
@ -85,24 +85,24 @@
}
#payment-data-submit {
background: $color-black;
background: $color-black-100;
border: none;
border-radius: 0;
color: $color-white;
color: $color-white-500;
outline: none;
transition: all 0.2s linear;
&:hover {
background: lighten($color-black, 5);
background: lighten($color-black-100, 5);
}
&:active {
background: darken($color-black, 5);
background: darken($color-black-100, 5);
}
}
}
.lookatme {
background-color: $color-white;
background-color: $color-white-500;
}
.cart-items {
@ -111,7 +111,7 @@
}
th {
color: $color-black;
color: $color-black-100;
padding: 0 0 16px;
font-style: normal;
font-weight: bold;
@ -233,7 +233,7 @@
}
input {
background-color: $color-white;
background-color: $color-white-500;
border: 1px solid $color-gray3;
border-radius: 0;
border-width: 0 1px;
@ -253,7 +253,7 @@
.icon-plus-sign,
.icon-minus-sign {
&::before {
color: $color-black;
color: $color-black-100;
display: block;
font-weight: 500;
padding: 1px 12px;
@ -300,7 +300,7 @@
font-weight: normal;
font-size: 14px;
line-height: 16px;
color: $color-black;
color: $color-black-100;
}
}
@ -326,7 +326,7 @@
.item-unavailable-message {
background-color: #d8c8ac;
color: $color-white;
color: $color-white-500;
.icon-warning-sign {
color: #bb4f4f;
@ -405,10 +405,10 @@
}
.srp-pickup-my-location__button {
background-color: $color-black;
background-color: $color-black-100;
border: none;
border-radius: 5px;
color: $color-white;
color: $color-white-500;
outline: none;
width: 100%;
@ -419,11 +419,11 @@
letter-spacing: 0.05em;
&:hover {
background-color: lighten($color-black, 5);
background-color: lighten($color-black-100, 5);
}
&:active {
background-color: darken($color-black, 5);
background-color: darken($color-black-100, 5);
}
}
}
@ -432,7 +432,7 @@
margin: 0 0 34px;
&__wrapper {
background-color: $color-white;
background-color: $color-white-500;
border-radius: 100px;
width: 100%;
font-family: $font-family;
@ -469,7 +469,7 @@
font-weight: normal;
font-size: 12px;
line-height: 14px;
color: $color-black;
color: $color-black-100;
margin-bottom: 12px;
}
@ -485,10 +485,10 @@
}
& ~ button {
background-color: $color-black;
background-color: $color-black-100;
border: none;
border-radius: 5px;
color: $color-white;
color: $color-white-500;
font-size: 12px;
height: 36px;
letter-spacing: 1px;
@ -501,11 +501,11 @@
text-transform: uppercase;
&:hover {
background-color: lighten($color-black, 5);
background-color: lighten($color-black-100, 5);
}
&:active {
background-color: darken($color-black, 5);
background-color: darken($color-black-100, 5);
}
}
@ -673,10 +673,10 @@
}
button {
background: $color-black;
background: $color-black-100;
border: none;
border-radius: 5px;
color: $color-white;
color: $color-white-500;
font-size: 12px;
height: 36px;
letter-spacing: 1px;
@ -691,11 +691,11 @@
}
&:hover {
background-color: lighten($color-black, 5);
background-color: lighten($color-black-100, 5);
}
&:active {
background-color: darken($color-black, 5);
background-color: darken($color-black-100, 5);
}
}
}
@ -716,7 +716,7 @@
font-weight: normal;
font-size: 14px;
line-height: 16px;
color: $color-black;
color: $color-black-100;
padding: 12px 0;
}
@ -737,7 +737,7 @@
font-weight: normal;
font-size: 18px;
line-height: 21px;
color: $color-black;
color: $color-black-100;
}
}
}
@ -800,7 +800,7 @@
font-weight: 500;
font-size: 13px;
letter-spacing: 0.05em;
color: $color-white;
color: $color-white-500;
text-transform: uppercase;
vertical-align: middle;
line-height: 19px;

View File

@ -1,7 +1,7 @@
.empty-cart {
font-family: $font-family;
&-content {
color: $color-black;
color: $color-black-100;
text-align: center;
@include mq(md, max) {
@ -15,7 +15,7 @@
&-links {
.link-choose-products {
background: $color-black;
background: $color-black-100;
border: none;
border-radius: 5px;
transition: ease-in 0.22s all;
@ -27,11 +27,11 @@
line-height: 16px;
text-align: center;
letter-spacing: 0.05em;
color: $color-white;
color: $color-white-500;
text-transform: uppercase;
&:hover {
background: lighten($color-black, 5);
background: lighten($color-black-100, 5);
}
}
}

View File

@ -14,8 +14,7 @@ footer .footerCheckout__wrapper {
}
footer .footerCheckout__prateleira,
header {
width: 79.53125%;
margin: 0 auto;
width: 100%;
}
body {
@ -54,16 +53,16 @@ body {
}
.btn-success {
background: $color-black;
background: $color-black-100;
text-shadow: none;
&:hover {
background: lighten($color-black, 15%);
background: lighten($color-black-100, 15%);
}
}
.emailInfo h3 {
color: $color-black !important;
color: $color-black-100 !important;
}
#cart-title,

View File

@ -1,22 +1,47 @@
/* _header.scss */
.headerCheckout {
border-bottom: 1px solid $color-black-500;
.container {
width: auto !important;
width: 79.53%;
@include mq(md, max) {
width: 100%;
}
}
&__wrapper {
align-items: center;
display: flex;
justify-content: space-between;
padding: 30px 0;
@include mq(md, max) {
padding: 16px;
}
}
&__logo {
img {
height: 52px;
height: 37px;
width: auto;
@include mq(xl, min) {
height: 91.89px;
}
@include mq(md, max) {
height: 32px;
}
}
}
&__safeBuy {
display: flex;
align-items: center;
gap: 8px;
span {
align-items: center;
display: flex;
@ -25,12 +50,104 @@
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 14px;
color: $color-gray;
line-height: 16px;
color: $color-black-100;
@include mq(xl, min) {
font-size: 24px;
line-height: 32px;
}
}
i {
margin-right: 8px;
img {
height: 15px;
@include mq(xl, min) {
height: 41px;
}
@include mq(md, max) {
height: 13px;
}
}
}
}
.progress-bar {
@include mq(md, max) {
display: none;
}
&__wrapper::before {
content: "";
background: $color-black-500;
position: absolute;
top: 31px;
left: 14px;
height: 1px;
width: 83%;
z-index: -1;
transform: translateY(-50%);
@include mq(xl, min) {
top: 55px;
width: 87%;
}
}
&__wrapper {
display: flex;
justify-content: space-between;
position: relative;
width: 439px;
@include mq(xl, min) {
width: 1078px;
}
&__items {
position: relative;
}
span {
display: block;
margin-bottom: 9px;
font-size: 12px;
line-height: 14px;
font-family: $font-family-secundary;
transform: translateX(-40%);
@include mq(xl, min) {
font-size: 24px;
line-height: 28px;
margin-bottom: 13px;
}
}
}
&__div {
background: $color-black-500;
position: absolute;
}
&__items {
.progress-bar__circle1, .progress-bar__circle2, .progress-bar__circle3 {
background: $color-white-500;
color: $color-black-500;
border-radius: 50%;
height: 12px;
width: 12px;
border: 1px solid $color-black-500;
@include mq(xl, min) {
height: 24px;
width: 24px;
}
}
.active-bar {
background: $color-black-500;
}
}
}

View File

@ -5,9 +5,10 @@ $font-family: "Open Sans", sans-serif;
$font-family-secundary:"Tenor Sans", sans-serif;
/* Colors */
$color-black: #292929;
$color-black-100: #292929;
$color-black-500: #000000;
$color-white: #fff;
$color-white-500: #fff;
$color-gray: #6c6c6c;
$color-gray2: #7d7d7d;
@ -23,10 +24,10 @@ $color-green: #4caf50;
$grid-breakpoints: (
xs: 0,
cstm: 400,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px
sm: 375px,
md: 1025px,
lg: 1280px,
xl: 2500px
) !default;
$z-index: (