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

appear-animation

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appear-animation - npm Package Compare versions

Comparing version 0.0.3 to 1.0.0

74

index.js

@@ -1,51 +0,59 @@

const forEach = require('lodash/forEach');
const OnAppear = require('on-appear');
var OnAppear = require('on-appear');
class Base {
constructor() {
this.delay = 0;
this.offset = 0;
this.instances = [];
var extend = function(obj, props) {
var newObj = Object.create(obj);
for(var prop in props) {
if(props.hasOwnProperty(prop)) {
newObj[prop] = props[prop];
}
}
init() {
const els = this.elements;
return newObj;
};
forEach(els, (el) => {
var AppearAnimation = {
delay: 0,
offset: 0,
instances: [],
elements: [],
create: function(obj) {
return extend(this, obj);
},
init: function() {
for (var i = 0; i < this.elements.length; i++) {
var el = this.elements[i];
this.prepare(el);
this.register(el);
});
}
}
},
get elements() {
prepare: function() {
// To implement
}
},
prepare() {
run: function(el) {
// To implement
}
},
run(el) {
// To implement
}
register(el) {
const instance = new OnAppear(el, {
register: function(el) {
var _this = this;
var instance = new OnAppear(el, {
delay: this.delay,
offset: this.offset,
callback: () => {
this.run(el);
callback: function() {
_this.run(el);
}
});
},
this.instances.push(instance);
destroy: function() {
for (var i = 0; i < this.instances.length; i++) {
this.instances[i].destroy();
}
}
};
destroy() {
forEach(this.instances, (instance) => {
instance.destroy();
});
}
}
module.exports = Base;
module.exports = AppearAnimation;
{
"name": "appear-animation",
"version": "0.0.3",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"lodash": "^4.11.1",
"on-appear": "^1.0.2"
"on-appear": "^1.0.3"
},

@@ -10,0 +9,0 @@ "scripts": {

@@ -1,1 +0,20 @@

# appear-animation
# appear-animation
Fade Up example
```
var FadeUp = AppearAnimation.create({
delay: 250,
elements: document.querySelectorAll('.card'),
prepare: function(el) {
TweenLite.set(el, { opacity: 0, y: 100 });
},
run: function(el) {
TweenLite.to(el, 0.5, { opacity: 1, y: 0 });
}
});
FadeUp.init();
```

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