SanderSpies / react-magician

Declaratively animate React components
http://sanderspies.github.io/react-magician/examples/simple/index.html
166 stars 2 forks source link

Add Spring easing #9

Open SanderSpies opened 9 years ago

SanderSpies commented 9 years ago

Borrow from here for now: https://github.com/iamralpht/iamralpht.github.io/tree/master/physics

Use npm package when available.

Syntax-wise it should be something like:

      fooBarAnimation: Animation.create({
        '0ms': {
          blockA: {
            left: 0,
            top: 0,
            width: 0,
            transform: 'rotate(0deg)'
          },
          blockB: {
            left: 0,
            top: 0
          }
        },
        '100ms': {
          blockA: {
            easing: Spring({
              spring: 2,
              damping: 2
            }),
            left: 100
          }
        }
  });

Also investigate other options, like gravity support.

SanderSpies commented 9 years ago

Better solution, use: https://github.com/iamralpht/gravitas.js.