Files
Testing/jackbox/js/jackbox-effects.min.js

1 line
12 KiB
JavaScript
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
(function(k){function C(){var b=k(this),a=b.data("fx");if(D.hasOwnProperty(a))D[a](b)}function N(b,a){var c=k(this);if("zoom"!==b){var e=parseInt(c.attr("width"),10)||c.width(),f=parseInt(c.attr("height"),10)||c.height(),e=k("<img />").attr({width:e,height:f}).data({fx:b,width:e,height:f,settings:a}).insertAfter(c);if(O)e.one("load.cj",C);e.attr("src",c.attr("data-src"));c.remove()}else if(e=c.attr("data-zoom"))c=k("<img />").data({fx:b,thumb:c,settings:a}).one("load.cj",C),c.attr("src",e)}function v(b, a){var c=k("<canvas />").attr(a).css(P),e,f=a.width,d=a.height;e=c[0].getContext("2d");e.drawImage(b[0],0,0,f,d);return[c,e,e.getImageData(0,0,f,d)]}function x(b){for(var a=b.length,c=4*a,e,f,d;a--;)c-=4,e=c+1,f=e+1,d=0.3*b[c]+0.59*b[e]+0.11*b[f],b[c]=d,b[e]=d,b[f]=d}function z(b,a){for(var c=[],e;a--;)c[a]=b[a];for(b=[];0<c.length;)e=Math.random()*c.length|0,b[b.length]=c[e],c.splice(e,1);return b}function Q(){var b=k(this),a=b.offset(),c=b.data();c.x=a.left;c.y=a.top;Jacked.tween(c.zoom,{opacity:1}); b.on("mousemove.cj",R)}function R(b){var a=k(this).data(),c=b.pageX-a.x,b=b.pageY-a.y,e=a.image.style,f=a.zoom.style,d=a.ww,i=a.hh;0>c||(c>a.width||0>b||b>a.height)||(f.top=((b<i?0:b>a.bufB?a.snapB:b-i)|0)+"px",f.left=((c<d?0:c>a.bufR?a.snapR:c-d)|0)+"px",e.marginTop=(1.5*-b|0)+"px",e.marginLeft=(1.5*-c|0)+"px")}function S(){var b=k(this).off("mousemove.cj");Jacked.tween(b.data("zoom"),{opacity:0})}function T(){var b=k(this).data("fx");Jacked.stopTween(b[0]);b.css("opacity",1);Jacked.tween(b[0],{opacity:0}, {ease:"Sine.easeInOut"})}function E(b){var a=k(this).data(),c=a.fx,e=c.length,f={opacity:0},d={opacity:1},i={visibility:"hidden",opacity:1},h={ease:"Quad.easeIn"};"mouseenter"===b.type?(a.fx=c=z(c,e),f=d={opacity:0}):(f={opacity:1},d={opacity:0});for(;e--;)b=c[e],a=b[1],b=b[0],h.delay=20*e,Jacked.stopTween(b[0]),Jacked.stopTween(a[0]),b.css("opacity",1),a.css(i),Jacked.tween(b[0],f,h),Jacked.tween(a[0],d,h)}function F(){for(var b=k(this).data("fx"),a=b.length,c={};a--;)itm=b[a],data=itm.data(),c.left= data.origLeft,c.top=data.origTop,Jacked.tween(itm[0],c)}function G(){var b=k(this).data(),a=b.fx,c=a.length,e=b.cols,f=b.newW,d=b.newH,i={},h;for(b.fx=a=z(a,c);c--;)b=c%e,h=c/e|0,i.left=f*b,i.top=d*h,Jacked.tween(a[c][0],i)}function H(b){for(var a=k(this).data("fx"),c=a.length,e=c,f,d,i="mouseenter"===b.type,h={ease:"Linear.easeNone"},g={opacity:0},l={opacity:1};c--;)b=a[c],f=b[1],d=b[2],b=b[0],Jacked.stopTween(b[0]),Jacked.stopTween(d[0]),Jacked.stopTween(f[0]),b.css("opacity",1),d.css("opacity", 1),f.css("opacity",0),i?(h.delay=50*c,Jacked.tween(d[0],g,h),Jacked.tween(b[0],g,h)):(h.delay=50*(e-c),Jacked.tween(d[0],g,h),Jacked.tween(f[0],l,h))}function I(b){var a=k(this).data("fx"),c=a.length,e={duration:400,ease:"Sine.easeOut"},f={};"mouseenter"===b.type?(b=U,f.opacity=0):(b=V,f.opacity=1);for(;c--;)itm=a[c],Jacked.special(itm[0],{duration:400,ease:"Sine.easeOut",callback:b}),Jacked.tween(itm[1],f,e)}function U(b,a){b.style[r]="rotate("+-180*(1-a)+"deg)";b.cjFx.style[r]="rotate("+180*a+"deg)"} function V(b,a){b.style[r]="rotate("+-180*a+"deg)";b.cjFx.style[r]="rotate("+180*(1-a)+"deg)"}function J(b){var a=k(this).data("fx"),c,e={},f,d={duration:400,ease:"Sine.easeOut"};if("mouseenter"===b.type){var i=a.length-1;f=W;e.opacity=0;for(b=c=-1;b++<i;)clearTimeout(a[b].cjTimeout),a[b].cjTimeout=setTimeout(function(){c++;itm=a[c];Jacked.special(itm[0],{ease:"Sine.easeOut",callback:f});Jacked.tween(itm[1],e,d)},50*b)}else{f=X;e.opacity=1;for(c=b=a.length;b--;)clearTimeout(a[b].cjTimeout),a[b].cjTimeout= setTimeout(function(){c--;itm=a[c];Jacked.special(itm[0],{ease:"Sine.easeOut",callback:f});Jacked.tween(itm[1],e,d)},50*b)}}function W(b,a){b.style[r]="rotateX("+-180*(1-a)+"deg)";b.cjFx.style[r]="rotateX("+180*a+"deg)"}function X(b,a){b.style[r]="rotateX("+-180*a+"deg)";b.cjFx.style[r]="rotateX("+180*(1-a)+"deg)"}function K(b){var a=k(this).data("fx"),c=j=c,e;if("mouseenter"===b.type){b=a.length-1;e=Y;for(c=j=-1;c++<b;)clearTimeout(a[c].cjTimeout),a[c].cjTimeout=setTimeout(function(){j++;Jacked.special(a[j], {duration:400,ease:"S