16 Commits

Author SHA1 Message Date
Joe Pea
34d4961044 refactor: remove requestAnimationFrame polyfill, it has been out for a long time in all browsers 2024-01-14 16:10:41 -08:00
Joe Pea
b1010e3984 update formatting 2024-01-14 16:02:56 -08:00
Joe Pea
fbdd788bf8 chore: format code to updated prettier standard 2023-04-22 21:09:08 -07:00
Joe Pea
1a81837269 chore: update examples list 2020-10-25 11:06:22 -07:00
Joe Pea
98c8064a33 breaking: add a dynamic option controls whether objects and arrays passed to Tween.to() can be dynamically modified during animation.
Adds a new `dynamic` option to the `to()` method. If set to true, objects are passed in an used directly by Tween. This allows outside code to modify values dynamically during animation (including interpolated array values). Tween will modify the initial interpolation arrays. If `dynamic` is set to false, the object passed in will be copied and will never be modified, but in this case it is not possible to modify the object values dynamically during animation.

The breaking change is that, when dynamic is false, Tween makes a non-inheriting hard copy of the object passed into `to()` instead of making an prototypal "copy" that inherits values from the original object.

The reason for this breaking change is that now things are consistent: when `dynamic` is set to `false` (the default) no object passed into `Tween.to()` will ever be modified AND those objects can never be used for dynamic updates (whereas before, objects could be dynamic, but arrays were not). Likewise, when `dynamic` is `true`, then both objects and arrays can be modified on the outside and Tween will animate based on those changes.
2020-10-24 17:23:40 -07:00
Joe Pea
91a34c107c fix: get dynamic to working again (for simple objects), add tests
fixes #545
2020-10-21 17:38:27 -07:00
Joe Pea
899a0e3a59 Merge branch 'master' into typescript
* master: (38 commits)
  update dist files
  rename some tests to better reflect what they test
  improve the conditional logic more so that values in nested arrays can also be animated
  add and example and test for animating values in an array
  start values aren't arrays, only to values are
  move _updateProperties function back out to a method
  fix yoyo with array values test
  temporary, move updateProperties function to make diff with master more clear
  move some code and update variable names to make mergin with master easier (less conflict)
  update dist
  improve state reset when stopping and starting a tween (fixes #512 where yoyo wouldn't restart properly)
  move value-swapping code for repeated tweens to a function (it will be re-used in an upcoming change)
  consolidate duplicate handling of relative values
  update dist files
  ignore VS Code's config folder
  small refactor to prevent update from doing anything when a tween has finished, yet still allow tweens to go back in time
  fix lint error
  rename _isFinished to _isComplete to match other wording
  add one more test for relative array values
  add editorconfig to settings editors can be consistently unique (because we use tabs so people can set their own tab width)
  ...
2020-06-03 01:29:51 -07:00
Joe Pea
bf4048706e format all files in the project now that we have prettier. Yay! 2020-06-02 23:29:00 -07:00
Guillermo Q. Chavez
f3c0efd45d Fix Tween.js path in examples. 2019-09-09 18:03:50 -06:00
Michael Casebolt
faa1e6c5f6 Fix the examples. 2017-10-24 19:44:25 -07:00
sole
3e49aecaaf (feat) Remove minified version, fixes #206 2015-09-29 13:51:42 +01:00
Robert Eisele
a79fae29c4 Improved performance by not relying on an own timer 2014-06-15 22:02:06 +01:00
sole
29d80c5711 Fix 06 -> 07 typo 2013-01-04 10:58:34 +01:00
Mr.doob
795a2d549a Updated examples. 2012-09-01 14:30:09 +02:00
Mr.doob
01f9dc7322 r6 2012-04-10 03:19:28 +02:00
Eberhard Gräther
88a674bf68 added fox and rabbit example 2012-04-08 23:54:55 +02:00