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

micro-fatina

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-fatina

Micro Tween library for js13k, keep the basic features from Fatina but stripped to the maximum

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Micro fatina

Micro Tween library for js13k, keep the basic features from Fatina but stripped to the maximum:

  • Less than 2KB
  • Provides events (onStarted, onCompleted, onKilled)
  • Fewer Easings (you can add back the one you need)
  • Sequence are replaced by a simple .append method to chain them
  • Well Unit tested

Samples

Tweens

import { tween } from 'micro-fatina'

// let's use any type of object to animate
var obj = { x: -2000, y: 150 }

// move the object to a new position in 2 seconds
var t = tween(obj, { x: -150, y: 100 }, 2)

// use events
t.onStarted.push(() => console.log('tween started !'))
t.onCompleted.push(() => console.log('tween completed !'))

Chains

you can chain tweens (here the chain takes 5s)

// append a new move after the first one
tween(obj, { x: -150, y: 100 }, 2)
    .append(tween(obj, { x: 0, y: 150 }, 1))
    .append(tween(obj, { x: 0, y: 250 }, 1))
    .append(tween(obj, { x: 0, y: 350 }, 1))

or run them in parallel (here the chain takes 3s)

// append a new move after the first one
const t = tween(obj, { x: -150, y: 100 }, 2)
t.append(tween(obj, { x: 0 }, 1))
t.append(tween(obj, { y: 250 }, 1))

FAQs

Package last updated on 29 Jun 2019

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