-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathrenderAlbums.js
84 lines (78 loc) · 2.62 KB
/
renderAlbums.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
function renderAlbums(albums) {
return `
<div class="text-center mt-5">
<code>${JSON.stringify(albums)}</code>
</div>
`
}
function albums() {
var content = document.getElementById('content');
var albumsAbstraction = [
{
artist: "Creed",
albums: [
{
title: "My Own Prison",
albumCover: "https://images-na.ssl-images-amazon.com/images/I/51Y5ZCMV2QL.jpg",
songs: [
{
title: "Torn",
length: "6:25"
},
{
title: "Ode",
length: "4:58"
},
{
title: "My Own Prison",
length: "5:00"
},
{
title: "Pity for a Dime",
length: "4:37"
},
{
title: "In America",
length: "3:38"
},
{
title: "Illusion",
length: "5:29"
}
]
},
{
title: "Weathered",
albumCover: "https://is5-ssl.mzstatic.com/image/thumb/Music22/v4/b1/a4/a9/b1a4a9dd-ecda-6233-07da-f53848d37bdf/mzm.qakvcpwo.jpg/1200x630bb.jpg",
songs: [
{
title: "Bullets",
length: "6:25"
},
{
title: "Freedom Fighter",
length: "4:58"
},
{
title: "Who's Got My Back?",
length: "5:00"
},
{
title: "Signs",
length: "4:37"
},
{
title: "One Last Breath",
length: "3:38"
},
{
title: "My Sacrifice",
length: "5:29"
}
]
}
]
}
]
content.innerHTML = renderAlbums(albumsAbstraction);
}