{"id":23635261,"url":"https://github.com/hoseungme/animate-linear-gradient","last_synced_at":"2025-04-10T00:36:22.259Z","repository":{"id":269266062,"uuid":"906757518","full_name":"hoseungme/animate-linear-gradient","owner":"hoseungme","description":"Simply animate linear-gradient css background","archived":false,"fork":false,"pushed_at":"2025-01-01T07:24:50.000Z","size":45,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-01T07:26:26.667Z","etag":null,"topics":["animation","css","css-animation","css-background-animations","css-backgrounds","css-transition","linear-gradient"],"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/hoseungme.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,"publiccode":null,"codemeta":null}},"created_at":"2024-12-21T20:17:29.000Z","updated_at":"2025-01-01T07:24:53.000Z","dependencies_parsed_at":"2024-12-22T09:32:14.523Z","dependency_job_id":"d3bcb5aa-9c8c-4d24-bdd4-ef7455bde68f","html_url":"https://github.com/hoseungme/animate-linear-gradient","commit_stats":null,"previous_names":["hoseungme/animate-linear-gradient"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoseungme%2Fanimate-linear-gradient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoseungme%2Fanimate-linear-gradient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoseungme%2Fanimate-linear-gradient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoseungme%2Fanimate-linear-gradient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoseungme","download_url":"https://codeload.github.com/hoseungme/animate-linear-gradient/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239565647,"owners_count":19660154,"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","css","css-animation","css-background-animations","css-backgrounds","css-transition","linear-gradient"],"created_at":"2024-12-28T05:32:07.211Z","updated_at":"2025-02-18T22:47:47.801Z","avatar_url":"https://github.com/hoseungme.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eanimate-linear-gradient\u003c/h1\u003e\n  \u003cp\u003eSimply animate linear-gradient css background\u003c/p\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/f861e506-20b0-4614-827e-1d719aa5d8fe\" alt=\"\" width=\"400\" height=\"238\" /\u003e\n\u003c/div\u003e\n\n## Install\n\n```\n$ npm install animate-linear-gradient\n```\n\n## Usage\n\n### Linear Gradient\n\n```typescript\nimport { LinearGradient, RGB } from \"animate-linear-gradient\";\n\nconst from = new LinearGradient({\n  angle: 270,\n  colorStops: [\n    [new RGB([0, 219, 222], 1), 0],\n    [new RGB([252, 0, 255], 1), 1],\n  ],\n});\n\n// linear-gradient(270deg, rgba(0,219,222,1) 0%, rgba(252,0,255,1) 100%)\nfrom.css();\n\nconst to = new LinearGradient({\n  angle: 43,\n  colorStops: [\n    [new RGB([65, 88, 208], 1), 0],\n    [new RGB([200, 80, 192], 1), 0.46],\n    [new RGB([255, 204, 112], 1), 1],\n  ],\n});\n\n// linear-gradient(43deg, rgba(65,88,208,1) 0%, rgba(200,80,192,1) 46%, rgba(255,204,112,1) 100%)\nto.css();\n```\n\n![](https://github.com/user-attachments/assets/0f92c4eb-9ebb-4d69-9cb2-8a4a15fbc036)\n\n### Interpolation\n\n```typescript\nimport { LinearGradient, RGB } from \"animate-linear-gradient\";\n\nconst from = new LinearGradient({\n  angle: 270,\n  colorStops: [\n    [new RGB([0, 219, 222], 1), 0],\n    [new RGB([252, 0, 255], 1), 1],\n  ],\n});\n\nconst to = new LinearGradient({\n  angle: 43,\n  colorStops: [\n    [new RGB([65, 88, 208], 1), 0],\n    [new RGB([200, 80, 192], 1), 0.46],\n    [new RGB([255, 204, 112], 1), 1],\n  ],\n});\n\nfrom.interpolate(to, 0.5).css();\n```\n\n![](https://github.com/user-attachments/assets/7f879a26-ceb5-4bd4-b612-7993b394f945)\n\n### Animate\n\n```typescript\nimport { LinearGradientAnimator, LinearGradient, RGB } from \"animate-linear-gradient\";\n\nconst from = new LinearGradient({\n  angle: 270,\n  colorStops: [\n    [new RGB([0, 219, 222], 1), 0],\n    [new RGB([252, 0, 255], 1), 1],\n  ],\n});\n\nconst to = new LinearGradient({\n  angle: 43,\n  colorStops: [\n    [new RGB([65, 88, 208], 1), 0],\n    [new RGB([200, 80, 192], 1), 0.46],\n    [new RGB([255, 204, 112], 1), 1],\n  ],\n});\n\nconst animator = new LinearGradientAnimator(element, {\n  from,\n  to,\n  duration: 2000,\n});\nanimator.play();\n```\n\nhttps://github.com/user-attachments/assets/3effec51-724a-49e6-a201-bac684a1ccae\n\n### Animate With Easing\n\n```typescript\nimport { LinearGradientAnimator, LinearGradient, RGB } from \"animate-linear-gradient\";\n\nconst from = new LinearGradient({\n  angle: 270,\n  colorStops: [\n    [new RGB([0, 219, 222], 1), 0],\n    [new RGB([252, 0, 255], 1), 1],\n  ],\n});\n\nconst to = new LinearGradient({\n  angle: 43,\n  colorStops: [\n    [new RGB([65, 88, 208], 1), 0],\n    [new RGB([200, 80, 192], 1), 0.46],\n    [new RGB([255, 204, 112], 1), 1],\n  ],\n});\n\nfunction easeInOutQuart(x: number): number {\n  return x \u003c 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2;\n}\n\nconst animator = new LinearGradientAnimator(element, {\n  from,\n  to,\n  duration: 2000,\n  easing: easeInOutQuart,\n});\nanimator.play();\n```\n\nhttps://github.com/user-attachments/assets/96109141-e39c-44fa-a5bf-8c83c57ac88b\n\n### Seek\n\n```typescript\nimport { LinearGradientAnimator, LinearGradient, RGB } from \"animate-linear-gradient\";\n\nconst from = new LinearGradient({\n  angle: 270,\n  colorStops: [\n    [new RGB([0, 219, 222], 1), 0],\n    [new RGB([252, 0, 255], 1), 1],\n  ],\n});\n\nconst to = new LinearGradient({\n  angle: 43,\n  colorStops: [\n    [new RGB([65, 88, 208], 1), 0],\n    [new RGB([200, 80, 192], 1), 0.46],\n    [new RGB([255, 204, 112], 1), 1],\n  ],\n});\n\nconst animator = new LinearGradientAnimator(element, {\n  from,\n  to,\n  duration: 2000,\n});\nanimator.seek(0.5);\n```\n\nhttps://github.com/user-attachments/assets/9e09e805-95af-4216-a380-451fc1c2bdfe\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoseungme%2Fanimate-linear-gradient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoseungme%2Fanimate-linear-gradient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoseungme%2Fanimate-linear-gradient/lists"}