mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Optimize avatar image loading with lazy and async attributes
Added `loading="lazy"` and `decoding="async"` to author avatar images in `VideoCard.js` and the creator avatar in `video-modal.html`. This aligns these components with `SimilarContentCard.js` and `VideoCard` thumbnails, improving initial page load performance and reducing main-thread blocking by deferring off-screen image loading and decoding. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
27891de246
commit
0ac1def5c2
2 files changed
+5
-1
No files matched your search
@@ -503,6 +503,8 @@
|
||||
id="creatorAvatar"
|
||||
src=""
|
||||
alt="Creator"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
class="h-full w-full rounded-full object-cover cursor-pointer"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -904,7 +904,9 @@ export class VideoCard {
|
||||
const avatar = this.createElement("img", {
|
||||
attrs: {
|
||||
src: "assets/svg/default-profile.svg",
|
||||
alt: "Placeholder"
|
||||
alt: "Placeholder",
|
||||
loading: "lazy",
|
||||
decoding: "async",
|
||||
}
|
||||
});
|
||||
avatar.classList.add(
|
||||
|
||||
Reference in new issue
Block a user