{"id":19053484,"url":"https://github.com/michitaro/easing","last_synced_at":"2025-08-24T01:16:33.883Z","repository":{"id":57116615,"uuid":"100792775","full_name":"michitaro/easing","owner":"michitaro","description":"easing functions for Typescript","archived":false,"fork":false,"pushed_at":"2017-08-19T12:46:00.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T10:47:50.978Z","etag":null,"topics":["easing","typescript"],"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/michitaro.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":"2017-08-19T12:26:56.000Z","updated_at":"2017-08-19T14:45:39.000Z","dependencies_parsed_at":"2022-08-22T22:20:15.517Z","dependency_job_id":null,"html_url":"https://github.com/michitaro/easing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michitaro%2Feasing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michitaro%2Feasing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michitaro%2Feasing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michitaro%2Feasing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michitaro","download_url":"https://codeload.github.com/michitaro/easing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240109714,"owners_count":19749181,"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":["easing","typescript"],"created_at":"2024-11-08T23:31:35.098Z","updated_at":"2025-02-22T01:16:51.716Z","avatar_url":"https://github.com/michitaro.png","language":"TypeScript","readme":"# easing\nSimple easing functions for TypeScript\n* [Working Demo](https://michitaro.github.io/easing/)\n\n## Install\n\n```sh\nnpm instasll --save @hscmap/easing\n```\n\n## Example\n\n```typescript\nimport * as easing from \"@hscmap/easing\"\n\n\nwindow.addEventListener('load', e =\u003e {\n    const fs = [\n        easing.linear,\n        easing.fastStart2, easing.fastStart4,\n        easing.slowStart2, easing.slowStart4,\n        easing.slowStartStop2,\n        easing.slowStartStop4,\n    ]\n\n    for (const f of fs) {\n        const box = document.createElement('div')\n        box.className = 'box'\n        const title = document.createElement('h2')\n        title.innerHTML = f.name\n        const canvas = document.createElement('canvas')\n        drawFunction(canvas, f)\n        box.appendChild(title)\n        box.appendChild(canvas)\n        document.body.appendChild(box)\n    }\n})\n\n\nfunction drawFunction(canvas: HTMLCanvasElement, f: (x: number) =\u003e number) {\n    function canvasCoord(x: number, y: number) {\n        return [canvas.width * x, canvas.height * (1 - y)]\n    }\n    const ctx = canvas.getContext('2d')!\n    ctx.beginPath()\n    for (let x = 0; x \u003c= 1; x += 0.01) {\n        const y = f(x)\n        const [X, Y] = canvasCoord(x, y)\n        ctx.lineTo(X, Y)\n    }\n    ctx.stroke()\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichitaro%2Feasing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichitaro%2Feasing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichitaro%2Feasing/lists"}