PluginProbe ʕ •ᴥ•ʔ
FrontBlocks for Gutenberg/GeneratePress / 0.2.4
FrontBlocks for Gutenberg/GeneratePress v0.2.4
trunk 0.2.0 0.2.1 0.2.2 0.2.3 0.2.4 0.2.5 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1.0 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 ci-artifacts
frontblocks / includes / dist / frontblocks-carousel.js
frontblocks / includes / dist Last commit date
frontblocks-animations.css 1 year ago frontblocks-animations.js 1 year ago frontblocks-carousel.css 1 year ago frontblocks-carousel.js 1 year ago glide.min.js 1 year ago
frontblocks-carousel.js
1 lines
1 window.addEventListener("load",function(t){const e=document.querySelectorAll(".frontblocks-carousel");e.length>0&&e.forEach(t=>{const e=t.parentNode,o=document.createElement("div");e.replaceChild(o,t),o.appendChild(t),o.classList.add("glide__track"),o.setAttribute("data-glide-el","track");const r=o.parentNode,a=document.createElement("div");r.replaceChild(a,o),a.appendChild(o),a.classList.add("glide"),carouselType=t.getAttribute("data-type")?t.getAttribute("data-type"):"carousel",carouselbuttons=t.getAttribute("data-buttons")?t.getAttribute("data-buttons"):"bullets",carouselView=t.getAttribute("data-view")?t.getAttribute("data-view"):4,carouselAutoplay=t.getAttribute("data-autoplay")?t.getAttribute("data-autoplay"):0,carouselResView=t.getAttribute("data-res-view")?t.getAttribute("data-res-view"):1,carouselbuttonsColor=t.getAttribute("data-buttons-color")?t.getAttribute("data-buttons-color"):"black",carouselbuttonsBackgroundColor=t.getAttribute("data-buttons-background-color")?t.getAttribute("data-buttons-background-color"):"transparent",t.classList.add("glide__slides","glide-"+Math.floor(1e3*Math.random()));for(const e of t.children)e.classList.add("glide__slide");if(window.screen.availWidth<768&&t.children.length<6?showBullets=!0:window.screen.availWidth>768?showBullets=!0:showBullets=!1,showBullets&&"bullets"==carouselbuttons){const e=document.createElement("div");e.classList.add("glide__bullets"),e.setAttribute("data-glide-el","controls[nav]");for(let o=0;o<t.children.length;o++){const t=document.createElement("button");t.classList.add("glide__bullet"),t.setAttribute("data-glide-dir","="+o),t.style.backgroundColor=carouselbuttonsBackgroundColor,e.appendChild(t)}a.appendChild(e)}if("arrows"==carouselbuttons){const t=document.createElement("div");t.classList.add("glide__arrows"),t.setAttribute("data-glide-el","controls"),arrowsHTML='<button class="glide__arrow glide__arrow--left glide__arrow glide__arrow--left" data-glide-dir="<"',arrowsHTML+=' style="background-color: '+carouselbuttonsBackgroundColor+'"',arrowsHTML+='><svg width="7" height="12" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 1L1 6L6 11" stroke="',arrowsHTML+=carouselbuttonsColor,arrowsHTML+='" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button><button class="glide__arrow glide__arrow--right glide__arrow glide__arrow--right" data-glide-dir=">"',arrowsHTML+=' style="background-color: '+carouselbuttonsBackgroundColor+'"',arrowsHTML+='><svg width="7" height="12" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 11L6 6L1 1" stroke="',arrowsHTML+=carouselbuttonsColor,arrowsHTML+='" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>',t.innerHTML=arrowsHTML,a.appendChild(t)}new Glide(a,{type:carouselType,perView:carouselView,startAt:0,autoplay:0===carouselAutoplay?2500:carouselAutoplay,gap:0,breakpoints:{430:{perView:carouselResView},600:{perView:carouselResView},768:{perView:carouselResView}}}).mount()})});