{"id":13805471,"url":"https://github.com/HaikuTeam/core","last_synced_at":"2025-05-13T19:31:19.524Z","repository":{"id":41390268,"uuid":"119432848","full_name":"HaikuTeam/core","owner":"HaikuTeam","description":":rice: Interactive UI animation engine for the Web.  Core renderer for Haiku Animator.","archived":false,"fork":false,"pushed_at":"2024-03-25T21:04:33.000Z","size":16133,"stargazers_count":765,"open_issues_count":9,"forks_count":46,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-08T12:02:09.660Z","etag":null,"topics":["animation","svg","web"],"latest_commit_sha":null,"homepage":"https://www.haikuforteams.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HaikuTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-01-29T19:49:33.000Z","updated_at":"2025-03-25T18:20:59.000Z","dependencies_parsed_at":"2024-06-18T16:58:22.432Z","dependency_job_id":"e188f14d-a7a3-41f7-a8cb-0e5649e8971f","html_url":"https://github.com/HaikuTeam/core","commit_stats":{"total_commits":656,"total_committers":15,"mean_commits":"43.733333333333334","dds":0.5975609756097561,"last_synced_commit":"7948ba69ece8b5cf63e23656084b0d6f8fc72afb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaikuTeam%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaikuTeam%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaikuTeam%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaikuTeam%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HaikuTeam","download_url":"https://codeload.github.com/HaikuTeam/core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253411588,"owners_count":21904153,"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","svg","web"],"created_at":"2024-08-04T01:01:01.469Z","updated_at":"2025-05-13T19:31:14.502Z","avatar_url":"https://github.com/HaikuTeam.png","language":"TypeScript","readme":"# Animator Core\n\n[![NPM](https://nodei.co/npm/@haiku/core.png)](https://nodei.co/npm/@haiku/core/)\n\nAnimator Core is the runtime and rendering engine for [Haiku Animator](https://www.haikuforteams.com/) and the components you create with Animator.  This engine is a dependency for any Haiku Animator components that are run on the web.\n\nNote that for iOS and Android, Haiku Animator [also supports exporting to Lottie](https://docs.haikuforteams.com/embedding-and-using-haiku/lottie.html).  Animator Core is only used when rendering Animator components for the web.\n\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"80%\" src=\"docs/assets/gif-of-animated-or-interactive-haiku-component.gif\"\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n\u003cbr\u003e\n\n### Compatible with modern browsers\n\n\u003cbr\u003e\n\nAnimator Core is compatible with all major modern web browsers: Firefox, Chrome, Safari, and Edge. Its footprint is ~50kB gzipped.\n\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"40%\" src='docs/assets/browser-logos.png' /\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n\n### Hackable + compatible with existing codebases\n\nAnimator Core provides a simple and familiar API for runtime manipulation of components that were built in Animator. You can play and pause animations, react to events, and even pass in dynamic data. (See the [docs](https://docs.haikuforteams.com/embedding-and-using-haiku/haiku-core-api.html) for more info.)\n\n\u003cbr\u003e\n\n### Getting started\n\nCreating an Animator component begins in Haiku Animator:\n\n1. Design a component in Animator — or ask your designer for a component's Animator share URL\n2. Install the Haiku CLI: `$ yarn global add @haiku/cli` or `$ npm i @haiku/cli --global`\n3. Add that component to an existing React or web codebase: `$ haiku install @haiku/yourusername-yourcomponent`\n4. Seamlessly update the component as its design changes: `$ haiku upgrade [projectname] [--version=rev]`\n\n**Dev tip:** If you have Animator installed, you can also `$ npm link` or `$ yarn link` your Animator components to make them available to your codebase toolchain's hot reloading hooks. Animator projects live in `~/.haiku/projects`.\n\n\u003cbr\u003e\n\n#### Direct installation\n\nIf you want to install and develop with Animator Core directly, you can do so with:\n\n    $ npm install @haiku/core\n\nOr via yarn:\n\n    $ yarn add @haiku/core\n\nAnimator Core is also available via Haiku's CDN:\n\n    \u003c!-- specific version --\u003e\n    \u003cscript src=\"https://code.haiku.ai/scripts/core/HaikuCore.VERSION.js\"\u003e\u003c/script\u003e\n\n\u003cbr\u003e\n\n### API / Docs\n\nFor our full documentation (a work in progress), please see [docs.haikuforteams.com](https://docs.haikuforteams.com/). We welcome your contributions [on Github](https://github.com/HaikuTeam/docs).\n\n\u003cbr\u003e\n\n### Usage examples\n\nSimple:\n\n    import AnimatorCore from \"@haiku/core/dom\";\n    const definition = {template: {elementName: 'div', children: ['Hello Animator!']}};\n    const factory = AnimatorCore(definition);\n    const component = factory(document.getElementById(\"mount\"));\n\nAnimated:\n\n    import AnimatorCore from \"@haiku/core/dom\";\n    const definition = {\n      timelines: {\n        Default: {\n          \"#box\": {\n            \"style.width\": { 0: { value: \"100px\" }},\n            \"style.height\": { 0: { value: \"100px\" }},\n            \"style.backgroundColor\": { 0: { value: \"red\" }},\n            \"rotation.z\": {\n              0: { value: 0, curve: \"linear\" },\n              1000: { value: 3.14159 },\n            },\n          },\n        },\n      },\n      template: {\n        elementName: 'div',\n        attributes: {id: 'box'},\n        children: ['Hello Animation!'],\n      },\n    };\n    const factory = AnimatorCore(definition);\n    const component = factory(document.getElementById(\"mount\"));\n\nInteractive:\n\n    import AnimatorCore from \"@haiku/core/dom\";\n    const definition = {\n      options: {\n        autoplay: false,\n      },\n      states: {\n        clicks: {\n          value: 0,\n        },\n      },\n      eventHandlers: {\n        \"#box\": {\n          \"click\": {\n            handler: function () {\n              this.state.clicks += 1;\n              this.getTimeline(\"Default\").play();\n            },\n          },\n        },\n      },\n      timelines: {\n        Default: {\n          \"#box\": {\n            \"content\": { 0: {\n              value: function (clicks) {\n                return clicks + \"\";\n              },\n            }},\n            \"style.width\": { 0: { value: \"100px\" }},\n            \"style.height\": { 0: { value: \"100px\" }},\n            \"style.backgroundColor\": { 0: { value: \"red\" }},\n            \"rotation.z\": {\n              0: { value: 0, curve: \"linear\" },\n              1000: { value: 3.14159 },\n            },\n          },\n        },\n      },\n      template: {\n        elementName: 'div',\n        attributes: {id: 'box'},\n      },\n    };\n    const factory = AnimatorCore(definition);\n    const component = factory(document.getElementById(\"mount\"));\n\n\u003cbr\u003e\n\n## Tracking / Analytics\n\nBy default, Haiku tracks usage of published components by transmitting metadata to Haiku's Mixpanel account when components are initialized on the page. We send only public information: your component's name, its Haiku account username, the software version it was built with, and its share identifier.\n\nTo disable this, set the `mixpanel` option to `false`:\n\n    // ...\n    const factory = AnimatorCore(definition);\n    const component = factory(document.getElementById(\"mount\"), {\n      mixpanel: false // Or the string of your own Mixpanel API token\n    })\n\n\u003cbr\u003e\n\n## Bugs / Feature Requests / Troubleshooting\n\nPlease use [GitHub Issues](https://github.com/HaikuTeam/core/issues).\n\n\u003cbr\u003e\n\n## Contributing\n\nPlease send contributions via [pull request](https://github.com/HaikuTeam/core/pulls).\n\n\u003cbr\u003e\n\n## Roadmap\n\n**Code improvements**\n\n- Use arrow functions throughout _(in progress!)_\n- Improve test coverage\n- Inline source code docs\n- Types\n\n**Features**\n\n- Alternative component formats\n- Improved Lottie integration\n- More comprehensive programmatic API\n\n\u003cbr\u003e\n\n## Development\n\nTo develop Animator Core locally:\n\n1. Fork the repo\n2. `$ yarn install`\n\nCompile with:\n\n    $ yarn compile\n\nTest with:\n\n    $ yarn test\n\nFind formatting problems with:\n\n    $ yarn lint\n\nRun demos in your browser:\n\n    $ yarn demos\n\n\u003cbr\u003e\n\n## License / Copyright\n\nMIT. Please refer to LICENSE.txt. Copyright (c) 2016-2018 Haiku Systems Inc.\n","funding_links":[],"categories":["Common","TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHaikuTeam%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHaikuTeam%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHaikuTeam%2Fcore/lists"}