{"_id":"component-tween","_rev":"4-8166750b6b0e448dc529dddcbd39683d","name":"component-tween","description":"Motion tween engine using 'ease'","dist-tags":{"latest":"1.2.0"},"versions":{"1.2.0":{"name":"component-tween","description":"Motion tween engine using 'ease'","version":"1.2.0","keywords":["tween","tweening","animation"],"dependencies":{"component-clone":"0.2.2","component-emitter":"1.2.0","component-type":"1.1.0","ease-component":"1.0.0"},"browser":{"clone":"component-clone","emitter":"component-emitter","type":"component-type","ease":"ease-component"},"license":"MIT","component":{"scripts":{"tween/index.js":"index.js"}},"repository":{"type":"git","url":"https://github.com/component/tween.git"},"gitHead":"2e31d55fe39b21e5ce29079632c8d4e296540bd7","bugs":{"url":"https://github.com/component/tween/issues"},"homepage":"https://github.com/component/tween","_id":"component-tween@1.2.0","scripts":{},"_shasum":"cc39ce5dbab05b52825f41d1947638a0b01b2b8a","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"cc39ce5dbab05b52825f41d1947638a0b01b2b8a","tarball":"https://registry.npmjs.org/component-tween/-/component-tween-1.2.0.tgz","integrity":"sha512-fQCubCyoosovh5VgnnnBsHnq6E0zjDpbAvW48t6glHIFWteowyP7cicPnzj9i3kuaFxI8P+zsSNao+26mQFG4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4UisM1fSkEV5Sykyx9Fw09cBk9+JKOdfc9vp3PKY1GAIgNlDmPdMSWKn6FVD40iWli6x+6TathfeV06M6mbjglTs="}]}}},"readme":"\n# tween\n\n  Motion tween component using [ease](https://github.com/component/ease).\n\n## Installation\n\n    $ component install component/tween\n\n## Example\n\n```js\nvar Tween = require('tween');\nvar raf = require('raf');\nvar button = document.querySelector('button');\n\nvar tween = Tween({ rotate: 0, opacity: 0 })\n  .ease('out-bounce')\n  .to({ rotate: 360, opacity: 1  })\n  .duration(800);\n\ntween.update(function(o){\n  button.style.opacity = o.opacity;\n  button.style.webkitTransform = 'rotate(' + (o.rotate | 0) + 'deg)';\n});\n\ntween.on('end', function(){\n  animate = function(){};\n});\n\nfunction animate() {\n  raf(animate);\n  tween.update();\n}\n\nanimate();\n```\n\n## API\n\n### Tween(obj:Object|Array)\n\n  Initialize a new `Tween` with `obj`.\n\n### Tween#reset()\n\n  Reset the tween.\n\n### Tween#to(obj:Object|Array)\n\n  Tween to `obj` and reset internal state.\n\n     tween.to({ x: 50, y: 100 })\n\n### Tween#duration(ms:Number)\n\n  Set duration to `ms` [500].\n\n### Tween#ease(fn:String|Function)\n\n  Set easing function to `fn`.\n\n     tween.ease('in-out-sine')\n\n### Tween#update(fn:Function)\n\n  Set update function to `fn` or\n  when no argument is given this performs\n  a \"step\".\n\n### Tween#stop()\n\n  Immediately stop the tween and emit \"stop\" and end\" events. `tween.stopped`\n  is then marked as `true`.\n\n## License\n\n  MIT\n","maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"time":{"modified":"2022-06-13T20:09:02.489Z","created":"2015-03-16T21:27:41.166Z","1.2.0":"2015-03-16T21:27:41.166Z"},"homepage":"https://github.com/component/tween","keywords":["tween","tweening","animation"],"repository":{"type":"git","url":"https://github.com/component/tween.git"},"bugs":{"url":"https://github.com/component/tween/issues"},"license":"MIT","readmeFilename":"Readme.md"}