Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

creepyface

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

creepyface - npm Package Compare versions

Comparing version 7.3.0 to 7.3.10

2

dist/creepyface.umd.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).creepyface=e()}(this,function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?e(Object(i),!0).forEach(function(t){var e,n,r;e=o,r=i[n=t],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})}return o}function u(r){return 1===r.length?r[0]:function(e,n){var t=r.map(function(t){return t(e,n)});return function(){return t.forEach(function(t){return t()})}}}function t(n){var r,o=[];return function(t,e){return o.push(t),1===o.length&&(r=n(function(e){return o.forEach(function(t){return t(e)})},e)),function(){o.splice(o.indexOf(t),1),0===o.length&&r&&r()}}}function s(t,e){return[t[0]+e[0],t[1]+e[1]]}function d(t){return t*Math.PI/180}function h(t){return e=Math.atan2(t[1],t[0]),180*(((n=2*Math.PI)+e%n)%n)/Math.PI;var e,n}function a(t){return i[t]?i[t]:(console.error("No point provider registered as '".concat(t,"', defaulting to pointer.")),i.pointer)}function n(t){var e=t?parseFloat(t):NaN;return isNaN(e)?void 0:e}function f(t){return{hover:t.getAttribute("data-src-hover")||void 0,looks:function(t){for(var e=/data-src-look-(\d+)/i,n=[],r=0;r<t.attributes.length;r++){var o=t.attributes[r],i=e.exec(o.name);i&&n.push({angle:parseFloat(i[1]),src:o.value})}return n.length?n:void 0}(t),points:t.getAttribute("data-points")||void 0,timeToDefault:n(t.getAttribute("data-timetodefault")),throttle:n(t.getAttribute("data-throttle")),fieldOfVision:n(t.getAttribute("data-fieldofvision"))}}function l(){}var r=t(function(e){function t(t){return e([t.clientX,t.clientY])}return window.addEventListener("mousemove",t,!0),function(){return window.removeEventListener("mousemove",t,!0)}}),o=t(function(o){function t(t){for(var e=[0,0],n=0;n<t.touches.length;n++){var r=t.touches[n];e=s(e,[r.clientX,r.clientY])}o(e)}return window.addEventListener("touchmove",t,!0),function(){return window.removeEventListener("touchmove",t,!0)}}),i={mouse:r,finger:o,pointer:u([r,o])};function p(t,e){var n,r=1<arguments.length&&void 0!==e?e:{},o=c({},f(t),{},r),i=t.getAttribute("src");if(!i)throw new Error("A default URL must be specified");return{src:i,hover:o.hover||"",pointProvider:"function"==typeof(n=o).points?n.points:u((n.points||"pointer").split(",").map(a)),looks:o.looks||[],timeToDefault:void 0!==o.timeToDefault?o.timeToDefault:1e3,throttle:o.throttle||100,fieldOfVision:o.fieldOfVision||150,onDebug:o.onDebug||l,onAttach:o.onAttach||l,onDetach:o.onDetach||l}}function v(o,i){var c=[];o.forEach(function(t){var e,n,r;e=t,n=function(t){c.push(t),c.length===o.length&&i(c)},(r=new Image).src=e,r.onload=r.onerror=function(){r.naturalWidth||console.error("Creepyface was unable to load ".concat(e)),delete r.onload,delete r.onerror,n(r)}})}function g(o,i,c,u){var a,f=!1,l=0;function s(){a&&clearTimeout(a)}function t(){var t=this,e=Date.now()-l,n=arguments;function r(){l=Date.now(),c.apply(t,n)}f||(u&&!a&&r(),s(),void 0===u&&o<e?r():!0!==i&&(a=setTimeout(u?function(){a=void 0}:r,void 0===u?o-e:o)))}return"boolean"!=typeof i&&(u=c,c=i,i=void 0),t.cancel=function(){s(),f=!0},t}function m(t,e){return h((o=s([window.scrollX,window.scrollY],e),c=t.getBoundingClientRect(),u=c.left,a=c.top,f=c.width,l=c.height,i=[u+window.pageXOffset+f/2,a+window.pageYOffset+l/2],n=[o[0]-i[0],o[1]-i[1]],r=90,[n[0]*Math.cos(d(r))-n[1]*Math.sin(d(r)),n[0]*Math.sin(d(r))+n[1]*Math.cos(d(r))]));var n,r,o,i,c,u,a,f,l}function b(t){return 180<Math.abs(t)?t-360*(t<0?-1:1):t}function w(t,e){return e.slice(0).sort((n=t,function(t,e){return Math.abs(b(t.angle-n))-Math.abs(b(e.angle-n))}))[0];var n}function y(t,e,n){return e<=t&&t<=n}function O(t,e){return document.elementFromPoint?document.elementFromPoint(e[0],e[1])===t:(n=t.getBoundingClientRect(),r=[e[0],e[1]],o=n.left,i=n.top,c=n.right,u=n.bottom,y(r[0],o,c)&&y(r[1],i,u));var n,r,o,i,c,u}function D(u,t){var n,r,e,o,i,c,a=p(u,t);return u.__creepyfaceCancel=(n=u,i=!(r=function(){function r(t,e,n){u.src=t,a.onDebug({src:t,point:e,angle:n,options:a})}var t,e,n,o=(t=a.timeToDefault,e=function(){return r(a.src)},void 0===n?g(t,e,!1):g(t,n,!1!==e)),i=g(a.throttle,function(t){if(!t)return r(a.src);var e=m(u,t),n=function(t,e,n,r){var o=r.looks,i=r.hover,c=r.fieldOfVision;if(i&&O(t,e))return i;if(0<o.length){var u=w(n,o);if(Math.abs(b(u.angle-n))<=c/2)return u.src}return r.src}(u,t,e,a);r(n,t,e),0<a.timeToDefault&&o()}),c=a.pointProvider(i,u);return a.onAttach(),function(){o.cancel(),i.cancel(),c(),u.src=a.src,delete u.__creepyfaceCancel,a.onDetach()}}),c=function(){i=!0},v(((o=(e=a).looks.map(function(t){return t.src})).push(e.src),e.hover&&o.push(e.hover),o),function(t){n.__creepyfaceReachableImages=t;var e=r();c=function(){e(),delete n.__creepyfaceReachableImages},(i||t.some(function(t){return!t.naturalWidth}))&&c()}),function(){return c()})}return D.cancel=function(t){var e=t.__creepyfaceCancel;e&&e()},D.registerPointProvider=function(t,e){i[t]=e},document.addEventListener("DOMContentLoaded",function(){for(var t=document.querySelectorAll("img[data-creepy],img[data-creepyface]"),e=0;e<t.length;e++)D(t[e])}),D});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).creepyface=e()}(this,function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?e(Object(i),!0).forEach(function(t){var e,n,r;e=o,r=i[n=t],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})}return o}function u(r){return 1===r.length?r[0]:function(e,n){var t=r.map(function(t){return t(e,n)});return function(){return t.forEach(function(t){return t()})}}}function t(n){var r,o=[];return function(t,e){return o.push(t),1===o.length&&(r=n(function(e){return o.forEach(function(t){return t(e)})},e)),function(){o.splice(o.indexOf(t),1),0===o.length&&r&&r()}}}function s(t,e){return[t[0]+e[0],t[1]+e[1]]}function d(t){return t*Math.PI/180}function h(t){return e=Math.atan2(t[1],t[0]),180*(((n=2*Math.PI)+e%n)%n)/Math.PI;var e,n}function a(t){return i[t]?i[t]:(console.error("No point provider registered as '".concat(t,"', defaulting to pointer.")),i.pointer)}function n(t){var e=t?parseFloat(t):NaN;return isNaN(e)?void 0:e}function f(t){return{hover:t.getAttribute("data-src-hover")||void 0,looks:function(t){for(var e=/data-src-look-(\d+)/i,n=[],r=0;r<t.attributes.length;r++){var o=t.attributes[r],i=e.exec(o.name);i&&n.push({angle:parseFloat(i[1]),src:o.value})}return n.length?n:void 0}(t),points:t.getAttribute("data-points")||void 0,timeToDefault:n(t.getAttribute("data-timetodefault")),throttle:n(t.getAttribute("data-throttle")),fieldOfVision:n(t.getAttribute("data-fieldofvision"))}}function l(){}var r=t(function(e){function t(t){return e([t.clientX,t.clientY])}return window.addEventListener("mousemove",t,!0),function(){return window.removeEventListener("mousemove",t,!0)}}),o=t(function(o){function t(t){for(var e=[0,0],n=0;n<t.touches.length;n++){var r=t.touches[n];e=s(e,[r.clientX,r.clientY])}o(e)}return window.addEventListener("touchmove",t,!0),function(){return window.removeEventListener("touchmove",t,!0)}}),i={mouse:r,finger:o,pointer:u([r,o])};function p(t,e){var n,r=1<arguments.length&&void 0!==e?e:{},o=c({},f(t),{},r),i=t.getAttribute("src");if(!i)throw new Error("A default URL must be specified");return{src:i,hover:o.hover||"",pointProvider:"function"==typeof(n=o).points?n.points:u((n.points||"pointer").split(",").map(a)),looks:o.looks||[],timeToDefault:void 0!==o.timeToDefault?o.timeToDefault:1e3,throttle:o.throttle||100,fieldOfVision:o.fieldOfVision||150,onDebug:o.onDebug||l,onAttach:o.onAttach||l,onDetach:o.onDetach||l}}function v(o,i){var c=[];o.forEach(function(t){var e,n,r;e=t,n=function(t){c.push(t),c.length===o.length&&i(c)},(r=new Image).src=e,r.onload=r.onerror=function(){r.naturalWidth||console.error("Creepyface was unable to load ".concat(e)),delete r.onload,delete r.onerror,n(r)}})}function g(o,i,c,u){var a,f=!1,l=0;function s(){a&&clearTimeout(a)}function t(){var t=this,e=Date.now()-l,n=arguments;function r(){l=Date.now(),c.apply(t,n)}f||(u&&!a&&r(),s(),void 0===u&&o<e?r():!0!==i&&(a=setTimeout(u?function(){a=void 0}:r,void 0===u?o-e:o)))}return"boolean"!=typeof i&&(u=c,c=i,i=void 0),t.cancel=function(){s(),f=!0},t}function m(t,e){return h((o=s([window.scrollX,window.scrollY],e),c=t.getBoundingClientRect(),u=c.left,a=c.top,f=c.width,l=c.height,i=[u+window.pageXOffset+f/2,a+window.pageYOffset+l/2],n=[o[0]-i[0],o[1]-i[1]],r=90,[n[0]*Math.cos(d(r))-n[1]*Math.sin(d(r)),n[0]*Math.sin(d(r))+n[1]*Math.cos(d(r))]));var n,r,o,i,c,u,a,f,l}function b(t){return 180<Math.abs(t)?t-360*(t<0?-1:1):t}function w(t,e){return e.slice(0).sort((n=t,function(t,e){return Math.abs(b(t.angle-n))-Math.abs(b(e.angle-n))}))[0];var n}function y(t,e,n){return e<=t&&t<=n}function O(t,e){return document.elementFromPoint?document.elementFromPoint(e[0],e[1])===t:(n=t.getBoundingClientRect(),r=[e[0],e[1]],o=n.left,i=n.top,c=n.right,u=n.bottom,y(r[0],o,c)&&y(r[1],i,u));var n,r,o,i,c,u}function D(u,t){var n,r,e,o,i,c,a=p(u,t);return u.__creepyfaceCancel=(n=u,i=!(r=function(){function r(t,e,n){u.src=t,a.onDebug({src:t,point:e,angle:n,options:a})}var t,e,n,o=(t=a.timeToDefault,e=function(){return r(a.src)},void 0===n?g(t,e,!1):g(t,n,!1!==e)),i=g(a.throttle,function(t){if(!t)return r(a.src);var e=m(u,t),n=function(t,e,n,r){var o=r.looks,i=r.hover,c=r.fieldOfVision;if(i&&O(t,e))return i;if(0<o.length){var u=w(n,o);if(Math.abs(b(u.angle-n))<=c/2)return u.src}return r.src}(u,t,e,a);r(n,t,e),0<a.timeToDefault&&o()}),c=a.pointProvider(i,u);return a.onAttach(),function(){o.cancel(),i.cancel(),c(),u.src=a.src,delete u.__creepyfaceCancel,a.onDetach()}}),c=function(){i=!0},v(((o=(e=a).looks.map(function(t){return t.src})).push(e.src),e.hover&&o.push(e.hover),o),function(t){n.__creepyfaceReachableImages=t;var e=r();c=function(){e(),delete n.__creepyfaceReachableImages},(i||t.some(function(t){return!t.naturalWidth}))&&c()}),function(){return c()})}return D.cancel=function(t){var e=t.__creepyfaceCancel;e&&e()},D.registerPointProvider=function(t,e){i[t]=e},"undefined"!=typeof window&&document.addEventListener("DOMContentLoaded",function(){for(var t=document.querySelectorAll("img[data-creepy],img[data-creepyface]"),e=0;e<t.length;e++)D(t[e])}),D});
//# sourceMappingURL=creepyface.umd.js.map
{
"name": "creepyface",
"version": "7.3.0",
"version": "7.3.10",
"main": "dist/creepyface.umd.js",

@@ -62,4 +62,3 @@ "types": "dist/creepyface.d.ts",

"test:coverage": "jest --coverage"
},
"gitHead": "a2903838ea3ee325d2bd8da66b579c999f981433"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc