-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
33 lines (33 loc) · 1.42 KB
/
script.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
import {data} from './data.js'
let dataHTML=``
data.forEach((item) => {
dataHTML+=`
<div class="video preview">
<div class="image">
<a class='youtube-link' href=${item.youtubeLink}>
<img src=${item.thumbnail}>
</a>
<p class="time">${item.videoTime}</p>
</div>
<div class="info">
<div class="channel-photo">
<a class="channel-link" href=${item.channelLink}>
<img src=${item.channelPhoto}>
<div class="channel-photo-preview">
<img src=${item.channelPhoto}>
<div>
<p class="channel-photo-preview-title">${item.channelTitle}</p>
<p class="channel-photo-preview-views">${item.subscribers}</p>
</div>
</div>
</a>
</div>
<div class="description">
<a class="video-title" href="${item.youtubeLink}">${item.videoTitle}</a>
<a class="channel-name" href=${item.channelLink}>${item.channelTitle}</a>
<p class="views">${item.videoViews}</p>
</div>
</div>
</div>`
})
document.querySelector('.main-grid').innerHTML=dataHTML