Features/app.js
Chaoscaot 31582a64b8 Add UHD Lazyload
Add btn class
2022-08-01 23:28:04 +02:00

13 Zeilen
366 B
JavaScript

if(window.innerWidth > 1200) {
let images = document.querySelectorAll("img");
for (let i = 0; i < images.length; i++) {
let image = images[i];
// Lazy load UHD images
image.onload = () => {
if(image.src.includes("-1080P")) {
image.src = image.src.replace("-1080P", "-UHD");
}
}
}
}