From 0165e17ca47e26b23f9b47e60f67cf70fca80f62 Mon Sep 17 00:00:00 2001 From: ueberjames Date: Mon, 12 Dec 2022 13:17:03 -0300 Subject: [PATCH] =?UTF-8?q?cria=C3=A7=C3=A3o=20do=20algoritimo=20para=20ap?= =?UTF-8?q?lica=20a=20=20Primeira=20parte=20para=20coloca=20o=20html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- checkout/src/arquivos/js/components/Header.js | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/checkout/src/arquivos/js/components/Header.js b/checkout/src/arquivos/js/components/Header.js index 6744524..df735cc 100644 --- a/checkout/src/arquivos/js/components/Header.js +++ b/checkout/src/arquivos/js/components/Header.js @@ -1,3 +1,4 @@ +/* eslint-disable prettier/prettier */ // import waitForEl from "../helpers/waitForEl"; import { waitElement } from "m3-utils"; @@ -8,14 +9,43 @@ export default class Header { async init() { await this.selectors(); - console.log(this.item); + this.progessBarHTML(); + await this.progressBarProgress(); } async selectors() { - this.item = await waitElement("#my-element", { + this.herader = await waitElement (".headerCheckout") + this.progressBar = await waitElement ("#progressBar") +("#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 }); } + + progessBarHTML(){ + // eslint-disable-next-line no-empty + if( this.progressBar && window.innerHeight > 1024){ + this.progressBar.innerHTML = ` + + + + + + ` + + } + if(this.progressBar && window.innerHeight <= 1024){ + this.progressBar.innerHTML = ``; + } + } }