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

ez.js

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ez.js

easing functions in es6 syntax

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
108
decreased by-9.24%
Maintainers
1
Weekly downloads
 
Created
Source

ez.js

Importable easing functions in ES6

Build Status

Install

npm install ez.js --save

Use

Import singular

import {easeInCubic} from 'ez.js';

let timeStart;
let diff = 1;

(function ticker(currTime) {
  if (!timeStart) timeStart = currTime;

  let elapsed = currTime - timeStart;
  let tick = easeInCubic(elapsed, timeStart, diff, 1000);

  console.log(tick);

  requestAnimationFrame(ticker);
})();

Import all

import * as ez from "./ez.js"

for (let key of Object.keys(ez)) {
  alert(ez[key](100, 0, 10, 1000));
}

Use as non-ES6

// download minified dist file and add it as a script
<script src="dist.min.js"></script>

Using easing functions

Takes four parameters, t: current time, b: beginning value, c: change in value, d: duration.

This will output a single number depending on how long the function has been running, this is great in conjunction with requestAnimationFrame to produce buttery animations.

Easings from Robert Penner

FAQs

Package last updated on 20 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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