creepyface
Advanced tools
Comparing version 3.4.1 to 3.5.0
@@ -9,3 +9,2 @@ 'use strict'; | ||
var debounce = _interopDefault(require('debounce')); | ||
var throttle = _interopDefault(require('lodash.throttle')); | ||
var $ = _interopDefault(require('queryselectorall')); | ||
@@ -201,4 +200,3 @@ | ||
fieldofvision = _parseDataAttributes.fieldofvision, | ||
timetodefault = _parseDataAttributes.timetodefault, | ||
throttle$$1 = _parseDataAttributes.throttle; | ||
timetodefault = _parseDataAttributes.timetodefault; | ||
@@ -210,3 +208,2 @@ var options = { | ||
if (timetodefault) options.timeToDefault = parseFloat(timetodefault); | ||
if (throttle$$1) options.throttle = parseFloat(throttle$$1); | ||
if (fieldofvision) options.fieldOfVision = parseFloat(fieldofvision); | ||
@@ -233,3 +230,2 @@ if (src.hover) options.hover = src.hover; | ||
timeToDefault: userOptions.timeToDefault || 1000, | ||
throttle: userOptions.throttle || 100, | ||
onDebug: userOptions.onDebug || function () {}, | ||
@@ -314,3 +310,3 @@ onAttach: userOptions.onAttach || function () {}, | ||
}, options.timeToDefault); | ||
var subscription = options.points.subscribe(throttle(function (point) { | ||
var subscription = options.points.subscribe(function (point) { | ||
var angle = getAngle$1(img, point); | ||
@@ -320,3 +316,3 @@ var src = getSrc(img, point, angle, options); | ||
backToDefault(); | ||
}, options.throttle)); | ||
}); | ||
return function () { | ||
@@ -323,0 +319,0 @@ backToDefault.clear(); |
@@ -5,3 +5,2 @@ import loadImages from 'image-promise'; | ||
import debounce from 'debounce'; | ||
import throttle from 'lodash.throttle'; | ||
import $ from 'queryselectorall'; | ||
@@ -197,4 +196,3 @@ | ||
fieldofvision = _parseDataAttributes.fieldofvision, | ||
timetodefault = _parseDataAttributes.timetodefault, | ||
throttle$$1 = _parseDataAttributes.throttle; | ||
timetodefault = _parseDataAttributes.timetodefault; | ||
@@ -206,3 +204,2 @@ var options = { | ||
if (timetodefault) options.timeToDefault = parseFloat(timetodefault); | ||
if (throttle$$1) options.throttle = parseFloat(throttle$$1); | ||
if (fieldofvision) options.fieldOfVision = parseFloat(fieldofvision); | ||
@@ -229,3 +226,2 @@ if (src.hover) options.hover = src.hover; | ||
timeToDefault: userOptions.timeToDefault || 1000, | ||
throttle: userOptions.throttle || 100, | ||
onDebug: userOptions.onDebug || function () {}, | ||
@@ -310,3 +306,3 @@ onAttach: userOptions.onAttach || function () {}, | ||
}, options.timeToDefault); | ||
var subscription = options.points.subscribe(throttle(function (point) { | ||
var subscription = options.points.subscribe(function (point) { | ||
var angle = getAngle$1(img, point); | ||
@@ -316,3 +312,3 @@ var src = getSrc(img, point, angle, options); | ||
backToDefault(); | ||
}, options.throttle)); | ||
}); | ||
return function () { | ||
@@ -319,0 +315,0 @@ backToDefault.clear(); |
@@ -1,1 +0,1 @@ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.creepyFace=t()}(this,function(){"use strict";function n(t){if(!t)return Promise.reject();if("string"==typeof t){var e=t;(t=new Image).src=e}else{if(void 0!==t.length){var r=[].map.call(t,function(t){return n(t).catch(function(n){return n})});return Promise.all(r).then(function(n){var t=n.filter(function(n){return n.naturalWidth});return t.length===n.length?t:Promise.reject({loaded:t,errored:n.filter(function(n){return!n.naturalWidth})})})}if("IMG"!==t.tagName)return Promise.reject()}var o=new Promise(function(n,e){function r(){t.naturalWidth?n(t):e(t),t.removeEventListener("load",r),t.removeEventListener("error",r)}t.naturalWidth?n(t):t.complete?e(t):(t.addEventListener("load",r),t.addEventListener("error",r))});return o.image=t,o}function t(n,t){return d(v(t)).then(function(t){n.creepyFaceReachableImages=t})}function e(n){return function(t){var e;return e=/^data\-/.test(t.name),void 0===n?e:e&&n.test(t.name.slice(5))}}function r(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function o(n){var t=h(n),e=t.src,r=void 0===e?{}:e,o=t.fieldofvision,i=t.timetodefault,u=t.throttle,c={src:n.getAttribute("src")};return i&&(c.timeToDefault=parseFloat(i)),u&&(c.throttle=parseFloat(u)),o&&(c.fieldOfVision=parseFloat(o)),r.hover&&(c.hover=r.hover),r.look&&(c.looks=k(r.look)),c}function i(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},o(n),t);if(!e.src)throw new Error("A default URL must be specified");return{fieldOfVision:e.fieldOfVision||150,src:e.src,hover:e.hover||"",points:e.points||P([y,L]),looks:e.looks||[],timeToDefault:e.timeToDefault||1e3,throttle:e.throttle||100,onDebug:e.onDebug||function(){},onAttach:e.onAttach||function(){},onDetach:e.onDetach||function(){}}}function u(n,t,e){function r(t){var e=d,r=v;return d=v=void 0,y=t,p=n.apply(r,e)}function o(n){return y=n,m=setTimeout(a,t),g?r(n):p}function i(n){var e=n-y,r=t-(n-b);return w?rn(r,h-e):r}function u(n){var e=n-b,r=n-y;return void 0===b||e>=t||e<0||w&&r>=h}function a(){var n=on();if(u(n))return f(n);m=setTimeout(a,i(n))}function f(n){return m=void 0,O&&d?r(n):(d=v=void 0,p)}function s(){var n=on(),e=u(n);if(d=arguments,v=this,b=n,e){if(void 0===m)return o(b);if(w)return m=setTimeout(a,t),r(b)}return void 0===m&&(m=setTimeout(a,t)),p}var d,v,h,p,m,b,y=0,g=!1,w=!1,O=!0;if("function"!=typeof n)throw new TypeError(q);return t=l(t)||0,c(e)&&(g=!!e.leading,h=(w="maxWait"in e)?en(l(e.maxWait)||0,t):h,O="trailing"in e?!!e.trailing:O),s.cancel=function(){void 0!==m&&clearTimeout(m),y=0,d=b=v=m=void 0},s.flush=function(){return void 0===m?p:f(on())},s}function c(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function a(n){return!!n&&"object"==typeof n}function f(n){return"symbol"==typeof n||a(n)&&tn.call(n)==H}function l(n){if("number"==typeof n)return n;if(f(n))return G;if(c(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=c(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=n.replace(U,"");var e=J.test(n);return e||K.test(n)?Q(n.slice(2),e?2:8):z.test(n)?G:+n}function s(n,t){var e=function(){},r=fn(n,function(){e=an(n,t)},function(){e()});return function(){r(),e()}}var d=n,v=function(n){var t=n.looks.map(function(n){return n.src});return n.src&&t.push(n.src),n.hover&&t.push(n.hover),t},h=function(n,t){var r={};return void 0===(t=t||{}).separator&&(t.separator="-"),Array.prototype.slice.call(n.attributes).filter(e(t.pattern)).forEach(function(n){n.name.slice(5).split(t.separator).reduce(function(t,e,r,o){return"data"===e?t:(r===o.length-1?t[e]=n.value:t[e]=t[e]||{},t[e])},r)}),r},p=function(){function n(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}return function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}}(),m=function(){function n(t){r(this,n),this.subscriber=function(n){return function(){}},this.subscriber=t}return p(n,[{key:"subscribe",value:function(n){var t={next:n},e=this.subscriber(t);return"function"==typeof e?{unsubscribe:e}:e}}]),n}(),b=[];document.addEventListener("mousemove",function(n){return b.forEach(function(t){return t.next([n.clientX,n.clientY])})},!0);var y=new m(function(n){return b.push(n),function(){b.splice(b.indexOf(n),1)}}),g=function(n,t){return n.map(function(n,e){return n-t[e]})},w=function(n,t){return n.map(function(n,e){return n+t[e]})},O=function(n){return n?n<0?-1:1:0},j=function(n){return n*Math.PI/180},x=function(n){return 180*n/Math.PI},E=function(n,t){return(t+n%t)%t},M=function(n){return x(E(Math.atan2(n[1],n[0]),2*Math.PI))},T=function(n,t){return[n[0]*Math.cos(j(t))-n[1]*Math.sin(j(t)),n[0]*Math.sin(j(t))+n[1]*Math.cos(j(t))]},D=[];document.addEventListener("touchmove",function(n){return D.forEach(function(t){var e=[0,0],r=!0,o=!1,i=void 0;try{for(var u,c=n.touches[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var a=u.value;e=w(e,[a.clientX,a.clientY])}}catch(n){o=!0,i=n}finally{try{!r&&c.return&&c.return()}finally{if(o)throw i}}t.next(e)})},!0);var L=new m(function(n){return D.push(n),function(){D.splice(D.indexOf(n),1)}}),P=function(n){return new m(function(t){var e=t.next.bind(t),r=n.map(function(n){return n.subscribe(e)});return function(){return r.forEach(function(n){return n.unsubscribe()})}})},k=function(n){var t=[],e=!0,r=!1,o=void 0;try{for(var i,u=Object.keys(n)[Symbol.iterator]();!(e=(i=u.next()).done);e=!0){var c=i.value,a=n[c];a&&t.push({angle:parseFloat(c),src:a})}}catch(n){r=!0,o=n}finally{try{!e&&u.return&&u.return()}finally{if(r)throw o}}return t},I=function(n){var t=n.getBoundingClientRect();return{y:t.top+window.pageYOffset+t.height/2,x:t.left+window.pageXOffset+t.width/2}},A=function(n){var t=I(n);return[t.x,t.y]},F=function(n,t){return M(T(g(w([window.scrollX,window.scrollY],t),A(n)),90))},N=function(){function n(n,t){var e=[],r=!0,o=!1,i=void 0;try{for(var u,c=n[Symbol.iterator]();!(r=(u=c.next()).done)&&(e.push(u.value),!t||e.length!==t);r=!0);}catch(n){o=!0,i=n}finally{try{!r&&c.return&&c.return()}finally{if(o)throw i}}return e}return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return n(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),S=function(n){return Math.abs(n)>180?n-360*O(n):n},W=function(n){return function(t,e){return Math.abs(S(t.angle-n))-Math.abs(S(e.angle-n))}},R=function(n,t){return t.slice(0).sort(W(n))[0]},V=function(n,t,e){return n>=t&&n<=e},X=function(n,t){var e=n.left,r=n.top,o=n.right,i=n.bottom,u=N(t,2),c=u[0],a=u[1];return V(c,e,o)&&V(a,r,i)},Y=function(n,t){var e=N(t,2),r=e[0],o=e[1];return document.elementFromPoint?document.elementFromPoint(r,o)===n:X(n.getBoundingClientRect(),[r,o])},$=function(n,t,e,r){var o=r.looks,i=r.hover,u=r.fieldOfVision,c=r.src;if(i&&Y(n,t))c=i;else{var a=R(e,o);a&&Math.abs(S(a.angle-e))<u/2&&(c=a.src)}return c},C=function(n,t,e){function r(){var f=Date.now()-c;f<t&&f>=0?o=setTimeout(r,t-f):(o=null,e||(a=n.apply(u,i),u=i=null))}var o,i,u,c,a;null==t&&(t=100);var f=function(){u=this,i=arguments,c=Date.now();var f=e&&!o;return o||(o=setTimeout(r,t)),f&&(a=n.apply(u,i),u=i=null),a};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.flush=function(){o&&(a=n.apply(u,i),u=i=null,clearTimeout(o),o=null)},f},B="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},q="Expected a function",G=NaN,H="[object Symbol]",U=/^\s+|\s+$/g,z=/^[-+]0x[0-9a-f]+$/i,J=/^0b[01]+$/i,K=/^0o[0-7]+$/i,Q=parseInt,Z="object"==typeof B&&B&&B.Object===Object&&B,_="object"==typeof self&&self&&self.Object===Object&&self,nn=Z||_||Function("return this")(),tn=Object.prototype.toString,en=Math.max,rn=Math.min,on=function(){return nn.Date.now()},un=function(n,t,e){var r=!0,o=!0;if("function"!=typeof n)throw new TypeError(q);return c(e)&&(r="leading"in e?!!e.leading:r,o="trailing"in e?!!e.trailing:o),u(n,t,{leading:r,maxWait:t,trailing:o})},cn=function(n,t){return new m(function(e){var r=C(function(){return e.next({src:t.src,options:t})},t.timeToDefault),o=t.points.subscribe(un(function(o){var i=F(n,o),u=$(n,o,i,t);e.next({point:o,angle:i,src:u,options:t}),r()},t.throttle));return function(){r.clear(),o.unsubscribe()}})},an=function(n,e){var r=i(n,e),o=function(t){n.src=t},u=t(n,r).then(function(){return r.onAttach(),cn(n,r).subscribe(function(n){o(n.src),r.onDebug(n)})});return function(){return u.then(function(n){n.unsubscribe(),o(r.src),r.onDetach()})}},fn=function(n,t,e){var r=function(n){return n?t():e()},o=window.MutationObserver;if(o){var i=document.body&&document.body.contains(n);i&&r(!0);var u=new o(function(t){var e=document.body&&document.body.contains(n);!e&&i?(r(!1),i=!1):e&&!i&&(r(!0),i=!0)});return u.observe(document,{childList:!0,subtree:!0}),function(){return u.disconnect()}}return document.body&&document.body.contains(n)&&r(!0),n.addEventListener("DOMNodeInserted",function(){return r(!0)},!1),n.addEventListener("DOMNodeRemoved",function(){return r(!1)},!1),function(){}},ln=function(n){return!(!n||"object"!=typeof n)&&("object"==typeof window&&"object"==typeof window.Node?n instanceof window.Node:"number"==typeof n.nodeType&&"string"==typeof n.nodeName)};return function(n){return ln(n)?[n]:"string"==typeof n?[].slice.call(document.querySelectorAll(n)):void 0}("img[data-creepy]").forEach(function(n){n instanceof HTMLImageElement&&s(n)}),s}); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.creepyFace=t()}(this,function(){"use strict";function n(t){if(!t)return Promise.reject();if("string"==typeof t){var e=t;(t=new Image).src=e}else{if(void 0!==t.length){var r=[].map.call(t,function(t){return n(t).catch(function(n){return n})});return Promise.all(r).then(function(n){var t=n.filter(function(n){return n.naturalWidth});return t.length===n.length?t:Promise.reject({loaded:t,errored:n.filter(function(n){return!n.naturalWidth})})})}if("IMG"!==t.tagName)return Promise.reject()}var o=new Promise(function(n,e){function r(){t.naturalWidth?n(t):e(t),t.removeEventListener("load",r),t.removeEventListener("error",r)}t.naturalWidth?n(t):t.complete?e(t):(t.addEventListener("load",r),t.addEventListener("error",r))});return o.image=t,o}function t(n,t){return c(a(t)).then(function(t){n.creepyFaceReachableImages=t})}function e(n){return function(t){var e;return e=/^data\-/.test(t.name),void 0===n?e:e&&n.test(t.name.slice(5))}}function r(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function o(n){var t=f(n),e=t.src,r=void 0===e?{}:e,o=t.fieldofvision,u=t.timetodefault,i={src:n.getAttribute("src")};return u&&(i.timeToDefault=parseFloat(u)),o&&(i.fieldOfVision=parseFloat(o)),r.hover&&(i.hover=r.hover),r.look&&(i.looks=D(r.look)),i}function u(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},o(n),t);if(!e.src)throw new Error("A default URL must be specified");return{fieldOfVision:e.fieldOfVision||150,src:e.src,hover:e.hover||"",points:e.points||O([v,x]),looks:e.looks||[],timeToDefault:e.timeToDefault||1e3,onDebug:e.onDebug||function(){},onAttach:e.onAttach||function(){},onDetach:e.onDetach||function(){}}}function i(n,t){var e=function(){},r=Y(n,function(){e=X(n,t)},function(){e()});return function(){r(),e()}}var c=n,a=function(n){var t=n.looks.map(function(n){return n.src});return n.src&&t.push(n.src),n.hover&&t.push(n.hover),t},f=function(n,t){var r={};return void 0===(t=t||{}).separator&&(t.separator="-"),Array.prototype.slice.call(n.attributes).filter(e(t.pattern)).forEach(function(n){n.name.slice(5).split(t.separator).reduce(function(t,e,r,o){return"data"===e?t:(r===o.length-1?t[e]=n.value:t[e]=t[e]||{},t[e])},r)}),r},s=function(){function n(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}return function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}}(),l=function(){function n(t){r(this,n),this.subscriber=function(n){return function(){}},this.subscriber=t}return s(n,[{key:"subscribe",value:function(n){var t={next:n},e=this.subscriber(t);return"function"==typeof e?{unsubscribe:e}:e}}]),n}(),d=[];document.addEventListener("mousemove",function(n){return d.forEach(function(t){return t.next([n.clientX,n.clientY])})},!0);var v=new l(function(n){return d.push(n),function(){d.splice(d.indexOf(n),1)}}),h=function(n,t){return n.map(function(n,e){return n-t[e]})},m=function(n,t){return n.map(function(n,e){return n+t[e]})},p=function(n){return n?n<0?-1:1:0},b=function(n){return n*Math.PI/180},y=function(n){return 180*n/Math.PI},w=function(n,t){return(t+n%t)%t},g=function(n){return y(w(Math.atan2(n[1],n[0]),2*Math.PI))},E=function(n,t){return[n[0]*Math.cos(b(t))-n[1]*Math.sin(b(t)),n[0]*Math.sin(b(t))+n[1]*Math.cos(b(t))]},M=[];document.addEventListener("touchmove",function(n){return M.forEach(function(t){var e=[0,0],r=!0,o=!1,u=void 0;try{for(var i,c=n.touches[Symbol.iterator]();!(r=(i=c.next()).done);r=!0){var a=i.value;e=m(e,[a.clientX,a.clientY])}}catch(n){o=!0,u=n}finally{try{!r&&c.return&&c.return()}finally{if(o)throw u}}t.next(e)})},!0);var x=new l(function(n){return M.push(n),function(){M.splice(M.indexOf(n),1)}}),O=function(n){return new l(function(t){var e=t.next.bind(t),r=n.map(function(n){return n.subscribe(e)});return function(){return r.forEach(function(n){return n.unsubscribe()})}})},D=function(n){var t=[],e=!0,r=!1,o=void 0;try{for(var u,i=Object.keys(n)[Symbol.iterator]();!(e=(u=i.next()).done);e=!0){var c=u.value,a=n[c];a&&t.push({angle:parseFloat(c),src:a})}}catch(n){r=!0,o=n}finally{try{!e&&i.return&&i.return()}finally{if(r)throw o}}return t},T=function(n){var t=n.getBoundingClientRect();return{y:t.top+window.pageYOffset+t.height/2,x:t.left+window.pageXOffset+t.width/2}},j=function(n){var t=T(n);return[t.x,t.y]},L=function(n,t){return g(E(h(m([window.scrollX,window.scrollY],t),j(n)),90))},P=function(){function n(n,t){var e=[],r=!0,o=!1,u=void 0;try{for(var i,c=n[Symbol.iterator]();!(r=(i=c.next()).done)&&(e.push(i.value),!t||e.length!==t);r=!0);}catch(n){o=!0,u=n}finally{try{!r&&c.return&&c.return()}finally{if(o)throw u}}return e}return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return n(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),k=function(n){return Math.abs(n)>180?n-360*p(n):n},A=function(n){return function(t,e){return Math.abs(k(t.angle-n))-Math.abs(k(e.angle-n))}},I=function(n,t){return t.slice(0).sort(A(n))[0]},F=function(n,t,e){return n>=t&&n<=e},N=function(n,t){var e=n.left,r=n.top,o=n.right,u=n.bottom,i=P(t,2),c=i[0],a=i[1];return F(c,e,o)&&F(a,r,u)},R=function(n,t){var e=P(t,2),r=e[0],o=e[1];return document.elementFromPoint?document.elementFromPoint(r,o)===n:N(n.getBoundingClientRect(),[r,o])},S=function(n,t,e,r){var o=r.looks,u=r.hover,i=r.fieldOfVision,c=r.src;if(u&&R(n,t))c=u;else{var a=I(e,o);a&&Math.abs(k(a.angle-e))<i/2&&(c=a.src)}return c},V=function(n,t,e){function r(){var f=Date.now()-c;f<t&&f>=0?o=setTimeout(r,t-f):(o=null,e||(a=n.apply(i,u),i=u=null))}var o,u,i,c,a;null==t&&(t=100);var f=function(){i=this,u=arguments,c=Date.now();var f=e&&!o;return o||(o=setTimeout(r,t)),f&&(a=n.apply(i,u),i=u=null),a};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.flush=function(){o&&(a=n.apply(i,u),i=u=null,clearTimeout(o),o=null)},f},W=function(n,t){return new l(function(e){var r=V(function(){return e.next({src:t.src,options:t})},t.timeToDefault),o=t.points.subscribe(function(o){var u=L(n,o),i=S(n,o,u,t);e.next({point:o,angle:u,src:i,options:t}),r()});return function(){r.clear(),o.unsubscribe()}})},X=function(n,e){var r=u(n,e),o=function(t){n.src=t},i=t(n,r).then(function(){return r.onAttach(),W(n,r).subscribe(function(n){o(n.src),r.onDebug(n)})});return function(){return i.then(function(n){n.unsubscribe(),o(r.src),r.onDetach()})}},Y=function(n,t,e){var r=function(n){return n?t():e()},o=window.MutationObserver;if(o){var u=document.body&&document.body.contains(n);u&&r(!0);var i=new o(function(t){var e=document.body&&document.body.contains(n);!e&&u?(r(!1),u=!1):e&&!u&&(r(!0),u=!0)});return i.observe(document,{childList:!0,subtree:!0}),function(){return i.disconnect()}}return document.body&&document.body.contains(n)&&r(!0),n.addEventListener("DOMNodeInserted",function(){return r(!0)},!1),n.addEventListener("DOMNodeRemoved",function(){return r(!1)},!1),function(){}},C=function(n){return!(!n||"object"!=typeof n)&&("object"==typeof window&&"object"==typeof window.Node?n instanceof window.Node:"number"==typeof n.nodeType&&"string"==typeof n.nodeName)};return function(n){return C(n)?[n]:"string"==typeof n?[].slice.call(document.querySelectorAll(n)):void 0}("img[data-creepy]").forEach(function(n){n instanceof HTMLImageElement&&i(n)}),i}); |
{ | ||
"name": "creepyface", | ||
"version": "3.4.1", | ||
"version": "3.5.0", | ||
"author": "Alejandro Tardín <alejandro@tardin.com>", | ||
@@ -37,3 +37,2 @@ "license": "MIT", | ||
"image-promise": "^5.0.1", | ||
"lodash.throttle": "^4.1.1", | ||
"queryselectorall": "^0.1.0" | ||
@@ -40,0 +39,0 @@ }, |
@@ -59,3 +59,2 @@ # [Creepyface](https://creepyface.io) · [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/4lejandrito/creepyface/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/creepyface.svg?style=flat)](https://www.npmjs.com/package/creepyface) [![Build Status](https://api.travis-ci.org/4lejandrito/creepyface.svg?branch=master)](https://travis-ci.org/4lejandrito/creepyface) [![Coverage Status](https://coveralls.io/repos/github/4lejandrito/creepyface/badge.svg?branch=master)](https://coveralls.io/github/4lejandrito/creepyface?branch=master) | ||
const cancel = creepyFace(faceImg, { | ||
throttle: 100, // Number of milliseconds to wait between src updates | ||
hover: 'img/face/crazy.jpg', // Image URL to display on hover | ||
@@ -62,0 +61,0 @@ looks: [ // Each of the images looking at a given direction |
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
48438
5
9
709
89
3
- Removedlodash.throttle@^4.1.1
- Removedlodash.throttle@4.1.1(transitive)