{"id":16325323,"url":"https://github.com/screamz/animatronic","last_synced_at":"2025-10-25T20:31:57.657Z","repository":{"id":224184383,"uuid":"762540348","full_name":"ScreamZ/Animatronic","owner":"ScreamZ","description":"Animations for NodeJS, Bun and Deno with custom clock","archived":false,"fork":false,"pushed_at":"2024-02-27T13:42:48.000Z","size":163,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T10:25:48.536Z","etag":null,"topics":["animation","bun","deno","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ScreamZ.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}},"created_at":"2024-02-24T02:12:20.000Z","updated_at":"2024-11-18T11:47:46.000Z","dependencies_parsed_at":"2024-02-24T11:27:36.167Z","dependency_job_id":null,"html_url":"https://github.com/ScreamZ/Animatronic","commit_stats":null,"previous_names":["screamz/animatronic"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2FAnimatronic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2FAnimatronic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2FAnimatronic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2FAnimatronic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScreamZ","download_url":"https://codeload.github.com/ScreamZ/Animatronic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238207646,"owners_count":19434095,"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","bun","deno","nodejs"],"created_at":"2024-10-10T23:04:46.940Z","updated_at":"2025-10-25T20:31:52.360Z","avatar_url":"https://github.com/ScreamZ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  Animatronic\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/logo.png\" alt=\"Logo Aurora\" width=\"300\"\u003e\n\u003c/p\u003e\n\u003ch4 align=\"center\"\u003eA library to animate numeric values with ease on NodeJS, Bun and Deno.\u003c/h4\u003e\n\n## What is is for?\n\nThis library is for animating numeric values, it can be used to animate anything that can be represented by a number, like the volume of a sound, the position of a servo motor, the brightness of a led, etc or even some [DMX](https://en.wikipedia.org/wiki/DMX512) channels values over time.\n\nIt is aim to be a simple and easy to use library, with a small footprint and no dependencies. The usage might be limited for big animations but it is perfect for small projects and to be used in embedded systems.\n\nIt's currently powering an Escape Room IoT device in production and it's working great.\n\nWhile this is working in browser context, it is not the main focus of this library, and there are better alternatives for that. The main reason is that we are using `setTimeout` and `setInterval` to animate the values, and this is not the best approach for the browser, where we should use `requestAnimationFrame` instead.\n\n## Usage\n\nThis library exports one single function and various Easing animations.\n\nJSDocumentation is well defined and pretty self explanatory, but here is a quick example, for more advanced usage, please check the [documentation](./docs) folder.:\n\n**Animating a PWM (Pulse Wave Modulation) value to dim a light bulb over time**\n\n```ts\n// For the sake of simplicity we have assume we have function `setPWMTo` that sets the PWM of a device between 0 and 255.\n\nimport { createAnimationController, Easing, type SegmentsConfig } from \"animatronic\";\n\n// Generate segments that take a full trip from 0 to 255 and back to 0 in 10 seconds.\nconst simplePulseSegments: SegmentsConfig = [\n  { initialValue: 0, duration: 5000, toValue: 255 },\n  { duration: 5000, toValue: 0, easing: Easing.inOutBack }, // With some easing\n];\n\n// Create an animation controller\nconst controller = createAnimationController({\n  fps: 20, // 20 times per seconds, generate a new value.\n  loop: true, // Loop the animation\n  segments: simplePulseSegments, // The animation to be used (the default one unless overridden on start).\n});\n\nstate.lightMode.onChange((lightMode) =\u003e {\n  // Cancel eventual previous animation\n  controller.stop();\n\n  switch (lightMode) {\n    case \"on\":\n      setPWMTo(255);\n      break;\n    case \"animating\":\n      controller.start(setPWMTo);\n      break;\n    default:\n      setPWMTo(0);\n      break;\n  }\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreamz%2Fanimatronic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscreamz%2Fanimatronic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreamz%2Fanimatronic/lists"}