Merge pull request 'develop' (#11) from develop into main

Reviewed-on: #11
This commit is contained in:
Henrique Santos Santana 2022-12-26 17:04:34 +00:00
commit e527a06c9a
17 changed files with 4584 additions and 1077 deletions

View File

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

View File

@ -1,5 +1,11 @@
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 {
constructor() {
this.init();
@ -7,34 +13,257 @@ export default class Footer {
async init() {
await this.selectors();
// this.onUpdate();
this.createdToPaymentsInFooter();
this.createdToDevelopedBy();
this.onloadWindowVerificatedShelf();
this.onUpdate();
}
async selectors() {
//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
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() {
//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 verificatedContents =
this.isExistElement(this.checkoutEmpty) && this.isExistElement(this.checkoutContainer);
if (verificatedContents) {
let target = this.checkoutEmpty;
let config = { childList: true, attributes: true };
let observer = new MutationObserver((mutations) => {
mutations.forEach(function (mutation) {
console.log(mutation.type);
});
/* 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));
}
async addCarrossel() {
const elemento = await waitElement("#my-element");
$(elemento).slick({
}
addCarrossel() {
$(this.shelf.children[1]).slick({
slidesToShow: 4,
slidesToScroll: 1,
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>`;
});
this.shelf.children[1].innerHTML = `
${structure.trim()}
`;
}
createdInitialShelfList() {
this.shelf.innerHTML = `
<div class="footerCheckout__prateleira-header">
<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 { 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 {
constructor() {
this.init();
@ -8,14 +117,19 @@ export default class Header {
async init() {
await this.selectors();
console.log(this.item);
this.innerToProgressBar();
}
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", {
timeout: 5000,
interval: 1000,
});
}
innerToProgressBar() {
let progress = OnProgress(this.progressBar);
progress.init();
}
}

View File

@ -2,4 +2,5 @@
@import "./lib/slick";
@import "./partials/header";
@import "./partials/footer";
@import "./partials/prateleira";
@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 {
.mini-cart {
width: 32.3242%;
margin-left: unset;
margin-right: 0;
float: right;
}
.orderform-template-holder {
width: 66.1132%;
}
--none-rules: #000;
}

View File

@ -1,37 +1,151 @@
@mixin btn-secondary {
display: flex;
align-items: center;
justify-content: center;
border: 1px solid $clr-common-black;
border-radius: 0;
font-weight: 400;
font-family: $font-family-200;
color: $clr-common-black;
background-color: $clr-common-white;
}
.container-main.container-cart {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
width: 100%;
height: 100%;
padding: 0 16px !important;
#cart-title {
display: none !important;
}
.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 {
font-family: $font-family;
&-message {
display: none;
}
}
.container-main.container-cart {
.empty-cart {
font-family: $font-family-100;
&-content {
color: $color-black;
color: $clr-gray-600;
text-align: center;
@include mq(md, max) {
padding: 0 16px;
}
}
.empty-cart-title {
font-size: 0px;
&-title {
font-size: 20px;
&::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 {
background: $color-black;
border: none;
border-radius: 5px;
@include btn-secondary();
transition: ease-in 0.22s all;
outline: none;
font-family: $font-family;
font-style: normal;
font-weight: 500;
font-size: 14px;
font-size: 0px;
padding: 16px 0;
&::before {
@include font-size("s-300");
line-height: 16px;
text-align: center;
content: "Continuar Comprando";
font-style: normal;
letter-spacing: 0.05em;
color: $color-white;
text-transform: uppercase;
}
&:hover {
background: lighten($color-black, 5);
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-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 {
display: flex;
flex-direction: column;
@ -29,7 +14,7 @@ body {
}
&.body-cart {
font-family: $font-family;
font-family: $font-family-100;
}
&.body-cart,
@ -47,38 +32,38 @@ body {
padding-left: 0;
}
}
.container-order-form,
.container-cart {
width: 80%;
}
.container-cart {
min-height: 70vh;
}
.btn-success {
background: $color-black;
background: $clr-gray-600;
text-shadow: none;
&:hover {
background: lighten($color-black, 15%);
background: lighten($clr-gray-600, 15%);
}
}
.emailInfo h3 {
color: $color-black !important;
color: $clr-gray-600 !important;
}
#cart-title,
#orderform-title {
color: $color-gray2;
font-family: $font-family;
font-weight: 500;
font-size: 36px;
color: $clr-common-black;
font-family: $font-family-100;
font-weight: 700;
font-size: 24px;
line-height: 42px;
margin: 40px 0 30px;
letter-spacing: 0.1em;
margin: 16px 0;
text-transform: uppercase;
@media screen and (min-width: 2500px) {
font-size: 48px;
@include mq(md, max) {
margin-left: 30px;
line-height: 65px;
}
}
@ -96,7 +81,7 @@ body {
&::before,
&::after {
content: "";
background: $color-gray2;
background: $clr-gray-400;
display: block;
float: right;
height: 2px;

View File

@ -101,14 +101,32 @@
position: absolute;
}
.slick-prev {
background: url("https://agenciamagma.vteximg.com.br/arquivos/arrow-left-mini-M3Academy.svg")
no-repeat center center;
z-index: 4;
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 {
z-index: 4;
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 {
display: none;

View File

@ -1,54 +1,168 @@
/* _footer.scss */
/* prettier-ignore*/
.footerCheckout {
border-top: none;
color: $color-gray2;
color: $clr-gray-400;
&__wrapper {
align-items: center;
display: flex;
justify-content: space-between;
border-top: 1px solid $clr-common-black;
padding: 16px 25px 18.88px 8px;
}
&__stamps {
order: 0;
margin: 0 0 16px;
}
&__address {
color: $color-gray2;
font-family: $font-family;
order: 1;
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-weight: normal;
font-size: 10px;
line-height: 12px;
text-transform: capitalize;
max-width: 40%;
@include mq(md, max) {
margin-bottom: 24px;
max-width: 100%;
color: $clr-gray-400;
}
}
.footerCheckout {
&__stamps {
align-items: center;
display: flex;
justify-self: center;
list-style: none;
@include mq(md, max) {
align-self: center;
margin-bottom: 12px;
}
&__divider {
background-color: $color-gray4;
display: inline-block;
width: 1px;
height: 24px;
margin: 0 8px;
width: 1px;
background-color: $clr-gray-300;
}
}
}
.footerCheckout {
&__developedBy {
align-items: center;
display: flex;
list-style-type: none;
margin: 0;
li:last-child {
@ -56,19 +170,23 @@
}
a {
align-items: center;
color: $color-gray2;
display: flex;
font-family: $font-family;
font-style: normal;
font-weight: normal;
font-size: 10px;
line-height: 12px;
font-family: $font-family-100;
text-decoration: none;
color: $clr-gray-400;
span {
margin-right: 8px;
}
img {
width: 32px;
height: auto;
}
}
}
}

View File

@ -1,36 +1,300 @@
/* _header.scss */
.headerCheckout {
.container {
width: auto !important;
}
&__wrapper {
align-items: center;
display: flex;
justify-content: space-between;
body {
margin: 0;
padding: 0;
}
&__logo {
img {
height: 52px;
width: auto;
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);
}
}
.headerCheckout {
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;
}
&__wrapper,
&__safeBuy {
display: flex;
align-items: center;
}
&__wrapper {
justify-content: space-between;
width: 100%;
}
&__safeBuy {
span {
align-items: center;
display: flex;
text-transform: uppercase;
font-family: $font-family;
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 14px;
color: $color-gray;
gap: 8px;
width: 100%;
max-width: 119px;
}
}
i {
margin-right: 8px;
.headerCheckout__safeBuy {
span {
@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;
}
.progress-bar {
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 */
.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,3 +1,27 @@
@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)
*/
@ -7,13 +31,12 @@
right: auto;
}
}
@mixin pseudo($display: block, $pos: absolute, $content: ''){
@mixin pseudo($display: block, $pos: absolute, $content: "") {
content: $content;
display: $display;
position: $pos;
}
@mixin position($top: false, $right: false, $bottom: false, $left: false) {
@if ($top) {
top: $top;
@ -30,7 +53,7 @@
}
@mixin responsive-ratio($x, $y, $pseudo: false) {
$padding: unquote( ( $y / $x ) * 100 + '%' );
$padding: unquote(($y / $x) * 100 + "%");
@if $pseudo {
&:before {
@include pseudo($pos: relative);
@ -73,11 +96,21 @@
}
@mixin input-placeholder {
&.placeholder { @content; }
&:-moz-placeholder { @content; }
&::-moz-placeholder { @content; }
&:-ms-input-placeholder { @content; }
&::-webkit-input-placeholder { @content; }
&.placeholder {
@content;
}
&:-moz-placeholder {
@content;
}
&::-moz-placeholder {
@content;
}
&:-ms-input-placeholder {
@content;
}
&::-webkit-input-placeholder {
@content;
}
}
@mixin hardware($backface: true, $perspective: 1000) {
@ -100,13 +133,12 @@
appearance: $val;
}
@mixin separador($cor, $p-right: 5px) {
position: relative;
padding-right: $p-right;
display: inline-block;
&:after {
content:' ';
content: " ";
display: block;
width: 1px;
height: 100%;
@ -135,7 +167,6 @@
@mixin mq_range($min, $max) {
@if (map_has_key($grid-breakpoints, $min) and map_has_key($grid-breakpoints, $max)) {
$width_max: map_get($grid-breakpoints, $max);
$width_min: map_get($grid-breakpoints, $min);
$width_max: $width_max - 1px;
@ -145,13 +176,19 @@
}
}
@mixin z-index($nome:'',$soma:0){
@mixin z-index($nome: "", $soma: 0) {
@if map_has_key($z-index, $nome) {
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(
$width: 8px,
$bg-color: #eee,
$trak-color: #aaa,
$trak-color-hover: #999,
$border-radius: 0
) {
&::-webkit-scrollbar {
width: $width;
}
@ -171,13 +208,10 @@
}
@function map-get-next($map, $key, $fallback: false, $return: value) {
// Check if map is valid
@if type-of($map) == map {
// Check if key exists in map
@if map-has-key($map, $key) {
// Init index counter variable
$i: 0;

View File

@ -1,38 +1,61 @@
/* fonts */
@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-100: "Open Sans", sans-serif;
$font-family-200: "Tenor Sans", sans-serif;
/* 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;
$color-gray2: #7d7d7d;
$color-gray3: #f0f0f0;
$color-gray4: #8d8d8d;
$color-gray5: #e5e5e5;
$clr-blue-500: #4267b2;
$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: (
xs: 0,
cstm: 400,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px
xxs: 0,
xs: 280px,
sm: 375px,
md: 600px,
lg: 1025px,
xl: 1280px,
xxl: 2500px,
) !default;
$z-index: (
level1: 5,
level2: 10,
level3: 15,
level4: 20,
level5: 25
level-100: 5,
level-200: 10,
level-300: 15,
level-400: 20,
level-500: 25,
) !default;

View File

@ -1,19 +1,30 @@
<!-- 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. -->
<header class="headerCheckout">
<div class="container">
<div class="headerCheckout__wrapper">
<div class="headerCheckout__logo">
<a href="/">
<img src="https://agenciamagma.vteximg.com.br/arquivos/LogoM3Academy.png" alt="M3 Academy"/>
<header class="headerCheckout w-100 h-auto">
<div class="container w-100 h-auto">
<div class="headerCheckout__wrapper d-flex align-items-center jus-between">
<div class="headerCheckout__logo w-PERCENT">
<a class="w-100 h-100" href="/">
<img
class="w-100 h-100"
src="https://agenciamagma.vteximg.com.br/arquivos/LogoM3Academy.png"
alt="M3 Academy"
/>
</a>
</div>
<div id="progressBar" class="progress-bar"> Aqui entra a barra de progresso
<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">
<img src="https://agenciamagma.vteximg.com.br/arquivos/cadeadoCompraSegM3Academy.png" alt="Cadeado"/>
<span>Compra segura</span>
<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>

2
package-lock.json generated
View File

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