-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
32 lines (30 loc) · 851 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function createGame(player1, hour, player2) {
return `
<li>
<img src="./assets/icon-${player1}.svg" alt="Bandeira do ${player1}" />
<strong>${hour}</strong>
<img src="./assets/icon-${player2}.svg" alt="Bandeira da ${player2}" />
</li>
`
}
let delay = -0.4
function createCard(date, day, games) {
delay = delay + 0.4
return `
<div class="card" style="animation-delay: ${delay}s">
<h2>${date} <span>${day}</span></h2>
<ul>
${games}
</ul>
</div>
`
}
document.querySelector("#cards").innerHTML =
createCard("24/11", "quinta", createGame("brazil", "16:00", "serbia")) +
createCard(
"28/11",
"segunda",
createGame("switzerland", "13:00", "brazil") +
createGame("portugal", "16:00", "uruguai")
) +
createCard("02/12", "sexta", createGame("brazil", "16:00", "cameroon"))