Skip to content

Commit

Permalink
Add lazy loading for champions images
Browse files Browse the repository at this point in the history
  • Loading branch information
Vianpyro committed Sep 29, 2024
1 parent c037ba4 commit 1e28cbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ <h1 id="loading-champions">Loading champions...</h1>
<img id="modal-image">
</section>
<section id="modal-right">
<h3>Abilities:</h3>
<ul id="modal-abilities"></ul>
</section>
</div>
Expand Down
1 change: 1 addition & 0 deletions resources/javascript/load_champions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const loadingChampionsMessage = document.getElementById("loading-champions");
const championPortrait = document.createElement("img");
championPortrait.src = `${dataDragonUrl}/cdn/${version}/img/champion/${champion.image.full}`;
championPortrait.alt = champion.name;
championPortrait.loading = 'lazy';

// Create element for champion's name
const championName = document.createElement("h3");
Expand Down

0 comments on commit 1e28cbd

Please sign in to comment.