{"id":15435883,"url":"https://github.com/uetchy/timecapsule","last_synced_at":"2026-05-01T10:30:18.975Z","repository":{"id":138511751,"uuid":"138557116","full_name":"uetchy/timecapsule","owner":"uetchy","description":"Timeline based high-precision event invoke system","archived":false,"fork":false,"pushed_at":"2018-06-29T08:39:25.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-03T02:17:01.446Z","etag":null,"topics":[],"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/uetchy.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-25T07:15:26.000Z","updated_at":"2021-10-26T23:06:19.000Z","dependencies_parsed_at":"2023-03-30T08:41:57.725Z","dependency_job_id":null,"html_url":"https://github.com/uetchy/timecapsule","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"002d3bc4bdf4d610f4fa91aa987daaa50a0ae742"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2Ftimecapsule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2Ftimecapsule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2Ftimecapsule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2Ftimecapsule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uetchy","download_url":"https://codeload.github.com/uetchy/timecapsule/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238741408,"owners_count":19522776,"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":[],"created_at":"2024-10-01T18:46:45.578Z","updated_at":"2026-05-01T10:30:18.895Z","avatar_url":"https://github.com/uetchy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TimecapsuleJS\n\n```shell\nnpm install --save timecapsule\n```\n\n## Usage\n\n```js\nconst { Timecapsule } = require('timecapsule')\n\nconst group = new Timecapsule()\n\ngroup.add(0, () =\u003e {\n  console.log('animation start')\n})\n\ngroup.add(1.2, () =\u003e {\n  console.log('show background')\n})\n\ngroup.add(3.2, () =\u003e {\n  console.log('show stars')\n})\n```\n\nor\n\n```js\nconst { Timecapsule, Capsule } = require('timecapsule')\n\nconst group = new Timecapsule([\n  new Capsule(0.0, () =\u003e console.log('animation start')),\n  new Capsule(1.2, () =\u003e console.log('show background')),\n  new Capsule(3.2, () =\u003e console.log('show stars')),\n])\n```\n\n### Sync with time interval\n\n```js\nlet time = 0\nsetInterval(() =\u003e {\n  group.invoke(time)\n  time += 0.1\n}, 100)\n```\n\n### Sync with music\n\n```js\nconst { AudioPlayer } = require('timecapsule/util/audioplayer')\n\nconst audioSource = {\n  name: 'bgm',\n  buffer: arbitoraryArrayBuffer,\n  oneTimeUpdate: group.invoke,\n  onEnded: () =\u003e console.log('music ended'),\n}\nconst player = new AudioPlayer()\nplayer.addSource(audioSource).then(() =\u003e {\n  player.play('bgm')\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuetchy%2Ftimecapsule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuetchy%2Ftimecapsule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuetchy%2Ftimecapsule/lists"}