Coder Social home page Coder Social logo

es6-tween's Introduction

es6-tween

This project development suspended due of no support from community and no financial support to author

  • High-performant animations without headaches
  • Simple, modular and functional animation library for web and node
  • Tweening library that needs to use where performance matter
  • Flexible, extendable, modular and resource-efficient tweening library

NPM Min Size NPM Gzip Size CDNJS NPM Version NPM Downloads license Travis tests
NPM

Frameworks

Docs

TWEEN.autoPlay(true); // simplify the your code

let coords = { x: 0, y: 0 };
let tween = new TWEEN.Tween(coords)
  .to({ x: 100, y: 100 }, 1000)
  .on('update', ({ x, y }) => {
    console.log(`The values is x: ${x} and y: ${y}`);
  })
  .start();

Plugins

Starting at v3, we provide excluded plugins from core, so our core becomes lighter and faster. Here our plugins list

Demos

Installation

Download the library and include it in your code:

<script src="bundled/Tween.js"></script>

CDN-Hosted version

  • See cdnjs-hosted version for get which result you want

  • NOTE: @latest suffix sometimes saves life by loading latest, because sometimes CDN services will not load the latest

  • Now you can load from CDN

<!-- jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/es6-tween"></script>

<!-- unpkg -->
<script src="https://unpkg.com/es6-tween"></script>

<!-- npmcdn -->
<script src="https://npmcdn.com/es6-tween"></script>

More advanced users might want to

Using import

import { Easing, Tween, autoPlay } from 'es6-tween';

Using getlibs

<script src="https://unpkg.com/getlibs"></script>
<script type="x-module">
  // ES6
  import { Easing, Tween, autoPlay } from 'es6-tween'


  // CommonJS
  const { Tween, Easing, autoPlay } = require('es6-tween')
</script>

Using npm or yarn

$ yarn add es6-tween
# or
$ npm install es6-tween

Then include the Tween.js module with the standard node.js require:

const { Tween, Easing, autoPlay } = require('es6-tween');

And you can use Tween.js as in all other examples--for example:

const t = new Tween(/* etc */);
t.start();

You can run script commands to build modules into single UMD compatible file:

Using commands

$ yarn build # builds production files
# or
$ yarn dev # builds and watchs development files

Then reference the library source:

<script src="bundled/Tween.min.js"></script>

Features

  • Tweens everything you give them, string, number, number of arrays, number of object, all-to, interpolators and much more. Endless possibilites
  • Can use CSS units (e.g. appending px)
  • Can interpolate colours
  • Easing functions are reusable outside of Tween
  • Can also use custom easing functions
  • Much of easings

Compatiblity Testing

Thanks to BrowserStack for providing us testing in a real devices to make it cross-browser, bug-free and better. BrowserStack saved my countless hours, before i spent on testing much of time, now it's very easy. I recommend to others use this service. I sure, BrowserStack helps us to make it, so i am linking to BrowserStack as our sponsor. Browser Stack Logo

Tests

yarn test

or you can go here for more information, tests and etc...

every time you want to run the tests.

If you want to add any feature or change existing features, you must run the tests to make sure you didn't break anything else. If you send a PR to add something new and it doesn't have tests, or the tests don't pass, the PR won't be accepted. See contributing for more information.

People

Thanks to

these tools developers and to their community and without these tools maybe this library wouldn't be possible

Projects using es6-tween

It's great to see this library to be used in production and/or library, thank you!

If you have projects using es6-tween, please make issue or PR, i will add here your project too :)

es6-tween's People

Contributors

dalisoft avatar dependabot[bot] avatar jaymoretti avatar malows avatar seincorp avatar sole avatar songololo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

es6-tween's Issues

Is there some kind of 'complete' event or onComplete method for es6-tween?

Issue

Issue name

Is there some kind of 'complete' event or onComplete method for es6-tween?

Issue description

I can't seem to find anything in the documentation and attempts at using a .on('complete...) method don't seem to work.

Related

This issue is related to

  • demos/examples
  • core.ts
  • Tween.ts

Example

I'm trying to do something like this:

new Tween({ opacity: 0.85})
            .to({ opacity: 1 }, 500)
            .easing(Easing.Quadratic.InOut)
            .reverse(true)
            .on('update', ({ opacity }) => {
              do something...
            })
            .on('complete', () => {
              do something once tween completes
            })

Timeline [BUG]: Properties unexcepted change

Issue

Issue name

Timeline: Properties unexcepted change

Issue description

Here demo, what i want to except, but won't work
https://codepen.io/dalisoft/pen/POaJGb

Related

This issue is related to

  • LICENSE

  • README

  • ABOUT COPYRIGHT VIOLATION (be careful before checking this...!)

  • package.json

  • demos/examples

  • core.ts

  • Tween.ts

  • lite.ts

  • Easing.ts

  • Interpolation.ts

  • Timeline.js

  • or provide something else (from es6-tween files...)

Example

https://codepen.io/dalisoft/pen/POaJGb

What you excepted?

Get the Timeline order and animation shown in Codepen

NOTE

  • Please add read code, docs, files, issues, PR list for avoid duplicating existing question, bug or something else...

Incorrect end value when tweening large numbers

Issue

Issue name

Incorrect end value when tweening large numbers

Related

This issue is related to

  • LICENSE
  • README
  • ABOUT COPYRIGHT VIOLATION (be careful before checking this...!)
  • package.json
  • demos/examples
  • core.ts
  • Tween.ts
  • lite.ts
  • Easing.ts
  • Interpolation.ts
  • Timeline.js

Example

https://jsfiddle.net/tdxkg9a8/

What you excepted?

The end value should be correct

v3: Introducing and Features

Core

  • New-level and breaking changely DOM Manipulation support
  • New super-effecient Plugins API
  • Shareable plugins method
  • Shifting DOM-Node argument to Tween constructor
  • Power effeciency
  • Reduced size due of plugins would be outside of core function
  • Extendable plugin API (creating your own is easy as 1,2,3)
  • Faster execution speed due of closer scope and lesser code to execute
  • Fully using active tweening ( #19 ) with DOM Node link/reference

Dependecy

  • Removing semantic-release and release manually

Ask

  • Using TypeScript for better quality code?
  • Using something better linting than ESLint?

main field in package.json points to nonexistent file

Here is the error:

While trying to resolve module `es6-tween` from file `foo.js`, the package `(...)/node_modules/es6-tween/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`(...)node_modules/es6-tween/bundled/Tween.min.js`. Indeed, none of these files exist:

  * `(...)/node_modules/es6-tween/bundled/Tween.min.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
  * `(...)/node_modules/es6-tween/bundled/Tween.min.js/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`

Strange output values when using Tween#update manually

I'm using es6-tween in a NodeJS script. I'm trying to evaluate a tween at a custom time using Tween#update, but I'm getting really strange results that are way out of bounds. The same code in the browser outputs better-looking numbers, but they're still incorrect.

(I'd love a way to feed all these options to the library and get a simple tween function back which accepts a time value argument and returns the corresponding domain value, but I didn't see a way to get that in the documentation.)

To reproduce

let tweenVal = 0;

const tween = new TWEEN.Tween({x: 0})
  .to({x: 128}, 1000)
  .easing(TWEEN.Easing.Linear.None)
  .yoyo(true)
  .repeat(Infinity)
  .on('update', val => tweenVal = val.x)
  .start();

for (let t = -1000; t <= 3500; t += 500) {
  // Have to set preserve to `false` to keep tween from stopping,
  // and forceTime to `true` to get tween to run at all.
  tween.update(t, false, true);
  console.log(`at t=${t}: ${tweenVal}`);
}

https://jsfiddle.net/ds5h17fo/7/

Expected behavior

Given a linear tween from 0 to 128 over a duration of 1000 with .repeat(Infinity) and .yoyo(true), I expect that calling Tween#update will trigger update events with output values like the following, on every platform:

at t=-1000: 128
at t=-500: 64
at t=0: 0
at t=500: 64
at t=1000: 128
at t=1500: 64
at t=2000: 0
at t=2500: 64
at t=3000: 128
at t=3500: 64

Actual behavior

Firefox Developer Edition 72.0.1 (64-bit), Linux Mint 18.3.

NOTE: outputs for time values less than the duration (-1000 thru 1000 here) are not stable, and change every time (!?) you execute the script. I tried a few durations, and it's always the times under the duration that emit strange outputs. Even stable values past the duration time are incorrect, acting as if the time is offset by 500 here.

at t=-1000: -154.496
at t=-500: -90.496
at t=0: -26.496
at t=500: 37.504
at t=1000: 101.504
at t=1500: 128
at t=2000: 64
at t=2500: 0
at t=3000: 64
at t=3500: 128

NodeJS 10.19.0 and 12.15.0, same platform:

NOTE: output values increase with every execution.

at t=-1000: -25912755.214790147
at t=-500: -25912691.214790147
at t=0: -25912627.214790147
at t=500: -25912563.214790147
at t=1000: -25912499.214790147
at t=1500: -25912435.214790147
at t=2000: -25912371.214790147
at t=2500: -25912307.214790147
at t=3000: -25912243.214790147
at t=3500: -25912179.214790147

Import instructions for 'lite' version refer to non-existant file.

Issue description

  • I believe that import { Easing, Interpolation, Tween, autoPlay } from 'es6-tween/src/index.lite' should end with .js., not .lite.

Related

This issue is related to: README

What you excepted?

  • I expected to be able to paste that line into my code and have access to the lite version of Tween. Instead, I had to change the file extension.

Also, what is the difference between importing { Easing, Tween, autoPlay } from index.js and from es6-tween? I found I had to change .onUpdate() to .on('update', ...) when importing the library.

[BUG]: Tween Easing pack isn't working properly?

What do you excepted?

Working easing pack as original

What do you unexcepted?

Some tween easing is working unproperly

Your problem

Easings like Exponential, Circular was excedding >2.

Is this related to es6-tween?

  • - no
  • - yes

NOTE: If you not give us log or demo we can't fix the issue. Thanks

[QUITING PROJECT] Really someone want continue development?

Hi @sole, @mikebolt, @trusktr.

I am see there no interest like original tween.js and community want implement those features tween.js. Then no need for es6-tween. @sole please make someone main dev for this repo or remove (it's your choice, as all of your work its). So if peoples want merge this project to tween.js, i am exit from project. Thanks for anybody, who interested.

I am wait review, reply and things.

Variable "isStarted" is not set properly in core.js

Variable "isStarted" remains "true" after all tweens removed by calling "removeAll" or "remove" in "core.js", so all tweens added after that will never start automatically unless event "visibilitychange" fired.

ps: sorry for my poor english...

Can't stop tween when Infinit repeat.

Can't stop tween when Infinit repeat. It just ignore when _isFinite is false in Tween.stop/Lite.stop.

But in origin tween.js version there is no _isFinite check in stop function.

Relative values not working

Relative string value example not working after introducing the setter-only property tween

Related

This issue is related to

  • LICENSE
  • README
  • ABOUT COPYRIGHT VIOLATION (be careful before checking this...!)
  • package.json
  • demos/examples
  • core.ts
  • Tween.ts
  • lite.ts
  • Easing.ts
  • Interpolation.ts
  • Timeline.js
  • Interpolator (InterTween)
  • or provide something else (from es6-tween files...)

What you excepted?

Relative values should work as excepted

NOTE

  • Please add read code, docs, files, issues, PR list for avoid duplicating existing question, bug or something else...

My Plugins List

Here the my plugins that can be ported from my old js

SuperAnimation.DocJSON = {
	"squash": {
		"id": 1,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "Add bounce-ball like squash and bouncing",
			"value": {
				"strength": "Strength of squashing, lower value agressive bouncing",
				"easeType": "Easing type of squash & bouncing",
				"useGravity": "Physics gravity like bouncing",
				"disableBounciness": "Use non-bounce easing for some serius large application",
				"customEasing": "Custom easing function for better XP",
				"backToStart": "Animation end state back to start",
				"manualPhysicOffset": "Add physic margin for better XP",
				"noScale": "Disable scaling while bouncing",
				"addMove": "Moves node to that move",
				"moveDirection": "addMove direction, can be x, y, rotate, etc."
			}
		},
		"value": {
			"default": {
				"strength": 0.7,
				"easeType": "BounceOut",
				"useGravity": false,
				"disableBounciness": false,
				"customEasing": null,
				"backToStart": false,
				"manualPhysicOffset": 0,
				"noScale": false,
				"addMove": 0,
				"moveDirection": null
			},
			"recommend": "true or {} (uses default param)",
			"userValue": {
				"strength": 0.6,
				"easeType": "One of in, out, inOut, gravity",
				"useGravity": true,
				"disableBounciness": false,
				"customEasing": "SuperAnimation.Easing.ExpoInOut",
				"backToStart": false,
				"manualPhysicOffset": 10,
				"noScale": false,
				"addMove": 20,
				"moveDirection": "y"
			}
		}
	},
	"keyframe": {
		"id": 2,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "JS Implementation of CSS Animation keyframe",
			"value": "Object pack as percent and value of animation"
		},
		"value": {
			"default": null,
			"recommend": null,
			"userValue": {
				"0": {
					"x": 0
				},
				"30": {
					"x": -50
				},
				"100": {
					"x": 100
				}
			}
		}
	},
	"classr": {
		"id": 3,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "CSS Class tweening",
			"value": "with/without relative class name"
		},
		"value": {
			"default": "node class name",
			"recommend": null,
			"userValue": "newclass"
		}
	},
	"roundValue": {
		"id": 4,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "Rounds property value while tweening",
			"value": "Object contains property and true if round need"
		},
		"value": {
			"default": null,
			"recommend": null,
			"userValue": {
				"property": 1
			}
		}
	},
	"changeValue": {
		"id": 5,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "Changes property value while tweening",
			"value": "Object contains property and functions for returning new value"
		},
		"value": {
			"default": null,
			"recommend": null,
			"userValue": {
				"property": "function(value){ return Math.sin(value); }"
			}
		}
	},
	"drag": {
		"id": 6,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "Add support for drag node with mouse",
			"value": {
				"min": "Minimum x/y position of drag",
				"max": "Maximum x/y position of drag",
				"defaultValue": "Default x/y position of node",
				"stepize": "Function for control over tracked x/y position while dragging",
				"gridStep": "Function for control over tracked x/y position after drag release"
			}
		},
		"value": {
			"default": {
				"min": {
					"x": -999,
					"y": -999
				},
				"max": {
					"x": 999,
					"y": 999
				},
				"defaultValue": {
					"x": 0,
					"y": 0
				},
				"stepize": null,
				"gridStep": null
			},
			"recommend": {},
			"userValue": {
				"min": {
					"x": -500,
					"y": -500
				},
				"max": {
					"x": 500,
					"y": 500
				},
				"defaultValue": {
					"x": 0,
					"y": 50
				},
				"stepize": "function (e) { e.x *= 9; return e; }",
				"gridStep": "function (e, defaultE) { e.y *= 2; return e; }"
			}
		}
	},
	"scroll": {
		"id": 7,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "Scrolling plug-in lets you scroll to any position or node",
			"value": "Object contains number of y-position or object contains both x/y positions"
		},
		"value": {
			"default": "Current position of scroll",
			"recommend": null,
			"userValue": {
				"x": 25,
				"y": 215
			}
		}
	},
	"attr": {
		"id": 8,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "Attribute tweening of node",
			"value": "Object contains new attribute value"
		},
		"value": {
			"default": "Current attribute of node",
			"recommend": null,
			"userValue": {
				"data-x": 12
			}
		}
	},
	"event": {
		"id": 9,
		"status": "RC",
		"credit": null,
		"desc": {
			"api": "Animation by Event listener",
			"value": "Object contains state with object of new value"
		},
		"value": {
			"default": null,
			"recommend": null,
			"userValue": {
				"mousedown": {
					"scale": 0.8,
					"options": {
						"easing": "ExpoInOut"
					},
					"action": "function (e) { this.innerHTML = \"mousedown\"; }"
				}
			}
		}
	},
	"typer": {
		"id": 10,
		"status": "RC",
		"credit": null,
		"desc": {
			"api": "Typing effect",
			"value": {
				"splitter": "Split character for typing",
				"scrambleMode": "Scramble effect mode state",
				"scrambleWord": "typer#scrambleMode Scrambling word",
				"offRandom": "Last character randomize for better looking",
				"text": "Value of new text"
			}
		},
		"value": {
			"default": {
				"splitter": "",
				"scrambleMode": false,
				"scrambleWord": "Typer",
				"offRandom": false,
				"text": "Current text"
			},
			"recommend": "{text:TEXT_HERE}",
			"userValue": {
				"text": "TEXT_HERE"
			}
		}
	},
	"tricle": {
		"id": 11,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "Interesting API for some loader or snippets",
			"value": {
				"count": "Count of circle",
				"type": "Tagname of circles",
				"opacityReduction": "Threshold of opacity reduce per circle",
				"defaultOpacity": "Default circle opacity threshold",
				"defaultTricleSize": "Default circle threshold size"
			}
		},
		"value": {
			"default": {
				"count": 3,
				"type": "div",
				"opacityReduction": 0.15,
				"defaultOpacity": 0.75,
				"defaultTricleSize": 0.25
			},
			"recommend": null,
			"userValue": {
				"count": 2,
				"type": "div",
				"opacityReduction": 0.25,
				"defaultOpacity": 1,
				"defaultTricleSize": 0.35
			}
		}
	},
	"sprite": {
		"id": 12,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "Sprite animation plug-in for images",
			"value": {
				"dir": "Direction of sprite",
				"src": "Image of sprite",
				"width": "Sprite node width (not image width)",
				"height": "Sprite node height (not image height)",
				"widthLength": "Sprite image width !(not node width)",
				"heightLength": "Sprite image height !(not node height)"
			}
		},
		"value": {
			"default": {
				"dir": "[\"right\"]",
				"src": "CSS Background image (if DOMPlugin loaded)",
				"width": null,
				"height": null,
				"widthLength": "width of sprite node",
				"heightLength": "height of sprite node"
			},
			"recommend": null,
			"userValue": {
				"width": 240,
				"height": 314,
				"widthLength": 1200,
				"heightLength": 1570
			}
		}
	},
	"three": {
		"id": 13,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "THREE.js plug-in for easier using",
			"value": "{property:value} of your tween"
		},
		"value": {
			"default": null,
			"recommend": null,
			"userValue": {
				"rotation": {
					"x": 100,
					"y": 100
				},
				"scale": {
					"x": 4,
					"y": 4,
					"z": 3
				}
			}
		}
	},
	"babylon": {
		"id": 14,
		"status": "Alpha",
		"credit": null,
		"desc": {
			"api": "Babylon.js plug-in for easier using",
			"value": "{property:value} of your tween"
		},
		"value": {
			"default": null,
			"recommend": null,
			"userValue": {
				"rotation": {
					"x": 100,
					"y": 100
				},
				"scale": {
					"x": 4,
					"y": 4,
					"z": 3
				}
			}
		}
	},
	"pixi": {
		"id": 15,
		"status": "Alpha",
		"credit": null,
		"desc": {
			"api": "Pixi.js plug-in for easier using",
			"value": "{property:value} of your tween"
		},
		"value": {
			"default": null,
			"recommend": null,
			"userValue": {
				"rotation": 90
			}
		}
	},
	"polyMorph": {
		"id": 16,
		"status": "Stable",
		"credit": {
			"user": "colinmeinke",
			"link": "https://github.com/colinmeinke/wilderness"
		},
		"desc": {
			"api": "SVG Polygon/Polyline Morphing",
			"value": {
				"shape": "Shape of morphing",
				"moveIndex": "move index of shape points",
				"reverse": "Reverse shape points"
			}
		},
		"value": {
			"default": {
				"shape": "Current shape",
				"moveIndex": 0,
				"reverse": false
			},
			"recommend": null,
			"userValue": {
				"shape": "#polygon2"
			}
		}
	},
	"shapeMorph": {
		"id": 17,
		"status": "Stable",
		"credit": {
			"user": "colinmeinke",
			"link": "https://github.com/colinmeinke/wilderness"
		},
		"desc": {
			"api": "SVG Shape Morphing",
			"value": {
				"shape": "Shape of morphing",
				"precision": "Precision of shape points (lower precision, more point)",
				"moveMap": "Shape mapping",
				"useSVGPoints": "Lets you make more natural morphing",
				"disableStyleMorph": "Disables shape style morphing",
				"keepOriginalPath": "After morphing finished, keep original d attribute",
				"disableComplexity": "Enable if shape looks unnatural",
				"showIndex": "Show circle on start index",
				"moveIndex": "move index of shape points",
				"reverse": "Reverse shape points",
				"flattenTransforms": "Flatten/Merges transforms into shape path",
				"mapOrder": "Pops and/or Shifts and/or moves the order of path on SVG Groups and Multi-points shapes"
			}
		},
		"value": {
			"default": {
				"shape": "Current shape",
				"precision": "4 (if useSVGPoints enabled, else no default precision)",
				"moveMap": "length",
				"useSVGPoints": false,
				"disableStyleMorph": false,
				"keepOriginalPath": true,
				"disableComplexity": false,
				"showIndex": false,
				"moveIndex": "auto-matches index",
				"reverse": false,
				"flattenTransforms": false,
				"mapOrder": 0
			},
			"recommend": {
				"disableComplexity": false,
				"keepOriginalPath": true,
				"useSVGPoints": true,
				"moveMap": "auto or length or complexity"
			},
			"userValue": {
				"shape": "#shape2",
				"moveIndex": 3,
				"reverse": true,
				"useSVGPoints": true,
				"precision": 3
			}
		}
	},
	"drawStroke": {
		"id": 18,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "SVG Stroke drawing",
			"value": {
				"offset": "Offset of value (start/end/length/interval)",
				"fadeStroke": "Show stroke after drawing done",
				"fadeFill": "Show fill after drawing done"
			}
		},
		"value": {
			"default": {
				"offset": "Current shape stroke-dasharray",
				"fadeStroke": false,
				"fadeFill": false
			},
			"recommend": null,
			"userValue": {
				"offset": "50% 85%"
			}
		}
	},
	"waveSVG": {
		"id": 19,
		"status": "Stable",
		"credit": {
			"user": "osublake",
			"link": "http://codepen.io/osublake/pen/957a0e49b1690d1946cba33e0e52f885?editors=0010"
		},
		"desc": {
			"api": "SVG Sine Wave",
			"value": {
				"amplitude": "Amplitude of wave",
				"frequency": "Frequency of wave",
				"segment": "Segment count",
				"width": "width of wave container",
				"height": "height of wave container"
			}
		},
		"value": {
			"default": {
				"amplitude": 45,
				"frequency": 4,
				"segment": 150,
				"width": "100%",
				"height": 150
			},
			"recommend": null,
			"userValue": {
				"amplitude": 80,
				"frequency": 3
			}
		}
	},
	"waveSine": {
		"id": 20,
		"status": "Stable",
		"credit": {
			"user": "olizilla",
			"link": "https://gist.github.com/olizilla/4240271"
		},
		"desc": {
			"api": "SVG Sine Wave",
			"value": {
				"amplitude": "Amplitude of wave",
				"frequency": "Frequency of wave",
				"segmentCount": "Segment count",
				"width": "width of wave container",
				"height": "height of wave container"
			}
		},
		"value": {
			"default": {
				"amplitude": 40,
				"frequency": 8,
				"segmentCount": 150,
				"width": 1200,
				"height": 300
			},
			"recommend": null,
			"userValue": {
				"amplitude": 80,
				"frequency": 7
			}
		}
	},
	"curver": {
		"id": 21,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "Bezier curve points interpolation",
			"value": {
				"shape": "Points of curve",
				"useRotate": "Rotates node when curve is rotated"
			}
		},
		"value": {
			"default": {
				"useRotate": false
			},
			"recommend": null,
			"userValue": {
				"shape": [{
						"x": 0,
						"y": 0
					}, {
						"x": 50,
						"y": 100
					}
				]
			}
		}
	},
	"alongPath": {
		"id": 22,
		"status": "Stable",
		"credit": {
			"user": "colinmeinke",
			"link": "https://github.com/colinmeinke/points#position"
		},
		"desc": {
			"api": "Animate target along path aka MotionPath",
			"value": {
				"shape": "Target shape that need along that path",
				"useRotate": "Rotates node when curve is rotated"
			}
		},
		"value": {
			"default": {
				"useRotate": false
			},
			"recommend": null,
			"userValue": {
				"shape": "#motionPath1",
				"useRotate": true
			}
		}
	},
	"siriWave": {
		"id": 23,
		"status": "Stable",
		"credit": {
			"user": "caffeinalab",
			"link": "https://github.com/caffeinalab/siriwavejs"
		},
		"desc": {
			"api": "Apple Siri like Wave",
			"value": {
				"width": "width of wave",
				"height": "height of wave",
				"speed": "Speed of wave",
				"amplitude": "Amplitude of wave",
				"hideAtDone": "Hide wave when tween ends"
			}
		},
		"value": {
			"default": {
				"width": "Container width",
				"height": "Container height",
				"speed": 0.2,
				"amplitude": 1,
				"hideAtDone": true
			},
			"recommend": null,
			"userValue": {
				"width": 259,
				"height": 40
			}
		}
	},
	"domPlugin": {
		"id": 24,
		"status": "Stable",
		"credit": null,
		"desc": {
			"api": "Enables CSS Tweening/Animation, Current style offset"
		},
		"value": null
	}
}

If you like one or more of these, leave review, so i will give you code and we together (or you) port the API to es6-tween, this would be amazed

Visual jump after pause

Hello, after this.tween.pause() in this case:

this.node.addEventListener('mouseenter', this.pause)
this.node.addEventListener('mouseleave', this.play)

this.tween = new window.TWEEN.Tween({ x: 0 })
  .to({ x: this.contentWidth * -1 }, random(4, 8) * 1000)
  .easing(window.TWEEN.Easing.Quintic.InOut)
  .on('update', (v) => {
    this.wrapper.style.setProperty('transform', 'translate3d(' + v.x + 'px, 0, 0)')
  })
  .repeat(Infinity)

I have a visual backward or forward jump for 1/3px on this.wrapper. I work with about 20 wrappers.

  • OS: MacOs
  • Browser chrome
  • Version 73.0.3683.103 (Official Build) (64-bit)

Do not publish .git subdirectory to npm registry

Describe the bug
'.git' subdirectory is published to NPM registry in version 5.4.2. It contains hooks/README.sample. The presence of '.git' subdirectory triggers a bug in NPM which prevents the installation of other packages: npm/npm#17475

Expected behavior
'.git' subdirectory should not be a part of published version

Consolidation

Rather than having two repos that are diverging, let's get ideas from here, and make PRs for them in the base tween branch, and let's delete this repo so we can clean up the org.

There's lots of good ideas here @dalisoft

Then moving forward, what we should do is create new feature branches in the original repo, or make new repos under our own usernames and make pull requests onto the main repo.

Lite users: Deprecation warning

Issue

Soon Lite version will deprecated as Full version should be optimized like Lite

Related

This issue is related to

  • LICENSE

  • README

  • ABOUT COPYRIGHT VIOLATION (be careful before checking this...!)

  • package.json

  • demos/examples

  • core.ts

  • Tween.ts

  • lite.ts

  • Easing.ts

  • Interpolation.ts

  • Timeline.js

  • or provide something else (from es6-tween files...)

Example

Url of some demos to showcase real issue, maybe Codepen, jsFiddle or elsewhere...

What you excepted?

  • Describe your result of research or idea...

NOTE

  • Please add read code, docs, files, issues, PR list for avoid duplicating existing question, bug or something else...

Tween instantiation syntax?

We should decide on a syntax for tween instantiation. We could use a syntax similar to the current version of tween.js, where options are added to tweens using chainable methods:

var myTween = new Tween.tween(object).to({a: 1, b: 2}).easing(TWEEN.Easing.Quadratic.In);

The other option is to use an options object:

var myTween = new Tween.tween(object, {'to': {a: 1, b: 2}, 'easing': TWEEN.Easing.Quadratic.In});

The above two options could both be available at the same time.

Please let me know what you think!

Docs issue

Issue

Issue name

  • Please provide short about issue or Title of this issue

Issue description

  • Please provide the more information as possible to be clear your issue

Related

This issue is related to

  • LICENSE

  • README

  • ABOUT COPYRIGHT VIOLATION (be careful before checking this...!)

  • package.json

  • demos/examples

  • core.ts

  • Tween.ts

  • lite.ts

  • Easing.ts

  • Interpolation.ts

  • Timeline.js

  • or provide something else (from es6-tween files...)

Example

Url of some demos to showcase real issue, maybe Codepen, jsFiddle or elsewhere...

What you excepted?

  • Describe your result of research or idea...

NOTE

  • Please add read code, docs, files, issues, PR list for avoid duplicating existing question, bug or something else...

Not working in Electron

Issue

Issue name

es6-tween relies on process.hrtime if available, which seems to work unexpectedly(?) in Electron.

Issue description

Animations doesn't progress in Electron.

Related

This issue is related to

  • LICENSE
  • README
  • ABOUT COPYRIGHT VIOLATION (be careful before checking this...!)
  • package.json
  • demos/examples
  • core.ts
  • Tween.ts
  • lite.ts
  • Easing.ts
  • Interpolation.ts
  • Timeline.js

Understanding Linear Interpolation

Issue

Issue name

  • Cannot get what happens in linear interpolation

Issue description

  • I want to understand some of your code to create animation engine for my work project to make it more efficient (our web game eats too much CPU with tween.js so we decided to make our own small library). What I am interested in for now is bouncing. As I saw, you count elapsed time for every tick depending on duration, current time at tick and start time. Can you please explain what happens in lines 14-26 of src/Interpolation.js?

Related

This issue is related to

  • LICENSE
  • README
  • ABOUT COPYRIGHT VIOLATION (be careful before checking this...!)
  • package.json
  • demos/examples
  • core.ts
  • Tween.ts
  • lite.ts
  • Easing.ts
  • Interpolation.ts
  • Timeline.js

Tween: Full version [#seek] method isn't working

Issue

Issue name

Tween: Full version [#seek] method isn't working

Issue description

Tween: Full version [#seek] method isn't working

Related

This issue is related to

  • LICENSE

  • README

  • ABOUT COPYRIGHT VIOLATION (be careful before checking this...!)

  • package.json

  • demos/examples

  • core.ts

  • Tween.ts

  • lite.ts

  • Easing.ts

  • Interpolation.ts

  • Timeline.js

  • or provide something else (from es6-tween files...)

Example

https://codepen.io/dalisoft/pen/boBNaV (remove commented code)

What you excepted?

Seek the tween

NOTE

  • Please add read code, docs, files, issues, PR list for avoid duplicating existing question, bug or something else...

Typescript cannot find declaration file (.d.ts) when used via npm

Issue

Issue name

Typescript cannot find declaration file (.d.ts) when used via npm

Issue description

When one tries to import es6-tween in TypeScript, they get:

ERROR in [at-loader] ./lib/graphics.ts:7:24 
    TS7016: Could not find a declaration file for module 'es6-tween'. '[...]/node_modules/es6-tween/full/Tween.js' implicitly has an 'any' type.
  Try `npm install @types/es6-tween` if it exists or add a new declaration (.d.ts) file containing `declare module 'es6-tween';`

Related

This issue is related to

  • package.json

What you excepted?

To fix, you simply need to add a "types" field in package.json. See http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html.

I'll send a pull request.

scroll property

Dear users if your scroll plugins doesnt work, try scrollfast. thanks. i have no time for documentate it

Tween only run first time since 5.4.x

Repro url: https://codesandbox.io/embed/24w5k8v3zn

Describe the bug
Since version 5.4.x tweens seem to only play first time around. For example I have the following code which creates and runs a new tween programatically, this works as expected in 5.3.x but only works the first time in 5.4.x.

I see there were some changes that mention timeline - could this be something to do with it?

Thanks

    watch() {
      new Tween({ offset: this.alternate ? 0 : 1 })
        .to({ offset: this.alternate ? 1 : 0 }, this.speed)
        .easing({
          offset: Easing.Quadratic.InOut,
        })
        .on('update', this.render)
        .start();
    },

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Have browser tests on travis - not only npm based

Current tests on travis are running on node so we're not actually using window or window.performance. Travis can run headless browsers, and we should use it to make sure we're not breaking things.

Passive versus active source and destination settings

There are two ways that a tween can respect the starting values: by only using the starting values when the tween started (passive), or by using the current values from the starting object (active).

I made an example that demonstrates the difference between passive and active in the source and destination objects: https://mikebolt.github.io/discuss/examples/active_tweens.html

I think we should add options for making the tween source-active and/or destination-active. The current default of passive/passive should remain the same.

Docs issue

Sorry for site doc issue, i will fix when have time

How to use es6-tween with Angular APP to animate vehicle Movement on ArcGIS JS API map

I have an angular js application. One of the controllers uses Esri MAP (ArcGIS JS API). I need to animate the vehicle graphic movement.

What I did?
I imported the es-tween library and set autoPlay to true

const { Tween, Easing, autoPlay } = require('es6-tween');
autoPlay(true);

On the function of the vehicle location updated I did the following code::
let position = {
x: vehicle.graphic.geometry.getLongitude(),
y: vehicle.graphic.geometry.getLatitude(),
heading: 180
};
let target = {x:position.x+2, y:position.y};
vehicle.tween = new Tween(position).to(target, 15000).easing(Easing.Elastic.InOut).on('update', (position) => {
vehicle.graphic.setGeometry(position);
console.log(position);
});
vehicle.tween.start();
The Tween object of the vehicle is updated with the position and target. But the vehicle image does not move.

This is the Vehicle Object
Object
graphic:
attributes: {currentPosition_X: -122.387786865234, currentPosition_Y: 47.5610885620117, driverName: "Unassigned", vehicleId: "new", mouseClicked: false}
geometry:
spatialReference: {wkid: 4326}
type: "point"
x: -122.387786865234
y: 47.5610885620117
proto: Object
infoTemplate: undefined
symbol: undefined
_cache: null
_extent: {type: "extent", xmin: -122.387786865234, ymin: 47.5610885620117, xmax: -122.387786865234, ymax: 47.5610885620117, …}
_graphicsLayer: {_attrs: {…}, _url: null, url: null, spatialReference: {…}, initialExtent: {…}, …}
_layer: {_attrs: {…}, _url: null, url: null, spatialReference: {…}, initialExtent: {…}, …}
proto: Object
make: "Dodge"
model: "Caravan"
onboard_device_id: "new"
tween: L
id: 7
object: {x: -122.387786865234, y: 47.5610885620117, heading: 180}
updateCallback0: ƒ (position)
_chainedTweensCount: 0
_delayTime: 0
_duration: 15000
_easingFunction: ƒ (t)
_easingReverse: ƒ (t)
_initTime: 48742.665000027046
_interpolationFunction: ƒ (t,e,r)
_isFinite: true
_isPlaying: true
_maxListener: 15
_onStartCallbackFired: false
_pausedTime: null
_prevTime: 48742.665000027046
_r: 0
_rendered: false
_repeat: 0
_reversed: false
_startTime: 48742.665000027046
_valuesEnd: {x: -120.387786865234, y: 47.5610885620117}
_valuesStart: {}
_yoyo: false
proto: Object
vehicle_id: 888
vehicle_id_number: "new"
vehicle_registration: "new"
vehicle_status: "active"
vehicle_type: "sedan"
proto: Object

Issue name Issue description Issue Demo URL

Related

This issue is related to

  • LICENSE

  • README

  • ABOUT COPYRIGHT VIOLATION (be careful before checking this...!)

  • package.json

  • demos/examples

  • core.ts

  • Tween.ts

  • lite.ts

  • Easing.ts

  • Interpolation.ts

  • Timeline.js

  • or provide something else (from es6-tween files...)

What you excepted?

  • Describe your result of research or idea...

NOTE

  • Please add read code, docs, files, issues, PR list for avoid duplicating existing question, bug or something else...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.