From 6fb18bebd02ba3f7a1ede56bdc1c116e1f0ed2ce Mon Sep 17 00:00:00 2001 From: JustinBeaudry Date: Fri, 15 Jun 2018 11:54:13 -0700 Subject: [PATCH 1/3] 1.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8f9d37b..cef06d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "appear", - "version": "1.0.3", + "version": "1.1.0", "description": "utility to run functions when dom elements are visible", "kewords": "detect viewable elements dom lazy load scroll ", "main": "appear.js", From 5a67841cbd0a6fdef1d53e3a86a6d0b4e85738af Mon Sep 17 00:00:00 2001 From: JustinBeaudry Date: Fri, 15 Jun 2018 11:54:26 -0700 Subject: [PATCH 2/3] 1.1.0, adds bower.json and adds appear to the bower registry --- bower.json | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 bower.json diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..91fa345 --- /dev/null +++ b/bower.json @@ -0,0 +1,27 @@ +{ + "name": "appear", + "description": "utility to run functions when dom elements are visible", + "main": "appear.js", + "authors": [ + "Matthew Hadley (https://github.com/diffsky)" + ], + "license": "MIT", + "keywords": [ + "detect", + "viewable", + "elements", + "dom", + "lazy", + "load", + "scroll", + "lazyload" + ], + "homepage": "https://github.com/creativelive/appear", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} From f42c22861832d1022f5e6c225ba15ed6637c3460 Mon Sep 17 00:00:00 2001 From: JustinBeaudry Date: Fri, 15 Jun 2018 11:55:48 -0700 Subject: [PATCH 3/3] build --- dist/appear.js | 3 ++- dist/appear.min.js | 4 ++-- dist/appearlazy.js | 2 +- dist/appearlazy.min.js | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dist/appear.js b/dist/appear.js index b60f2fc..9c8931b 100644 --- a/dist/appear.js +++ b/dist/appear.js @@ -1,4 +1,4 @@ -/* appear.js 1.0.3 */ +/* appear.js 1.1.0 */ appear = (function(){ 'use strict'; var scrollLastPos = null, scrollTimer = 0, scroll = {}; @@ -206,6 +206,7 @@ appear = (function(){ // add an event listener to init when dom is ready addEventListener('DOMContentLoaded', init, false); + // http://stackoverflow.com/questions/9900311/how-do-i-target-only-internet-explorer-10-for-certain-situations-like-internet-e/13971998#13971998 var isIE10 = false; if (Function('/*@cc_on return document.documentMode===10@*/')()){ isIE10 = true; diff --git a/dist/appear.min.js b/dist/appear.min.js index b7b4406..3cb74b3 100644 --- a/dist/appear.min.js +++ b/dist/appear.min.js @@ -1,2 +1,2 @@ -/* appear.min.js 1.0.3 */ -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,!1),function(e){return function(e){function n(e,t){return function(){var n=this,i=arguments;clearTimeout(l),l=setTimeout(function(){e.apply(n,i)},t)}}function i(){o.deltat;t+=1)v.push(e[t]),h.push(!0);r()}}}var p,l,s,f,m=!1,v=[],h=[],g=0,w=0,y={};return function(e){e=e||{},y={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",c,!1);var t=!1;Function("/*@cc_on return document.documentMode===10@*/")()&&(t=!0);var n="complete"===document.readyState||"loaded"===document.readyState;return t?n&&c():(n||"interactive"===document.readyState)&&c(),{trigger:function(){d()},pause:function(){u()},resume:function(){r()},destroy:function(){a()}}}}()(e)}}(); \ No newline at end of file +/* appear.min.js 1.1.0 */ +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,!1),function(e){return function(e){function n(e,t){return function(){var n=this,i=arguments;clearTimeout(l),l=setTimeout(function(){e.apply(n,i)},t)}}function i(){o.deltas;s++)e(r[s])}else e(t)}function a(t,e){setTimeout(function(){r(t)},e)}var s=[];return{init:function(){for(var t=document.getElementsByClassName("appear"),e=t.length,r=0;e>r;r+=1){var n=t[r].getAttribute("data-delay");n?a(t[r],n):s.push(t[r])}},elements:s,appear:r,bounds:200}}()); \ No newline at end of file +/* appearlazy.min.js 1.1.0 */ +appear(function(){"use strict";function t(t){t.classList?t.classList.add("appeared"):t.className+=" appeared"}function e(e){var r=e.getAttribute("src")||!1;e.addEventListener("error",function s(t){r&&e.setAttribute("src",r),e.removeEventListener("error",s)});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 r(t){if(t.hasChildNodes()){var r=t.querySelectorAll("[data-src], [data-bkg]"),a=r.length;if(0===a)e(t);else for(var s=0;s