|
1 | 1 | import "./hellobar.css"; |
2 | 2 |
|
3 | 3 | const generateAnchorTag = (url) => { |
4 | | - const anchorTag = document.createElement("a"); |
5 | | - anchorTag.setAttribute("target", "_blank"); |
6 | | - anchorTag.href = url; |
7 | | - return anchorTag; |
| 4 | + const anchorTag = document.createElement("a"); |
| 5 | + anchorTag.setAttribute("target", "_blank"); |
| 6 | + anchorTag.href = url; |
| 7 | + return anchorTag; |
8 | 8 | }; |
9 | 9 |
|
10 | 10 | const generateDivTag = () => { |
11 | | - const div = document.createElement("div"); |
12 | | - div.classList.add("hello-bar", "hello-bar-emms"); |
13 | | - div.id = "hello-bar"; |
14 | | - return div; |
| 11 | + const div = document.createElement("div"); |
| 12 | + div.classList.add("hello-bar", "hello-bar-emms"); |
| 13 | + div.id = "hello-bar"; |
| 14 | + return div; |
15 | 15 | }; |
16 | 16 |
|
17 | 17 | const generateImgTag = (src, alt, title) => { |
18 | | - const img = document.createElement("img"); |
19 | | - img.src = src; |
20 | | - if (alt != null) img.alt = alt; |
21 | | - if (title != null) img.title = title; |
22 | | - img.classList.add("hb-logo"); |
23 | | - return img; |
| 18 | + const img = document.createElement("img"); |
| 19 | + img.src = src; |
| 20 | + if (alt != null) img.alt = alt; |
| 21 | + if (title != null) img.title = title; |
| 22 | + img.classList.add("hb-logo"); |
| 23 | + return img; |
24 | 24 | }; |
25 | 25 |
|
26 | 26 | const generatePTag = (pContent) => { |
27 | | - const p = document.createElement("p"); |
28 | | - p.innerHTML = pContent; |
29 | | - return p; |
| 27 | + const p = document.createElement("p"); |
| 28 | + p.innerHTML = pContent; |
| 29 | + return p; |
30 | 30 | }; |
31 | 31 |
|
32 | 32 | const generateButtonTag = (buttonContent) => { |
33 | | - const btn = document.createElement("button"); |
34 | | - btn.classList.add("hb-button", "long"); |
35 | | - btn.innerHTML = buttonContent; |
36 | | - return btn; |
| 33 | + const btn = document.createElement("button"); |
| 34 | + btn.classList.add("hb-button", "long"); |
| 35 | + btn.innerHTML = buttonContent; |
| 36 | + return btn; |
37 | 37 | }; |
38 | 38 |
|
39 | 39 | const createHelloBar = () => { |
40 | | - const a = generateAnchorTag( |
41 | | - `https://goemms.com/digital-trends?utm_source=fromdoppler&utm_medium=hellobar&utm_campaign=cw-emmsdt- |
| 40 | + const a = generateAnchorTag( |
| 41 | + `https://goemms.com/digital-trends?utm_source=fromdoppler&utm_medium=hellobar&utm_campaign=cw-emmsdt- |
42 | 42 | invitacion-nov23` |
43 | | - ); |
44 | | - const div = generateDivTag(); |
45 | | - const img = generateImgTag( |
46 | | - "https://academyqa.fromdoppler.com/wp-content/themes/doppler-webpack/hello_bar/img/asset-demoday.png", |
47 | | - "Demo Day", |
48 | | - "Demo Day" |
49 | | - ); |
50 | | - const p = generatePTag( |
51 | | - `<strong>¡El EMMS Digital Trends ya comenzó!</strong>| Referentes de Google, Youtube, Meta y Spotify |
| 43 | + ); |
| 44 | + const div = generateDivTag(); |
| 45 | + const img = generateImgTag( |
| 46 | + "https://academyqa.fromdoppler.com/wp-content/themes/doppler-webpack/hello_bar/img/asset-demoday.png", |
| 47 | + "Demo Day", |
| 48 | + "Demo Day" |
| 49 | + ); |
| 50 | + const p = generatePTag( |
| 51 | + `<strong>¡El EMMS Digital Trends ya comenzó!</strong>| Referentes de Google, Youtube, Meta y Spotify |
52 | 52 | te estarán contando sus estrategias más efectivas para escalar tu negocio con éxito.` |
53 | | - ); |
54 | | - const btn = generateButtonTag("RESERVA GRATIS TU LUGAR"); |
55 | | - const header = document.querySelector("header"); |
56 | | - div.appendChild(img); |
57 | | - div.appendChild(p); |
58 | | - div.appendChild(btn); |
59 | | - a.appendChild(div); |
60 | | - if (header) header.insertBefore(a, header.firstChild); |
| 53 | + ); |
| 54 | + const btn = generateButtonTag("RESERVA GRATIS TU LUGAR"); |
| 55 | + const header = document.querySelector("header"); |
| 56 | + div.appendChild(img); |
| 57 | + div.appendChild(p); |
| 58 | + div.appendChild(btn); |
| 59 | + a.appendChild(div); |
| 60 | + if (header) header.insertBefore(a, header.firstChild); |
61 | 61 | }; |
62 | 62 |
|
63 | 63 | createHelloBar(); |
|
0 commit comments