🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

appear

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appear - npm Package Compare versions

Comparing version

to
0.0.12

2

dist/appear.js

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

/* appear.js 0.0.11 */
/* appear.js 0.0.12 */
appear = (function(){

@@ -3,0 +3,0 @@ 'use strict';

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

/* appear.min.js 0.0.11 */
/* appear.min.js 0.0.12 */
appear=function(){"use strict";function e(){var e=window.scrollY||window.pageYOffset;null!=n&&(o.velocity=e-n,o.delta=o.velocity>=0?o.velocity:-1*o.velocity),n=e,i&&clearTimeout(i),i=setTimeout(function(){n=null},30)}function t(e,t){var n=e.getBoundingClientRect();return n.top+n.height>=0&&n.left+n.width>=0&&n.bottom-n.height<=(window.innerHeight||document.documentElement.clientHeight)+t&&n.right-n.width<=(window.innerWidth||document.documentElement.clientWidth)+t}var n=null,i=0,o={};return addEventListener("scroll",e),function(e){return function(){function e(e,t){return function(){var n=this,i=arguments;clearTimeout(c),c=setTimeout(function(){e.apply(n,i)},t)}}function n(){o.delta<w.delta.speed&&(l||(l=!0,u(),setTimeout(function(){l=!1},w.delta.timeout))),e(function(){u()},w.debounce)()}function i(){u(),addEventListener("scroll",n),addEventListener("resize",n)}function r(){m=[],c&&clearTimeout(c),a()}function a(){removeEventListener("scroll",n),removeEventListener("resize",n)}function u(){s||(m.forEach(function(e,n){e&&t(e,w.bounds)?v[n]&&(v[n]=!1,h++,w.appear&&w.appear(e),w.disappear||w.reappear||(m[n]=null)):(v[n]===!1&&(w.disappear&&w.disappear(e),g++,w.reappear||(m[n]=null)),v[n]=!0)}),w.reappear||w.appear&&(!w.appear||h!==p)||w.disappear&&(!w.disappear||g!==p)||(s=!0,a(),w.done&&w.done()))}function d(){if(!f){f=!0,w.init&&w.init();var e;if(e="function"==typeof w.elements?w.elements():w.elements){p=e.length;for(var t=0;p>t;t+=1)m.push(e[t]),v.push(!0);i()}}}var p,c,l,s,f=!1,m=[],v=[],h=0,g=0,w={};return function(e){return e=e||{},w={init:e.init,elements:e.elements,appear:e.appear,disappear:e.disappear,done:e.done,reappear:e.reappear,bounds:e.bounds||0,debounce:e.debounce||50,delta:{speed:e.deltaSpeed||50,timeout:e.deltaTimeout||500}},addEventListener("DOMContentLoaded",d),"complete"===document.readyState&&d(),{trigger:function(){u()},pause:function(){a()},resume:function(){i()},destroy:function(){r()}}}}()(e)}}();

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

/* appearlazy.js 0.0.11 */
/* appearlazy.js 0.0.12 */
appear(

@@ -7,2 +7,11 @@ (function() {

function addClass(el) {
if (el.classList) {
el.classList.add('appeared');
} else {
// IE9 compat
el.className += ' ' + 'appeared';
}
}
// set the image src or background attribute

@@ -13,3 +22,3 @@ function doReveal(el) {

el.setAttribute('src', src);
el.classList.add('appeared');
addClass(el);
return;

@@ -20,3 +29,3 @@ }

el.style.backgroundImage = 'url("' + src + '")';
el.classList.add('appeared');
addClass(el);
return;

@@ -23,0 +32,0 @@ }

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

/* appearlazy.min.js 0.0.11 */
appear(function(){"use strict";function t(t){var e=t.getAttribute("data-src");return e?(t.setAttribute("src",e),void t.classList.add("appeared")):(e=t.getAttribute("data-bkg"),e?(t.style.backgroundImage='url("'+e+'")',void t.classList.add("appeared")):void 0)}function e(e){if(e.hasChildNodes()){var a=e.querySelectorAll("[data-src], [data-bkg]"),r=a.length;if(0===r)t(e);else for(var s=0;r>s;s++)t(a[s])}else t(e)}function a(t,a){setTimeout(function(){e(t)},a)}var r=[];return{init:function(){for(var t=document.getElementsByClassName("appear"),e=t.length,s=0;e>s;s+=1){var i=t[s].getAttribute("data-delay");i?a(t[s],i):r.push(t[s])}},elements:r,appear:e,bounds:200}}());
/* appearlazy.min.js 0.0.12 */
appear(function(){"use strict";function t(t){t.classList?t.classList.add("appeared"):t.className+=" appeared"}function e(e){var a=e.getAttribute("data-src");return a?(e.setAttribute("src",a),void t(e)):(a=e.getAttribute("data-bkg"),a?(e.style.backgroundImage='url("'+a+'")',void t(e)):void 0)}function a(t){if(t.hasChildNodes()){var a=t.querySelectorAll("[data-src], [data-bkg]"),r=a.length;if(0===r)e(t);else for(var s=0;r>s;s++)e(a[s])}else e(t)}function r(t,e){setTimeout(function(){a(t)},e)}var s=[];return{init:function(){for(var t=document.getElementsByClassName("appear"),e=t.length,a=0;e>a;a+=1){var n=t[a].getAttribute("data-delay");n?r(t[a],n):s.push(t[a])}},elements:s,appear:a,bounds:200}}());

@@ -6,2 +6,11 @@ appear(

function addClass(el) {
if (el.classList) {
el.classList.add('appeared');
} else {
// IE9 compat
el.className += ' ' + 'appeared';
}
}
// set the image src or background attribute

@@ -12,3 +21,3 @@ function doReveal(el) {

el.setAttribute('src', src);
el.classList.add('appeared');
addClass(el);
return;

@@ -19,3 +28,3 @@ }

el.style.backgroundImage = 'url("' + src + '")';
el.classList.add('appeared');
addClass(el);
return;

@@ -22,0 +31,0 @@ }

{
"name": "appear",
"version": "0.0.11",
"version": "0.0.12",
"description": "utility to run functions when dom elements are visible",

@@ -5,0 +5,0 @@ "kewords": "detect viewable elements dom lazy load scroll ",