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

stepperjs

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stepperjs - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

dist/stepperjs.browser-0.1.3.js

28

dist/Stepper.js

@@ -29,2 +29,20 @@ 'use strict';

function blender(easing, reverse) {
if (typeof easing === 'function') {
return function (t) {
return [reverse ? 1 - easing(t) : 0 + easing(t)];
};
}
return function (t) {
var result = [];
for (var i = 0, n = easing.length; i < n; i++) {
result.push(reverse ? 1 - easing[i](t) : 0 + easing[i](t));
}
return result;
};
}
var Stepper = function () {

@@ -111,7 +129,3 @@ function Stepper() {

var duration = this.duration;
var easing = this.reverse ? function (n) {
return 1 - _this.easing(n);
} : function (n) {
return 0 + _this.easing(n);
};
var blend = blender(this.easing, this.reverse);
var startTime = 0;

@@ -134,3 +148,3 @@

_this.status.stop();
_this.emitter.emit('update', easing(1));
_this.emitter.emit.apply(_this.emitter, ['update'].concat(blend(1)));
_this.emitter.emit('ended');

@@ -142,3 +156,3 @@

_this.emitter.emit('update', easing(progress));
_this.emitter.emit.apply(_this.emitter, ['update'].concat(blend(progress)));

@@ -145,0 +159,0 @@ _this.pastTime = pastTime;

{
"name": "stepperjs",
"version": "0.1.2",
"version": "0.1.3",
"description": "A tiny requestAnimationFrame wrapper to improve usability.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -18,3 +18,3 @@ # StepperJS

for Babel
#### for Babel

@@ -41,6 +41,47 @@ ```js

for Browser
If you want to change options after creating the object
```js
const stepper = new Stepper();
stepper.option('duration', 500);
stepper.option('easing', linear);
stepper.option('loop', false);
stepper.option('reverse', false);
// or
stepper.option({
duration: 500,
easing: linear,
loop: false,
reverse: false
});
```
If you want to use multiple easing function.
```js
import Stepper from 'stepperjs';
import linear from 'stepperjs/dist/easings/linear';
import inBack from 'stepperjs/dist/easings/inBack';
const stepper = new Stepper({
duration: 300,
easing: [linear, inBack]
}).on({
update: (n1, n2) => {
console.log(n1); // value of linear
console.log(n2); // value of inBack
}
});
stepper.start();
```
#### for Browser
```html
<script type="text/javascript" src="stepperjs.browser-0.1.2.min.js"></script>
<script type="text/javascript" src="stepperjs.browser-0.1.3.min.js"></script>
```

@@ -47,0 +88,0 @@

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