{"id":26509754,"url":"https://github.com/weaverse/animate-loading-bar","last_synced_at":"2025-03-21T01:36:09.656Z","repository":{"id":42210036,"uuid":"111830574","full_name":"Weaverse/animate-loading-bar","owner":"Weaverse","description":"1kb loading bar like Shopify, Github, JSFiddle... that works!","archived":false,"fork":false,"pushed_at":"2023-09-30T14:46:50.000Z","size":782,"stargazers_count":26,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-09T17:44:58.550Z","etag":null,"topics":["animation-css","github","github-loading-bar","jsfiddle-loading-bar","loading-bar","shopify-loading","tiny"],"latest_commit_sha":null,"homepage":"https://weaverse.github.io/animate-loading-bar/","language":"HTML","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/Weaverse.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}},"created_at":"2017-11-23T16:26:50.000Z","updated_at":"2024-10-16T03:30:15.000Z","dependencies_parsed_at":"2022-08-12T09:41:27.237Z","dependency_job_id":"a2983d30-5438-49ce-878d-e25ded129d24","html_url":"https://github.com/Weaverse/animate-loading-bar","commit_stats":null,"previous_names":["hta218/animate-loading-bar"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weaverse%2Fanimate-loading-bar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weaverse%2Fanimate-loading-bar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weaverse%2Fanimate-loading-bar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weaverse%2Fanimate-loading-bar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Weaverse","download_url":"https://codeload.github.com/Weaverse/animate-loading-bar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244722706,"owners_count":20499151,"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","github","github-loading-bar","jsfiddle-loading-bar","loading-bar","shopify-loading","tiny"],"created_at":"2025-03-21T01:36:08.975Z","updated_at":"2025-03-21T01:36:09.649Z","avatar_url":"https://github.com/Weaverse.png","language":"HTML","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/github_username/repo_name\"\u003e\n    \u003cimg src=\"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/twitter/282/comet_2604-fe0f.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n\u003ch3 align=\"center\"\u003eAnimate Loading Bar\u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n    1kb loading bar like Shopify, Github, JSFiddle... that works!\n    \u003cbr /\u003e\n    \u003ca href=\"https://hta218.github.io/animate-loading-bar/\"\u003eView Demo\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n![Bundle phobia](https://i.imgur.com/zqTcrcV.png)\n\n## Installation\n1. Via npm\n\t```sh\n\tnpm install animate-loading\n\t```\n\tOr yarn\n\t```sh\n\tyarn add animate-loading\n\t```\n2. Import to your project\n\t```js\n\timport 'animate-loading/dist/main.css'\n\timport AnimateLoading from 'animate-loading'\n\t```\n3. Usage\n\t```js\n\t// Create an instance in your project\n\tconst loading = new AnimateLoading()\n\n\t// Start loading\n\tloading.start()\n\n\t// Execute your async stuff\n\tawait fetch('YOUR_API')\n\n\t// Finish loading\n\tloading.finish()\n\t```\n\n\n## Available options\n\n```javascript\nconst loading = new AnimateLoading(target, options)\n```\n\n- `target` [HTMLElement]: where the loading bar shows up. (Default value: `document.body`)\n- `options` [Object]: Loading options\n  - `options.overlay` [HTMLElement]: Set a blur overlay to your node (if neccessary)\n  - `options.thickness` [String]: the loading bar thickness (Default value: `3px`)\n  - `options.color` [String]: the loading bar background color (Default value: `gray`)\n  - `options.startDuration` [Number]: The duration (in `ms`) from the start of your async stuff until it gets done (Default value: `1000`)\n  - `options.finishDuration` [Number]: The duration (in `ms`) left to finish loading (Default value: `300`)\n\n## Methods\n\n1. Start loading\n\t```javascript\n\tloading.start()\n\t```\n\tRun this before starting your async stuff\n\n2. Finish loading\n\t```javascript\n\tloading.finish(callback = () =\u003e {})\n\t```\n\tRun this after your async stuff gets done.\n\n\tOptional `callback` can be pass to run after finishing the loading process.\n\n## Credit\n\nCopyright (c) 2022 Leo Huynh @ [https://leohuynh.dev](https://leohuynh.dev)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaverse%2Fanimate-loading-bar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweaverse%2Fanimate-loading-bar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaverse%2Fanimate-loading-bar/lists"}