-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
44 lines (42 loc) · 1.07 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
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("switzerland", "07:00", "cameroon") +
createGame("portugal", "13:00", "ghana") +
createGame("brazil", "16:00", "serbia")
) +
createCard(
"28/11",
"segunda",
createGame("cameroon", "07:00", "serbia") +
createGame("switzerland", "13:00", "brazil") +
createGame("portugal", "16:00", "uruguay")
) +
createCard(
"02/12",
"sexta",
createGame("southkorea", "12:00", "portugal") +
createGame("cameroon", "16:00", "brazil")
)