{"id":20129372,"url":"https://github.com/ryanmorr/fx","last_synced_at":"2025-04-09T16:09:42.155Z","repository":{"id":70575089,"uuid":"75492337","full_name":"ryanmorr/fx","owner":"ryanmorr","description":"JavaScript animation library","archived":false,"fork":false,"pushed_at":"2024-11-25T17:54:59.000Z","size":330,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T16:09:35.057Z","etag":null,"topics":["animation","effects","javascript","tween"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanmorr.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":"2016-12-03T18:26:51.000Z","updated_at":"2024-11-25T17:55:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"b665f872-9858-473d-94bf-c0184a38a942","html_url":"https://github.com/ryanmorr/fx","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Ffx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Ffx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Ffx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Ffx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanmorr","download_url":"https://codeload.github.com/ryanmorr/fx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065283,"owners_count":21041871,"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","effects","javascript","tween"],"created_at":"2024-11-13T20:33:57.542Z","updated_at":"2025-04-09T16:09:42.150Z","avatar_url":"https://github.com/ryanmorr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fx\n\n[![Version Badge][version-image]][project-url]\n[![License][license-image]][license-url]\n[![Build Status][build-image]][build-url]\n\n\u003e JavaScript animation library\n\n## Install\n\nDownload the [CJS](https://github.com/ryanmorr/fx/raw/master/dist/cjs/fx.js), [ESM](https://github.com/ryanmorr/fx/raw/master/dist/esm/fx.js), [UMD](https://github.com/ryanmorr/fx/raw/master/dist/umd/fx.js) versions or install via NPM:\n\n```sh\nnpm install @ryanmorr/fx\n```\n\n## Usage\n\nProvide an element, nodelist, or selector string and an object that maps CSS properties to a value that the property will be animated to. It returns a promise that is resolved when the animation is complete:\n\n```javascript\nimport fx from '@ryanmorr/fx';\n\nawait fx('#foo', {\n    width: 100,\n    height: 200\n});\n```\n\nOptionally specify the duration in milliseconds (defaults to 1000):\n\n```javascript\nfx(element, {\n    width: 100,\n    duration: 500\n});\n```\n\nOptionally provide an easing method as a string, supporting \"linear\", \"ease-in\", \"ease-out\", and the default \"ease-in-out\":\n\n```javascript\nfx(element, {\n    opacity: 0,\n    easing: 'ease-in'\n});\n```\n\nDefine a starting value for the animation by using an array, with the start value at the first index and the end value at the last index:\n\n```javascript\nfx(element, {\n    width: [100, 500]\n});\n```\n\nAdd units to the value to override the default \"px\" used by most properties:\n\n```javascript\nfx(element, {\n    height: '5em'\n});\n```\n\nSupports 2D transforms:\n\n```javascript\nfx(element, {\n    translateX: 100,\n    translateY: 100,\n    scaleX: 2,\n    scaleY: 2,\n    rotate: 45\n});\n```\n\nSupports colors as hex or RGB:\n\n```javascript\nfx(element, {\n    color: '#0000FF',\n    backgroundColor: 'rgb(255, 0, 0)'\n});\n```\n\nSupports custom properties:\n\n```javascript\nfx(element, {\n    '--value': 100\n});\n```\n\nSupports scrolling:\n\n```javascript\nfx(element, {\n    scrollTop: 100,\n    scrollLeft: 100\n});\n```\n\nSupports motion path:\n\n```javascript\nfx(element, {\n    offsetDistance: '100%'\n});\n```\nSupports a custom easing function:\n\n```javascript\nfunction bounceIn(t) {\n    if (t \u003c 1 / 2.75) {\n        return 7.5625 * t * t;\n    } else if (t \u003c 2 / 2.75) {\n        return 7.5625 * (t -= 1.5 / 2.75) * t + 0.75;\n    } else if (t \u003c 2.5 / 2.75) {\n        return 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375;\n    } else {\n        return 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;\n    }\n}\n\nfx(element, {\n    translateX: 500,\n    easing: bounceIn\n});\n```\n\n## License\n\nThis project is dedicated to the public domain as described by the [Unlicense](http://unlicense.org/).\n\n[project-url]: https://github.com/ryanmorr/fx\n[version-image]: https://img.shields.io/github/package-json/v/ryanmorr/fx?color=blue\u0026style=flat-square\n[build-url]: https://github.com/ryanmorr/fx/actions\n[build-image]: https://img.shields.io/github/actions/workflow/status/ryanmorr/fx/node.js.yml?style=flat-square\n[license-image]: https://img.shields.io/github/license/ryanmorr/fx?color=blue\u0026style=flat-square\n[license-url]: UNLICENSE","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Ffx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanmorr%2Ffx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Ffx/lists"}