1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
|
!function(){"use strict";if("undefined"!=typeof jQuery){jQuery(".tp-caption[data-explodinglayersin]",".tp-caption[data-explodinglayersin]").each(function(){d.call(this)}),window.ExplodingLayersAddOn=function(o,e){if(o&&e){var i,A,P=o(window),a={padding:0,size:1,speed:0,density:1,power:0,duration:300};e.find(".tp-caption[data-explodinglayersin]",".tp-caption[data-explodinglayersin]").each(function(){-1===this.className.search("revaddonexplayer")&&d.call(this)}),e.on("revolution.slide.onloaded",function(){if(A=e[0].opt.responsiveLevels){for(Array.isArray(A)||(A=[A]);A.length<4;)A[A.length]=A[A.length-1];for(var t=0;t<4;t++)A[t]=parseInt(A[t],10)}e.find(".tp-caption[data-explodinglayersin]").each(function(){var t=this.getAttribute("data-explodinglayersin");t&&(t=JSON.parse(t))&&n.apply(this,["in",t])}),e.find(".tp-caption[data-explodinglayersout]").each(function(){var t=this.getAttribute("data-explodinglayersout");t&&(t=JSON.parse(t))&&n.apply(this,["out",t])}),P.on("resize",function(){clearTimeout(i),i=setTimeout(s,50)})}).on("revolution.slide.onbeforeswap revolution.slide.onafterswap",function(t,e){-1!==t.namespace.search("before")?e.nextslide&&e.nextslide.length&&r(e.nextslide):e.prevslide&&e.prevslide.length&&r(e.prevslide)}).on("revolution.slide.layeraction",function(t,e){var i,a,s=e.layer.data("revaddonexpeffect"),r=e.layer.hasClass("tp-static-layer"),n=r&&!e.layer.hasClass("revaddonexpstatic");s&&("enterstage"===e.eventtype||n?(r&&e.layer.addClass("revaddonexpstatic"),a=e.layer.data("revaddonexplayerin"),i=!1):"leavestage"===e.eventtype&&(a=e.layer.data("revaddonexplayerout"),i=!0),a&&(a.options=o.extend({},a.orig),s.o=a.options,function(t,e,i,a){var s,r,n=0,o=P.width();if(A)for(var h=A.length,d=0;d<h;d++)r=A[d],s!==r&&(o<r&&(n=d),s=r);for(var l in t)t.hasOwnProperty(l)&&"effect"!==l&&(e[l]=O(l,e[l],n));z("size",e,e.size),z("speed",e,e.speed),e.sync="on"===e.sync;var p,c,f=function(t){{if("transparent"===t.trim())return["#ffffff",!1];if(-1===t.search(/\[\{/))return-1!==t.search("#")?[t,!1]:-1!==t.search("rgba")?[t.replace(/\s/g,"").replace(/false/g,"1"),!1]:-1!==t.search("rgb")?[t.replace(/\s/g,""),!1]:/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)?[t,!1]:["#ffffff",!1];try{return[t=function(t){for(var e,i=t.colors,a=i.length,s=[],r=0;r<a;r++){var n=i[r];delete n.align,e?JSON.stringify(n)!==JSON.stringify(e)&&(s[s.length]=n):s[s.length]=n,e=n}return t.colors=s,t}(t=JSON.parse(t.replace(/\&/g,'"'))),!0]}catch(t){return["#ffffff",!1]}}}(e.color);if(f[1]){var u=(g=f)[1]?"radial"===(g=g[0]).type?function(t){for(var e,i,a=t.length,s="explodinglayers"+Math.floor(1e4*Math.random()),r='<defs><radialGradient id="'+s+'">',n=0;n<a;n++)e=t[n],i=parseInt(e.position,10),r+='<stop offset="'+i+'%" style="stop-color: rgb('+e.r+","+e.g+","+e.b+"); stop-opacity: "+e.a+'" />';return["url(#"+s+")",r+="</radialGradient></defs>"]}(g.colors):function(t,e){e=parseInt(e,10)/180*Math.PI;var i,a,s,r=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(r-e))*Math.sqrt(2),o=n*Math.cos(e),h=n*Math.sin(e),d=[o<0?1:0,h<0?1:0,0<=o?o:o+1,0<=h?h:h+1],l=t.length,p="explodinglayers"+Math.floor(1e4*Math.random()),c='<defs><linearGradient id="'+p+'" x1="'+d[0]+'" y1="'+d[1]+'" x2="'+d[2]+'" y2="'+d[3]+'">';for(s=0;s<l;s++)i=t[s],a=parseInt(i.position,10),c+='<stop offset="'+a+'%" style="stop-color: rgb('+i.r+","+i.g+","+i.b+"); stop-opacity: "+i.a+'" />';return["url(#"+p+")",c+="</linearGradient></defs>"]}(g.colors,g.angle):g[0];p=u[0],c=u[1]}else p=f[0],c="";var g;var y,v,m='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">'+c;"circle"!==e.type?(y="<path ",v="></path>"):(y='<circle cx="12" cy="12" r="12" ',v=" />");"fill"===e.style?m+=y+'fill="'+p+'" d="'+e.type+'"'+v:m+=y+'fill="transparent" d="'+e.type+'" stroke="'+p+'" stroke-width="1"'+v;m+="</svg>";var x=new Image,w="data:image/svg+xml;base64,"+btoa(m),M=document.createElement("canvas"),b=M.getContext("2d");M.width=M.height=24,x.onload=function(){b.drawImage(this,0,0),e.type=b.canvas,i.run(a)},x.src=w}(a.orig,a.options,s,i)))})}function t(){r(o(this),!0)}f
|