Skip to content

Willmo36/fp-ts-animation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fp-ts-animation

This is a demo, not a library (yet?)

fp-ts port of Bkase's swift-fp-animation & their slides; "Algebraic Animation"

Example

You can run examples by using parcel:

yarn add global parcel-bundler
parcel examples/jquery/index.html

From examples/jquery:

const opacityAnimation = pipe(
  duration(5000),
  map(opacity)
);

//map - from functor instance
const scaleAnimation = pipe(
  duration(5000),
  map(repeat(4)),
  map(reversable),
  map(scale)
);

//add - from semiring instance
//do both at the same time
const animation = pipe(
  semiringStyleAnimation.add(scaleAnimation, opacityAnimation),
  map(render(elem))
);

run(rafScheduler)(animation);

About

Animation algebra from bkase's talk

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published