| 1 | <!DOCTYPE html> |
| 2 | <html lang="es"> |
| 3 | |
| 4 | <head> |
| 5 | <meta charset="UTF-8"> |
| 6 | <meta name="viewport" |
| 7 | content="width=device-width"> |
| 8 | <title>Adorno Horizontal</title> |
| 9 | <style> |
| 10 | .sprite { |
| 11 | position: fixed; |
| 12 | } |
| 13 | </style> |
| 14 | </head> |
| 15 | |
| 16 | <body> |
| 17 | <h1>Adorno Horizontal</h1> |
| 18 | <script> |
| 19 | const Y = 0 |
| 20 | const DISTANCIA = 20 |
| 21 | const X_MÁXIMA = innerWidth |
| 22 | let x = 0 |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | let inner = "" |
| 29 | while (x < X_MÁXIMA) { |
| 30 | |
| 31 | |
| 32 | inner += |
| 33 | `<div class="sprite" |
| 34 | style="top: ${Y}px; |
| 35 | left: ${x}px;"> |
| 36 | 💕 |
| 37 | </div>` |
| 38 | x += DISTANCIA |
| 39 | } |
| 40 | |
| 41 | |
| 42 | document.body.innerHTML += inner |
| 43 | </script> |
| 44 | </body> |
| 45 | |
| 46 | </html> |