PageSourceSearch

https://kritikalsolutions.com/wp-content/plugins/revslider-bubblem…volution.addon.bubblemorph.min.js?ver=6.7.2

js kritikalsolutions.com collected 2026-09-24 09:45:24 UTC 12,928 bytes, 8 lines download raw bytes

1/**
2 * @preserve
3 * @author    ThemePunch <[email protected]>
4 * @link      http://www.themepunch.com/
5 * @copyright 2018 ThemePunch
6 * @version 6.7.0
7 */
8!function(){"use strict";var t,e,i;function s(t,e){this.slider=t,this.carousel=e,t.one("revolution.slide.onloaded",this.onLoaded.bind(this)).one("rsBubbleMorphDestroyed",this.destroy.bind(this))}function r(){var e=t(this),i=e.data("bubbleaddon");i&&(i.destroy(),e.removeData("bubbleaddon"))}function h(t,e){if(!t)return!1;if(0===e)return t[e];for(var i=e,s=t[e];"inherit"===s;)s=--i>-1?t[i]:t[0];return s}function n(t){var i,s,r,h=t.levels,n=h.length,l=e.width(),a=0;if(h)for(var o=0;o<n;o++)s!==(r=h[o])&&(l<r&&(a=o),s=r);var d=t.layerW[a],u=t.layerH[a],b="100%"===u||"full"===u;if("100%"===d||"full"===d){var p=!t.carousel||t.isStatic?t.slider:t.slotholder;t.fullAlign?(d=p.width(),t.wrapper[0].style.left=0):(i=Math.min(t.slider.width()/t.grids[a],1),d=t.grids[a]*i)}else d=parseInt(t.layr.css("width"),10);return b?(u=t.isStatic?t.slider.height():t.slotholder.height(),t.wrapper[0].style.top=0):u=parseInt(t.layr.css("height"),10),{width:d,height:u,level:a}}function l(){var e=t(this),s=e.data("bubbleObj"),l=!1,o=e.data("bubbleaddon");if(s&&(9999===s.slideIndex&&parseInt(e.data("bubbleIndex"),0)>=parseInt(e.data("startslide"),0)&&parseInt(e.data("bubbleIndex"),0)<=parseInt(e.data("endslide"),0)&&(l=!0),e.data("bubbleIndex")==s.slideIndex||!0===l||jQuery&&jQuery.fn.revolution&&jQuery.fn.revolution[s.slider[0].id].shuffle)){o&&r.call(this);var d=n(s),u=d.level,p=h(s.blurStrength,u),c=h(s.borderSize,u),f=h(s.borderColor,u),g=h(s.blurColor,u),v=h(s.blurX,u),y=h(s.blurY,u),w=h(s.bufferX,u),m=h(s.bufferY,u),x=h(s.numBubbles,u),S=h(s.velX,u),I=h(s.velY,u),M=function(t,e,s,r,h,n,l,a,o,d,u,p,c,f,g,v,y){var w,m={screen:{elem:null,callback:null,ctx:null,width:0,height:0,left:0,top:0,init:function(t,e){return this.elem=r,this.callback=t||null,"CANVAS"==this.elem.tagName&&(this.ctx=this.elem.getContext("2d")),this.elem.onselectstart=function(){return!1},this.elem.ondrag=function(){return!1},e&&this.resize(),this},resize:function(){var i=this.elem;for(this.width=t,this.height=e,this.left=0,this.top=0;null!=i;i=i.offsetParent)this.left+=i.offsetLeft,this.top+=i.offsetTop;this.ctx&&(this.elem.width=this.width,this.elem.height=this.height),w&&(w.width=this.width,w.height=this.height),this.callback&&this.callback()},destroy:function(){for(var t in this)this.hasOwnProperty(t)&&delete this[t]}}},x=function(t,e){this.x=t,this.y=e,this.magnitude=t*t+e*e,this.computed=0,this.force=0};x.prototype.add=function(t){return new x(this.x+t.x,this.y+t.y)};var S=function(t){var e=.1,i=1.5;this.vel=new x((Math.random()>.5?1:-1)*(.2+Math.random()*g),(Math.random()>.5?1:-1)*(.2+Math.random()*v)),this.pos=new x(.2*t.width+Math.random()*t.width*.6,.2*t.height+Math.random()*t.height*.6),this.size=t.wh/Math.min(30,15/y)+(Math.random()*(i-e)+e)*(t.wh/Math.min(30,15/y)),this.width=t.width,this.height=t.height};S.prototype.move=function(){this.pos.x>=this.width-this.size-c?(this.vel.x>0&&(this.vel.x=-this.vel.x),this.pos.x=this.width-this.size-c):this.pos.x<=this.size+c&&(this.vel.x<0&&(this.vel.x=-this.vel.x),this.pos.x=this.size+c),this.pos.y>=this.height-this.size-f?(this.vel.y>0&&(this.vel.y=-this.vel.y),this.pos.y=this.height-this.size-f):this.pos.y<=this.size+f&&(this.vel.y<0&&(this.vel.y=-this.vel.y),this.pos.y=this.size+f),this.pos=this.pos.add(this.vel)};var I=function(t,e,i,s){this.step=5,this.width=t,this.height=e,this.wh=Math.min(t,e),this.sx=Math.floor(this.width/this.step),this.sy=Math.floor(this.height/this.step),this.paint=!1,this.metaFill=M(t,e,s),this.plx=[0,0,1,0,1,1,1,1,1,1,0,1,0,0,0,0],this.ply=[0,0,0,0,0,0,1,0,0,1,1,1,0,1,0,1],this.mscases=[0,3,0,3,1,3,0,3,2,2,0,2,1,1,0],this.ix=[1,0,-1,0,0,1,0,-1,-1,0,1,0,0,1,1,0,0,0,1,1],this.grid=[],this.balls=[],this.iter=0,this.sign=1;for(var r=0;r<(this.sx+2)*(this.sy+2);r++)this.grid[r]=new x(r%(this.sx+2)*this.step,Math.floor(r/(this.sx+2))*this.step);for(var h=0;h<i;h++)this.balls[h]=new S(this)};I.prototype.destroy=function(){var t;for(t in this.balls)this.balls.hasOwnProperty(t)&&delete this.balls[t];for(t in this)this.hasOwnProperty(t)&&delete this[t]}
8,I.prototype.computeForce=function(t,e,i){var s,r=i||t+e*(this.sx+2);if(0===t||0===e||t===this.sx||e===this.sy)s=.6*this.sign;else{s=0;var h=this.grid[r];if(!h)return;for(var n,l=0;n=this.balls[l++];)s+=n.size*n.size/(-2*h.x*n.pos.x-2*h.y*n.pos.y+n.pos.magnitude+h.magnitude);s*=this.sign}if(this.grid[r])return this.grid[r].force=s,s},I.prototype.marchingSquares=function(t){var e=t[0],i=t[1],s=t[2],r=e+i*(this.sx+2);if(this.grid[r]){if(this.grid[r].computed===this.iter)return!1;for(var h,n,l=0,a=0;a<4;a++){var o=e+this.ix[a+12]+(i+this.ix[a+16])*(this.sx+2);if(!this.grid[o]){n=!0;break}var d=this.grid[o].force;(d>0&&this.sign<0||d<0&&this.sign>0||!d)&&(d=this.computeForce(e+this.ix[a+12],i+this.ix[a+16],o)),Math.abs(d)>1&&(l+=Math.pow(2,a))}if(!n){if(15===l)return[e,i-1,!1];if(5===l)h=2===s?3:1;else if(10===l)h=3===s?0:2;else{if(h=this.mscases[l],!this.grid[r])return;this.grid[r].computed=this.iter}var u=this.step/(Math.abs(Math.abs(this.grid[e+this.plx[4*h+2]+(i+this.ply[4*h+2])*(this.sx+2)].force)-1)/Math.abs(Math.abs(this.grid[e+this.plx[4*h+3]+(i+this.ply[4*h+3])*(this.sx+2)].force)-1)+1);return z.lineTo(this.grid[e+this.plx[4*h]+(i+this.ply[4*h])*(this.sx+2)].x+this.ix[h]*u,this.grid[e+this.plx[4*h+1]+(i+this.ply[4*h+1])*(this.sx+2)].y+this.ix[h+4]*u),this.paint=!0,[e+this.ix[h+4],i+this.ix[h+8],h]}}},I.prototype.renderMetaballs=function(){for(var t,e=0;t=this.balls[e++];)t.move();for(this.iter++,this.sign=-this.sign,this.paint=!1,z.fillStyle=this.metaFill,l&&(z.shadowBlur=l,z.shadowColor=a,z.shadowOffsetX=o,z.shadowOffsetY=d),p&&(z.strokeStyle=u,z.lineWidth=p),z.beginPath(),e=0;t=this.balls[e++];){var i=[Math.round(t.pos.x/this.step),Math.round(t.pos.y/this.step),!1];do{i=this.marchingSquares(i)}while(i);this.paint&&(z.fill(),z.closePath(),p&&z.stroke(),z.beginPath(),this.paint=!1)}};var M=function(t,e,s){return s[1]?"radial"===(s=s[0]).type?function(t,e,i,s){e*=.5,i*=.5;for(var r,h=t.createRadialGradient(e,i,0,e,i,e),n=s.length,l=0;l<n;l++)r=s[l],h.addColorStop(.01*r.position,b(r.r,r.g,r.b,r.a));return h}(z,t,e,s.colors):function(t,e,s,r,h){var n,l,a,o=i.calcLinearGradient(t,e,s,h,!0);n=r.length;for(var d=0;d<n;d++)l=r[d],a=parseInt(l.position,10),o.addColorStop(.01*a,b(l.r,l.g,l.b,l.a));return o}(z,t,e,s.colors,s.angle):s[0]},F=function(){P&&!P.paused&&(z.clearRect(0,0,O.width,O.height),w.renderMetaballs(),requestAnimationFrame(F))},O=m.screen.init(null,!0),z=O.ctx,A=function(){w&&w.destroy(),w=new I(O.width,O.height,h,n)};function C(){P.paused=!0,cancelAnimationFrame(F),z.clearRect(0,0,O.width,O.height),w&&w.destroy(),O.destroy(),w=null,m=null,x=null,S=null,I=null,F=null,O=null,P=null,A=null,M=null,z=null}var P={play:F,paused:!0,screen:O,inited:A,started:!1,destroy:C,height:e,width:t};return P}(d.width,d.height,s.slider,s.canvas,parseInt(x,10),s.color,parseInt(p,10),g,parseInt(v,10),parseInt(y,10),f,parseInt(c,10),parseInt(w,10),parseInt(m,10),parseFloat(S),parseFloat(I),s.opt.bw);e.data("bubbleaddon",M),e.data("bubblesplaying")&&a(M,e)}}function a(t,e){t.paused=!1,t.screen.resize(),t.started||(t.started=!0,t.inited()),e.data("bubblesplaying",!0),t.play()}function o(t,e){t.paused=!0,e.data("bubblesplaying",!1)}function d(t){for(var e,i=t.colors,s=i.length,r=[],h=0;h<s;h++){var n=i[h];delete n.align,e?JSON.stringify(n)!==JSON.stringify(e)&&(r[r.length]=n):r[r.length]=n,e=n}return t.colors=r,t}function u(t){if("object"==typeof t)return[t=d(t),!0];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=d(t=JSON.parse(t.replace(/\&/g,'"'))),!0]}catch(t){return["#FFFFFF",!1]}}function b(t,e,i,s){return"rgba("+t+", "+e+", "+i+", "+s+")"}window.BubbleMorphAddOn=function(i,r,h){if(i&&r)return e=(t=i)(window),t.event.special.rsBubbleMorphDestroyed={remove:function(t){t.handler()}},new s(r,h)},s.prototype={onLoaded:function(){var e,s=this.slider,r=this.carousel,h=!(!t.fn.revolution||!t.fn.revolution[s[0].id])&&t.fn.revolution[s[0].id];if(i=t.fn.revolution,h){this.revObj=h;var n=h.gridwidth,l=h.responsiveLevels;for(Array.isArray(n)||(n=[n]);n.length<4;)n[n.length]=n[n.length-1];for(e=0;e<4;e++)n[e]=parseInt(n[e],10);if(l){for(Array.isArray(l)||(l=[l]);l.length<4;)l[l.length]=l[l.length-1];for(e=0;e<4;e++)l[e]=parseInt(l[e],10)}this.morph=s.find(".tp-bubblemorph").each((function(){var e=t(this),i=e.attr("data-bubblemorph");try{i=JSON.parse(i)}catch(t){return}var a=t("<canvas />").appendTo(e),o=i.num,d=i.speedx,b=i.speedy,p=i.bufferx,c=i.buffery,f=e.attr("data-dim");if(f){for(var g=!1,v=!1,y=(f=f.split(";")).length,w=0;w<y&&("w"===f[w].charAt(0).toLowerCase()?g=f[w].replace("w:","").split(","):"h"===f[w].charAt(0).toLowerCase()&&(v=f[w].replace("h:","").split(",")),!1===g||!1===v);w++);if(!1!==g&&!1!==v){for(;g.length<4;)g[g.length]=g[g.length-1];for(;v.length<4;)v[v.length]=v[v.length-1];for(;v.length<g.length;)v[v.length]=v[v.length-1];for(;g.length<v.length;)v[g.length]=g[g.length-1];o=o.split("|"),p=p.split("|"),c=c.split("|"),d=d.split("|"),b=b.
8split("|");var m=e.hasClass("rs-layer-static")?e.closest("rs-static-layers"):e.closest("rs-slide"),x={opt:h,velX:d,velY:b,layr:e,grids:n,layerW:g,layerH:v,slider:s,levels:l,bufferX:p,bufferY:c,canvas:a[0],carousel:r,numBubbles:o,wrapper:e.closest("rs-layer-wrap"),isStatic:e.hasClass("rs-layer-static"),color:u(i.bg),fullAlign:"slide"===this.getAttribute("data-basealign"),slotholder:m.find("rs-sbg-wrap"),slideIndex:e.hasClass("rs-layer-static")?9999:parseInt(m.attr("data-originalindex"),10)},S=i.blur;S&&(x.blurStrength=S.split("|"),x.blurColor=i.blurcolor.split("|"),x.blurX=i.blurx.split("|"),x.blurY=i.blury.split("|"));var I=i.bordersize;I&&(x.borderSize=I.split("|"),x.borderColor=i.bordercolor.split("|")),e.data("bubbleObj",x)}}})),this.morph.length?(void 0!==this.revObj.onBeforeSwap&&this.beforeChange.call(this,null,this.revObj.onBeforeSwap),s.on("leftviewport",this.leftViewport.bind(this)).on("enterviewport",this.enterViewport.bind(this)).on("revolution.slide.onbeforeswap",this.beforeChange.bind(this)).on("revolution.slide.onafterswap",this.afterSwap.bind(this)).on("revolution.slide.afterdraw",this.onResize.bind(this)).on("revolution.slideprepared",this.slidePrepared.bind(this))):this.destroy()}},slidePrepared:function(t,e){this.waitingForSlidePrepare&&this.beforeChange.call(this,null,this.revObj.onBeforeSwap)},beforeChange:function(t,e){this.waitingForSlidePrepare=!1,(this.revObj.slidePresets&&this.revObj.slidePresets[e.nextSlideLIIndex]||(this.waitingForSlidePrepare=!0,this.carousel))&&(this.slider.find(".tp-bubblemorph").data("bubbleIndex",parseInt(e.nextSlideIndex,10)),this.carousel?this.slider.on("revolution.slide.layeraction",this.layerAction.bind(this)):this.slider.one("revolution.slide.layeraction",this.layerAction.bind(this)))},afterSwap:function(e,i){var s=i.slideIndex-1;this.slider[0].activeBubbleIndex=s,this.slider.find("rs-slide").each((function(e,i){t(i).find(".tp-bubblemorph").each((function(){if(e!==s){this.bubbleSlideIndex=e;var i=t(this),r=i.data("bubbleaddon");r&&o(r,i)}}))}))},enterViewport:function(){var e=this.slider[0].activeBubbleIndex;this.slider.find(".tp-bubblemorph").each((function(){var i=t(this),s=i.data("bubbleaddon");s&&s.paused&&(void 0===this.bubbleSlideIndex||this.bubbleSlideIndex===e)&&a(s,i)}))},leftViewport:function(e){this.slider.find(".tp-bubblemorph").each((function(){var e=t(this),i=e.data("bubbleaddon");i&&o(i,e)}))},createBubbles:function(){this.morph.each(l)},onResize:function(t){clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(this.resize.bind(this),250)},resize:function(){this.morph.each((function(){var e=t(this);e.data("bubbleaddon")&&(r.call(e),l.call(e))}))},layerAction:function(e){var i=this;this.slider.find(".tp-bubblemorph").each((function(){var e=t(this),s=e.data("bubbleaddon");if(s||l.call(e),s=e.data("bubbleaddon")){if(s.screen&&s.screen.width&&s.screen.height||(l.call(e),s=e.data("bubbleaddon")),i.carousel){var r=n(e.data("bubbleObj"));r.width===s.width&&r.height===s.height||l.call(e)}s.paused&&s.screen&&s.screen.resize&&a(s,e)}}))},checkRemoved:function(){return(!this.slider||!document.body.contains(this.slider[0]))&&(this.destroy(),!0)},destroy:function(){for(var e in this.slider.find(".tp-bubblemorph").each((function(){var e=t(this);e.data("bubbleaddon").paused=!0,e.removeData("bubbleaddon bubbleObj")})),this)this.hasOwnProperty(e)&&delete this[e]}},window.RS_MODULES=window.RS_MODULES||{},window.RS_MODULES.bubblemorph={loaded:!0,version:"6.7.0"},window.RS_MODULES.checkMinimal&&window.RS_MODULES.checkMinimal()}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.