{"id":16592796,"url":"https://github.com/michaelgira23/sequins","last_synced_at":"2025-07-29T17:09:03.977Z","repository":{"id":67193859,"uuid":"98574162","full_name":"michaelgira23/sequins","owner":"michaelgira23","description":"A library for adding sequences of values and smoothly transitioning between them","archived":false,"fork":false,"pushed_at":"2017-07-31T18:18:55.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T01:37:15.870Z","etag":null,"topics":["easings","frames","sequences","sequins","timeframe","translation"],"latest_commit_sha":null,"homepage":null,"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/michaelgira23.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":"2017-07-27T19:43:47.000Z","updated_at":"2021-03-28T17:49:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"04273ca7-3064-4d4a-b9d7-342ae38bfb5d","html_url":"https://github.com/michaelgira23/sequins","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/michaelgira23%2Fsequins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelgira23%2Fsequins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelgira23%2Fsequins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelgira23%2Fsequins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelgira23","download_url":"https://codeload.github.com/michaelgira23/sequins/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242240797,"owners_count":20095331,"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":["easings","frames","sequences","sequins","timeframe","translation"],"created_at":"2024-10-11T23:22:29.003Z","updated_at":"2025-03-06T15:43:39.603Z","avatar_url":"https://github.com/michaelgira23.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sequins\n\nA library for adding sequences of values and smoothly transitioning between them\n\n# Installation\n\n```\n$ npm install sequins\n```\n\n# Example\n\n```javascript\nconst { Sequence } = require('sequins');\n\nconst sequence = new Sequence([\n\t{\n\t\ttime: 0,\n\t\tvariables: {\n\t\t\tx: {\n\t\t\t\tvalue: 0,\n\t\t\t\teaseNext: 'easeInOutCirc'\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\ttime: 100,\n\t\tvariables: {\n\t\t\tx: {\n\t\t\t\tvalue: 80\n\t\t\t}\n\t\t}\n\t}\n]);\n\nconsole.log(sequence.exportArray(5));\n// [ { time: 0, values: { x: 0 } },\n//  { time: 10, values: { x: 0.8081641154691521 } },\n//  { time: 20, values: { x: 3.3393944403532805 } },\n//  { time: 30, values: { x: 7.999999999999998 } },\n//  ...\n//  { time: 90, values: { x: 79.19183588453085 } },\n//  { time: 100, values: { x: 80 } } ]\n\n```\n\n# Exporting Sequences\n\nThe main functionality of this library is creating sequences and exporting them. You can export sequences in a number of different ways.\n\n## Export as Array\n\n```javascript\nSequence.exportArray(interval[, startTime[, endTime]]);\n```\n\n### Parameters\n\n#### interval\n`number` - How much time in between each instance of the exported sequence.\n\n#### startTime\n`number` - Optional. At what time to start exporting values. Defaults to `0`.\n\n#### endTime\n`number` - Optional. At what time to stop exporting values. Defaults to `Sequence.length`.\n\n### Return value\n`Instance[]` - Array of instance values.\n\n## Export as Generator Function\n\n```javascript\nSequence.exportGenerator(interval[, startTime[, endTime]]);\n```\n\n### Parameters\n\n#### interval\n`number` - How much time in between each instance of the exported sequence.\n\n#### startTime\n`number` - Optional. At what time to start exporting values. Defaults to `0`.\n\n#### endTime\n`number` - Optional. At what time to stop exporting values. Defaults to `Sequence.length`.\n\n### Return value\n`IterableIterator\u003cInstance\u003e` - A generator function which `yields` the next value in the exported sequence.\n\n\n## Export as Interval\n\n```javascript\nSequence.exportInterval(delay, interval, callback[, startTime[, endTime]]);\n```\n\n### Parameters\n\n#### delay\n`number` - How much time in between each invocation of callback (in milliseconds).\n\n#### interval\n`number` - How much time in between each instance of the exported sequence.\n\n#### callback\n`(instance: Instance, index: number) =\u003e void` - Callback invoked every `delay`. First parameter is the instance object (contains `time` and `values`). Second parameter is the current instance's index in the exported sequence.\n\n#### startTime\n`number` - Optional. At what time to start exporting values. Defaults to `0`.\n\n#### endTime\n`number` - Optional. At what time to stop exporting values. Defaults to `Sequence.length`.\n\n### Return value\nNothing is returned.\n\n# Types\n\n\n\n## Instance\n\nAn instance object represents one point on a sequence. It contains a `time` property which, as the same suggests, the point of time in the sequence. It also contains a `values` property, which is an object of all the current variables and their number value.\n\n```javascript\nInstance {\n\ttime: number;\n\tvalues: {\n\t\t[name: string]: number;\n\t};\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelgira23%2Fsequins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelgira23%2Fsequins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelgira23%2Fsequins/lists"}