Plugin Directory

Changeset 3134641


Ignore:
Timestamp:
08/13/2024 06:25:10 AM (19 months ago)
Author:
bricksable
Message:

update 1.6.59

Location:
bricksable
Files:
162 added
3 edited

Legend:

Unmodified
Added
Removed
  • bricksable/trunk/bricksable.php

    r3134590 r3134641  
    22/**
    33 * Plugin Name: Bricksable
    4  * Version: 1.6.58
     4 * Version: 1.6.59
    55 * Plugin URI: https://bricksable.com/
    66 * Description: Elevate your website game with the Bricksable collection of premium elements for Bricks Builder. Designed to speed up your workflow, our customizable and fully responsive elements will take your website to the next level in no time.
     
    4040 */
    4141function bricksable() {
    42     $instance = Bricksable::instance( __FILE__, '1.6.58' );
     42    $instance = Bricksable::instance( __FILE__, '1.6.59' );
    4343
    4444    if ( is_null( $instance->settings ) ) {
  • bricksable/trunk/includes/elements/animated-svg/assets/js/frontend.min.js

    r3134590 r3134641  
    1 !function(){"use strict";var t,e,n,i;function r(t){if(void 0===t)throw Error('Pathformer [constructor]: "element" parameter is required');if(t.constructor===String&&!(t=document.getElementById(t)))throw Error('Pathformer [constructor]: "element" parameter is not related to an existing ID');if(!(t instanceof window.SVGElement||t instanceof window.SVGGElement||/^svg$/i.test(t.nodeName)))throw Error('Pathformer [constructor]: "element" parameter must be a string or a SVGelement');this.el=t,this.scan(t)}function a(e,n,i){t(),this.isReady=!1,this.setElement(e,n),this.setOptions(n),this.setCallback(i),this.isReady&&this.init()}r.prototype.TYPES=["line","ellipse","circle","polygon","polyline","rect"],r.prototype.ATTR_WATCH=["cx","cy","points","r","rx","ry","x","x1","x2","y","y1","y2"],r.prototype.scan=function(t){for(var e,n,i,r=t.querySelectorAll(this.TYPES.join(",")),a=0;a<r.length;a++)n=(0,this[(e=r[a]).tagName.toLowerCase()+"ToPath"])(this.parseAttr(e.attributes)),i=this.pathMaker(e,n),e.parentNode.replaceChild(i,e)},r.prototype.lineToPath=function(t){var e={},n=t.x1||0,i=t.y1||0,r=t.x2||0,a=t.y2||0;return e.d="M"+n+","+i+"L"+r+","+a,e},r.prototype.rectToPath=function(t){var e={},n=parseFloat(t.x)||0,i=parseFloat(t.y)||0,r=parseFloat(t.width)||0,a=parseFloat(t.height)||0;if(t.rx||t.ry){var s=parseInt(t.rx,10)||-1,o=parseInt(t.ry,10)||-1;s=Math.min(Math.max(s<0?o:s,0),r/2),o=Math.min(Math.max(o<0?s:o,0),a/2),e.d="M "+(n+s)+","+i+" L "+(n+r-s)+","+i+" A "+s+","+o+",0,0,1,"+(n+r)+","+(i+o)+" L "+(n+r)+","+(i+a-o)+" A "+s+","+o+",0,0,1,"+(n+r-s)+","+(i+a)+" L "+(n+s)+","+(i+a)+" A "+s+","+o+",0,0,1,"+n+","+(i+a-o)+" L "+n+","+(i+o)+" A "+s+","+o+",0,0,1,"+(n+s)+","+i}else e.d="M"+n+" "+i+" L"+(n+r)+" "+i+" L"+(n+r)+" "+(i+a)+" L"+n+" "+(i+a)+" Z";return e},r.prototype.polylineToPath=function(t){var e,n,i={},r=t.points.trim().split(" ");if(-1===t.points.indexOf(",")){var a=[];for(e=0;e<r.length;e+=2)a.push(r[e]+","+r[e+1]);r=a}for(n="M"+r[0],e=1;e<r.length;e++)-1!==r[e].indexOf(",")&&(n+="L"+r[e]);return i.d=n,i},r.prototype.polygonToPath=function(t){var e=r.prototype.polylineToPath(t);return e.d+="Z",e},r.prototype.ellipseToPath=function(t){var e={},n=parseFloat(t.rx)||0,i=parseFloat(t.ry)||0,r=parseFloat(t.cx)||0,a=parseFloat(t.cy)||0,s=r-n,o=parseFloat(r)+parseFloat(n),h=a;return e.d="M"+s+","+a+"A"+n+","+i+" 0,1,1 "+o+","+h+"A"+n+","+i+" 0,1,1 "+s+","+h,e},r.prototype.circleToPath=function(t){var e={},n=parseFloat(t.r)||0,i=parseFloat(t.cx)||0,r=parseFloat(t.cy)||0,a=i-n,s=parseFloat(i)+parseFloat(n),o=r;return e.d="M"+a+","+r+"A"+n+","+n+" 0,1,1 "+s+","+o+"A"+n+","+n+" 0,1,1 "+a+","+o,e},r.prototype.pathMaker=function(t,e){var n,i,r=document.createElementNS("http://www.w3.org/2000/svg","path");for(n=0;n<t.attributes.length;n++)i=t.attributes[n],-1===this.ATTR_WATCH.indexOf(i.name)&&r.setAttribute(i.name,i.value);for(n in e)r.setAttribute(n,e[n]);return r},r.prototype.parseAttr=function(t){for(var e,n={},i=0;i<t.length;i++){if(e=t[i],-1!==this.ATTR_WATCH.indexOf(e.name)&&-1!==e.value.indexOf("%"))throw Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'.");n[e.name]=e.value}return n},a.LINEAR=function(t){return t},a.EASE=function(t){return-Math.cos(t*Math.PI)/2+.5},a.EASE_OUT=function(t){return 1-Math.pow(1-t,3)},a.EASE_IN=function(t){return Math.pow(t,3)},a.EASE_OUT_BOUNCE=function(t){var e=Math.pow(1-t,2);return 1-e+(1-Math.abs(Math.cos(Math.pow(1-Math.cos(t*(.5*Math.PI)),1.5)*(2.5*Math.PI))))*e},a.prototype.setElement=function(t,e){var n,i;if(void 0===t)throw Error('Vivus [constructor]: "element" parameter is required');if(t.constructor===String&&!(t=document.getElementById(t)))throw Error('Vivus [constructor]: "element" parameter is not related to an existing ID');if(this.parentEl=t,e&&e.file){i=this,n=function(){var t=document.createElement("div");t.innerHTML=this.responseText;var n=t.querySelector("svg");if(!n)throw Error("Vivus [load]: Cannot find the SVG in the loaded file : "+e.file);i.el=n,i.el.setAttribute("width","100%"),i.el.setAttribute("height","100%"),i.parentEl.appendChild(i.el),i.isReady=!0,i.init(),i=null};var r=new window.XMLHttpRequest;return r.addEventListener("load",n),r.open("GET",e.file),void r.send()}switch(t.constructor){case window.SVGSVGElement:case window.SVGElement:case window.SVGGElement:this.el=t,this.isReady=!0;break;case window.HTMLObjectElement:i=this,(n=function(e){if(!i.isReady){if(i.el=t.contentDocument&&t.contentDocument.querySelector("svg"),!i.el&&e)throw Error("Vivus [constructor]: object loaded does not contain any SVG");i.el&&(t.getAttribute("built-by-vivus")&&(i.parentEl.insertBefore(i.el,t),i.parentEl.removeChild(t),i.el.setAttribute("width","100%"),i.el.setAttribute("height","100%")),i.isReady=!0,i.init(),i=null)}})()||t.addEventListener("load",n);break;default:throw Error('Vivus [constructor]: "element" parameter is not valid (or miss the "file" attribute)')}},a.prototype.setOptions=function(t){var e=["delayed","sync","async","nsync","oneByOne","scenario","scenario-sync"],n=["inViewport","manual","autostart"];if(void 0!==t&&t.constructor!==Object)throw Error('Vivus [constructor]: "options" parameter must be an object');if((t=t||{}).type&&-1===e.indexOf(t.type))throw Error("Vivus [constructor]: "+t.type+" is not an existing animation `type`");if(this.type=t.type||e[0],t.start&&-1===n.indexOf(t.start))throw Error("Vivus [constructor]: "+t.start+" is not an existing `start` option");if(this.start=t.start||n[0],this.isIE=-1!==window.navigator.userAgent.indexOf("MSIE")||-1!==window.navigator.userAgent.indexOf("Trident/")||-1!==window.navigator.userAgent.indexOf("Edge/"),this.duration=i(t.duration,120),this.delay=i(t.delay,null),this.dashGap=i(t.dashGap,1),this.forceRender=t.hasOwnProperty("forceRender")?!!t.forceRender:this.isIE,this.reverseStack=!!t.reverseStack,this.selfDestroy=!!t.selfDestroy,this.onReady=t.onReady,this.map=[],this.frameLength=this.currentFrame=this.delayUnit=this.speed=this.handle=null,this.ignoreInvisible=!!t.hasOwnProperty("ignoreInvisible")&&!!t.ignoreInvisible,this.animTimingFunction=t.animTimingFunction||a.LINEAR,this.pathTimingFunction=t.pathTimingFunction||a.LINEAR,this.delay>=this.duration)throw Error("Vivus [constructor]: delay must be shorter than duration")},a.prototype.setCallback=function(t){if(t&&t.constructor!==Function)throw Error('Vivus [constructor]: "callback" parameter must be a function');this.callback=t||function(){}},a.prototype.mapping=function(){var t,e,n,r,a,s,o,h,l,c;for(h=s=o=0,e=this.el.querySelectorAll("path"),c=!1,t=0;t<e.length;t++)if(n=e[t],!this.isInvisible(n)){if(a={el:n,length:0,startAt:0,duration:0,isResizeSensitive:!1},"non-scaling-stroke"===n.getAttribute("vector-effect")){var u=n.getBoundingClientRect(),p=n.getBBox();l=Math.max(u.width/p.width,u.height/p.height),c=a.isResizeSensitive=!0}else l=1;a.length=Math.ceil(n.getTotalLength()*l),isNaN(a.length)?window.console&&console.warn&&console.warn("Vivus [mapping]: cannot retrieve a path element length",n):(this.map.push(a),n.style.strokeDasharray=a.length+" "+(a.length+2*this.dashGap),n.style.strokeDashoffset=a.length+this.dashGap,a.length+=this.dashGap,s+=a.length,this.renderPath(t))}for(c&&console.warn("Vivus: this SVG contains non-scaling-strokes. You should call instance.recalc() when the SVG is resized or you will encounter unwanted behaviour. See https://github.com/maxwellito/vivus#non-scaling for more info."),s=0===s?1:s,this.delay=null===this.delay?this.duration/3:this.delay,this.delayUnit=this.delay/(1<e.length?e.length-1:1),this.reverseStack&&this.map.reverse(),t=0;t<this.map.length;t++){switch(a=this.map[t],this.type){case"delayed":a.startAt=this.delayUnit*t,a.duration=this.duration-this.delay;break;case"oneByOne":a.startAt=o/s*this.duration,a.duration=a.length/s*this.duration;break;case"sync":case"async":case"nsync":a.startAt=0,a.duration=this.duration;break;case"scenario-sync":n=a.el,r=this.parseAttr(n),a.startAt=h+(i(r["data-delay"],this.delayUnit)||0),a.duration=i(r["data-duration"],this.duration),h=void 0!==r["data-async"]?a.startAt:a.startAt+a.duration,this.frameLength=Math.max(this.frameLength,a.startAt+a.duration);break;case"scenario":n=a.el,r=this.parseAttr(n),a.startAt=i(r["data-start"],this.delayUnit)||0,a.duration=i(r["data-duration"],this.duration),this.frameLength=Math.max(this.frameLength,a.startAt+a.duration)}o+=a.length,this.frameLength=this.frameLength||this.duration}},a.prototype.recalc=function(){this.mustRecalcScale||(this.mustRecalcScale=e((function(){this.performLineRecalc()}).bind(this)))},a.prototype.performLineRecalc=function(){for(var t,e,n,i,r,a=0;a<this.map.length;a++)(t=this.map[a]).isResizeSensitive&&(n=(e=t.el).getBoundingClientRect(),i=e.getBBox(),r=Math.max(n.width/i.width,n.height/i.height),t.length=Math.ceil(e.getTotalLength()*r),e.style.strokeDasharray=t.length+" "+(t.length+2*this.dashGap));this.trace(),this.mustRecalcScale=null},a.prototype.draw=function(){var t=this;if(this.currentFrame+=this.speed,this.currentFrame<=0)this.stop(),this.reset();else{if(!(this.currentFrame>=this.frameLength))return this.trace(),void(this.handle=e(function(){t.draw()}));this.stop(),this.currentFrame=this.frameLength,this.trace(),this.selfDestroy&&this.destroy()}this.callback(this),this.instanceCallback&&(this.instanceCallback(this),this.instanceCallback=null)},a.prototype.trace=function(){var t,e,n,i;for(i=this.animTimingFunction(this.currentFrame/this.frameLength)*this.frameLength,t=0;t<this.map.length;t++)e=(i-(n=this.map[t]).startAt)/n.duration,e=this.pathTimingFunction(Math.max(0,Math.min(1,e))),n.progress!==e&&(n.progress=e,n.el.style.strokeDashoffset=Math.floor(n.length*(1-e)),this.renderPath(t))},a.prototype.renderPath=function(t){if(this.forceRender&&this.map&&this.map[t]){var e=this.map[t],n=e.el.cloneNode(!0);e.el.parentNode.replaceChild(n,e.el),e.el=n}},a.prototype.init=function(){this.frameLength=0,this.currentFrame=0,this.map=[],new r(this.el),this.mapping(),this.starter(),this.onReady&&this.onReady(this)},a.prototype.starter=function(){switch(this.start){case"manual":return;case"autostart":this.play();break;case"inViewport":var t=this,e=function(){t.isInViewport(t.parentEl,1)&&(t.play(),window.removeEventListener("scroll",e))};window.addEventListener("scroll",e),e()}},a.prototype.getStatus=function(){return 0===this.currentFrame?"start":this.currentFrame===this.frameLength?"end":"progress"},a.prototype.reset=function(){return this.setFrameProgress(0)},a.prototype.finish=function(){return this.setFrameProgress(1)},a.prototype.setFrameProgress=function(t){return t=Math.min(1,Math.max(0,t)),this.currentFrame=Math.round(this.frameLength*t),this.trace(),this},a.prototype.play=function(t,e){if(this.instanceCallback=null,t&&"function"==typeof t)this.instanceCallback=t,t=null;else if(t&&"number"!=typeof t)throw Error("Vivus [play]: invalid speed");return e&&"function"==typeof e&&!this.instanceCallback&&(this.instanceCallback=e),this.speed=t||1,this.handle||this.draw(),this},a.prototype.stop=function(){return this.handle&&(n(this.handle),this.handle=null),this},a.prototype.destroy=function(){var t,e;for(this.stop(),t=0;t<this.map.length;t++)(e=this.map[t]).el.style.strokeDashoffset=null,e.el.style.strokeDasharray=null,this.renderPath(t)},a.prototype.isInvisible=function(t){var e,n=t.getAttribute("data-ignore");return null!==n?"false"!==n:!!this.ignoreInvisible&&!(e=t.getBoundingClientRect()).width&&!e.height},a.prototype.parseAttr=function(t){var e,n={};if(t&&t.attributes)for(var i=0;i<t.attributes.length;i++)n[(e=t.attributes[i]).name]=e.value;return n},a.prototype.isInViewport=function(t,e){var n=this.scrollY(),i=n+this.getViewportH(),r=t.getBoundingClientRect(),a=r.height,s=n+r.top;return s+a*(e=e||0)<=i&&n<=s+a},a.prototype.getViewportH=function(){var t=this.docElem.clientHeight,e=window.innerHeight;return t<e?e:t},a.prototype.scrollY=function(){return window.pageYOffset||this.docElem.scrollTop},t=function(){a.prototype.docElem||(a.prototype.docElem=window.document.documentElement,e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},n=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t)})},i=function(t,e){var n=parseInt(t,10);return 0<=n?n:e},"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof exports?module.exports=a:window.Vivus=a}();var bricksableAnimatedSVGFn=new BricksFunction({parentNode:document,selector:".brxe-ba-animated-svg",eachElement:function(t){new BricksIntersect({element:t.querySelector("svg"),callback:function(){var e;if(t.dataset.scriptId){try{e=JSON.parse(t.dataset.baBricksAnimatedSvgOptions)}catch(n){return!1}var i=t.querySelector("svg"),r=new Vivus(i,{start:"autostart"===e.start||"inViewport"===e.start?e.start:"manual",type:e.type,duration:e.duration,delay:e.delay,animTimingFunction:Vivus[e.animTimingFunction]},function(t){});if(i&&(window.bricksableAnimatedSVGData.animatedSVGInstances[e]&&window.bricksableAnimatedSVGData.animatedSVGInstances[e].destroy(),window.bricksableAnimatedSVGData.animatedSVGInstances[e]=r),"autostart"!==e.start&&"inViewport"!==e.start){var a=function(t){("end"!==r.getStatus()||!1!==e.svgAnimationReRender)&&(r.play(1),"end"===r.getStatus()&&r.reset().play(1))},s=function(t){"end"!==r.getStatus()&&("progress"===r.getStatus()?"stop"===e.onMouseLeave?r.stop():"end"===r.getStatus()?r.reset().play(1):r.play(-1):"end"===r.getStatus()&&r.reset().play(1))};"hover"===e.manualMethod&&(t.addEventListener("mouseover",a),t.addEventListener("mouseleave",s)),"click"===e.manualMethod&&t.addEventListener("click",a)}}},once:!0!==JSON.parse(t.dataset.baBricksAnimatedSvgOptions).svgAnimationReAnimation,threshold:.1})}});function bricksableAnimatedSVG(){bricksableAnimatedSVGFn.run()}document.addEventListener("DOMContentLoaded",function(t){bricksIsFrontend&&bricksableAnimatedSVG()});
     1!function(){"use strict";var t,e,n,i;function r(t){if(void 0===t)throw Error('Pathformer [constructor]: "element" parameter is required');if(t.constructor===String&&!(t=document.getElementById(t)))throw Error('Pathformer [constructor]: "element" parameter is not related to an existing ID');if(!(t instanceof window.SVGElement||t instanceof window.SVGGElement||/^svg$/i.test(t.nodeName)))throw Error('Pathformer [constructor]: "element" parameter must be a string or a SVGelement');this.el=t,this.scan(t)}function a(e,n,i){t(),this.isReady=!1,this.setElement(e,n),this.setOptions(n),this.setCallback(i),this.isReady&&this.init()}r.prototype.TYPES=["line","ellipse","circle","polygon","polyline","rect"],r.prototype.ATTR_WATCH=["cx","cy","points","r","rx","ry","x","x1","x2","y","y1","y2"],r.prototype.scan=function(t){for(var e,n,i,r=t.querySelectorAll(this.TYPES.join(",")),a=0;a<r.length;a++)n=(0,this[(e=r[a]).tagName.toLowerCase()+"ToPath"])(this.parseAttr(e.attributes)),i=this.pathMaker(e,n),e.parentNode.replaceChild(i,e)},r.prototype.lineToPath=function(t){var e={},n=t.x1||0,i=t.y1||0,r=t.x2||0,a=t.y2||0;return e.d="M"+n+","+i+"L"+r+","+a,e},r.prototype.rectToPath=function(t){var e={},n=parseFloat(t.x)||0,i=parseFloat(t.y)||0,r=parseFloat(t.width)||0,a=parseFloat(t.height)||0;if(t.rx||t.ry){var s=parseInt(t.rx,10)||-1,o=parseInt(t.ry,10)||-1;s=Math.min(Math.max(s<0?o:s,0),r/2),o=Math.min(Math.max(o<0?s:o,0),a/2),e.d="M "+(n+s)+","+i+" L "+(n+r-s)+","+i+" A "+s+","+o+",0,0,1,"+(n+r)+","+(i+o)+" L "+(n+r)+","+(i+a-o)+" A "+s+","+o+",0,0,1,"+(n+r-s)+","+(i+a)+" L "+(n+s)+","+(i+a)+" A "+s+","+o+",0,0,1,"+n+","+(i+a-o)+" L "+n+","+(i+o)+" A "+s+","+o+",0,0,1,"+(n+s)+","+i}else e.d="M"+n+" "+i+" L"+(n+r)+" "+i+" L"+(n+r)+" "+(i+a)+" L"+n+" "+(i+a)+" Z";return e},r.prototype.polylineToPath=function(t){var e,n,i={},r=t.points.trim().split(" ");if(-1===t.points.indexOf(",")){var a=[];for(e=0;e<r.length;e+=2)a.push(r[e]+","+r[e+1]);r=a}for(n="M"+r[0],e=1;e<r.length;e++)-1!==r[e].indexOf(",")&&(n+="L"+r[e]);return i.d=n,i},r.prototype.polygonToPath=function(t){var e=r.prototype.polylineToPath(t);return e.d+="Z",e},r.prototype.ellipseToPath=function(t){var e={},n=parseFloat(t.rx)||0,i=parseFloat(t.ry)||0,r=parseFloat(t.cx)||0,a=parseFloat(t.cy)||0,s=r-n,o=parseFloat(r)+parseFloat(n),h=a;return e.d="M"+s+","+a+"A"+n+","+i+" 0,1,1 "+o+","+h+"A"+n+","+i+" 0,1,1 "+s+","+h,e},r.prototype.circleToPath=function(t){var e={},n=parseFloat(t.r)||0,i=parseFloat(t.cx)||0,r=parseFloat(t.cy)||0,a=i-n,s=parseFloat(i)+parseFloat(n),o=r;return e.d="M"+a+","+r+"A"+n+","+n+" 0,1,1 "+s+","+o+"A"+n+","+n+" 0,1,1 "+a+","+o,e},r.prototype.pathMaker=function(t,e){var n,i,r=document.createElementNS("http://www.w3.org/2000/svg","path");for(n=0;n<t.attributes.length;n++)i=t.attributes[n],-1===this.ATTR_WATCH.indexOf(i.name)&&r.setAttribute(i.name,i.value);for(n in e)r.setAttribute(n,e[n]);return r},r.prototype.parseAttr=function(t){for(var e,n={},i=0;i<t.length;i++){if(e=t[i],-1!==this.ATTR_WATCH.indexOf(e.name)&&-1!==e.value.indexOf("%"))throw Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'.");n[e.name]=e.value}return n},a.LINEAR=function(t){return t},a.EASE=function(t){return-Math.cos(t*Math.PI)/2+.5},a.EASE_OUT=function(t){return 1-Math.pow(1-t,3)},a.EASE_IN=function(t){return Math.pow(t,3)},a.EASE_OUT_BOUNCE=function(t){var e=Math.pow(1-t,2);return 1-e+(1-Math.abs(Math.cos(Math.pow(1-Math.cos(t*(.5*Math.PI)),1.5)*(2.5*Math.PI))))*e},a.prototype.setElement=function(t,e){var n,i;if(void 0===t)throw Error('Vivus [constructor]: "element" parameter is required');if(t.constructor===String&&!(t=document.getElementById(t)))throw Error('Vivus [constructor]: "element" parameter is not related to an existing ID');if(this.parentEl=t,e&&e.file){i=this,n=function(){var t=document.createElement("div");t.innerHTML=this.responseText;var n=t.querySelector("svg");if(!n)throw Error("Vivus [load]: Cannot find the SVG in the loaded file : "+e.file);i.el=n,i.el.setAttribute("width","100%"),i.el.setAttribute("height","100%"),i.parentEl.appendChild(i.el),i.isReady=!0,i.init(),i=null};var r=new window.XMLHttpRequest;return r.addEventListener("load",n),r.open("GET",e.file),void r.send()}switch(t.constructor){case window.SVGSVGElement:case window.SVGElement:case window.SVGGElement:this.el=t,this.isReady=!0;break;case window.HTMLObjectElement:i=this,(n=function(e){if(!i.isReady){if(i.el=t.contentDocument&&t.contentDocument.querySelector("svg"),!i.el&&e)throw Error("Vivus [constructor]: object loaded does not contain any SVG");i.el&&(t.getAttribute("built-by-vivus")&&(i.parentEl.insertBefore(i.el,t),i.parentEl.removeChild(t),i.el.setAttribute("width","100%"),i.el.setAttribute("height","100%")),i.isReady=!0,i.init(),i=null)}})()||t.addEventListener("load",n);break;default:throw Error('Vivus [constructor]: "element" parameter is not valid (or miss the "file" attribute)')}},a.prototype.setOptions=function(t){var e=["delayed","sync","async","nsync","oneByOne","scenario","scenario-sync"],n=["inViewport","manual","autostart"];if(void 0!==t&&t.constructor!==Object)throw Error('Vivus [constructor]: "options" parameter must be an object');if((t=t||{}).type&&-1===e.indexOf(t.type))throw Error("Vivus [constructor]: "+t.type+" is not an existing animation `type`");if(this.type=t.type||e[0],t.start&&-1===n.indexOf(t.start))throw Error("Vivus [constructor]: "+t.start+" is not an existing `start` option");if(this.start=t.start||n[0],this.isIE=-1!==window.navigator.userAgent.indexOf("MSIE")||-1!==window.navigator.userAgent.indexOf("Trident/")||-1!==window.navigator.userAgent.indexOf("Edge/"),this.duration=i(t.duration,120),this.delay=i(t.delay,null),this.dashGap=i(t.dashGap,1),this.forceRender=t.hasOwnProperty("forceRender")?!!t.forceRender:this.isIE,this.reverseStack=!!t.reverseStack,this.selfDestroy=!!t.selfDestroy,this.onReady=t.onReady,this.map=[],this.frameLength=this.currentFrame=this.delayUnit=this.speed=this.handle=null,this.ignoreInvisible=!!t.hasOwnProperty("ignoreInvisible")&&!!t.ignoreInvisible,this.animTimingFunction=t.animTimingFunction||a.LINEAR,this.pathTimingFunction=t.pathTimingFunction||a.LINEAR,this.delay>=this.duration)throw Error("Vivus [constructor]: delay must be shorter than duration")},a.prototype.setCallback=function(t){if(t&&t.constructor!==Function)throw Error('Vivus [constructor]: "callback" parameter must be a function');this.callback=t||function(){}},a.prototype.mapping=function(){var t,e,n,r,a,s,o,h,l,c;for(h=s=o=0,e=this.el.querySelectorAll("path"),c=!1,t=0;t<e.length;t++)if(n=e[t],!this.isInvisible(n)){if(a={el:n,length:0,startAt:0,duration:0,isResizeSensitive:!1},"non-scaling-stroke"===n.getAttribute("vector-effect")){var u=n.getBoundingClientRect(),p=n.getBBox();l=Math.max(u.width/p.width,u.height/p.height),c=a.isResizeSensitive=!0}else l=1;a.length=Math.ceil(n.getTotalLength()*l),isNaN(a.length)?window.console&&console.warn&&console.warn("Vivus [mapping]: cannot retrieve a path element length",n):(this.map.push(a),n.style.strokeDasharray=a.length+" "+(a.length+2*this.dashGap),n.style.strokeDashoffset=a.length+this.dashGap,a.length+=this.dashGap,s+=a.length,this.renderPath(t))}for(c&&console.warn("Vivus: this SVG contains non-scaling-strokes. You should call instance.recalc() when the SVG is resized or you will encounter unwanted behaviour. See https://github.com/maxwellito/vivus#non-scaling for more info."),s=0===s?1:s,this.delay=null===this.delay?this.duration/3:this.delay,this.delayUnit=this.delay/(1<e.length?e.length-1:1),this.reverseStack&&this.map.reverse(),t=0;t<this.map.length;t++){switch(a=this.map[t],this.type){case"delayed":a.startAt=this.delayUnit*t,a.duration=this.duration-this.delay;break;case"oneByOne":a.startAt=o/s*this.duration,a.duration=a.length/s*this.duration;break;case"sync":case"async":case"nsync":a.startAt=0,a.duration=this.duration;break;case"scenario-sync":n=a.el,r=this.parseAttr(n),a.startAt=h+(i(r["data-delay"],this.delayUnit)||0),a.duration=i(r["data-duration"],this.duration),h=void 0!==r["data-async"]?a.startAt:a.startAt+a.duration,this.frameLength=Math.max(this.frameLength,a.startAt+a.duration);break;case"scenario":n=a.el,r=this.parseAttr(n),a.startAt=i(r["data-start"],this.delayUnit)||0,a.duration=i(r["data-duration"],this.duration),this.frameLength=Math.max(this.frameLength,a.startAt+a.duration)}o+=a.length,this.frameLength=this.frameLength||this.duration}},a.prototype.recalc=function(){this.mustRecalcScale||(this.mustRecalcScale=e((function(){this.performLineRecalc()}).bind(this)))},a.prototype.performLineRecalc=function(){for(var t,e,n,i,r,a=0;a<this.map.length;a++)(t=this.map[a]).isResizeSensitive&&(n=(e=t.el).getBoundingClientRect(),i=e.getBBox(),r=Math.max(n.width/i.width,n.height/i.height),t.length=Math.ceil(e.getTotalLength()*r),e.style.strokeDasharray=t.length+" "+(t.length+2*this.dashGap));this.trace(),this.mustRecalcScale=null},a.prototype.draw=function(){var t=this;if(this.currentFrame+=this.speed,this.currentFrame<=0)this.stop(),this.reset();else{if(!(this.currentFrame>=this.frameLength))return this.trace(),void(this.handle=e(function(){t.draw()}));this.stop(),this.currentFrame=this.frameLength,this.trace(),this.selfDestroy&&this.destroy()}this.callback(this),this.instanceCallback&&(this.instanceCallback(this),this.instanceCallback=null)},a.prototype.trace=function(){var t,e,n,i;for(i=this.animTimingFunction(this.currentFrame/this.frameLength)*this.frameLength,t=0;t<this.map.length;t++)e=(i-(n=this.map[t]).startAt)/n.duration,e=this.pathTimingFunction(Math.max(0,Math.min(1,e))),n.progress!==e&&(n.progress=e,n.el.style.strokeDashoffset=Math.floor(n.length*(1-e)),this.renderPath(t))},a.prototype.renderPath=function(t){if(this.forceRender&&this.map&&this.map[t]){var e=this.map[t],n=e.el.cloneNode(!0);e.el.parentNode.replaceChild(n,e.el),e.el=n}},a.prototype.init=function(){this.frameLength=0,this.currentFrame=0,this.map=[],new r(this.el),this.mapping(),this.starter(),this.onReady&&this.onReady(this)},a.prototype.starter=function(){switch(this.start){case"manual":return;case"autostart":this.play();break;case"inViewport":var t=this,e=function(){t.isInViewport(t.parentEl,1)&&(t.play(),window.removeEventListener("scroll",e))};window.addEventListener("scroll",e),e()}},a.prototype.getStatus=function(){return 0===this.currentFrame?"start":this.currentFrame===this.frameLength?"end":"progress"},a.prototype.reset=function(){return this.setFrameProgress(0)},a.prototype.finish=function(){return this.setFrameProgress(1)},a.prototype.setFrameProgress=function(t){return t=Math.min(1,Math.max(0,t)),this.currentFrame=Math.round(this.frameLength*t),this.trace(),this},a.prototype.play=function(t,e){if(this.instanceCallback=null,t&&"function"==typeof t)this.instanceCallback=t,t=null;else if(t&&"number"!=typeof t)throw Error("Vivus [play]: invalid speed");return e&&"function"==typeof e&&!this.instanceCallback&&(this.instanceCallback=e),this.speed=t||1,this.handle||this.draw(),this},a.prototype.stop=function(){return this.handle&&(n(this.handle),this.handle=null),this},a.prototype.destroy=function(){var t,e;for(this.stop(),t=0;t<this.map.length;t++)(e=this.map[t]).el.style.strokeDashoffset=null,e.el.style.strokeDasharray=null,this.renderPath(t)},a.prototype.isInvisible=function(t){var e,n=t.getAttribute("data-ignore");return null!==n?"false"!==n:!!this.ignoreInvisible&&!(e=t.getBoundingClientRect()).width&&!e.height},a.prototype.parseAttr=function(t){var e,n={};if(t&&t.attributes)for(var i=0;i<t.attributes.length;i++)n[(e=t.attributes[i]).name]=e.value;return n},a.prototype.isInViewport=function(t,e){var n=this.scrollY(),i=n+this.getViewportH(),r=t.getBoundingClientRect(),a=r.height,s=n+r.top;return s+a*(e=e||0)<=i&&n<=s+a},a.prototype.getViewportH=function(){var t=this.docElem.clientHeight,e=window.innerHeight;return t<e?e:t},a.prototype.scrollY=function(){return window.pageYOffset||this.docElem.scrollTop},t=function(){a.prototype.docElem||(a.prototype.docElem=window.document.documentElement,e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},n=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t)})},i=function(t,e){var n=parseInt(t,10);return 0<=n?n:e},"function"==typeof define&&define.amd?define([],function(){return a}):"object"==typeof exports?module.exports=a:window.Vivus=a}();var bricksableAnimatedSVGFn=new BricksFunction({parentNode:document,selector:".brxe-ba-animated-svg",eachElement:function(t){var e;e=setInterval(function(){clearInterval(e),new BricksIntersect({element:t,callback:function(){var e;if(t.dataset.scriptId){try{e=JSON.parse(t.dataset.baBricksAnimatedSvgOptions)}catch(n){return!1}var i=t.querySelector("svg"),r=new Vivus(i,{start:"autostart"===e.start||"inViewport"===e.start?e.start:"manual",type:e.type,duration:e.duration,delay:e.delay,animTimingFunction:Vivus[e.animTimingFunction]},function(t){});if("autostart"!==e.start&&"inViewport"!==e.start){var a=function(t){("end"!==r.getStatus()||!1!==e.svgAnimationReRender)&&(r.play(1),"end"===r.getStatus()&&r.reset().play(1))},s=function(t){"end"!==r.getStatus()&&("progress"===r.getStatus()?"stop"===e.onMouseLeave?r.stop():"end"===r.getStatus()?r.reset().play(1):r.play(-1):"end"===r.getStatus()&&r.reset().play(1))};"hover"===e.manualMethod&&(t.addEventListener("mouseover",a),t.addEventListener("mouseleave",s)),"click"===e.manualMethod&&t.addEventListener("click",a)}}},once:!0!==JSON.parse(t.dataset.baBricksAnimatedSvgOptions).svgAnimationReAnimation,threshold:.1})},10)}});function bricksableAnimatedSVG(){bricksableAnimatedSVGFn.run()}document.addEventListener("DOMContentLoaded",function(t){bricksIsFrontend&&bricksableAnimatedSVG()});
  • bricksable/trunk/readme.txt

    r3134590 r3134641  
    44Requires at least: 5.6
    55Tested up to: 6.6.1
    6 Stable tag: 1.6.58
     6Stable tag: 1.6.59
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    9595
    9696== Changelog ==
     97= 1.6.59 (2024-08-13) =
     98* Fix: Animated SVG Element not working in multiple element in a page.
     99
    97100= 1.6.58 (2024-08-13) =
    98101* Fix: Floating Element default image URL replaced with placeholder.
Note: See TracChangeset for help on using the changeset viewer.