@gidw/image-comparison-slider
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,9 +0,10 @@ | ||
'use strict';var f='undefined'!==typeof self?self:this; | ||
function g(){function h(a,b){var d;a=a.changedTouches;var c=a.length;for(d=0;d<c;d++)if(a[d].identifier===b)return a[d];return null}function b(a){this.F=this.M.bind(this);this.D=this.K.bind(this);this.i=this.L.bind(this);this.h=this.J.bind(this);this.c=document.createElement('div');this.f=document.createElement('div');this.l=document.createElement('img');this.m=document.createElement('img');this.b=document.createElement('div');this.c.classList.add('gicsw');this.f.classList.add('gicsw');this.l.classList.add('gicsi'); | ||
this.m.classList.add('gicsi');this.b.classList.add('gicsh');this.c.appendChild(this.l);this.f.appendChild(this.m);this.a=null;this.u=this.G='';this.g=void 0;this.j=this.s=0;this.A=.5;this.config(a);this.U();this.H()}var c={capture:!1,passive:!1},e={capture:!1,passive:!0};b.prototype.config=function(a){'object'===typeof a&&a&&('string'===typeof a.element?this.a=document.getElementById(a.element):a.element&&a.element.contains&&a.element.appendChild&&(this.a=a.element),'string'===typeof a.before&&(this.G= | ||
a.before),'string'===typeof a.after&&(this.u=a.after));this.N()};b.prototype.N=function(){this.l.src=this.G;this.m.src=this.u;this.C()};b.prototype.C=function(){var a=100*this.A;this.f.style.width=a+'%';this.b.style.left=a+'%'};b.prototype.M=function(a){if(void 0===this.g&&a.changedTouches&&1===a.changedTouches.length){var b=a.changedTouches[0];this.g=b.identifier;this.T();this.B(a,b)}};b.prototype.K=function(a){this.S();this.B(a)};b.prototype.L=function(a){var b;'number'===typeof this.g?(b=h(a,this.g))&& | ||
this.v(a,b):this.v(a)};b.prototype.J=function(a){'number'===typeof this.g?a.changedTouches?(a=h(a,this.g))&&this.o():console.warn('No end for touch event'):this.o()};b.prototype.B=function(a,b){a.stopImmediatePropagation();a.preventDefault();this.b.classList.add('gicsh-a');var d=window.scrollX;var c=this.c.getBoundingClientRect();this.s=c.width;this.j=c.left+d;this.V=this.j+this.s;this.w(a,b)};b.prototype.v=function(a,b){a.stopImmediatePropagation();a.preventDefault();this.w(a,b)};b.prototype.o=function(){this.g= | ||
void 0;this.P();this.O();this.b.classList.remove('gicsh-a')};b.prototype.w=function(a,b){a=b?b.pageX:a.pageX;this.A=a>this.V?1:a<this.j?0:(a-this.j)/this.s;this.C()};b.prototype.T=function(){window.addEventListener('touchend',this.h,e);window.addEventListener('touchcancel',this.h,e);window.addEventListener('touchmove',this.i,c)};b.prototype.P=function(){window.removeEventListener('touchmove',this.i,c);window.removeEventListener('touchcancel',this.h,e);window.removeEventListener('touchend',this.h, | ||
e)};b.prototype.S=function(){window.addEventListener('mouseup',this.h,e);window.addEventListener('mousemove',this.i,c)};b.prototype.O=function(){window.removeEventListener('mousemove',this.i,c);window.removeEventListener('mouseup',this.h,e)};b.prototype.U=function(){this.b.addEventListener('touchstart',this.F,c);this.b.addEventListener('mousedown',this.D,c)};b.prototype.R=function(){this.b.removeEventListener('touchstart',this.F,c);this.b.removeEventListener('mousedown',this.D,c)};b.prototype.H=function(){if(this.a&& | ||
!this.a.contains(this.c)&&!this.a.contains(this.f)&&!this.a.contains(this.b)){var a=document.createDocumentFragment();a.appendChild(this.c);a.appendChild(this.f);a.appendChild(this.b);this.a.appendChild(a)}};b.prototype.I=function(){this.a&&(this.a.contains(this.c)&&this.a.removeChild(this.c),this.a.contains(this.f)&&this.a.removeChild(this.f),this.a.contains(this.b)&&this.a.removeChild(this.b))};b.prototype.destroy=function(){this.o();this.R();this.I();this.a=null};return b} | ||
'function'===typeof define&&define.amd?define([],g):'object'===typeof module&&module.exports?module.exports=g():(f.gidw||(f.gidw={}),f.gidw.ImageComparisonSlider=g()); | ||
'use strict';var h='undefined'!==typeof self?self:this; | ||
function k(){function l(a,c){var e;a=a.changedTouches;var g=a.length;for(e=0;e<g;e++)if(a[e].identifier===c)return a[e];return null}function b(a){this.J=this.R.bind(this);this.I=this.O.bind(this);this.l=this.P.bind(this);this.h=this.N.bind(this);this.c=document.createElement('div');this.f=document.createElement('div');this.o=document.createElement('img');this.s=document.createElement('img');this.a=document.createElement('div');this.c.classList.add('gicsw');this.f.classList.add('gicsw');this.o.classList.add('gicsi'); | ||
this.s.classList.add('gicsi');this.a.classList.add('gicsh');this.c.appendChild(this.o);this.f.appendChild(this.s);this.b=null;this.v=this.K='';this.g=void 0;this.m=this.u=0;this.D=.5;this.i=!1;this.config(a);this.C();this.L()}var d={capture:!1,passive:!1},f={capture:!1,passive:!0};Object.defineProperty(b.prototype,'disabled',{get:function(){return this.i},set:function(a){this.i=!!a;this.H()}});b.prototype.config=function(a){'object'===typeof a&&a&&('string'===typeof a.element?this.b=document.getElementById(a.element): | ||
a.element&&a.element.contains&&a.element.appendChild&&(this.b=a.element),'string'===typeof a.before&&(this.K=a.before),'string'===typeof a.after&&(this.v=a.after),'boolean'===typeof a.disabled&&(this.i=a.disabled));this.S()};b.prototype.S=function(){this.H();this.o.src=this.K;this.s.src=this.v;this.G()};b.prototype.H=function(){this.i?(this.B(),this.j(),this.c.classList.add('gicsh-dis'),this.f.classList.add('gicsh-dis'),this.a.classList.add('gicsh-dis')):(this.c.classList.remove('gicsh-dis'),this.f.classList.remove('gicsh-dis'), | ||
this.a.classList.remove('gicsh-dis'),this.C())};b.prototype.G=function(){var a=100*this.D;this.f.style.width=a+'%';this.a.style.left=a+'%'};b.prototype.R=function(a){if(void 0===this.g&&a.changedTouches&&1===a.changedTouches.length){var c=a.changedTouches[0];this.g=c.identifier;this.W();this.F(a,c)}};b.prototype.O=function(a){this.V();this.F(a)};b.prototype.P=function(a){var c;'number'===typeof this.g?(c=l(a,this.g))&&this.w(a,c):this.w(a)};b.prototype.N=function(a){'number'===typeof this.g?a.changedTouches? | ||
(a=l(a,this.g))&&this.j():console.warn('No end for touch event'):this.j()};b.prototype.F=function(a,c){a.stopImmediatePropagation();a.preventDefault();this.a.classList.add('gicsh-a');var e=window.scrollX;var g=this.c.getBoundingClientRect();this.u=g.width;this.m=g.left+e;this.X=this.m+this.u;this.A(a,c)};b.prototype.w=function(a,c){a.stopImmediatePropagation();a.preventDefault();this.A(a,c)};b.prototype.j=function(){this.g=void 0;this.U();this.T();this.a.classList.remove('gicsh-a')};b.prototype.A= | ||
function(a,c){a=c?c.pageX:a.pageX;this.D=a>this.X?1:a<this.m?0:(a-this.m)/this.u;this.G()};b.prototype.W=function(){this.a.addEventListener('touchend',this.h,f);this.a.addEventListener('touchcancel',this.h,f);this.a.addEventListener('touchmove',this.l,d)};b.prototype.U=function(){this.a.removeEventListener('touchmove',this.l,d);this.a.removeEventListener('touchcancel',this.h,f);this.a.removeEventListener('touchend',this.h,f)};b.prototype.V=function(){window.addEventListener('mouseup',this.h,f);window.addEventListener('mousemove', | ||
this.l,d)};b.prototype.T=function(){window.removeEventListener('mousemove',this.l,d);window.removeEventListener('mouseup',this.h,f)};b.prototype.C=function(){this.a.addEventListener('touchstart',this.J,d);this.a.addEventListener('mousedown',this.I,d)};b.prototype.B=function(){this.a.removeEventListener('touchstart',this.J,d);this.a.removeEventListener('mousedown',this.I,d)};b.prototype.L=function(){if(this.b&&!this.b.contains(this.c)&&!this.b.contains(this.f)&&!this.b.contains(this.a)){var a=document.createDocumentFragment(); | ||
a.appendChild(this.c);a.appendChild(this.f);a.appendChild(this.a);this.b.appendChild(a)}};b.prototype.M=function(){this.b&&(this.b.contains(this.c)&&this.b.removeChild(this.c),this.b.contains(this.f)&&this.b.removeChild(this.f),this.b.contains(this.a)&&this.b.removeChild(this.a))};b.prototype.destroy=function(){this.j();this.B();this.M();this.b=null};return b} | ||
'function'===typeof define&&define.amd?define([],k):'object'===typeof module&&module.exports?module.exports=k():(h.gidw||(h.gidw={}),h.gidw.ImageComparisonSlider=k()); |
{ | ||
"name": "@gidw/image-comparison-slider", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Before/After image slider", | ||
@@ -20,3 +20,3 @@ "author": "Gilles De Waele", | ||
"node-sass": "4.11.0", | ||
"google-closure-compiler": "20190301.0.0", | ||
"google-closure-compiler": "20190325.0.0", | ||
"standard": "12.0.1" | ||
@@ -23,0 +23,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7002
27