-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
42 lines (40 loc) · 990 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
33
34
35
36
37
38
39
40
41
42
function createGame(player1, player2, time) {
return `
<li>
<img src="./assets/icon-${player1}.svg" alt="${player1}" />
<strong>${time}</strong>
<img src="./assets/icon-${player2}.svg" alt="${player2}" />
</li>
`;
}
let delay = -0.2;
function createCard(date, weekDay, games) {
delay += 0.2;
return `
<div class="card" style="animation-delay: ${delay}s;">
<h2>${date} <span>${weekDay}</span></h2>
<ul>
${games}
</ul>
</div>
`;
}
document.querySelector('#cards').innerHTML =
createCard(
'24/11',
'quinta',
createGame('uruguay', 'south-korea', '10:00') +
createGame('brazil', 'serbia', '16:00')
) +
createCard(
'28/11',
'segunda',
createGame('brazil', 'switzerland', '13:00') +
createGame('portugal', 'uruguay', '16:00')
) +
createCard(
'02/12',
'sexta',
createGame('ghana', 'uruguay', '12:00') +
createGame('cameroon', 'brazil', '16:00')
);