feat: Cria a Progressbar desktop

This commit is contained in:
Filipe Quintanilha Evangelista 2022-12-09 19:58:03 -03:00
parent 2dab582c69
commit f0e5bf920e
5 changed files with 10017 additions and 7 deletions

View File

@ -8,14 +8,56 @@ export default class Header {
async init() {
await this.selectors();
console.log(this.item);
this.progressBarHTML();
// console.log(this.item);
}
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
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(".progress-bar", {
//#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
});
}
progressBarHTML() {
if (this.progressBar && window.innerWidth > 1024) {
this.progressBar.innerHTML = `
<ul>
<li>
<div class="containerLi">
<div>
<p class="progress-bar-text">Meu Carrinho</p>
<p id="progressbar-circle-1" class="progressbar-circle-1"></p>
<p class="progress-bar-line-1"></p>
</div>
</div>
</li>
<li class="central">
<div class="containerLi">
<div>
<p class="progress-bar-text">Dados Pesssoais</p>
<p id="progressbar-circle-2" class="progressbar-circle-2"></p>
</div>
</div>
</li>
<li>
<div class="containerLi">
<div>
<p class="progress-bar-text">Pagamento</p>
<p id="progressbar-circle-3" class="progressbar-circle-3"></p>
<p class="progress-bar-line-2"></p>
</div>
</div>
</li>
</ul>
`;
}
}
}

View File

@ -14,8 +14,8 @@ footer .footerCheckout__wrapper {
}
footer .footerCheckout__prateleira,
header {
width: 79.53125%;
margin: 0 auto;
width: 100%;
margin: 0;
}
body {
@ -82,6 +82,17 @@ body {
}
}
.empty-cart-title {
font-weight: 700;
font-size: 24px;
line-height: 33px;
font-family: $font-family;
}
.empty-cart-content {
padding: 171px 0 264px;
}
.dropdown {
&__content {
&--closed {

View File

@ -1,22 +1,106 @@
/* _header.scss */
.headerCheckout {
width: 100%;
border-bottom: 1px solid black;
.container {
width: auto !important;
width: 79.53125% !important;
.progress-bar {
ul {
list-style-type: none;
display: flex;
margin: 0;
gap: 100px;
}
li {
.containerLi {
width: 100%;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
position: relative;
.progress-bar-text {
margin-bottom: 9px;
font-family: $font-family-secundary;
font-size: 12px;
line-height: 14px;
}
.progressbar-circle-1 {
width: 12%;
left: 41%;
height: 10px;
position: relative;
background-color: black;
border: 1px solid black;
border-radius: 50%;
margin: 0;
}
.progress-bar-line-1 {
position: absolute;
left: 10%;
transform: translate(20%);
bottom: -2px;
width: 224%;
height: 1px;
border-top: 1px solid #000;
}
.progressbar-circle-2 {
width: 10%;
left: 41%;
height: 10px;
position: relative;
background-color: white;
border: 1px solid black;
border-radius: 50%;
margin: 0;
}
.progressbar-circle-3 {
width: 14%;
left: 41%;
height: 10px;
position: relative;
background-color: white;
border: 1px solid black;
border-radius: 50%;
margin: 0;
}
.progress-bar-line-2 {
position: absolute;
right: 30%;
transform: translate(-11%);
bottom: -2px;
width: 269%;
height: 1px;
border-top: 1px solid #000;
}
}
}
}
}
&__wrapper {
align-items: center;
display: flex;
justify-content: space-between;
padding: 29px 0;
}
&__logo {
img {
height: 52px;
height: 37px;
width: auto;
}
}
&__safeBuy {
display: flex;
gap: 8px;
span {
align-items: center;
display: flex;
@ -29,6 +113,11 @@
color: $color-gray;
}
img {
width: 12px;
height: 15px;
}
i {
margin-right: 8px;
}

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"
}

9850
yarn.lock Normal file

File diff suppressed because it is too large Load Diff