-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
50 lines (49 loc) · 1.16 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
45
46
47
48
49
50
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.3;
function createCard(date, day, games) {
delay = delay + 0.3;
return `
<div class="card" style="animation-delay: ${delay}s">
<h2>${date} <span>${day}</span></h2>
<ul>
${games}
</ul>
</div>
`
}
document.querySelector("#cards").innerHTML =
createCard(
"2 WIN",
"Grupo G",
createGame("brazil", "2 x 0", "serbia") +
createGame("brazil", "1 x 0", "switzerland") +
createGame("brazil", "0 x 1", "cameroon")
) +
createCard(
"WIN",
"Oitavas de final",
createGame("brazil", "4 x 1", "corea")
) +
createCard(
"LOST",
"Quartas de final",
createGame("brazil", "1(2)x(4)1", "croatia")
) +
createCard (
"WHAIT",
"THE WINNER?",
createGame("argentina", "3(4)x3(2)", "france")
) +
createCard (
"WINNER",
"ARGENTINA",
createGame("argentina", "WINNER", "argentina")
)