web-assets/venobox/v2/dist/venobox.min.js

8 lines
16 KiB
JavaScript
Raw Normal View History

2023-12-30 22:34:25 +01:00
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VenoBox=t()}(this,(function(){"use strict";
/**
* VenoBox 2.0.4
* Copyright 2013-2021 Nicola Franchini
* @license: https://github.com/nicolafranchini/VenoBox/blob/master/LICENSE
*/let e,t,o,n,s,i,a,r,l,d,c,v,u,b,p,g,f,m,y,x,h,L,w,k,S,C,A,E,P,q,M,T,j,H,O,z,B;const I=document.createElement("div");let V=0,D=0,N=0,Q=!1,R=new Image;const W={bounce:["sk-bounce","sk-bounce-dot",2],chase:["sk-chase","sk-chase-dot",6],circle:["sk-circle","sk-circle-dot",12],"circle-fade":["sk-circle-fade","sk-circle-fade-dot",12],flow:["sk-flow","sk-flow-dot",3],fold:["sk-fold","sk-fold-cube",4],grid:["sk-grid","sk-grid-cube",9],plane:["sk-plane","",0],pulse:["sk-pulse","",5],swing:["sk-swing","sk-swing-dot",2],wander:["sk-wander","sk-wander-cube",3],wave:["sk-wave","sk-wave-rec",5]},X={selector:".venobox",autoplay:!1,bgcolor:"#fff",border:"0",customClass:!1,infinigall:!1,maxWidth:"100%",navigation:!0,navKeyboard:!0,navTouch:!0,navSpeed:300,numeration:!1,overlayClose:!0,overlayColor:"rgba(23,23,23,0.95)",popup:!1,ratio:"16x9",share:!1,shareStyle:"pill",spinner:"bounce",spinColor:"#d2d2d2",titleattr:"title",titlePosition:"top",titleStyle:"bar",toolsBackground:"#1C1C1C",toolsColor:"#d2d2d2",onPreOpen:function(){return!0},onPostOpen:function(){},onPreClose:function(){return!0},onNavComplete:function(){},onContentLoaded:function(){},onInit:function(){},jQuerySelectors:!1};function Y(e,t,o){if("[object Object]"===Object.prototype.toString.call(e)){let n;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.call(o,e[n],n,e)}else{let n=0,s=e.length;for(n=0;n<s;n++)t.call(o,e[n],n,e)}}function F(e){return e}function K({timing:e,draw:t,duration:o}){let n=performance.now();requestAnimationFrame((function s(i){let a=(i-n)/o;a>1&&(a=1);let r=e(a);t(r),a<1&&requestAnimationFrame(s)}))}function U(e){if(!e)return!1;y=!0,r=e,L=!1,w=!1,S=e.getAttribute("data-maxwidth")||e.settings.maxWidth,C=e.getAttribute("data-overlay")||e.settings.overlayColor,A=e.getAttribute("data-ratio")||e.settings.ratio,E=e.getAttribute("data-autoplay")||e.settings.autoplay,P=e.getAttribute("data-href")||e.getAttribute("href"),q=e.getAttribute("data-customclass")||e.settings.customClass,z=e.getAttribute(e.settings.titleattr)||"",H=e.getAttribute("data-border")||e.settings.border}function Z(){return!(!r||!document.body.classList.contains("vbox-open"))&&((!r.settings.onPreClose||"function"!=typeof r.settings.onPreClose||(r.settings.onPreClose(r,p,T,j),!1!==r.settings.onPreClose))&&(document.body.removeEventListener("keydown",J),document.body.classList.remove("vbox-open"),r.focus(),void K({duration:200,timing:F,draw:function(e){k.style.opacity=1-e,1===e&&k.remove()}})))}function _(){le(T)}function G(){le(j)}function J(e){27===e.keyCode&&Z(),B||(37==e.keyCode&&!0===w&&le(j),39==e.keyCode&&!0===L&&le(T),B=setTimeout((()=>{B=null}),100))}function $(e){a.classList.contains("vbox-"+e)||function(){y=!1,a.style.opacity=0,a.innerHTML=x;let e=a.querySelector(":first-child");e.classList.add("vbox-child"),e.style.backgroundColor=r.settings.bgcolor,e.style.maxWidth=S,e.style.transform="scale(0.9)",e.style.transition="transform 200ms";let t=a.querySelector(".vbox-child img");t&&t.addEventListener("dragstart",(function(e){e.preventDefault()})),i.scrollTo(0,0),e.style.transform="scale(1)",k.style.setProperty("--vbox-padding",H),Y(k.classList,(function(e){"vbox-overlay"!==e&&k.classList.remove(e)})),q&&k.classList.add(q),K({duration:200,timing:F,draw:function(e){a.style.opacity=e,1===e&&u.classList.add("vbox-hidden")}}),r.settings.onContentLoaded&&"function"==typeof r.settings.onContentLoaded&&r.settings.onContentLoaded(x)}()}function ee(e,t,o){let n;if(a.classList.add("vbox-loading"),-1!==e.search(/.+\.mp4|og[gv]|webm/))n=o?" autoplay":"",x='<div class="venoratio venoratio-'+t+'"><video src="'+e+'"'+n+" controls>Your browser does not support the video tag.</video></div>";else{let s,i=function(e){let t,o,n;if(o=e.match(/(https?:\/\/)?((www\.)?(youtube(-nocookie)?|youtube.googleapis)\.com.*(v\/|v=|vi=|vi\/|e\/|embed\/|user\/.*\/u\/\d+\/)|youtu\.be\/)([_0-9a-z-]+)/i),o&&o[7])t="youtube",n=o[7];else{let s=/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/;o=e.match(s),o&&o[5]&&(t="vimeo",n=o[5])}return{type:t,id:n}}(e);n=o?"?rel=0&autoplay=1":"?rel=0"
//# sourceMappingURL=venobox.min.js.map