Features/app.js

13 Zeilen
366 B
JavaScript

2022-08-01 23:28:04 +02:00
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");
}
}
}
}