Comparing version 0.0.4 to 0.0.5
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.BradPitt=t()}(this,function(){"use strict";var e=function(){var e=(arguments.length<=0||void 0===arguments[0]?{}:arguments[0],function(e,t,n){});return{lazy:e}};return e});!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.BradPitt=e()}(this,function(){"use strict";var t=function(){var t=(arguments.length<=0||void 0===arguments[0]?{}:arguments[0],function(t,e,n){setTimeout(function(){t.classList.add(e)},n)});return{lazy:t}};return t});!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.BradPitt=n()}(this,function(){"use strict";var t=function(){var t=(arguments.length<=0||void 0===arguments[0]?{}:arguments[0],function(t,n,e){var i=t instanceof Array;i?Array.from(t,function(t){setTimeout(function(){t.classList.add(n)},e)}):setTimeout(function(){t.classList.add(n)},e)});return{lazy:t}};return t});!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.BradPitt=n()}(this,function(){"use strict";var t=function(){var t=(arguments.length<=0||void 0===arguments[0]?{}:arguments[0],function(t,n,e){var i=t instanceof Array;i?Array.from(t,function(t){setTimeout(function(){t.classList.add(n)},e)}):setTimeout(function(){t.classList.add(n)},e)});return{lazy:t}};return t});!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.BradPitt=n()}(this,function(){"use strict";var t=function(){function t(t,n,e){var i=t instanceof Array;i?Array.from(t,function(t){setTimeout(function(){t.classList.add(n)},e)}):setTimeout(function(){t.classList.add(n)},e)}arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return{lazy:t}};return t});!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.BradPitt=n()}(this,function(){"use strict";var t=function(){function t(t,n,e){var i=t instanceof Array;i?Array.from(t,function(t){setTimeout(function(){t.classList.add(n)},e)}):setTimeout(function(){t.classList.add(n)},e)}arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return{lazy:t}};return t});!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.BradPitt=n()}(this,function(){"use strict";var t=function(){function t(t,n,e){var i=t instanceof Array;return i?Array.from(t,function(t){setTimeout(function(){t.classList.add(n)},e)}):setTimeout(function(){t.classList.add(n)},e),this}arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return{lazy:t}};return t});!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.BradPitt=e()}(this,function(){"use strict";var t=function(){function t(t,e,n){return t.length?Array.from(t,function(t){setTimeout(function(){t.classList.add(e)},n)}):setTimeout(function(){t.classList.add(e)},n),this}arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return{lazy:t}};return t}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(this,function(){"use strict";function t(t,e,n){return t.length?Array.from(t,function(t){setTimeout(function(){t.classList.add(e)},n)}):setTimeout(function(){t.classList.add(e)},n),this}exports.lazy=t}); |
@@ -56,3 +56,3 @@ // imports | ||
format: 'umd', | ||
exports: 'default', | ||
// exports: 'default', | ||
moduleName: 'BradPitt', | ||
@@ -59,0 +59,0 @@ sourceMap: true |
{ | ||
"name": "bradpitt", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Set of javascript modules that do cool stuff", | ||
@@ -5,0 +5,0 @@ "main": "dist/bradpitt.min.js", |
## Bradpitt.js | ||
_nothing in demo yet ;)_ | ||
This is a javascript snippet library for animating and interacting with the DOM. Most of these are modules I use in my projects everyday and simply wanted to share them for anyone else that's interested in contributing fun reusable code. | ||
### npm | ||
Install BradPitt, and add it to your `package.json` dependencies. | ||
``` | ||
$ npm i bradpitt --save | ||
``` | ||
## Initialize BradPitt | ||
``` | ||
```javascript | ||
import BradPitt from 'bradpitt' | ||
@@ -16,3 +27,3 @@ const bradpitt = new BradPitt() | ||
``` | ||
```javascript | ||
let oscar = doucment.querySelector('.award') | ||
@@ -26,1 +37,4 @@ | ||
``` | ||
* * * | ||
MIT License |
export default (object = {}) => { | ||
/** | ||
* @param {object|...array} el dom element/s | ||
* @param {string} className long to wait for a response | ||
* @param {number} iming in milliseconds | ||
*/ | ||
function lazy(el, className, timing) { | ||
/** | ||
* @param {object|...array} el dom element/s | ||
* @param {string} className long to wait for a response | ||
* @param {number} iming in milliseconds | ||
*/ | ||
if (el.length) { | ||
Array.from(el, (e) => { | ||
setTimeout(() => { | ||
e.classList.add(className) | ||
}, timing) | ||
}) | ||
} else { | ||
function lazy(el, className, timing) { | ||
if (el.length) { | ||
Array.from(el, (e) => { | ||
setTimeout(() => { | ||
el.classList.add(className) | ||
e.classList.add(className) | ||
}, timing) | ||
} | ||
return this | ||
}) | ||
} else { | ||
setTimeout(() => { | ||
el.classList.add(className) | ||
}, timing) | ||
} | ||
return this | ||
} | ||
return { | ||
lazy | ||
} | ||
} | ||
exports.lazy = lazy |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
39
0
10484
118