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() {
await this.selectors();
// this.onUpdate();
this.footer();
}
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.divFooter = await waitElement(".footerCheckout__wrapper");
this.checkoutVazio = await waitElement(".empty-cart-content");
}
@ -37,4 +39,97 @@ export default class Footer {
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() {
await this.selectors();
console.log(this.item);
this.progressBarHtml();
await this.progressBarEvolution();
}
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.header = await waitElement(".headerCheckout");
this.progressBar = await waitElement("#progressBar");
}
}

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

View File

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

View File

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

View File

@ -1,6 +1,16 @@
/* _footer.scss */
.conteiner_footer {
display: flex;
align-items: center;
align-content: space-between;
margin-top: 16px !important;
margin: 0 auto;
}
.footerCheckout {
border-top: none;
border-top: 1px solid $color-black;
color: $color-gray2;
&__wrapper {
@ -10,14 +20,16 @@
}
&__address {
color: $color-gray2;
font-family: $font-family;
font-style: normal;
font-weight: normal;
font-size: 10px;
line-height: 12px;
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) {
margin-bottom: 24px;
@ -51,6 +63,7 @@
list-style-type: none;
margin: 0;
li:last-child {
margin-left: 16px;
}

View File

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

View File

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

View File

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

View File

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

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

9726
yarn.lock Normal file

File diff suppressed because it is too large Load Diff