Creating a physics-based animation using Dynamics.js
Using physics-based animations can make your app more interactive and lively, which helps attract and retain more users. There are many methods to add physics to your component animation. For example, you could even use the CSS animation-timing
function to add property values, such as ease-in
, ease-out
, or cubic-bezier
. However, it's easier and better to use an existing JavaScript-based physic animation. Dynamics.js
is one of those JavaScripts that comes with utilities and performance. Using native CSS physic features is actually not a good practice as it comes with a frame-per-second penalty on mobile devices.
The app will show a bouncing button, which can show and hide a top quote box, as follows, it also uses physics animation:
Getting ready
This app example could work either in a browser or on a physical device. However, it's recommended that you run the app via your physical device to test for performance.
How to do it...
Here...