optically-size-images
Version:
Normalize the size of a group of images, optically, based on their aspect ratios
2 lines (1 loc) • 322 B
JavaScript
import"../modulepreload-polyfill.js";/* empty css */import i from"../lib/index.js";const o=Array.from(document.querySelectorAll(".optically-size-images figure img"));window.addEventListener("load",()=>i(o,(e,t)=>{e.style.setProperty("--optical-image-size",t.toString()),e.style.setProperty("opacity","1")}));