PageSourceSearch

https://affant.com/wp-content/plugins/revslider-mousetrap-addon/sr…/js/revolution.addon.mousetrap.min.js

js affant.com collected 2026-10-04 01:11:39 UTC 13,597 bytes, 7 lines download raw bytes

1/**
2 * @preserve
3 * @version: 3.1.0
4 * @requires jquery.themepunch.revolution.js
5 * @author ThemePunch
6 */
7!function(e){var o,r={rx:"rotationX",ry:"rotationY",rz:"rotation",sx:"scaleX",sy:"scaleY",op:"opacity"},s="ontouchend"in document,a=Math.PI/2-.4,t=Math.PI/2+.4,l={x:0,y:0,block:!1};function u(e){l.x=e.clientX,l.y=e.clientY,l.block=!1}function n(e){var o=l.x-e.clientX,r=l.y-e.clientY,s=Math.abs(Math.atan2(r,o));l.block=s>a&&s<t?"no":"yes"}window.RSMousetrap=function(e){void 0!==e&&0!==e.length&&0!=e[0].getElementsByClassName("rs-mtrap").length&&void 0!==jQuery&&void 0!==jQuery.fn&&(o=jQuery.fn.revolution)&&o[e[0].id]&&i(e[0].id)};var i=function(e){o[e].mouseTraps={layers:[],follow:[],defcursor:o[e].c[0].style.cursor},p(e),w(e)},p=function(e){var s,a,t,l,u=o[e].c[0].getElementsByClassName("rs-mtrap");for(s in u)u.hasOwnProperty(s)&&o[e].mouseTraps.layers.push(u[s].id);o[e].c.on("layerinitialised",(function(s,u){if(void 0!==u&&void 0!==u.layer&&o[e].mouseTraps.layers.indexOf(u.layer)>=0){var n=o[e]._L[u.layer];for(a in n.mTrap=void 0===n.mousetrap?[]:n.mousetrap.split(";"),n.mouseTrap={hide:!0,follow:"slider",offset:{x:0,y:0},olayer:[],delay:0,ease:"none",radius:0,block:{x:!1,y:!1},revert:{use:!1,speed:1e-4,ease:"none"}},n.mTrap)if(n.mTrap.hasOwnProperty(a))switch((t=n.mTrap[a].split(":"))[0]){case"f":n.mouseTrap.follow=t[1];break;case"h":n.mouseTrap.hide="f"!==t[1]&&"false"!==t[1]&&!1!==t[1];break;case"d":n.mouseTrap.delay=parseInt(t[1],0)/1e3;break;case"mc":n.mouseTrap.mcenter="t"==t[1];break;case"mr":""!==t[1]&&(n.mouseTrap.radius=parseInt(t[1],0));break;case"e":n.mouseTrap.ease=t[1];break;case"r":n.mouseTrap.revert.use="t"===t[1]||"true"===t[1]||!0===t[1];break;case"rs":n.mouseTrap.revert.speed=parseInt(t[1],0)/1e3+1e-4;break;case"re":n.mouseTrap.revert.ease=t[1];break;case"ro":n.mouseTrap.rotate.use="t"===t[1]||"true"===t[1]||!0===t[1];break;case"rus":n.mouseTrap.rules=void 0===n.mouseTrap.rules?{}:n.mouseTrap.rules,n.mouseTrap.rules.speed=parseInt(t[1],0)/1e3+1e-4;break;case"rue":n.mouseTrap.rules=void 0===n.mouseTrap.rules?{}:n.mouseTrap.rules,n.mouseTrap.rules.ease=t[1];break;case"bx":n.mouseTrap.block.x="t"===t[1]||"true"===t[1]||!0===t[1];break;case"by":n.mouseTrap.block.y="t"===t[1]||"true"===t[1]||!0===t[1];break;case"ola1":case"ola2":case"ola3":case"ola4":case"ola5":n.mouseTrap.olayer.push(t[1]);break;case"ox":""!==t[1]&&(n.mouseTrap.offset.x=t[1].split(","));break;case"oy":""!==t[1]&&(n.mouseTrap.offset.y=t[1].split(","));break;default:for(i in l=!1,r)!l&&r.hasOwnProperty(i)&&t[0].indexOf(i)>=0&&(l=!0,n.mouseTrap.rules=void 0===n.mouseTrap.rules?{}:n.mouseTrap.rules,n.mouseTrap.rules[i]=void 0===n.mouseTrap.rules[i]?{min:0,max:0,axis:"none",calc:"direction",offset:0}:n.mouseTrap.rules[i],t[0]===i+"d"&&(n.mouseTrap.rules[i].axis="h"===t[1]?"horizontal":"b"===t[1]?"both":"c"===t[1]?"center":"vertical"),t[0]===i+"min"&&(n.mouseTrap.rules[i].min=parseFloat(t[1])),t[0]===i+"max"&&(n.mouseTrap.rules[i].max=parseFloat(t[1])),t[0]===i+"o"&&(n.mouseTrap.rules[i].offset=parseInt(t[1],0)),t[0]===i+"c"&&(n.mouseTrap.rules[i].calc="s"===t[1]?"distance":"r"===t[1]?"direction":t[1]),n.mouseTrap.rules[i].len=n.mouseTrap.rules[i].max-n.mouseTrap.rules[i].min)}for(i in void 0!==n.mouseTrap.rules&&(n.mouseTrap.rules.speed=void 0===n.mouseTrap.rules.speed?.2:n.mouseTrap.rules.speed,n.mouseTrap.rules.ease=void 0===n.mouseTrap.rules.ease?"none":n.mouseTrap.rules.ease),n.mouseTrap.whStyle="","shape"==n.type&&(n.mouseTrap.whStyle=";width:100%;height:100%;"),null==n.reqWrp||n.reqWrp.loop?n.lp.wrap('<mousetrap style="position:absolute;top:0px;left:0px;display:block'+n.mouseTrap.whStyle+'"></mousetrap>'):null==n.reqWrp||n.reqWrp.mask?n.m.wrap('<mousetrap style="position:absolute;top:0px;left:0px;display:block'+n.mouseTrap.whStyle+'"></mousetrap>'):n.c.wrap('<mousetrap style="position:absolute;top:0px;left:0px;display:block'+n.mouseTrap.whStyle+'"></mousetrap>'),n.mouseTrap.c=n.p[0].getElementsByTagName("mousetrap")[0],n.mouseTrap.offset={x:o.revToResp(n.mouseTrap.offset.x,o[e].rle,0),y:o.revToResp(n.mouseTrap.offset.y,o[e].rle,0)},n.mouseTrap.offset.x)n.mouseTrap.offset.x[i]=parseInt(n.mouseTrap.offset.x[i],0),n.mouseTrap.offset.y[i]=parseInt(n.mouseTrap.offset.y[i],0);if(n.mouseTrap.radius=o.revToResp(n.mouseTrap.radius,o[e].rle,0),tpGS.gsap.set(n.mouseTrap.c,{x:0,y:0,transformPerspective:null==n.reqWrp||n.reqWrp.loop?1e3:300}
7),n.mouseTrap.cache={},n.mouseTrap.last={},n._ingroup&&(n.groupparent=o[e]._L[n.c.closest("rs-group")[0].id]),"slider"===n.mouseTrap.follow&&(n.mouseTrap.activeFollow=!0),"self"===n.mouseTrap.follow)n.mouseTrap.hide=!1,n.mouseTrap.block={x:!0,y:!0},n.mouseTrap.caller={layerid:n.c[0].id,mouse:{x:0,y:0}},m(n.mouseTrap.caller.layerid,n.c[0].id,e,0);else if("olayer"===n.mouseTrap.follow)for(var i in n.mouseTrap.olayer)n.mouseTrap.caller={olayer:!0,mouse:{x:0,y:0}},m(n.mouseTrap.olayer[i],n.c[0].id,e,0);o[e].mouseTraps.follow.push(u.layer)}}))},m=function(e,r,a,t){void 0!==o[a]._L[e]?(o[a]._L[e].p.on("mouseenter touchstart",(function(t){s&&((t=t.originalEvent).touches&&(t=t.touches[0]),u(t));o[a]._L[r].mouseTrap.caller.olayer&&(o[a]._L[r].mouseTrap.caller.layerid=e),o[a]._L[r].mouseTrap.activeFollow=!0})),o[a]._L[e].p.on("mousemove touchmove",(function(t){if("no"!==l.block){if(s){var u=t;if((t=t.originalEvent).touches&&(t=t.touches[0]),l.block||n(t),"yes"===l.block&&u.preventDefault(),"no"===l.block)return}var i=this.getBoundingClientRect();o[a]._L[r].mouseTrap.caller.olayer&&(o[a]._L[r].mouseTrap.caller.layerid=e),o[a]._L[r].mouseTrap.activeFollow=!0,o[a]._L[r].mouseTrap.caller.mouse={x:t.clientX-i.left,y:t.clientY-i.top}}})),o[a]._L[e].p.on("mouseleave touchend",(function(e){o[a]._L[r].mouseTrap.activeFollow=!1,T(o[a]._L[r])}))):++t<50?setTimeout((function(){m(e,r,a,t)}),100):console.warn("Mouse Trap Sensor:"+e+" is not existing.")},c=function(e){var s,a,t,l,u,n,i,p,m,c,T=0;if(e.new={x:0-e.group.x+e.mouse.x-e.slider.left,y:0-e.group.y+e.mouse.y-e.slider.top},0!==e.radius&&(s=e.new.x-e.orig.x,a=e.new.y-e.orig.y,Math.sqrt(s*s+a*a)>e.radius&&0!==s&&0!==a?(t=e.new.x<e.orig.x?-1:1,l=Math.atan(a/s),e.new.x=e.orig.x+Math.cos(l)*e.radius*t,e.new.y=e.orig.y+Math.sin(l)*e.radius*t):(e.new.x=s>e.radius?e.new.x-s-e.radius:e.orig.x-e.new.x>
7e.radius?e.orig.x-e.radius:e.new.x,e.new.y=a>e.radius?e.new.y-a-e.radius:e.orig.y-e.new.y>e.radius?e.orig.y-e.radius:e.new.y)),void 0!==e.rules)for(var d in e.new.rules={ease:e.rules.ease,overwrite:!0,duration:e.rules.speed,transformOrigin:e.origin},r)r.hasOwnProperty(d)&&void 0!==e.rules[d]&&("both"===e.rules[d].axis?(e.new.rules.rotation=void 0===e.last||void 0===e.last.rules||void 0===e.last.rules.rotation?0:e.last.rules.rotation,e.last.x=void 0===e.last.x?e.new.x:e.last.x,e.last.y=void 0===e.last.y?e.new.y:e.last.y,e.new.ufr=void 0===e.last.ufr?{x:e.last.x,y:e.last.y}:e.last.ufr,s=e.new.ufr.x-e.new.x,a=e.new.ufr.y-e.new.y,Math.sqrt(s*s+a*a)>5&&(e.new.ufr.x=e.new.x,e.new.ufr.y=e.new.y,e.new.rules.rotation=Math.round(Math.atan2(a,s)*tpGS.RAD2DEG)-90||e.new.rules.rotation,e.new.rules.rotation+="_short")):"center"===e.rules[d].axis?(e.new.rules.rotation=void 0===e.last||void 0===e.last.rules||void 0===e.last.rules.rotation?0:e.last.rules.rotation,e.last.x=void 0===e.last.x?e.new.x:e.last.x,e.last.y=void 0===e.last.y?e.new.y:e.last.y,s=e.orig.x-e.new.x,a=e.orig.y-e.new.y,Math.sqrt(s*s+a*a)>5&&(e.new.rules.rotation=Math.round(Math.atan2(a,s)*tpGS.RAD2DEG)-90||e.new.rules.rotation,e.new.rules.rotation+="_short")):"distance"===e.rules[d].calc?(void 0!==e.caller?(e.new.width=i=o[e.id]._L[e.caller.layerid].eow,e.new.height=p=o[e.id]._L[e.caller.layerid].eoh,m=e.caller.mouse.x,c=e.caller.mouse.y):(i=o[e.id].width,p=o[e.id].height,m=e.realmouse.x,c=e.realmouse.y),n="horizontal"===e.rules[d].axis?0!==e.rules[d].offset?i*(e.rules[d].offset/100):i:0!==e.rules[d].offset?p*(e.rules[d].offset/100):p,0!==e.rules[d].offset&&(T="horizontal"===e.rules[d].axis?(i-n)/2:(p-n)/2),u="horizontal"===e.rules[d].axis?(m-T)/n:(c-T)/n,0!==e.rules[d].offset&&(u=u<0?0:u>1?1:u),e.new.rules[r[d]]=e.rules[d].min+e.rules[d].len*u,e.new.rules[r[d]]=isNaN(e.new.rules[r[d]])?0:e.new.rules[r[d]]):"direction"===e.rules[d].calc&&(u="vertical"===e.rules[d].axis?e.last.y-e.new.y:e.last.x-e.new.x,Math.abs(u)>2&&(e.new.rules[r[d]]=void 0===e.last||void 0===e.last.rules||void 0===e.last.rules[r[d]]?0:e.last.rules[r[d]],e.new.rules[r[d]]=e.new.rules[r[d]]+.5*u,e.new.rules[r[d]]=e.new.rules[r[d]]<e.rules[d].min?e.rules[d].min:e.new.rules[r[d]],e.new.rules[r[d]]=e.new.rules[r[d]]>e.rules[d].max?e.rules[d].max:e.new.rules[r[d]],e.new.rules[r[d]]=isNaN(e.new.rules[r[d]])?0:e.new.rules[r[d]],e.last.y=e.new.y,e.last.x=e.new.x)));return e.new.x=e.block.x?e.orig.x:e.new.x,e.new.y=e.block.y?e.orig.y:e.new.y,e.new.x=isNaN(e.new.x)?e.orig.x:e.new.x,e.new.y=isNaN(e.new.y)?e.orig.y:e.new.y,void 0!==e.new.rules&&(e.new.rules.rotationX=isNaN(e.new.rules.rotationX)?0:e.new.rules.rotationX,e.new.rules.rotationY=isNaN(e.new.rules.rotationY)?0:e.new.rules.rotationY),e.new},T=function(e){void 0!==e.mouseTrap&&void 0!==e.mouseTrap.revert&&e.mouseTrap.revert.use&&(tpGS.gsap.to(e.p,e.mouseTrap.revert.speed,{x:0,y:0,overwrite:!0,ease:e.mouseTrap.revert.ease}),tpGS.gsap.to(e.mouseTrap.c,e.mouseTrap.revert.speed,{scaleX:1,scaleY:1,rotationX:0,rotationY:0,opacity:1,rotation:0,overwrite:!0,ease:e.mouseTrap.revert.ease}))},d=function(e,r){if(o[e].mouseTrapFrame&&(o[e].mouseTrapFrame=window.cancelAnimationFrame(o[e].mouseTrapFrame)),o[e].MTactiveSlide){var s=-1,a=o[e].MTactiveSlide.getBoundingClientRect();for(var t in r&&r.hasOwnProperty("getBoundingClientRect")&&(a=r.getBoundingClientRect()),o[e].mouseTraps.follow){var l=a,u=o[e]._L[o[e].mouseTraps.follow[t]];if(!0===u.mouseTrap.activeFollow){if(u.MTparent||(u.p.closest("rs-static-layers").length>0?u.MTparent={parent:u.p.closest("rs-static-layers")[0],type:"rs-static"}:u.p.closest("rs-slide").length>0&&(u.MTparent={parent:u.p.closest("rs-slide")[0],type:"rs-slide"})),"rs-static"===u.MTparent.type)l=u.MTparent.parent.getBoundingClientRect();else if(u.MTparent.parent!==o[e].MTactiveSlide&&!r.hasOwnProperty("getBoundingClientRect")){if(!o[e].carousel||"all"!==o[e].carousel.showLayersAllTime)continue;l=u.MTparent.parent.getBoundingClientRect()}var n=u.mouseTrap.mcenter?u.eow/2:parseInt(u.mouseTrap.offset.x[o[e].level],0)*o[e].bw,i=u.mouseTrap.mcenter?u.eoh/2:parseInt(u.mouseTrap.offset.y[o[e].level],0)*o[e].bw;n=u.mouseTrap.mcenter?n:o[e].rtl?-(u.eow-n):n;var p=o[e].clientX-n,m=o[e].clientY-i;u.mouseTrap.last=c({rtl:o[e].rtl,mouse:{x:p,y:m},last:u.mouseTrap.last,block:u.mouseTrap.block,ingroup:u._ingroup,group:u._ingroup?{x:u.groupparent.calcx,y:u.groupparent.calcy}:{x:0,y:0},orig:{x:u.calcx,y:u.calcy},radius:u.mouseTrap.radius[o[e].level]*o[e].bw,rules:u.mouseTrap.rules,origin:n+"px "+i+"px",caller:u.mouseTrap.caller,realmouse:{x:o[e].clientX,y:o[e].clientY},layerid:o[e].mouseTraps.follow[t],slider:l,id:e}),void 0!==u.mouseTrap.last.width&&tpGS.gsap.set(u.p,{width:u.mouseTrap.last.width,height:u.mouseTrap.last.height,overwrite:!0}),u.pPointerStatus="self"===u.mouseTrap.follow?"auto":"none",tpGS.gsap.to(u.p,{duration:u.mouseTrap.delay,x:u.mouseTrap.last.x-u.calcx,y:u.mouseTrap.last.y-u.calcy,pointerEvents:"self"===u.mouseTrap.follow?"auto":"none",overwrite:!0,ease:u.mouseTrap.ease}),void 0!==u.mouseTrap.last.rules&&tpGS.gsap.to(u.mouseTrap.c,u.mouseTrap.last.rules),-1!==s&&!0!==s||(s=u.mouseTrap.hide)}}!0===s?o[e].c[0].style.cursor="none":!1!==s&&-1!==s||(o[e].c[0].style.cursor=o[e].mouseTraps.defcursor)}},w=function(e){o[e].c.on("mousemove touchmove",(function(r){if("no"!==l.block){if(s){var a=r;if((r=r.originalEvent).touches&&(r=r.touches[0]),l.block||n(r),"yes"===l.block&&a.preventDefault(),"no"===l.block)return}o[e].clientX=r.clientX,o[e].clientY=r.clientY,o[e].mouseTrapFrame||(o[e].mouseTrapFrame=requestAnimationFrame(d.bind(this,e)))}})),o[e].c.on("touchstart",(function(e){s&&((e=e.originalEvent).touches&&(e=e.touches[0]),u(e))})),o[e].c.on("mouseleave touchend",(function(r){for(var s in o[e].mouseTraps.follow)T(o[e]._L[o[e].mouseTraps.follow[s]])})),o[e].c.on("revolution.slide.onafterswap",(function(r,s){setTimeout((function(){o[e].MTactiveSlide=s.currentslide[0],d(e,o[e].MTactiveSlide)}),100)})),o[e].c.on("revolution.slide.onbeforeswap",(function(r,s){o[e].MTactiveSlide=s.nextslide[0],d(e,o[e].MTactiveSlide)})),o[e].c.on("layeraction",(function(r,a,t,i){switch(a){case"mtrapfollow":void 0!==(p=o[e]._L[i.layer])&&void 0!==p.mouseTrap&&(p.mouseTrap.activeFollow=!0,p.mou
7seTrap.caller={layerid:t[0].id,mouse:{x:0,y:0}},p.mouseTrap.mouseMoveID=void 0===p.mouseTrap.mouseMoveID?0:p.mouseTrap.mouseMoveID+1,t.on("touchstart.mouseMoveId"+p.mouseTrap.mouseMoveID,(function(e){s&&((e=e.originalEvent).touches&&(e=e.touches[0]),u(e))})),t.on("mousemove.mouseMoveId"+p.mouseTrap.mouseMoveID+" touchmove.mouseMoveId"+p.mouseTrap.mouseMoveID,(function(e){if("no"!==l.block){if(s){var o=e;if((e=e.originalEvent).touches&&(e=e.touches[0]),l.block||n(e),"yes"===l.block&&o.preventDefault(),"no"===l.block)return}var r=this.getBoundingClientRect();p.mouseTrap.caller.mouse={x:e.clientX-r.left,y:e.clientY-r.top}}})));break;case"mtrapunfollow":var p;if(!(p=o[e]._L[i.layer]).mouseTrap)break;p.mouseTrap.activeFollow=!1,t.off("mousemove.mouseMoveId"+p.mouseTrap.mouseMoveID),t.off("touchmove.mouseMoveId"+p.mouseTrap.mouseMoveID),t.off("touchstart.mouseMoveId"+p.mouseTrap.mouseMoveID),T(p)}}))};window.RS_MODULES=window.RS_MODULES||{},window.RS_MODULES.mousetrap={loaded:!0,version:"6.7.0"},window.RS_MODULES.checkMinimal&&window.RS_MODULES.checkMinimal()}(jQuery);

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.