Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

wip lazy loading images

Christian Fei3908afedd6da
diff --git a/client/main.js b/client/main.js
index c3a0d88..b4d11fb 100644
--- a/client/main.js
+++ b/client/main.js
@@ -37,7 +37,7 @@ class VideoElement extends HTMLElement {
Download the video instead <a href="/videos/${this.video.id}" target="_blank">here</a>
</p>
</video>`
- : `<img src="${this.video.thumbnail}"/>`}
+ : `<img loading="lazy" src="${this.video.thumbnail}"/>`}
<div>
<span>${new Date(this.video.publishedAt).toISOString().substring(0, 16)}</span> | <span>${this.video.viewCount}</span> | <span>${this.video.duration || 'N/A'}</span><br/>
</div>