develop #1

Merged
affonso_kopmann merged 4 commits from develop into main 2022-12-19 01:33:13 +00:00
14 changed files with 9960 additions and 56 deletions

View File

@ -8,11 +8,13 @@ export default class Footer {
async init() { async init() {
await this.selectors(); await this.selectors();
// this.onUpdate(); // this.onUpdate();
this.footer();
} }
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.divFooter = await waitElement(".footerCheckout__wrapper");
this.checkoutVazio = await waitElement(".empty-cart-content"); this.checkoutVazio = await waitElement(".empty-cart-content");
} }
@ -37,4 +39,97 @@ export default class Footer {
slidesToScroll: 1, slidesToScroll: 1,
}); });
} }
createShelf() {
if (this.itensShelf) {
this.itensShelf.innerHTML = `
<div class="footerCheckout__prateleira-title">
<h2>Você também pode gostar:</h2>
</div>
<ul class="footerCheckout__shelfList"></ul>
`;
}
}
async shelfItens() {
let structure = "";
this.list.forEach((response) => {
const sku = response.skus.map((item) => `<li>${item}</li>`);
structure += `
<li>
<figure><img src ="${response.img}"/></figure>
<figcaption>${response.name}</figcaption>
<div><ul>${sku}</ul></div>
<button type="button"><a href="${response.link}">Ver Produto</a></button>
</li>
`;
});
this.shelfList.innerHTML = structure;
}
async requestApi() {
const api =
"https://m3academy.myvtex.com/api/catalog_system/pub/products/search/?fq=productClusterIds:319";
return fetch(api)
.then((response) => response.json())
.then((data) => {
const prodInfo = data.map((response) => ({
name: response.productName,
skus: response.items.map((item) => item.name),
img: response.items[0].images[0].imageUrl,
link: response.link,
}));
return prodInfo;
});
}
footer() {
this.divFooter.innerHTML = `
<hr></hr>
<div class="conteiner_footer">
<div class="footerCheckout__address">
<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>
</div>
<ul class="footerCheckout__stamps">
<li>
<span class="footerCheckout__payments">
<img class="imgFooter" src="https://agenciamagma.vteximg.com.br/arquivos/masterCardM3Academy.png" alt="mastercard" style="width: 35px; margin-right: 13px; ">
<img class="imgFooter" src="https://agenciamagma.vteximg.com.br/arquivos/visaM3Academy.png" alt="visa" style="width: 35px; margin-right: 13px;">
<img class="imgFooter" src="https://agenciamagma.vteximg.com.br/arquivos/amexM3Academy.png" alt="american" style="width: 35px; margin-right: 13px;">
<img class="imgFooter" src="https://agenciamagma.vteximg.com.br/arquivos/eloM3Academy.png" alt="elo" style="width: 35px; margin-right: 13px;">
<img class="imgFooter" src="https://agenciamagma.vteximg.com.br/arquivos/hiperCardM3Academy.png" alt="hipercard" style="width: 35px; margin-right: 13px;">
<img class="imgFooter" src="https://agenciamagma.vteximg.com.br/arquivos/payPalM3Academy.png" alt="paypal" style="width: 35px; margin-right: 13px;">
<img class="imgFooter" src="https://agenciamagma.vteximg.com.br/arquivos/boletoM3Academy.png" alt="boleto" style="width: 35px; margin-right: 13px;">
</span>
</li>
<li>
<span class="footerCheckout__stamps__divider"></span>
</li>
<li>
<span class="footerCheckout__payments">
<img class="imgFooter" src="https://agenciamagma.vteximg.com.br/arquivos/vtexPCIM3Academy.png" alt="logoCertificado" style="width: 53px; margin-right: 90px;">
</span>
</li>
</ul>
<ul class="footerCheckout__developedBy">
<li>
<a href="https://vtex.com/br-pt/">
<span>Powered By</span>
<img class="imgFooter" src="https://agenciamagma.vteximg.com.br/arquivos/logoVTEXM3Academy.png" alt="logoVTEX" style="width: 45px;">
</a>
</li>
<li style="width: 217px; >
<a href="https://agenciam3.com/">
<span>Developed By</span>
<img class="imgFooter" src="https://agenciamagma.vteximg.com.br/arquivos/logoM3M3Academy.png" alt="logoM3" style="width: 29px; margin-left: 10px;">
</a>
</li>
</ul>
</div>
`;
}
} }

View File

@ -8,14 +8,12 @@ export default class Header {
async init() { async init() {
await this.selectors(); await this.selectors();
console.log(this.item); this.progressBarHtml();
await this.progressBarEvolution();
} }
async selectors() { async selectors() {
this.item = await waitElement("#my-element", { this.header = await waitElement(".headerCheckout");
//#my-element pode ser a class ou o id do elemento html qeu vocÊ quer pegar this.progressBar = await waitElement("#progressBar");
timeout: 5000, // vai esperar 5 segundos antes de rejeitar a promise
interval: 1000, // vai verificar a cada 1 segundo se o elemento existe
});
} }
} }

View File

@ -0,0 +1,7 @@
function fetchApiData() {
fetch(
"https://m3academy.myvtex.com/api/catalog_system/pub/products/search/?fq=productClusterIds:319"
)
.then((response) => response.json())
.then((data) => console.log(data));
}

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>api teste</title>
</head>
<body>
<main>
<h1>
teste api m3
</h1>
<button onclick="fetchApiData()"> teste para api m3 academy</button>
<ul id="fill_list"></ul>
</main>
<script src="./fetchapi.js"></script>
</body>
</html>

View File

@ -63,7 +63,7 @@
.shipping-date, .shipping-date,
.price { .price {
color: #7d7d7d; color: #989898;
} }
} }
} }
@ -155,9 +155,9 @@
} }
a { a {
color: $color-blue; color: $color-black;
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;
@ -253,10 +253,15 @@
.icon-plus-sign, .icon-plus-sign,
.icon-minus-sign { .icon-minus-sign {
&::before { &::before {
color: $color-black; color: $color-white;
display: block; display: block;
font-weight: 500; font-weight: bold;
padding: 1px 12px; margin: 1px 12px;
background: #00C8FF;
border-radius: 50%;
width: 16px;
height: 16px;
} }
} }
@ -733,11 +738,13 @@
tfoot { tfoot {
td.info, td.info,
td.monetary { td.monetary {
font-family: 'Open Sans';
font-style: normal; font-style: normal;
font-weight: normal; font-weight: 700;
font-size: 18px; font-size: 18px;
line-height: 21px; line-height: 25px;
color: $color-black;
color: $color-black-black;
} }
} }
} }
@ -771,18 +778,19 @@
} }
a { a {
font-family: $font-family; font-family: 'Tenor Sans';
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; text-align: right;
color: #000000;
} }
} }
.btn-place-order-wrapper { .btn-place-order-wrapper {
a { a {
background: $color-green; background: #00C8FF;
border: none; border: none;
border-radius: 5px; border-radius: 5px;
display: block; display: block;
@ -791,20 +799,18 @@
padding: 12px 19px; padding: 12px 19px;
&:hover { &:hover {
background-color: darken($color-green, 5); background-color: darken($color-blue, 5);
} }
&:after { &:after {
content: "finalizar compra"; content: "finalizar compra";
font-family: $font-family; color: $color-black-black;
font-weight: 500; font-weight: 700;
font-size: 13px; font-size: 14px;
letter-spacing: 0.05em;
color: $color-white;
text-transform: uppercase;
vertical-align: middle;
line-height: 19px; line-height: 19px;
text-shadow: none; text-align: center;
letter-spacing: 0.05em;
text-transform: uppercase;
} }
} }
} }

View File

@ -9,30 +9,41 @@
} }
} }
&-title { &-title {
font-size: 20px; font-family: $font-family;
font-style: normal;
font-weight: 700;
font-size: 24px;
line-height: 33px;
text-align: center;
text-transform: uppercase;
color: $color-black;
} }
&-links { &-links {
.link-choose-products { .link-choose-products {
background: $color-black; font-family: $font-family-secundary;
border: none; width: 327px;
border-radius: 5px; height: 48px;
transition: ease-in 0.22s all; background: transparent;
outline: none; border: 1px solid #000000;
font-family: $font-family; // transition: ease-in 0.22s all;
// outline: none;
border-radius: 0;
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 400;
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
text-align: center; text-align: center;
letter-spacing: 0.05em; // letter-spacing: 0.05em;
color: $color-white; color: $color-black;
text-transform: uppercase; text-transform: uppercase;
cursor: pointer;
&:hover {
background: lighten($color-black, 5);
}
} }
} }
} }

View File

@ -57,9 +57,9 @@ body {
background: $color-black; background: $color-black;
text-shadow: none; text-shadow: none;
&:hover { // &:hover {
background: lighten($color-black, 15%); // background: lighten($color-black, 15%);
} // }
} }
.emailInfo h3 { .emailInfo h3 {
@ -70,15 +70,16 @@ body {
#orderform-title { #orderform-title {
color: $color-gray2; color: $color-gray2;
font-family: $font-family; font-family: $font-family;
font-weight: 500; font-weight: 700;
font-size: 36px; font-size: 24px;
line-height: 42px; line-height: 33px;
margin: 40px 0 30px; margin: 40px 0 30px;
letter-spacing: 0.1em;
text-transform: uppercase; text-transform: uppercase;
@include mq(md, max) { @include mq(md, max) {
margin-left: 30px; margin-left: 30px;
} }
} }

View File

@ -1,6 +1,16 @@
/* _footer.scss */ /* _footer.scss */
.conteiner_footer {
display: flex;
align-items: center;
align-content: space-between;
margin-top: 16px !important;
margin: 0 auto;
}
.footerCheckout { .footerCheckout {
border-top: none; border-top: 1px solid $color-black;
color: $color-gray2; color: $color-gray2;
&__wrapper { &__wrapper {
@ -10,14 +20,16 @@
} }
&__address { &__address {
color: $color-gray2;
font-family: $font-family; font-family: $font-family;
font-style: normal; font-style: normal;
font-weight: normal;
font-size: 10px; font-size: 10px;
line-height: 12px;
text-transform: capitalize; text-transform: capitalize;
max-width: 40%; // max-width: 40%;
font-weight: 400;
font-size: 10px;
line-height: 14px;
text-transform: capitalize;
color: $color-black;
@include mq(md, max) { @include mq(md, max) {
margin-bottom: 24px; margin-bottom: 24px;
@ -51,6 +63,7 @@
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
li:last-child { li:last-child {
margin-left: 16px; margin-left: 16px;
} }

View File

@ -11,12 +11,18 @@
&__logo { &__logo {
img { img {
height: 52px; height: 37.14px;
width: auto; width: auto;
} }
} }
&__safeBuy { &__safeBuy {
display: flex;
img {
width: 12px;
height: 15px;
margin-right: 8px;
}
span { span {
align-items: center; align-items: center;
display: flex; display: flex;
@ -31,6 +37,7 @@
i { i {
margin-right: 8px; margin-right: 8px;
} }
} }
} }

View File

@ -6,6 +6,7 @@ $font-family-secundary:"Tenor Sans", sans-serif;
/* Colors */ /* Colors */
$color-black: #292929; $color-black: #292929;
$color-black-black: #000000;
$color-white: #fff; $color-white: #fff;

View File

@ -16,7 +16,7 @@
<span class="footerCheckout__stamps__divider"></span> <span class="footerCheckout__stamps__divider"></span>
</li> </li>
<li> <li>
<span class="footerCheckout__payments">Aqui: vtex pci icon</span> <span class="footerCheckout__vtexpci">Aqui: vtex pci icon</span>
</li> </li>
</ul> </ul>
<ul class="footerCheckout__developedBy"> <ul class="footerCheckout__developedBy">

View File

@ -18,3 +18,4 @@
</div> </div>
</div> </div>
</header> </header>

20
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": {
@ -3484,6 +3485,8 @@
}, },
"checkout/node_modules/core-util-is": { "checkout/node_modules/core-util-is": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
"license": "MIT" "license": "MIT"
}, },
"checkout/node_modules/cosmiconfig": { "checkout/node_modules/cosmiconfig": {
@ -4844,6 +4847,8 @@
}, },
"checkout/node_modules/get-intrinsic": { "checkout/node_modules/get-intrinsic": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz",
"integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
@ -6294,6 +6299,8 @@
}, },
"checkout/node_modules/micromatch": { "checkout/node_modules/micromatch": {
"version": "4.0.5", "version": "4.0.5",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"braces": "^3.0.2", "braces": "^3.0.2",
@ -6305,6 +6312,8 @@
}, },
"checkout/node_modules/micromatch/node_modules/braces": { "checkout/node_modules/micromatch/node_modules/braces": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"fill-range": "^7.0.1" "fill-range": "^7.0.1"
@ -19345,6 +19354,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"
@ -21672,7 +21682,9 @@
} }
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.3" "version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
}, },
"cosmiconfig": { "cosmiconfig": {
"version": "7.1.0", "version": "7.1.0",
@ -22645,6 +22657,8 @@
}, },
"get-intrinsic": { "get-intrinsic": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz",
"integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==",
"requires": { "requires": {
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
"has": "^1.0.3", "has": "^1.0.3",
@ -23679,6 +23693,8 @@
}, },
"micromatch": { "micromatch": {
"version": "4.0.5", "version": "4.0.5",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
"requires": { "requires": {
"braces": "^3.0.2", "braces": "^3.0.2",
"picomatch": "^2.3.1" "picomatch": "^2.3.1"
@ -23686,6 +23702,8 @@
"dependencies": { "dependencies": {
"braces": { "braces": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"requires": { "requires": {
"fill-range": "^7.0.1" "fill-range": "^7.0.1"
} }

9726
yarn.lock Normal file

File diff suppressed because it is too large Load Diff