!function(){function t(){if(this.complete){const e=this.getAttribute("data-lazy-src");if(e&&this.src!==e)return void this.addEventListener("onload",t);const n=this.width,d=this.height;n&&n>0&&d&&d>0&&(this.setAttribute("width",n),this.setAttribute("height",d),i(this))}else this.addEventListener("onload",t)}var e=function(){const e=document.querySelectorAll("img[data-recalc-dims]");for(let i=0;i elements, depending on their width & height props. * * @see Twenty Twenty-One file responsive-embeds.js. * @since 2.7.8 * * @return {void} */ function recipeCardResponsiveEmbeds() { let proportion, parentWidth; // Loop iframe elements. document.querySelectorAll("iframe").forEach(function (iframe) { // Only continue if the iframe has a width & height defined. if (iframe.width && iframe.height) { // Calculate the proportion/ratio based on the width & height. proportion = parseFloat(iframe.width) / parseFloat(iframe.height); // Get the parent element's width. parentWidth = parseFloat( window .getComputedStyle(iframe.parentElement, null) .width.replace("px", "") ); // Set the max-width & height. iframe.style.maxWidth = "100%"; iframe.style.maxHeight = Math.round(parentWidth / proportion).toString() + "px"; } }); } // Run on initial load. recipeCardResponsiveEmbeds(); // Run on resize. window.onresize = recipeCardResponsiveEmbeds; ;