develop #11

Merged
HenriqueSantosSantana merged 37 commits from develop into main 2022-12-26 17:04:35 +00:00
17 changed files with 4584 additions and 1077 deletions

View File

@ -62,7 +62,8 @@ function styles() {
) )
.pipe( .pipe(
autoprefixer({ autoprefixer({
cascade: false, cascade: true,
add: true,
}) })
) )
.pipe( .pipe(

View File

@ -1,5 +1,11 @@
import { waitElement } from "m3-utils"; import { waitElement } from "m3-utils";
const insertImage = (name, options) => {
const domain = "https://agenciamagma.vteximg.com.br";
return `<img ${options} src="${domain}/arquivos/${name}M3Academy.png"/>`;
};
export default class Footer { export default class Footer {
constructor() { constructor() {
this.init(); this.init();
@ -7,34 +13,257 @@ export default class Footer {
async init() { async init() {
await this.selectors(); await this.selectors();
// this.onUpdate();
this.createdToPaymentsInFooter();
this.createdToDevelopedBy();
this.onloadWindowVerificatedShelf();
this.onUpdate();
} }
async selectors() { async selectors() {
//Para verificar se o carrinho está vazio e remover a prateleira de produtos: //Para verificar se o carrinho está vazio e remover a prateleira de produtos:
// vocês devem olhar a doc fornecida no Desafio para aprender a usar o waitElement // vocês devem olhar a doc fornecida no Desafio para aprender a usar o waitElement
this.checkoutVazio = await waitElement(".empty-cart-content"); this.checkoutEmpty = await waitElement(".empty-cart-content");
this.paymentContainer = await waitElement(".footerCheckout__stamps");
this.developedByContainer = await waitElement(".footerCheckout__developedBy");
this.checkoutContainer = await waitElement(".container-main");
this.shelf = await waitElement(".footerCheckout__prateleira");
}
createdToPaymentsInFooter() {
if (this.isExistElement(this.paymentContainer)) {
const paymentCreditContent = this.paymentContainer.children[0].children[0];
const verificatedVtexPCI = this.paymentContainer.children[2].children[0];
let verifacatedContents =
this.isExistElement(paymentCreditContent) &&
this.isExistElement(verificatedVtexPCI);
if (verifacatedContents) {
let creditStructure = "";
let verificatedVtexStructure = insertImage(
"vtexPCI",
'class="footerCheckout__verificatedVtex"'
);
let creditTypes = this.creditPaymentsName();
creditTypes.forEach((creditType) => {
creditStructure += `<li class="footerCheckout__creditItem" >${insertImage(
creditType,
'class="footerCheckout__creditImage"'
)}</li>`;
});
paymentCreditContent.innerHTML = `<ul class="footerCheckout__creditList">${creditStructure}</ul>`;
verificatedVtexPCI.innerHTML = verificatedVtexStructure;
}
}
}
createdToDevelopedBy() {
if (this.isExistElement(this.developedByContainer)) {
const poweredByContent = this.developedByContainer.children[0].children[0];
const developedByContent = this.developedByContainer.children[1].children[0];
let verificatedContents =
this.isExistElement(poweredByContent) && this.isExistElement(developedByContent);
if (verificatedContents) {
poweredByContent.innerHTML = `<span>Powered By</span>${insertImage(
"logoVTEX",
'class="footerCheckout__logo footerCheckout__logo--vtex"'
)}`;
developedByContent.innerHTML = `<span>Developed By</span>${insertImage(
"logoM3",
'class="footerCheckout__logo footerCheckout__logo--m3"'
)}`;
}
}
}
onloadWindowVerificatedShelf() {
let checkoutEmpty = this.checkoutEmpty;
let checkoutContainer = this.checkoutContainer;
if (checkoutEmpty.style.display === "none") {
this.addClassToElement(checkoutContainer, "container-cart-fill");
} else {
this.removeClassToElement(checkoutContainer, "container-fill");
}
if (
this.getElementClass(checkoutContainer, "container-cart-fill") &&
this.getElementClass(checkoutContainer, "container-cart") &&
window.location.href.endsWith("#/cart")
) {
this.createdInitialShelfList();
this.createdProductsToShelf();
this.addCarrossel();
} else {
this.shelf.innerHTML = "";
}
} }
onUpdate() { 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 config = { childList: true, attributes: true }; let verificatedContents =
let observer = new MutationObserver((mutations) => { this.isExistElement(this.checkoutEmpty) && this.isExistElement(this.checkoutContainer);
mutations.forEach(function (mutation) {
console.log(mutation.type); if (verificatedContents) {
let target = this.checkoutEmpty;
let config = { childList: true, attributes: true };
let observer = new MutationObserver((mutations) => {
/* prettier-ignore */
for (let i = 0; i < mutations.length; i++) {
if (mutations[i].attributeName === "style") {
if (this.checkoutEmpty.style.display === "none") {
this.addClassToElement(this.checkoutContainer, "container-cart-fill");
} else {
this.removeClassToElement(this.checkoutContainer,"container-cart-fill");
}
this.onloadWindowVerificatedShelf();
break;
}
}
}); });
observer.observe(target, config);
window.addEventListener("hashchange", this.onloadWindowVerificatedShelf.bind(this));
}
}
addCarrossel() {
$(this.shelf.children[1]).slick({
slidesToShow: 4,
arrows: true,
responsive: [
{
breakpoint: 1025,
settings: {
slidesToShow: 3,
},
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
},
},
],
});
}
async requestAPIProducts() {
let url = (name) => {
let domain = "https://m3academy.myvtex.com/";
return domain + name;
};
let featchProducts = fetch(
url("api/catalog_system/pub/products/search/?fq=productClusterIds:319")
);
let response = await featchProducts.then((res) => res.json());
return response;
}
async createdProductsToShelf() {
let datas = await this.requestAPIProducts();
datas.forEach(() => {
$(this.shelf.children[1]).slick("unslick");
this.createdCardsProducts(datas);
this.addCarrossel();
});
}
createdCardsProducts(data) {
let structure = "";
data.forEach((data) => {
structure += `<li class="shelf-item product-item">
<div class="product-item-container">
<div class="product-item-header">
<figure class="product-item-figure">
<img src="${data.items[0].images[0].imageUrl}" alt="">
</figure>
<h3 class="product-item-name">
${data.productName}
</h3>
</div>
<div class="product-item-types product-type">
${data.items.reduce((acc, item) => {
return (acc += `<div class="product-type-container">
<span class="type-name">${item.name}</span>
</div>`);
}, "")}
</div>
<a class="product-item-link" href="${data.link}">
<span>
Ver Produto
</span>
</a>
</div></li>`;
}); });
observer.observe(target, config); this.shelf.children[1].innerHTML = `
${structure.trim()}
`;
} }
async addCarrossel() {
const elemento = await waitElement("#my-element"); createdInitialShelfList() {
$(elemento).slick({ this.shelf.innerHTML = `
slidesToShow: 4, <div class="footerCheckout__prateleira-header">
slidesToScroll: 1, <h2 class="footerCheckout__prateleira-title">Você também pode gostar:</h2>
}); </div>
<ul class="shelf-list"></ul>
`;
}
addClassToElement(element, name) {
element.classList.add(name);
}
removeClassToElement(element, name) {
element.classList.remove(name);
}
getElementClass(element, name) {
return element.classList.contains(name);
}
isExistElement(element) {
return !!element;
}
creditPaymentsName() {
const creditPaymentsTypes = [
"masterCard",
"visa",
"amex",
"elo",
"hiperCard",
"payPal",
"boleto",
];
return creditPaymentsTypes;
} }
} }

View File

@ -1,6 +1,115 @@
// import waitForEl from "../helpers/waitForEl"; // import waitForEl from "../helpers/waitForEl";
import { waitElement } from "m3-utils"; import { waitElement } from "m3-utils";
/**
* @param {Object} options
* @param {HTMLAllElement} target
* @return {Object}
*/
function OnProgress(target) {
if (!target) {
return;
}
const innerElement = () => {
target.innerHTML = `<ul class="progress-list">
<li class="progress-item progress-item--left">
<div class="progress-container">
<div class="progress-content">
<p>Meu Carrinho</p>
<span class="progress-bullet"></span>
<span class="progress-line"></span>
</div>
</div>
</li>
<li class="progress-item progress-item--center">
<div class="progress-container">
<div class="progress-content">
<p>Dados Pessoais</p>
<span class="progress-bullet"></span>
</div>
</div>
</li>
<li class="progress-item progress-item--right">
<div class="progress-container">
<div class="progress-content">
<p>Pagamento</p>
<span class="progress-bullet"></span>
<span class="progress-line"></span>
</div>
</div>
</li>
</ul>`;
};
const verifyCurrentRoute = () => {
let bullets = target.querySelectorAll(".progress-bullet");
bullets.forEach((bullet) => {
if (window.location.href.endsWith("#/cart")) {
bullets[0].classList.add("active");
}
if (
window.location.href.endsWith("#/email") ||
window.location.href.endsWith("#/shipping") ||
window.location.href.endsWith("#/profile")
) {
bullets[1].classList.add("active");
}
if (window.location.href.endsWith("#/payment")) {
bullets[2].classList.add("active");
}
window.addEventListener("hashchange", () => {
if (window.location.href.endsWith("#/cart")) {
bullets[0].classList.add("active");
if (bullet != bullets[0]) {
bullet.classList.remove("active");
}
}
if (
window.location.href.endsWith("#/email") ||
window.location.href.endsWith("#/shipping") ||
window.location.href.endsWith("#/profile")
) {
bullets[1].classList.add("active");
if (bullet != bullets[1]) {
bullet.classList.remove("active");
}
}
if (window.location.href.endsWith("#/payment")) {
bullets[2].classList.add("active");
if (bullet != bullets[2]) {
bullet.classList.remove("active");
}
}
});
});
};
const init = () => {
innerElement();
verifyCurrentRoute();
};
const remove = () => {
target.innerHTML = "";
};
return {
ref: target,
init,
remove,
};
}
export default class Header { export default class Header {
constructor() { constructor() {
this.init(); this.init();
@ -8,14 +117,19 @@ export default class Header {
async init() { async init() {
await this.selectors(); await this.selectors();
console.log(this.item); this.innerToProgressBar();
} }
async selectors() { async selectors() {
this.item = await waitElement("#my-element", { this.progressBar = await waitElement("#progressBar", {
//#my-element pode ser a class ou o id do elemento html qeu vocÊ quer pegar timeout: 5000,
timeout: 5000, // vai esperar 5 segundos antes de rejeitar a promise interval: 1000,
interval: 1000, // vai verificar a cada 1 segundo se o elemento existe
}); });
} }
innerToProgressBar() {
let progress = OnProgress(this.progressBar);
progress.init();
}
} }

View File

@ -2,4 +2,5 @@
@import "./lib/slick"; @import "./lib/slick";
@import "./partials/header"; @import "./partials/header";
@import "./partials/footer"; @import "./partials/footer";
@import "./partials/prateleira";
@import "./checkout/checkout.scss"; @import "./checkout/checkout.scss";

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,3 @@
body .container-main.container-order-form .orderform-template.active { body .container-main.container-order-form .orderform-template.active {
.mini-cart { --none-rules: #000;
width: 32.3242%;
margin-left: unset;
margin-right: 0;
float: right;
}
.orderform-template-holder {
width: 66.1132%;
}
} }

View File

@ -1,38 +1,152 @@
.empty-cart { @mixin btn-secondary {
font-family: $font-family; display: flex;
&-content { align-items: center;
color: $color-black; justify-content: center;
text-align: center;
@include mq(md, max) { border: 1px solid $clr-common-black;
padding: 0 16px; border-radius: 0;
}
}
&-title { font-weight: 400;
font-size: 20px; font-family: $font-family-200;
}
&-links { color: $clr-common-black;
.link-choose-products { background-color: $clr-common-white;
background: $color-black; }
border: none;
border-radius: 5px; .container-main.container-cart {
transition: ease-in 0.22s all; display: flex;
outline: none; align-items: center;
font-family: $font-family; justify-content: center;
font-style: normal; flex-direction: column;
font-weight: 500;
font-size: 14px; width: 100%;
line-height: 16px; height: 100%;
text-align: center; padding: 0 16px !important;
letter-spacing: 0.05em;
color: $color-white; #cart-title {
text-transform: uppercase; display: none !important;
}
&:hover {
background: lighten($color-black, 5); .checkout-container,
} .cart-template {
} min-height: auto;
} margin: 0;
}
.link-choose-products {
width: fluid(250px, 343px);
max-width: 250px;
margin: 0 auto;
}
.transactions-container {
display: none;
}
@include mq("lg") {
width: fluid(400px, 1280px);
padding: 0 !important;
max-width: none;
.link-choose-products {
width: fluid(327px, 400px);
max-width: 327px;
}
}
@include mq("xxl") {
width: fluid(659px, 2500px);
}
}
.empty-cart {
&-message {
display: none;
}
}
.container-main.container-cart {
.empty-cart {
font-family: $font-family-100;
&-content {
color: $clr-gray-600;
text-align: center;
.empty-cart-title {
font-size: 0px;
&::before {
@include font-size("s-500");
line-height: 24.51px;
content: "Seu carrinho está vazio.";
text-align: center;
text-transform: uppercase;
}
}
}
&-links {
.link-choose-products {
@include btn-secondary();
transition: ease-in 0.22s all;
font-size: 0px;
padding: 16px 0;
&::before {
@include font-size("s-300");
line-height: 16px;
content: "Continuar Comprando";
font-style: normal;
letter-spacing: 0.05em;
text-transform: uppercase;
}
&:hover {
background: lighten($clr-gray-600, 5);
}
}
}
&-content {
@include mq("lg") {
padding: 0;
}
@include mq("xl") {
.empty-cart-title {
&::before {
@include font-size("splus-100");
line-height: 32.68px;
}
}
}
}
@include mq("xxl") {
&-content {
.empty-cart-title {
&::before {
@include font-size("sxplus");
line-height: 65.37px;
}
}
}
&-links {
.link-choose-products {
width: fluid(638.67px, 659px);
max-width: none;
&::before {
@include font-size("splus-200");
line-height: 32.76px;
}
}
}
}
}
} }

View File

@ -3,21 +3,6 @@
@import "./checkout-pagamento"; @import "./checkout-pagamento";
@import "./checkout-autenticacao"; @import "./checkout-autenticacao";
html {
height: 100%;
min-height: 100%;
}
footer .footerCheckout__wrapper {
width: 94.9734%;
margin: auto auto 0 auto;
}
footer .footerCheckout__prateleira,
header {
width: 79.53125%;
margin: 0 auto;
}
body { body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -29,7 +14,7 @@ body {
} }
&.body-cart { &.body-cart {
font-family: $font-family; font-family: $font-family-100;
} }
&.body-cart, &.body-cart,
@ -47,38 +32,38 @@ body {
padding-left: 0; padding-left: 0;
} }
} }
.container-order-form, }
.container-cart {
width: 80%; .container-cart {
} min-height: 70vh;
} }
.btn-success { .btn-success {
background: $color-black; background: $clr-gray-600;
text-shadow: none; text-shadow: none;
&:hover { &:hover {
background: lighten($color-black, 15%); background: lighten($clr-gray-600, 15%);
} }
} }
.emailInfo h3 { .emailInfo h3 {
color: $color-black !important; color: $clr-gray-600 !important;
} }
#cart-title, #cart-title,
#orderform-title { #orderform-title {
color: $color-gray2; color: $clr-common-black;
font-family: $font-family; font-family: $font-family-100;
font-weight: 500; font-weight: 700;
font-size: 36px; font-size: 24px;
line-height: 42px; line-height: 42px;
margin: 40px 0 30px; margin: 16px 0;
letter-spacing: 0.1em;
text-transform: uppercase; text-transform: uppercase;
@media screen and (min-width: 2500px) {
font-size: 48px;
@include mq(md, max) { line-height: 65px;
margin-left: 30px;
} }
} }
@ -96,7 +81,7 @@ body {
&::before, &::before,
&::after { &::after {
content: ""; content: "";
background: $color-gray2; background: $clr-gray-400;
display: block; display: block;
float: right; float: right;
height: 2px; height: 2px;

View File

@ -101,14 +101,32 @@
position: absolute; position: absolute;
} }
.slick-prev { .slick-prev {
background: url("https://agenciamagma.vteximg.com.br/arquivos/arrow-left-mini-M3Academy.svg")
no-repeat center center;
z-index: 4; z-index: 4;
left: 10px; left: 10px;
background: url("https://agenciamagma.vteximg.com.br/arquivos/arrow-left-mini-M3Academy.svg")
no-repeat center center;
@media screen and (min-width: 2500px) {
height: 57.99px;
width: 26px;
background: url("https://agenciamagma.vteximg.com.br/arquivos/arrow-left-M3Academy.svg")
no-repeat center center / cover;
}
} }
.slick-next { .slick-next {
z-index: 4; z-index: 4;
right: 10px; right: 10px;
background: url("https://agenciamagma.vteximg.com.br/arquivos/arrow-right-mini-M3Academy.svg")
no-repeat center center;
@media screen and (min-width: 2500px) {
height: 57.99px;
width: 26px;
background: url("https://agenciamagma.vteximg.com.br/arquivos/arrow-right-M3Academy.svg")
no-repeat center center / cover;
}
} }
.slick-arrow.slick-hidden { .slick-arrow.slick-hidden {
display: none; display: none;

View File

@ -1,54 +1,168 @@
/* _footer.scss */ /* prettier-ignore*/
.footerCheckout { .footerCheckout {
border-top: none; color: $clr-gray-400;
color: $color-gray2;
&__wrapper { &__wrapper {
align-items: center; border-top: 1px solid $clr-common-black;
display: flex; padding: 16px 25px 18.88px 8px;
justify-content: space-between; }
&__stamps {
order: 0;
margin: 0 0 16px;
} }
&__address { &__address {
color: $color-gray2; order: 1;
font-family: $font-family; margin: 0 0 16px;
}
&__developedBy {
order: 2;
}
}
/* prettier-ignore*/
.footerCheckout {
.container {
display: flex;
flex-direction: column;
width: 100%;
&::before,
&::after {
content: none;
}
}
}
.footerCheckout {
&__developedBy a,
&__developedBy,
&__wrapper,
&__stamps {
display: flex;
align-items: center;
}
&__wrapper {
justify-content: space-between;
}
}
.footerCheckout {
@include mq("md") {
&__stamps {
width: 34.510595358%;
}
&__wrapper {
padding: 16px 0;
.container {
width: 94.9734%;
margin: 0 auto;
}
}
}
@include mq("lg") {
.container {
align-items: center;
justify-content: space-between;
flex-direction: row;
}
&__wrapper {
width: 100%;
}
&__address {
order: 0;
margin: 0;
}
&__stamps {
order: 1;
width: 33.223684211%;
margin: 0;
}
&__developedBy {
order: 2;
}
}
@include mq("xxl") {
&__address {
span {
font-size: 20px;
}
}
&__stamps {
width: 29.074771156%;
}
&__developedBy {
span {
font-size: map-get($text-sizes, "s-500");
line-height: 24.51px;
}
}
}
}
.footerCheckout {
&__creditList {
display: flex;
align-items: center;
gap: 4px;
width: 100%;
}
&__creditItem,
&__verificatedVtex {
max-width: 100%;
img {
width: 100%;
height: auto;
}
}
}
.footerCheckout {
&__address {
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 10px; font-size: 10px;
line-height: 12px; line-height: 12px;
text-transform: capitalize; text-transform: capitalize;
max-width: 40%;
@include mq(md, max) { color: $clr-gray-400;
margin-bottom: 24px;
max-width: 100%;
}
} }
}
.footerCheckout {
&__stamps { &__stamps {
align-items: center;
display: flex;
justify-self: center;
list-style: none;
@include mq(md, max) {
align-self: center;
margin-bottom: 12px;
}
&__divider { &__divider {
background-color: $color-gray4;
display: inline-block; display: inline-block;
width: 1px;
height: 24px; height: 24px;
margin: 0 8px; margin: 0 8px;
width: 1px;
background-color: $clr-gray-300;
} }
} }
}
.footerCheckout {
&__developedBy { &__developedBy {
align-items: center;
display: flex;
list-style-type: none;
margin: 0; margin: 0;
li:last-child { li:last-child {
@ -56,19 +170,23 @@
} }
a { a {
align-items: center;
color: $color-gray2;
display: flex;
font-family: $font-family;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
font-size: 10px; font-size: 10px;
line-height: 12px; line-height: 12px;
font-family: $font-family-100;
text-decoration: none; text-decoration: none;
color: $clr-gray-400;
span { span {
margin-right: 8px; margin-right: 8px;
} }
img {
width: 32px;
height: auto;
}
} }
} }
} }

View File

@ -1,36 +1,300 @@
/* _header.scss */ /* _header.scss */
.headerCheckout {
.container { body {
width: auto !important; margin: 0;
padding: 0;
}
body * {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body :where(ul, li, ol) {
list-style: none;
margin: 0;
}
@function fluid($width, $design-width) {
$width: calc($width / $design-width * 100);
$width: quote($width + "%");
@return unquote($width);
}
@mixin font-size($size) {
$content: $text-sizes;
@if map-has-key($content, $size) {
font-size: map-get($content, $size);
} }
&__wrapper { }
align-items: center;
display: flex; .headerCheckout {
justify-content: space-between; position: sticky;
position: -webkit-sticky;
top: 0;
left: 0;
background: $clr-common-white;
width: 100%;
padding: 16px;
border-bottom: 1px solid $clr-common-black;
z-index: 10000;
.container {
width: 100%;
height: auto;
margin: 0;
} }
&__logo { &__wrapper,
img { &__safeBuy {
height: 52px; display: flex;
width: auto; align-items: center;
} }
&__wrapper {
justify-content: space-between;
width: 100%;
} }
&__safeBuy { &__safeBuy {
span { gap: 8px;
align-items: center;
display: flex; width: 100%;
text-transform: uppercase; max-width: 119px;
font-family: $font-family; }
font-style: normal; }
font-weight: normal;
font-size: 12px; .headerCheckout__safeBuy {
line-height: 14px; span {
color: $color-gray; @include font-size("s-200");
line-height: 16.34px;
font-style: normal;
font-weight: normal;
font-family: $font-family-100;
text-transform: uppercase;
}
img {
width: 12px;
height: 13px;
}
}
.headerCheckout__logo {
width: fluid(155.58px, 343px);
height: auto;
max-width: 155.58px;
img {
width: 100%;
height: 100%;
}
}
.headerCheckout {
.progress-bar {
display: none;
}
}
.headerCheckout {
@include mq("lg") {
padding: 29px 0;
&__wrapper {
width: fluid(1018px, 1280px);
margin: 0 auto;
} }
i { .progress-bar {
margin-right: 8px; display: flex;
}
}
@include mq("xxl") {
$width-container: 1988.28px;
&__wrapper {
width: fluid($width-container, 2500px);
}
&__logo {
width: fluid(382.07px, $width-container);
max-width: none;
height: auto;
}
&__safeBuy {
width: fluid(235.28px, $width-container);
max-width: none;
span {
@include font-size("splus-100");
line-height: 32.68px;
font-family: $font-family-100;
}
img {
width: 29.47px;
height: 41.46px;
}
}
}
}
.headerCheckout {
.progress-bar {
width: 439px;
}
.progress-list,
.progress-item,
.progress-container,
.progress-content {
display: flex;
align-items: center;
}
.progress-list {
justify-content: space-between;
width: 100%;
margin: 0;
}
.progress-item,
.progress-container,
.progress-content {
flex-direction: column;
justify-content: center;
}
.progress-container {
position: relative;
width: 100%;
}
.progress-content {
gap: 16px;
}
.progress-item {
@include font-size("s-200");
line-height: 14.04px;
font-family: $font-family-200;
&--left,
&--right {
width: 40%;
.progress-line {
position: absolute;
bottom: 6px;
width: 100%;
height: 1px;
border-bottom: 1px solid #000;
}
}
&--left {
.progress-container {
align-items: flex-start;
}
.progress-line {
left: 75%;
transform: translateX(-50%);
}
}
&--center {
width: 90px;
}
&--right {
.progress-container {
align-items: flex-end;
}
.progress-line {
right: 72%;
transform: translateX(50%);
}
}
}
.progress-bullet {
$square-size: 12px;
position: relative;
z-index: 10;
width: $square-size;
height: $square-size;
border: 1px solid $clr-common-black;
border-radius: 100%;
background-color: $clr-common-white;
&.active {
background-color: $clr-common-black;
}
}
}
.headerCheckout {
@include mq("xxl") {
.progress-bar {
width: 1078.86px;
}
.progress-list {
justify-content: initial;
}
.progress-item {
@include font-size("splus-100");
line-height: 28.08px;
&--left,
&--right {
width: fluid(444px, 1078.86px);
.progress-line {
bottom: 12px;
}
}
&--left {
.progress-line {
left: 67%;
}
}
&--center {
width: auto;
max-width: none;
}
&--right {
.progress-line {
right: 67%;
}
}
}
.progress-bullet {
$square-size: 24px;
width: $square-size;
height: $square-size;
} }
} }
} }

View File

@ -1 +1,175 @@
/* _prateleira.scss */ /* _prateleira.scss */
.footerCheckout__prateleira {
width: 100%;
padding: 0 8px;
margin: 43.42px 0 54px;
.slick-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 13.64px;
height: 29.47px;
border: none;
background-color: transparent;
}
}
.footerCheckout__prateleira {
&-title {
width: 100%;
padding: 0 8px;
margin-bottom: 20px;
font-size: 14px;
font-weight: 400;
font-family: $font-family-200;
text-align: center;
color: $clr-common-black;
}
}
.footerCheckout__prateleira {
.product-item-container {
margin: 0 8px;
}
}
.footerCheckout__prateleira {
.product-item {
&-figure {
width: 100%;
margin-bottom: 20px;
img {
max-width: 100%;
width: 100%;
height: auto;
}
}
}
}
.footerCheckout__prateleira {
.product-item {
&-name,
&-link,
.type-name {
@include font-size("s-250");
line-height: 24px;
font-family: $font-family-100;
}
}
}
.footerCheckout__prateleira {
.product-item {
&-name {
min-height: 36px;
height: 36px;
font-weight: 400;
font-family: $font-family-100;
text-overflow: ellipsis;
text-align: center;
@media screen and (max-width:410px) {
height: 53px;
}
}
&-types {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
gap: 5px;
min-height: 68px;
height: 68px
}
}
}
.footerCheckout__prateleira {
.product-item {
&-link {
@include btn-primary-blue-white();
display: flex;
align-items: center;
justify-content: center;
width: 100%;
padding: 12px 0;
border-radius: 8px;
font-weight: 700;
letter-spacing: 5;
color: $clr-common-white;
}
}
.product-type-container {
display: flex;
align-items: center;
justify-content: center;
height: 28px;
border-radius: 8px;
background-color: $clr-primary-blue-500;
}
.type-name {
padding: 5px;
font-weight: 700;
letter-spacing: 5;
font-family: $font-family-100;
color: $clr-common-white;
}
}
.footerCheckout__prateleira {
@include mq("lg") {
width: fluid(1034px, 1280px);
margin: 43.42px auto 56px;
padding: 0;
}
@include mq("md") {
&-title {
@include font-size("splus-100");
line-height: 38px;
}
}
@include mq("xxl") {
&-title {
@include font-size("sxplus");
line-height: 76px;
padding: 0;
}
.product-item {
&-name,
&-link,
.type-name {
@include font-size("splus-200");
line-height: 35.41px;
font-family: $font-family-100;
}
}
.product-item-container {
margin: 0 9.965px;
}
}
}

View File

@ -1,183 +1,217 @@
@use "sass:meta";
@mixin btn-primary-blue-black() {
border: none;
color: $clr-common-black;
background: $clr-primary-blue-500;
text-transform: uppercase;
}
@mixin btn-primary-blue-white() {
border: none;
color: $clr-common-white;
background: $clr-primary-blue-500;
text-transform: uppercase;
}
@mixin text-size($size) {
@if map_has_key($text-sizes, $size) {
$size: map_get($text-sizes, $size);
font-size: $size;
}
}
/** /**
* @reference (https://github.com/engageinteractive/core/blob/master/src/scss/utility/_mixins.scss) * @reference (https://github.com/engageinteractive/core/blob/master/src/scss/utility/_mixins.scss)
*/ */
@mixin push--auto { @mixin push--auto {
margin: { margin: {
left: auto; left: auto;
right: auto; right: auto;
} }
} }
@mixin pseudo($display: block, $pos: absolute, $content: ''){ @mixin pseudo($display: block, $pos: absolute, $content: "") {
content: $content; content: $content;
display: $display; display: $display;
position: $pos; position: $pos;
} }
@mixin position($top: false, $right: false, $bottom: false, $left: false) {
@mixin position($top: false,$right: false, $bottom:false, $left: false){ @if ($top) {
@if( $top ){ top: $top;
top:$top; }
} @if ($right) {
@if( $right ){ right: $right;
right:$right; }
} @if ($left) {
@if( $left ){ left: $left;
left:$left; }
} @if ($bottom) {
@if( $bottom ){ bottom: $bottom;
bottom:$bottom; }
}
} }
@mixin responsive-ratio($x,$y, $pseudo: false) { @mixin responsive-ratio($x, $y, $pseudo: false) {
$padding: unquote( ( $y / $x ) * 100 + '%' ); $padding: unquote(($y / $x) * 100 + "%");
@if $pseudo { @if $pseudo {
&:before { &:before {
@include pseudo($pos: relative); @include pseudo($pos: relative);
width: 100%; width: 100%;
padding-top: $padding; padding-top: $padding;
} }
} @else { } @else {
padding-top: $padding; padding-top: $padding;
} }
} }
@mixin css-triangle($color, $direction, $size: 6px, $position: absolute, $round: false){ @mixin css-triangle($color, $direction, $size: 6px, $position: absolute, $round: false) {
@include pseudo($pos: $position); @include pseudo($pos: $position);
width: 0; width: 0;
height: 0; height: 0;
@if $round { @if $round {
border-radius: 3px; border-radius: 3px;
} }
@if $direction == down { @if $direction == down {
border-left: $size solid transparent; border-left: $size solid transparent;
border-right: $size solid transparent; border-right: $size solid transparent;
border-top: $size solid $color; border-top: $size solid $color;
margin-top: 0 - round( $size / 2.5 ); margin-top: 0 - round($size / 2.5);
} @else if $direction == up { } @else if $direction == up {
border-left: $size solid transparent; border-left: $size solid transparent;
border-right: $size solid transparent; border-right: $size solid transparent;
border-bottom: $size solid $color; border-bottom: $size solid $color;
margin-bottom: 0 - round( $size / 2.5 ); margin-bottom: 0 - round($size / 2.5);
} @else if $direction == right { } @else if $direction == right {
border-top: $size solid transparent; border-top: $size solid transparent;
border-bottom: $size solid transparent; border-bottom: $size solid transparent;
border-left: $size solid $color; border-left: $size solid $color;
margin-right: -$size; margin-right: -$size;
} @else if $direction == left { } @else if $direction == left {
border-top: $size solid transparent; border-top: $size solid transparent;
border-bottom: $size solid transparent; border-bottom: $size solid transparent;
border-right: $size solid $color; border-right: $size solid $color;
margin-left: -$size; margin-left: -$size;
} }
} }
@mixin input-placeholder { @mixin input-placeholder {
&.placeholder { @content; } &.placeholder {
&:-moz-placeholder { @content; } @content;
&::-moz-placeholder { @content; } }
&:-ms-input-placeholder { @content; } &:-moz-placeholder {
&::-webkit-input-placeholder { @content; } @content;
}
&::-moz-placeholder {
@content;
}
&:-ms-input-placeholder {
@content;
}
&::-webkit-input-placeholder {
@content;
}
} }
@mixin hardware($backface: true, $perspective: 1000) { @mixin hardware($backface: true, $perspective: 1000) {
@if $backface { @if $backface {
backface-visibility: hidden; backface-visibility: hidden;
} }
perspective: $perspective; perspective: $perspective;
} }
@mixin truncate($truncation-boundary) { @mixin truncate($truncation-boundary) {
max-width: $truncation-boundary; max-width: $truncation-boundary;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
@mixin appearance($val: none) { @mixin appearance($val: none) {
-webkit-appearance: $val; -webkit-appearance: $val;
-moz-appearance: $val; -moz-appearance: $val;
appearance: $val; appearance: $val;
} }
@mixin separador($cor, $p-right: 5px) {
@mixin separador($cor,$p-right: 5px) { position: relative;
position: relative; padding-right: $p-right;
padding-right: $p-right; display: inline-block;
display: inline-block; &:after {
&:after{ content: " ";
content:' '; display: block;
display: block; width: 1px;
width: 1px; height: 100%;
height: 100%; position: absolute;
position: absolute; top: 50%;
top: 50%; right: 0;
right: 0; transform: translateY(-50%);
transform: translateY(-50%); background-color: $cor;
background-color: $cor; }
} &:last-child:after {
&:last-child:after{ display: none;
display: none; }
}
} }
@mixin mq($width, $type: min) { @mixin mq($width, $type: min) {
@if map_has_key($grid-breakpoints, $width) { @if map_has_key($grid-breakpoints, $width) {
$width: map_get($grid-breakpoints, $width); $width: map_get($grid-breakpoints, $width);
@if $type == max { @if $type == max {
$width: $width - 1px; $width: $width - 1px;
} }
@media only screen and (#{$type}-width: $width) { @media only screen and (#{$type}-width: $width) {
@content; @content;
} }
} }
} }
@mixin mq_range($min, $max) { @mixin mq_range($min, $max) {
@if (map_has_key($grid-breakpoints, $min) and map_has_key($grid-breakpoints, $max)) { @if (map_has_key($grid-breakpoints, $min) and map_has_key($grid-breakpoints, $max)) {
$width_max: map_get($grid-breakpoints, $max);
$width_max: map_get($grid-breakpoints, $max); $width_min: map_get($grid-breakpoints, $min);
$width_min: map_get($grid-breakpoints, $min); $width_max: $width_max - 1px;
$width_max: $width_max - 1px; @media only screen and (min-width: $width_min) and (max-width: $width_max) {
@media only screen and (min-width: $width_min) and (max-width:$width_max) { @content;
@content; }
} }
}
} }
@mixin z-index($nome:'',$soma:0){ @mixin z-index($nome: "", $soma: 0) {
@if map_has_key($z-index, $nome) { @if map_has_key($z-index, $nome) {
z-index: (map_get($z-index,$nome )+$soma) ; z-index: (map_get($z-index, $nome) + $soma);
} }
} }
@mixin scrollbar($width:8px,$bg-color:#eee, $trak-color:#aaa,$trak-color-hover:#999,$border-radius:0 ){ @mixin scrollbar(
&::-webkit-scrollbar { $width: 8px,
width: $width; $bg-color: #eee,
} $trak-color: #aaa,
$trak-color-hover: #999,
$border-radius: 0
) {
&::-webkit-scrollbar {
width: $width;
}
&::-webkit-scrollbar-track { &::-webkit-scrollbar-track {
background-color: $bg-color; background-color: $bg-color;
border-radius: $border-radius; border-radius: $border-radius;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
background-color: $trak-color; background-color: $trak-color;
border-radius: $border-radius; border-radius: $border-radius;
&:hover { &:hover {
background: $trak-color-hover; background: $trak-color-hover;
} }
} }
} }
@function map-get-next($map, $key, $fallback: false, $return: value) { @function map-get-next($map, $key, $fallback: false, $return: value) {
// Check if map is valid // Check if map is valid
@if type-of($map) == map { @if type-of($map) == map {
// Check if key exists in map // Check if key exists in map
@if map-has-key($map, $key) { @if map-has-key($map, $key) {
// Init index counter variable // Init index counter variable
$i: 0; $i: 0;

View File

@ -1,38 +1,61 @@
/* fonts */ /* fonts */
@import url("https://fonts.googleapis.com/css2?family=Tenor+Sans&display=swap"); @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"); @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-100: "Open Sans", sans-serif;
$font-family-secundary:"Tenor Sans", sans-serif; $font-family-200: "Tenor Sans", sans-serif;
/* Colors */ /* Colors */
$color-black: #292929; $clr-common-black: #000;
$clr-common-white: #fff;
$color-white: #fff; $clr-gray-600: #292929;
$clr-gray-500: #6c6c6c;
$clr-gray-400: #7d7d7d;
$clr-gray-300: #8d8d8d;
$clr-gray-250: #c4c4c4;
$clr-gray-200: #e5e5e5;
$clr-gray-100: #f0f0f0;
$color-gray: #6c6c6c; $clr-blue-500: #4267b2;
$color-gray2: #7d7d7d;
$color-gray3: #f0f0f0;
$color-gray4: #8d8d8d;
$color-gray5: #e5e5e5;
$color-blue: #4267b2; $clr-green-500: #4caf50;
$color-green: #4caf50; $clr-primary-blue-500: #00c8ff;
/*prettier-ignore*/
$text-sizes: (
"s-050": 9px,
"s-100": 10px,
"s-200": 12px,
"s-250": 13px,
"s-300": 14px,
"s-400": 16px,
"s-500": 18px, // MAIN
"s-600": 20px,
"splus-100": 24px,
"splus-200": 26px,
"splus-300": 28px,
"splus-500": 32px,
"splus-700": 36px,
"splus-900": 40px,
"sxplus": 48px,
) !default;
/* Grid breakpoints */ /* Grid breakpoints */
$grid-breakpoints: ( $grid-breakpoints: (
xs: 0, xxs: 0,
cstm: 400, xs: 280px,
sm: 576px, sm: 375px,
md: 768px, md: 600px,
lg: 992px, lg: 1025px,
xl: 1200px xl: 1280px,
xxl: 2500px,
) !default; ) !default;
$z-index: ( $z-index: (
level1: 5, level-100: 5,
level2: 10, level-200: 10,
level3: 15, level-300: 15,
level4: 20, level-400: 20,
level5: 25 level-500: 25,
) !default; ) !default;

View File

@ -1,20 +1,31 @@
<!-- Esse arquivo é só um demonstrativo de como está o html do header do checkout atualmente, <!-- Esse arquivo é só um demonstrativo de como está o html do header do checkout atualmente,
MODIFICA-LO NÃO CAUSARÁ EFEITO ALGUM, todo html que for modificado no header, deverá ser feito através de javaScript. --> MODIFICA-LO NÃO CAUSARÁ EFEITO ALGUM, todo html que for modificado no header, deverá ser feito através de javaScript. -->
<header class="headerCheckout"> <header class="headerCheckout w-100 h-auto">
<div class="container"> <div class="container w-100 h-auto">
<div class="headerCheckout__wrapper"> <div class="headerCheckout__wrapper d-flex align-items-center jus-between">
<div class="headerCheckout__logo"> <div class="headerCheckout__logo w-PERCENT">
<a href="/"> <a class="w-100 h-100" href="/">
<img src="https://agenciamagma.vteximg.com.br/arquivos/LogoM3Academy.png" alt="M3 Academy"/> <img
</a> class="w-100 h-100"
</div> src="https://agenciamagma.vteximg.com.br/arquivos/LogoM3Academy.png"
<div id="progressBar" class="progress-bar"> Aqui entra a barra de progresso alt="M3 Academy"
</div> />
<div class="headerCheckout__safeBuy"> </a>
<img src="https://agenciamagma.vteximg.com.br/arquivos/cadeadoCompraSegM3Academy.png" alt="Cadeado"/> </div>
<span>Compra segura</span>
</div> <div id="progressBar w-DEFINE-FIXED" class="progress-bar">
<ul class="progress-list w-100 pos-relative d-flex jus-between"></ul>
</div>
<div class="headerCheckout__safeBuy w-PERCENT">
<img
class="w-100 h-100"
src="https://agenciamagma.vteximg.com.br/arquivos/cadeadoCompraSegM3Academy.png"
alt="Cadeado"
/>
<span class="fz-12">Compra segura</span>
</div> </div>
</div> </div>
</header> </div>
</header>

2
package-lock.json generated
View File

@ -45,6 +45,7 @@
"jquery": "^3.6.0", "jquery": "^3.6.0",
"m3-utils": "^0.1.0", "m3-utils": "^0.1.0",
"sass": "^1.38.1", "sass": "^1.38.1",
"slick-carousel": "^1.8.1",
"terser-webpack-plugin": "^5.1.4" "terser-webpack-plugin": "^5.1.4"
}, },
"devDependencies": { "devDependencies": {
@ -19345,6 +19346,7 @@
"m3-utils": "^0.1.0", "m3-utils": "^0.1.0",
"prettier": "^2.3.2", "prettier": "^2.3.2",
"sass": "^1.38.1", "sass": "^1.38.1",
"slick-carousel": "^1.8.1",
"terser-webpack-plugin": "^5.1.4", "terser-webpack-plugin": "^5.1.4",
"webpack": "^5.51.1", "webpack": "^5.51.1",
"webpack-merge": "^5.8.0" "webpack-merge": "^5.8.0"