View file File name : two_yt_vi_lazyload.min.js Content :function replaceEmbedToImage(e){var t,a,o,l,r,u,n="youtube"==e?"yt-lazyload":"vi-lazyload",c=document.querySelectorAll("."+n),i="youtube"==e?"https://img.youtube.com/vi/":"https://raw.githubusercontent.com/the-muda-organization/vimeo-lazyload/master/demo-img/";c.length>0&&(a=document.createElement("div"),o=document.createElement("div"),l=document.createElement("div"),r=document.createElement("a"),u=document.createElement("iframe"),a.classList.add(n+"-wrap"),o.classList.add(n+"-content"),l.classList.add(n+"-playbtn"),r.classList.add(n+"-logo"),r.target="_blank",r.rel="noreferrer",u.setAttribute("allow","youtube"==e?"accelerometer;autoplay;encrypted-media;gyroscope;picture-in-picture":"autoplay;fullscreen;picture-in-picture"),u.setAttribute("allowfullscreen",""),t=new IntersectionObserver(function(n){n.forEach(function(n){var c,d,p,s,m,y=n.target,b=n.target.dataset.id,g=n.target.dataset.thumb,v=n.target.dataset.logo;!0===n.isIntersecting&&(c=a.cloneNode(),y.append(c),d=o.cloneNode(),c.append(d),"youtube"==e&&d.style.setProperty("youtube"==e?"--yt-lazyload-img":"--vi-lazyload-img",'url("'+(i+b+g)+'/hqdefault.webp")'),p=l.cloneNode(),d.append(p),"0"!==v&&((s=r.cloneNode()).href="youtube"==e?"https://youtu.be/"+b:"https://vimeo.com/"+b,d.append(s)),p.addEventListener("click",function(){(m=u.cloneNode()).src="youtube"==e?"https://www.youtube.com/embed/"+b+"?autoplay=1":"https://player.vimeo.com/video/"+b+"?autoplay=1&autopause=0",d.append(m)}),t.unobserve(y))})},{rootMargin:"200px 0px"}),c.forEach(function(e){t.observe(e)}))}replaceEmbedToImage("youtube"),replaceEmbedToImage("vimeo");