{"id":19566299,"url":"https://github.com/juliendargelos/easings","last_synced_at":"2025-06-29T21:05:46.945Z","repository":{"id":57123311,"uuid":"250232956","full_name":"juliendargelos/easings","owner":"juliendargelos","description":"Easing functions in TypeScript.","archived":false,"fork":false,"pushed_at":"2022-08-30T00:14:29.000Z","size":478,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-23T20:17:20.326Z","etag":null,"topics":["animation","easing","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://julien.gl/easings","language":"TypeScript","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/juliendargelos.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}},"created_at":"2020-03-26T10:55:01.000Z","updated_at":"2024-10-18T06:37:11.000Z","dependencies_parsed_at":"2022-08-24T14:59:34.936Z","dependency_job_id":null,"html_url":"https://github.com/juliendargelos/easings","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":"juliendargelos/rollup-library","purl":"pkg:github/juliendargelos/easings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendargelos%2Feasings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendargelos%2Feasings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendargelos%2Feasings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendargelos%2Feasings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliendargelos","download_url":"https://codeload.github.com/juliendargelos/easings/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendargelos%2Feasings/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261851837,"owners_count":23219557,"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","easing","javascript","typescript"],"created_at":"2024-11-11T05:30:55.716Z","updated_at":"2025-06-29T21:05:46.880Z","avatar_url":"https://github.com/juliendargelos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# easings\n\n[![test](https://github.com/juliendargelos/easings/workflows/test/badge.svg?branch=master)](https://github.com/juliendargelos/easings/actions?workflow=test)\n[![build](https://github.com/juliendargelos/easings/workflows/build/badge.svg?branch=master)](https://github.com/juliendargelos/easings/actions?workflow=build)\n[![version](https://img.shields.io/github/package-json/v/juliendargelos/easings)](https://github.com/juliendargelos/easings)\n\n\u003cimg align=\"right\" src=\"https://github.com/juliendargelos/easings/raw/master/figure.gif\" width=\"277\" height=\"200\"\u003e\n\nEasing functions in TypeScript.\n\n[Demo](https://julien.gl/easings) (relies on css paint api so you should use Google Chrome for now).\n\n## Install\n\n```bash\nnpm install @juliendargelos/easings --save\n```\n\n## Usage\n\n#### Basic\n\n[All easing functions](#available-easings) take a number in range `[0..1]` and return the eased number.\n\n```typescript\nimport { cubic } from '@juliendargelos/easings'\n\ncubic(0.1)     // in out\ncubic.in(0.2)  // in\ncubic.out(0.3) // out\n```\n\nYou can access easing functions by their name which follows the same pattern as above.\n\n```typescript\nimport { Easings } from '@juliendargelos/easings'\n\nEasings['exponential'](0.1)\nEasings['exponential.in'](0.2)\nEasings['exponential.out'](0.3)\n```\n\n#### Parameterized easings\n\nParameterized easings have an extra `with()` method that generate a new easing function based on parameters. Other easings **do not** have the `with()` method (would be pointless), see [*Available easings*](#available-easings).\n\n```typescript\nimport { elastic } from '@juliendargelos/easings'\n\n// Use default parameterss\nelastic(0.1)\nelastic.in(0.2)\nelastic.out(0.3)\n\n// Use custom parameters (creates a new easing function)\nconst customElastic = elastic.with({ amplitude: 0.8, period: 0.4 })\nconst customElasticIn = elastic.in.with({ amplitude: 0.8, period: 0.4 })\nconst customElasticOut = elastic.out.with({ amplitude: 0.8, period: 0.4 })\n\ncustomElastic(0.1)\ncustomElasticIn(0.2)\ncustomElasticOut(0.3)\n```\n\n#### Available easings\n\n| Name                     | Parameters (default values)     |\n|--------------------------|---------------------------------|\n| `linear`                 |                                 |\n| `quadratic[.in\\|.out]`   |                                 |\n| `cubic[.in\\|.out]`       |                                 |\n| `quartic[.in\\|.out]`     |                                 |\n| `quintic[.in\\|.out]`     |                                 |\n| `circular[.in\\|.out]`    |                                 |\n| `sinusoidal[.in\\|.out]`  |                                 |\n| `bounce[.in\\|.out]`      |                                 |\n| `exponential[.in\\|.out]` | `{ order: 10 }`                 |\n| `back[.in\\|.out]`        | `{ overshoot: 1.70158 }`        |\n| `elastic[.in\\|.out]`     | `{ amplitude: 1, period: 0.3 }` |\n\n#### Types\n\nThe library exports basic types you might find useful if you want to expose easing options in your own library:\n\n```typescript\nimport { EasingName, EasingFunction } from '@juliendargelos/easing'\n\n// EasingName represents all string names from the above list ('cubic', 'cubic.in', ...)\n// EasingFunction is an alias for (t: number) =\u003e number\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendargelos%2Feasings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliendargelos%2Feasings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendargelos%2Feasings/lists"}