{"id":16194464,"url":"https://github.com/anatolelucet/easae","last_synced_at":"2025-07-30T10:33:52.030Z","repository":{"id":50093163,"uuid":"307995731","full_name":"AnatoleLucet/easae","owner":"AnatoleLucet","description":"A small utility for easy easings.","archived":false,"fork":false,"pushed_at":"2021-06-04T13:41:36.000Z","size":495,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-28T15:18:27.122Z","etag":null,"topics":["animation","animation-library","easing","easing-functions","javascript","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"","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/AnatoleLucet.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-10-28T11:32:13.000Z","updated_at":"2022-09-16T09:57:08.000Z","dependencies_parsed_at":"2022-09-26T18:41:06.069Z","dependency_job_id":null,"html_url":"https://github.com/AnatoleLucet/easae","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnatoleLucet%2Feasae","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnatoleLucet%2Feasae/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnatoleLucet%2Feasae/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnatoleLucet%2Feasae/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnatoleLucet","download_url":"https://codeload.github.com/AnatoleLucet/easae/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243968622,"owners_count":20376424,"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","animation-library","easing","easing-functions","javascript","typescript","typescript-library"],"created_at":"2024-10-10T08:19:27.082Z","updated_at":"2025-03-19T04:30:47.666Z","avatar_url":"https://github.com/AnatoleLucet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/AnatoleLucet/easae/main/docs/assets/code-preview.webp\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eEasae\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eA small utility for easy easing.\u003c/p\u003e\n\n---\n\n## Features\n\n- Browser AND NodeJs support.\n- Built in easing functions.\n- Custom easing function.\n- Easy to use.\n- Custom duration, delay, and framerate.\n\n## Install\n\n```\nnpm i easae\n```\n\n## Usage\n\n```ts\nimport { easae, easeInCubic } from 'easae';\n\nconst modal = document.querySelector('.modal');\n\neasae({\n  // Easing function you want to use, you can find the list further in the doc.\n  easing: easeInCubic,\n  // This function will be called on each tick of the easing.\n  tick: (t, u) =\u003e {\n    // 't' is going from 0 to 1 and 'u' is going from 1 to 0 (u = 1-t).\n    // The tick function will be called in a requestAnimationsFrame on the browser, and a setTimeout in Node.\n\n    // Bellow - as an example - we set the new scale of the modal.\n    // But the idea is that you can animate anything in here using 't' and 'u'.\n    modal.style.transform = `scale(${t})`;\n\n    // For example we could set a React state:\n    setProgressBarWidth(t * 100); // t * 100 so it's in %\n  },\n  // The duration of the easing in milliseconds\n  duration: 300,\n  // The delay before the easing starts in milliseconds (default is 0)\n  delay: 100,\n  // The refresh rate of the easing (default is 60)\n  rate: 144,\n});\n```\n\n## Easing functions\n\nYou can find the list of every easing functions on https://easings.net. They are all exported from `easae` (for example `import { easeInBounce } from 'easae'`).\n\nOr you can make your own:\n\n```ts\neasae({\n  easing: (x) =\u003e x, // linear\n  tick: (t) =\u003e {\n    // ...\n  },\n  duration: 500,\n});\n```\n\n## Terminal based animations\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"1000px\" src=\"https://raw.githubusercontent.com/AnatoleLucet/easae/main/docs/assets/terminal.svg\" /\u003e\n\u003c/p\u003e\n\n```js\nconst { easae, easeOutBounce } = require('easae');\n\neasae({\n  easing: easeOutBounce,\n  tick: (t) =\u003e {\n    console.clear();\n    console.log('■'.repeat(t * 100), '\\n');\n  },\n  duration: 1300,\n});\n```\n\n## Chained animations\n\n`easae` returns a promise that resolves when the easing is finished. So you can await this promise, then start the next one.\n\n```ts\nimport { easae, easeOutBounce, easeInCubic } from 'easae';\n\nasync function animate() {\n  // first\n  await easae({\n    easing: easeOutBounce,\n    tick: (t) =\u003e {\n      // ...\n    },\n    duration: 1300,\n  });\n\n  // second\n  await easae({\n    easing: easeInCubic,\n    tick: (t) =\u003e {\n      // ...\n    },\n    duration: 500,\n  });\n}\n\nanimate();\n```\n\n## Examples\n\nSee the [examples folder](examples).\n\n## Inspiration\n\nIf you're familiar with [Svelte's animation API](https://svelte.dev/docs#animate_fn), you've probably noticed the resemblance.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanatolelucet%2Feasae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanatolelucet%2Feasae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanatolelucet%2Feasae/lists"}