{"id":13670941,"url":"https://github.com/gre/bezier-easing","last_synced_at":"2025-04-10T02:14:14.541Z","repository":{"id":12618008,"uuid":"15289182","full_name":"gre/bezier-easing","owner":"gre","description":"cubic-bezier implementation for your JavaScript animation easings – MIT License","archived":false,"fork":false,"pushed_at":"2023-07-12T02:39:01.000Z","size":336,"stargazers_count":1752,"open_issues_count":5,"forks_count":137,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-10T02:13:59.617Z","etag":null,"topics":["animation","bezier","cubic-bezier","easing"],"latest_commit_sha":null,"homepage":"http://greweb.me/bezier-easing-editor/example/","language":"JavaScript","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/gre.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":"2013-12-18T17:07:14.000Z","updated_at":"2025-04-07T13:32:33.000Z","dependencies_parsed_at":"2024-06-18T11:09:06.790Z","dependency_job_id":"4f6b37df-718f-4dcf-91ca-ffbe69717391","html_url":"https://github.com/gre/bezier-easing","commit_stats":{"total_commits":82,"total_committers":12,"mean_commits":6.833333333333333,"dds":0.3902439024390244,"last_synced_commit":"7785b0b63acd6fefb240607f169f037b8add26ad"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gre%2Fbezier-easing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gre%2Fbezier-easing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gre%2Fbezier-easing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gre%2Fbezier-easing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gre","download_url":"https://codeload.github.com/gre/bezier-easing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142902,"owners_count":21054671,"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","bezier","cubic-bezier","easing"],"created_at":"2024-08-02T09:00:53.971Z","updated_at":"2025-04-10T02:14:14.518Z","avatar_url":"https://github.com/gre.png","language":"JavaScript","readme":"bezier-easing [![Build Status](https://img.shields.io/travis/gre/bezier-easing.svg)](https://travis-ci.org/gre/bezier-easing)\n===\n\nBezierEasing provides **Cubic Bezier** Curve easing which generalizes easing functions (ease-in, ease-out, ease-in-out, ...any other custom curve) exactly like in CSS Transitions.\n\nImplementing efficient lookup is not easy because it implies projecting\nthe X coordinate to a Bezier Curve.\nThis micro library uses fast heuristics (involving dichotomic search, newton-raphson, sampling) to focus on **performance** and **precision**.\n\n\u003e It is heavily based on implementations available in Firefox and Chrome (for the CSS transition-timing-function property).\n\nUsage\n-------\n\n```javascript\nvar easing = BezierEasing(0, 0, 1, 0.5);\n// easing allows to project x in [0.0,1.0] range onto the bezier-curve defined by the 4 points (see schema below).\nconsole.log(easing(0.0)); // 0.0\nconsole.log(easing(0.5)); // 0.3125\nconsole.log(easing(1.0)); // 1.0\n```\n\n(this schema is from the CSS spec)\n\n[![TimingFunction.png](https://www.w3.org/TR/css-timing-1/cubic-bezier-timing-curve.svg)](http://www.w3.org/TR/css3-transitions/#transition-timing-function-property)\n\n\u003e `BezierEasing(P1.x, P1.y, P2.x, P2.y)`\n\nInstall\n-------\n\n[![npm install bezier-easing](https://nodei.co/npm/bezier-easing.png)](http://npmjs.org/package/bezier-easing)\n\nIt is the equivalent to [CSS Transitions' `transition-timing-function`](http://www.w3.org/TR/css-easing-1/#cubic-bezier-easing-functions).\n\n\nIn the same way you can define in CSS `cubic-bezier(0.42, 0, 0.58, 1)`,\nwith BezierEasing, you can define it using `BezierEasing(0.42, 0, 0.58, 1)` which have the `` function taking an X and computing the Y interpolated easing value (see schema).\n\nLicense\n-------\n\nMIT License.\n\nTests\n---\n\n[![Build Status](https://img.shields.io/travis/gre/bezier-easing.svg)](https://travis-ci.org/gre/bezier-easing)\n\n```\nnpm test\n```\n\nSee also\n===\n\n- [https://github.com/gre/bezier-easing-editor/](https://github.com/gre/bezier-easing-editor/)\n\nWho use it?\n===\n\n- [React Native](https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/bezier.js)\n- [Apple®](http://images.apple.com/v/mac-pro/home/b/scripts/overview.js) :)\n- [Velocity.js](https://github.com/julianshapiro/velocity)\n- [GLSL.io](http://glsl.io/) and [Diaporama Maker](https://github.com/gre/diaporama-maker)\n- [ipo](https://github.com/gre/ipo)\n\nMore informations\n-----------------\n\nImplementation based on this [article](http://greweb.me/2012/02/bezier-curve-based-easing-functions-from-concept-to-implementation/).\n\nContributing\n------------\n\nYou need a `node` installed.\n\nInstall the deps:\n\n```\nnpm install\n```\n\nThe library is in `index.js`.\n\nEnsure any modication will:\n- keep validating the tests (run `npm test`)\n- not bring performance regression (compare with `npm run benchmark` – don't rely 100% on its precision but it still helps to notice big gaps)\n- Run the visual example: `npm run visual`\n","funding_links":[],"categories":["JavaScript","Common"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgre%2Fbezier-easing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgre%2Fbezier-easing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgre%2Fbezier-easing/lists"}