{"id":19909983,"url":"https://github.com/aitoroses/react-animation-engine","last_synced_at":"2026-05-10T21:44:08.892Z","repository":{"id":30882874,"uuid":"34440559","full_name":"aitoroses/react-animation-engine","owner":"aitoroses","description":"Extract famo.us transitionable capabilities in 14kb for react. Mixin to transition between state values.","archived":false,"fork":false,"pushed_at":"2015-04-26T13:34:31.000Z","size":520,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T19:51:57.191Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aitoroses.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-23T07:23:52.000Z","updated_at":"2015-07-28T22:18:49.000Z","dependencies_parsed_at":"2022-08-31T14:10:56.845Z","dependency_job_id":null,"html_url":"https://github.com/aitoroses/react-animation-engine","commit_stats":null,"previous_names":["aitoroses/famous-animation-engine"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Freact-animation-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Freact-animation-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Freact-animation-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Freact-animation-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aitoroses","download_url":"https://codeload.github.com/aitoroses/react-animation-engine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241337484,"owners_count":19946423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T21:17:12.206Z","updated_at":"2026-05-10T21:44:03.849Z","avatar_url":"https://github.com/aitoroses.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-animation-engine\nExtract famous transitionable capabilities in 10kb. Mixin to transition between state values.\n\n![Spring animation](http://s8.postimg.org/w9knnfj6d/springs.gif)\n\n# Install\n\n```\nnpm install react-animation-engine\n```\n\n# Usage\n```jsx\n\nimport {TransitionableMixin, Easing} from 'react-animation-engine';\n\nvar TestComponent = React.createClass({\n  \n  /**\n   * Define transitionable properties\n   */\n  mixins: [TransitionableMixin([\"width\", \"height\"])],\n\n  /**\n   * Return initial values for the transitionables\n   */\n  getInitialState() {\n    return {\n      width: 200,\n      height: 50\n    }\n  },\n\n  /**\n   * Animate using Easing functions\n   */\n  handleButtonClick() {\n    this.width = {\n      value: document.body.clientWidth / 2,\n      duration: 5000\n    };\n    this.height = {\n      value: document.body.clientHeight / 2,\n      duration: 2000,\n      curve: Easing.outCirc\n    };\n  },\n\n  /**\n   * Animate using Springs\n   */\n  handleClick() {\n    // Halt the ongoing animation\n    this.handleStop();\n\n    // Toggle the status\n    var toggle = !!this.state.toggle;\n\n    // Animate\n    this.width = {\n      value: toggle ? 400: 100,\n      method: \"spring\",\n      dampingRatio: 0.2,\n      period: 1000\n    };\n    this.height = {\n      value: toggle ? 300: 200,\n      method: \"spring\",\n      dampingRatio: 0.2,\n      period: 500\n    };\n\n    // Store the state\n    this.setState({\n      toggle: !toggle\n    })\n  },\n\n  /**\n   * Handle transitionable stop\n   */\n  handleStop() {\n    this.halt();\n  },\n\n  /**\n   * Render method\n   */\n  render() {\n    return (\n      \u003cdiv\u003e\n        \u003cbutton onClick={this.handleButtonClick}\u003eclick me\u003c/button\u003e\n        \u003cbutton onClick={this.handleStop}\u003eStop\u003c/button\u003e\n        \u003cdiv style={{\n          width: this.state.width,\n          height: this.state.height,\n          backgroundColor: 'blue',\n          color: \"white\"\n        }}\n        onClick={this.handleClick}\u003e\u003c/div\u003e\n      \u003c/div\u003e\n    )\n  }\n});\n\n/**\n * Render component into body\n */\nReact.render(\u003cTestComponent/\u003e, document.body);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitoroses%2Freact-animation-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faitoroses%2Freact-animation-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitoroses%2Freact-animation-engine/lists"}