97 Commits

Author SHA1 Message Date
Joe Pea
397d396467 examples: add two example projects, one plain JS modules, the other TS compiled to plain JS modules 2024-01-14 17:19:35 -08:00
Joe Pea
3302497ef5 examples: simplify the createGraph function, and make it crispier on devices with devicePixelRatio higher than 1 2024-01-14 16:41:35 -08:00
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
0e10e567af chore: update examples to use CSS transform instead of CSS top/left
closes #219
2023-04-23 13:53:19 -07:00
Joe Pea
fbdd788bf8 chore: format code to updated prettier standard 2023-04-22 21:09:08 -07:00
Joe Pea
58250f5ebd chore: fix the relative_start_time example 2023-04-22 20:47:34 -07:00
Joe Pea
81e13893a6 Merge branch 'fix-dynamic-to-with-array-values'
* fix-dynamic-to-with-array-values:
  WIP sync github pages
  chore: update examples list
  chore: re-order list of examples
  fix: the video example wasn't working sometimes
  breaking: add a dynamic option controls whether objects and arrays passed to `Tween.to()` can be dynamically modified during animation.
  unit tests and examples for #555
2023-04-22 09:43:41 -07:00
Joe Pea
f125db1580 fix: the video example wasn't working sometimes 2023-04-21 22:21:31 -07:00
chris-bingham
429edef64e docs: 📝 Add startFromCurrentValues example (example no 18) 2022-02-28 14:34:34 +00:00
MasatoMakino
53eba58de3 add : a example page for TWEEN.Easing.generatePow()
related #116
2021-04-21 17:45:34 +09:00
Joe Pea
1a81837269 chore: update examples list 2020-10-25 11:06:22 -07:00
Joe Pea
9cd8c4116d fix: the video example wasn't working sometimes 2020-10-24 17:23:57 -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
Lukasz Guminski
1e0c8aeca5 unit tests and examples for #555 2020-10-23 16:46:44 -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
b7bf53e9ae fix: some APIs didn't work with tweens having no groups
Added corresponding tests.
fixes #570
fixes #576
2020-10-21 14:36:08 -07:00
Joe Pea
ea948a236b don't format stats.min.js 2020-06-03 01:42:40 -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
Joe Pea
b933dae58e add and example and test for animating values in an array 2020-05-31 10:31:22 -07:00
Joe Pea
3d7de626b0 Merge branch 'master' into nested-properties
* master: (22 commits)
  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)
  add tests for .to() with relative array values, and implement it
  add unit tests for yoyo with relative values
  update yoyo example to test yoyo with relative values
  Revert "Remove stopChainedTweens test because it didn't test stopChainedTweens."
  delete Travis CI stuff, we now have free GitHub actions, easier to manage right here in the repo
  add GitHub Actions config for automated testing
  fixed issue with not stopping chained tweens when the head chain is not playing. Also works with cyclic chains.
  bug-fix: update function still be called after end();
  fixes #284; add tests for tweening to array
  ...
2020-05-30 21:03:06 -07:00
Joe Pea
f82ee2598e improve state reset when stopping and starting a tween (fixes #512 where yoyo wouldn't restart properly) 2020-05-30 18:50:54 -07:00
Joe Pea
c0a435d408 update yoyo example to test yoyo with relative values 2020-05-29 21:29:05 -07:00
Juan Manuel Cruz
3c809a9b78 Example title updated 2020-05-15 23:03:20 -03:00
Juan Manuel Cruz
f8bb5fca26 Add a example using complex properties 2020-05-15 22:59:01 -03:00
mikebolt
d6902ca8db Merge branch 'pause_resume' of ssh://github.com/chepe263/tween.js into chepe 2019-09-09 19:59:28 -07:00
Guillermo Q. Chavez
840d31bf10 Add functions to pause and resume a tween. 2019-09-09 19:29:09 -06:00
Guillermo Q. Chavez
f3c0efd45d Fix Tween.js path in examples. 2019-09-09 18:03:50 -06:00
Michael Casebolt
fb0635d217 Fix a reference in 01_bars example. 2018-01-21 12:39:23 -08:00
Michael Casebolt
faa1e6c5f6 Fix the examples. 2017-10-24 19:44:25 -07:00
Joe Pea
3abcac4351 Merge branch 'master' into master 2017-09-16 15:28:23 -07:00
Joe Pea
fef27710b6 Use position, not this, as this now refers to the Tween instance 2017-09-16 15:24:51 -07:00
Michael Casebolt
1abfbbebc2 Add an example of relative start times. 2017-07-27 14:17:46 -07:00
RobertoDeveloper
4f13df8f9e Update 00_hello_world.html 2016-12-20 08:56:07 -05:00
Michael Casebolt
f9135d9983 Remove unnecessary code from the 01_bars.html example. 2016-12-11 14:45:39 -08:00
sole
6cb21f2397 fix: Don't interpret string values as relative if they do not start with a sign. Closes #239 and also add tests to define the behaviour of relative values, closes #243 2016-01-12 16:44:42 +00: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
Soledad Penades
3314927004 Expand the relative values example 2014-05-05 20:54:16 +01:00
Soledad Penades
b3d179ebd1 Example 12: random is random 2014-02-17 04:59:00 +00:00
Soledad Penades
bb5eab33fa Example 12: More custom easing functions! 2014-02-16 21:40:16 +00:00
Soledad Penades
710fe18470 Refactor example 3's createGraph function to external file, in order to use it in the new example 12 for custom easing functions. 2014-02-16 21:22:24 +00:00
Soledad Penades
18095340be No jank example 04-using CSS transform instead of changing left property 2014-02-15 17:20:03 +00:00
sole
80485bf0c5 Formatting for consistency 2013-10-13 19:09:09 +01:00
cfddream
d8b2deb02c All chained tweens will be stoped when I stop a tween. 2013-10-12 21:56:35 +08:00
benjamind
81d014db4a Added yoyo example. 2013-06-04 09:55:10 -07:00
sole
93fb85af7c add more data about example 09 and relative values feat 2013-03-03 15:39:12 +00:00
sole
f55cfdf679 rename example name: from relative destination to relative values 2013-03-03 15:32:26 +00:00
sole
be0535b46d Make example 9 more JSHint-friendly O:-), also fix title to be 'relative destination', and use minified tween version 2013-02-28 21:37:52 +00:00