All Projects → tannerlinsley → springer

tannerlinsley / springer

Licence: MIT License
A spring that generates realistic easing functions

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to springer

Popmotion
Simple animation libraries for delightful user interfaces
Stars: ✭ 18,656 (+39593.62%)
Mutual labels:  physics, motion
utils.js
👷 🔧 zero dependencies vanilla JavaScript utils.
Stars: ✭ 14 (-70.21%)
Mutual labels:  function, easing
Mathutilities
A collection of some of the neat math and physics tricks that I've collected over the last few years.
Stars: ✭ 2,815 (+5889.36%)
Mutual labels:  physics, motion
React Move
React Move | Beautiful, data-driven animations for React
Stars: ✭ 6,395 (+13506.38%)
Mutual labels:  motion, easing
Advance
Physics-based animations for iOS, tvOS, and macOS.
Stars: ✭ 4,445 (+9357.45%)
Mutual labels:  physics, motion
use-spring
Hooke's law hook
Stars: ✭ 53 (+12.77%)
Mutual labels:  physics, motion
ux-animate
A simple but powerful tweening, spring physics, animation library for Rust
Stars: ✭ 19 (-59.57%)
Mutual labels:  physics, motion
HeartRateMeasure
Video based Heart rate measure
Stars: ✭ 31 (-34.04%)
Mutual labels:  motion
von-physics
"Arcade"-style game physics library
Stars: ✭ 35 (-25.53%)
Mutual labels:  physics
Rootex
An advanced C++ 3D game engine powering an in-production game yet to be announced
Stars: ✭ 161 (+242.55%)
Mutual labels:  physics
emerald
A 2D rust game engine focused on portability.
Stars: ✭ 383 (+714.89%)
Mutual labels:  physics
use
Easily add plugin support to your node.js application.
Stars: ✭ 25 (-46.81%)
Mutual labels:  function
toybox
a collection of computational playthings.
Stars: ✭ 94 (+100%)
Mutual labels:  physics
awesome-ha-blueprints
A curated collection of automation blueprints for Home Assistant.
Stars: ✭ 258 (+448.94%)
Mutual labels:  motion
obj-filter
JavaScript Object Filter. Deep filtering key/content recursively. Support wildcard, nested, and filter function in template.
Stars: ✭ 13 (-72.34%)
Mutual labels:  function
rust-easing
Tiny Rust library implementing Robert Penner's easing functions
Stars: ✭ 17 (-63.83%)
Mutual labels:  easing
micell
A collection of functions for front-end development
Stars: ✭ 16 (-65.96%)
Mutual labels:  easing
JuliaChallenge
Can you solve all the puzzles in this repo? Master Julia in an easy way!
Stars: ✭ 18 (-61.7%)
Mutual labels:  physics
opem
OPEM (Open Source PEM Fuel Cell Simulation Tool)
Stars: ✭ 107 (+127.66%)
Mutual labels:  physics
AniX
🐿 Super easy and lightweight(<3kb) JavaScript animation library
Stars: ✭ 253 (+438.3%)
Mutual labels:  motion

Springer

A spring that generates realistic easing functions

Features

  • 1 kb! (minified)
  • Tension & Wobble parameters
  • No dependencies
  • Compatible with any animation library

Demo

Installation

$ yarn add springer
# or
$ npm install springer --only=dev
CDN
<script src='https://unpkg.com/springer@latest/springer.js'></script>

Usage

  • springer(tension, wobble)
    • tension
      • The percentage of force the spring has before release.
      • Min: 0
      • Max: 1
      • Default: 0.5
    • wobble
      • The percentage of wobble, or malleability the spring exhibits
      • Min: 0
      • Max: 1
      • Default: 0.5
  • Returns an spring-based easing function

Example

import springer from 'springer' // or 'window.Springer.default' for script-tag users

const spring = springer(0.5, 0.8)

console.log(spring(0))   // 0
console.log(spring(0.2)) // 0.80516
console.log(spring(0.4)) // 1.01897
console.log(spring(0.6)) // 1.00010
console.log(spring(0.8)) // 0.99974
console.log(spring(1))   // 1

Acknowledgements

Springer is heavily inspired by React-Motion with he bulk of the difficult physics logic originally done by the amazing Cheng Lou (chenglou). Thanks Cheng!

Contributing

To suggest a feature, create an issue if it does not already exist. If you would like to help develop a suggested feature follow these steps:

  • Fork this repo
  • $ yarn
  • Implement your changes to files in the src/ directory
  • Submit PR for review

Scripts

  • $ yarn run test Runs the test suite
  • $ yarn run prepublish Builds for NPM distribution

Used By

Nozzle Logo
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].