UNPKG

bruh

Version:

The thinnest possible layer between development and production for the modern web.

11 lines (9 loc) 319 B
export default (className = "bruh-optimized-picture") => document.querySelectorAll(`.${className} > img`) .forEach(img => { const removeLQIP = () => img.removeAttribute("style") if (img.complete) removeLQIP() else img.addEventListener("load", removeLQIP, { once: true }) })