{"id":14961358,"url":"https://github.com/cloudbit-interactive/gsap-rn","last_synced_at":"2025-10-24T20:31:39.934Z","repository":{"id":57256335,"uuid":"252269442","full_name":"cloudbit-interactive/GSAP-RN","owner":"cloudbit-interactive","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-01T14:22:17.000Z","size":1656,"stargazers_count":48,"open_issues_count":7,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T04:23:44.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudbit-interactive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-01T19:35:15.000Z","updated_at":"2024-11-04T00:43:32.000Z","dependencies_parsed_at":"2024-06-20T21:57:42.894Z","dependency_job_id":"c36959e8-fa4f-4f4a-a727-82104cb41fe0","html_url":"https://github.com/cloudbit-interactive/GSAP-RN","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":"0.36363636363636365","last_synced_commit":"d920452761562fdf41ea0f3476d46e8b67419ef7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudbit-interactive%2FGSAP-RN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudbit-interactive%2FGSAP-RN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudbit-interactive%2FGSAP-RN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudbit-interactive%2FGSAP-RN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudbit-interactive","download_url":"https://codeload.github.com/cloudbit-interactive/GSAP-RN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238035385,"owners_count":19405682,"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-09-24T13:24:53.004Z","updated_at":"2025-10-24T20:31:38.627Z","avatar_url":"https://github.com/cloudbit-interactive.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# GSAP-RN\nSupport for gsap: 3.0.0+. For older versions use [https://github.com/tufik2/TweenMaxRN](https://github.com/tufik2/TweenMaxRN)\n- This repository enable GSAP to work with ReactNative thanks to Direct Manipulation.\n- With this library is possible animate Styles and Transform properties.\n- Currently in RN there is not way to recover the current status of a style appied to an element, so is always important specify the initial params with **gsap.set()** before animate its.\n- The performance using Direct Manipulation is really good, specially when we compile our app in release version.\n\n# How use\n- Install gsap and gsap-rn\n\t\u003e npm install gsap gsap-rn\n\n```javascript\nimport {gsap, Back} from 'gsap-rn';\n\ncomponentDidMount() {  \n    gsap.to(this.ref, {duration:1, style:{left:50}, transform:{rotate:90, scale:0.5}, \tease:Back.easeInOut});  \n}\n\n\u003cView ref={ref=\u003e this.ref = ref} style={{width:100, height:100, backgroundColor:\"#F00\"}}\u003e\u003c/View\u003e\n```\nAnimating percentages\n```javascript\n\ttimeline = gsap.timeline();\n\ttimeline.set(this.bar, {style:{width:\"0%\"}});\n\ttimeline.to(this.bar, {duration:1, style:{width:\"100%\"}, ease:Power2.easeInOut});\n```\n\nAnimating colors\n```javascript\n\ttimeline = gsap.timeline();\n\ttimeline.set(this.box, {style:{backgroundColor:\"#F00\"}});\n\ttimeline.to(this.box, {duration:1, style:{backgroundColor:\"#F0F\"}, ease:Power2.easeInOut});\n```\n\n# AutoKillTween\nIf the app need unmount a component and It is executing an animation ReactNative will throw an updating in an unmontain component error. To offert a easy solution to It you can use AutoKillTween to force stop all animation before unmount.\n\n```javascript\n// This method receive a tween, array of tweens, object with tweens, Class reference that contain all tweens references   \nAutoKillTween.tweensOf(tween)\n\n// If you don't want to worry about kill tween by tween, You can define AutoKillTween also like component and It will stop all animation automatically before unmount the component.\n\u003cView\u003e\n\t\u003cAutoKillTween tweens={this} /\u003e  \n\u003c/View\u003e\n```\n\nHere there is a code of an animation using AutoKillTween\n\n```javascript\nimport React, {Component} from 'react';\nimport {View, Text, TouchableOpacity, StyleSheet} from 'react-native';\nimport {gsap, Power2, Elastic, AutoKillTweens} from 'gsap-rn';\n\nexport default class Main extends Component {\n    boxes = [];\n\n    onPress(){\n\t// Using AutoKillTweens.tweensOf method to kill a specific tween\n\tAutoKillTweens.tweensOf(this.tl);\n\t// We mantain the reference of the tween directly in the Class\n        this.tl = gsap.timeline();\n        this.tl.to(this.boxes, {duration:1, transform:{y:-100, scale:0.8}, ease:Power2.easeInOut, stagger: {amount: 0.3}});\n        this.tl.to(this.boxes, {duration:0.3, transform:{y:0, scale:1 }, ease:Elastic.easeOut, stagger: {amount: 0.3}});\n    }\n\n    render() {\n        return (\n\t\t\u003cView style={{flex:1, justifyContent:\"center\", alignItems:\"center\"}}\u003e\n\t\t\t/* We pass the Class reference to AutoKillTween Componet. \n\t\t\t\tIf this component will unmount, AutoKillTween will end all tween references directy linked to the Class.\n\t\t\t */\n\t\t\t\u003cAutoKillTweens tweens={this} /\u003e\n\t\t\t\u003cView style={{flexDirection:\"row\"}}\u003e\n\t\t\t    \u003cView ref={ ref=\u003ethis.boxes.push(ref) } style={styles.box} /\u003e\n\t\t\t    \u003cView ref={ ref=\u003ethis.boxes.push(ref) } style={styles.box} /\u003e\n\t\t\t    \u003cView ref={ ref=\u003ethis.boxes.push(ref) } style={styles.box} /\u003e\n\t\t\t\u003c/View\u003e\n\t\t\t\u003cTouchableOpacity onPress={this.onPress.bind(this)}\u003e\n\t\t\t    \u003cText ref={ref=\u003ethis.text = ref} style={[styles.button, {marginTop: 30}]} \u003eTouch Me\u003c/Text\u003e\n\t\t\t\u003c/TouchableOpacity\u003e\n\t\t    \u003c/View\u003e\n        );\n    }\n}\n\nconst styles = StyleSheet.create({\n    box:{width:75, height:75, backgroundColor: \"#f0ad4e\", marginHorizontal:5},\n    button:{fontSize:20, backgroundColor: \"#337ab7\", paddingVertical:10, paddingHorizontal:20, color:\"#FFF\", borderRadius:5}\n})\n```\n![animation](http://int-server-one.info/cloudbit/gsap-rn/gsap-rn-animation1.gif)\n\n\n# DEMOS\n[DOWNLOAD APK](http://int-server-one.info/cloudbit/gsap-rn/gsap-rn.apk)\n\n![animation](http://int-server-one.info/cloudbit/gsap-rn/gsap-rn-animation2.gif)\n\n![animation](http://int-server-one.info/cloudbit/gsap-rn/tweenmaxRN.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudbit-interactive%2Fgsap-rn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudbit-interactive%2Fgsap-rn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudbit-interactive%2Fgsap-rn/lists"}