<picture> elements for jxls

This commit is contained in:
rhiannon morris 2023-01-17 18:45:12 +01:00
parent 0f20753808
commit 84f822f73b
4 changed files with 17 additions and 7 deletions

View file

@ -45,7 +45,10 @@ function setImage(id, src, width, height, href, cw, firstLoad) {
mainlink.tabIndex = -1;
}
mainimg.src = src;
let jxl = src.replace(/\..*?$/, ".jxl");
mainimg.querySelector('img').src = src;
mainimg.querySelector('source').srcset = jxl;
mainfig.dataset.width = width;
mainfig.dataset.height = height;
mainlink.href = href;