{"id":16104024,"url":"https://github.com/davesnx/re-spring-css","last_synced_at":"2025-03-18T08:31:24.972Z","repository":{"id":85582548,"uuid":"192319197","full_name":"davesnx/re-spring-css","owner":"davesnx","description":"CSS-keyframes animations in Reason","archived":false,"fork":false,"pushed_at":"2019-10-26T15:22:18.000Z","size":202,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T08:19:13.213Z","etag":null,"topics":["animation","css","reason","spring"],"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/davesnx.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-17T09:45:14.000Z","updated_at":"2022-06-17T21:18:04.000Z","dependencies_parsed_at":"2023-07-04T04:54:43.547Z","dependency_job_id":null,"html_url":"https://github.com/davesnx/re-spring-css","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davesnx%2Fre-spring-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davesnx%2Fre-spring-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davesnx%2Fre-spring-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davesnx%2Fre-spring-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davesnx","download_url":"https://codeload.github.com/davesnx/re-spring-css/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910750,"owners_count":20367545,"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":["animation","css","reason","spring"],"created_at":"2024-10-09T18:59:24.655Z","updated_at":"2025-03-18T08:31:24.955Z","avatar_url":"https://github.com/davesnx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# re-spring-css\n\nre-spring-css makes it easy to create keyframes animations in Reason.\n\nYou define a spring: giving a tension and a friction (like [chenglou/react-motion](https://github.com/chenglou/react-motion) or [react-spring.io](https://www.react-spring.io)) and it would create the keyframe!\n\n- It runs at 60 FPS.\n- Doesn't block the DOM, like JavaScript-based animation libs.\n- Can't be canceled or dynamically treated.\n\nIt's an implementation in ReasonML of [gerardabello/spring-animation-keyframes](https://github.com/gerardabello/spring-animation-keyframes), all credits to [him: @gerardabello](https://github.com/gerardabello).\n\n## How it works\n\nThis module depends on [bs-css](https://github.com/SentiaAnalytics/bs-css), ensure that you install both!\n\n```reason\nmodule Styles = {\n  open Css;\n  open ReSpring;\n\n  let fade =\n    createPropertyKeyFrame(\n      ~tension=120.,\n      ~friction=40.,\n      ~initialValue=0.,\n      ~finalValue=1.,\n      ~property=Css.opacity,\n    );\n\n  let jump =\n    createTransformKeyFrame(\n      ~tension=120.,\n      ~friction=40.,\n      ~initialValue=0.,\n      ~finalValue=100.,\n      ~transform=Css.translateX,\n    );\n\n  let crazyAnimation = Css.keyframes(merge(jump, fade));\n\n  let root =\n    style([\n      width(px(50)),\n      height(px(50)),\n      backgroundColor(rgb(0, 0, 0)),\n      animationName(crazyAnimation),\n      animationDuration(2000),\n      unsafe(\"animation-iteration-count\", \"infinite\"),\n    ]);\n};\n\nReactDOMRe.renderToElementWithId(\n  \u003cdiv className=Styles.root\u003e {ReasonReact.string(\"Hello!\")} \u003c/div\u003e,\n  \"index\",\n);\n```\n\n## Why\nCSS animations runs at 60FPS (or more) even if the main thread is busy with parsing/executing JavaScript.\n\u003c!-- todo: add (link to screens with freq 120/144/etc[] --\u003e\n\n## Contribute (Help!)\nI have a list of issues to improve it [here](https://github.com/davesnx/re-spring-css/issues)\n\n```bash\ngit clone https://github.com/davesnx/re-spring-css\nyarn install\nyarn start\n```\n\n## Licence\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavesnx%2Fre-spring-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavesnx%2Fre-spring-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavesnx%2Fre-spring-css/lists"}