Fatina v3.1.0
Description
- Update dependencies (typescript, ...)
- Improve fatina build process
- Replaced
webpack
byesbuild
- Replaced
tslint
byeslint
- Expose two version of the lib:
fatina.cjs.js
for NodeJSfatina.esm.js
for Browser and Deno
- Replaced
Deno Compatibility
With this new ESM Build, it means Fatina also get compatible with Deno
import Fatina from 'https://cdn.skypack.dev/fatina'
Fatina.init(true);
// create a dummy object
var obj = { a: 0, b: 0, position: {x:0, y:0}};
// create a tween (api: https://kefniark.github.io/Fatina/api/tween/)
Fatina.tween(obj.position)
.to({x: 10, y: 10}, 4)
.onStart(() => console.log("My tween is starting !"))
.onUpdate((dt: number, progress: number) => console.log(`My tween is updating (+${dt}ms, ${progress*100}%)`))
.onComplete(() => console.log("My tween is finished !"))
.start();
// simulate frame update
for (var i = 0; i < 5; i++) {
Fatina.update(1);
}
Breaking change
Drop the default export in browser usage.
<script type="text/javascript" src="fatina.min.js"></script>
Now you have to use it as a ESM module, but you can achieve the same behavior by binding the library on the global variable yourself
<script type="module">
import Fatina from './fatina.esm.js'
window.Fatina = Fatina;
</script>
Full Changelog: v3.0.5...v3.1.0