{"id":15065303,"url":"https://github.com/theghostyced/sprogress","last_synced_at":"2025-04-10T17:12:08.676Z","repository":{"id":57368067,"uuid":"199350787","full_name":"theghostyced/sprogress","owner":"theghostyced","description":"⭐️ Simple on-scroll progress bar","archived":false,"fork":false,"pushed_at":"2019-07-30T15:38:01.000Z","size":13566,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T14:07:17.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/theghostyced.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}},"created_at":"2019-07-29T00:21:44.000Z","updated_at":"2023-11-30T05:29:44.000Z","dependencies_parsed_at":"2022-08-23T20:11:04.431Z","dependency_job_id":null,"html_url":"https://github.com/theghostyced/sprogress","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/theghostyced%2Fsprogress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theghostyced%2Fsprogress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theghostyced%2Fsprogress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theghostyced%2Fsprogress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theghostyced","download_url":"https://codeload.github.com/theghostyced/sprogress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248261905,"owners_count":21074224,"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-09-25T00:36:30.283Z","updated_at":"2025-04-10T17:12:08.656Z","avatar_url":"https://github.com/theghostyced.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\"\u003e\n    \u003cimg alt=\"SProgress\" title=\"SProgress\" src=\"./assets/sprogress logo.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\"\u003e\n    \u003cimg alt=\"SProgress\" title=\"SProgress\" src=\"https://forthebadge.com/images/badges/built-with-love.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"#\"\u003e\n    \u003cimg alt=\"SProgress\" title=\"SProgress\" src=\"https://forthebadge.com/images/badges/made-with-javascript.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"#\"\u003e\n    \u003cimg alt=\"SProgress\" title=\"SProgress\" src=\"https://forthebadge.com/images/badges/uses-js.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n## Table of Contents\n\n-   [Introduction](#introduction)\n-   [Usage](#usage)\n-   [Events](#events)\n-   [Options](#options)\n-   [Customization](#customization)\n-   [Contributions](#contributions)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Introduction\n\nSProgress is a simple on-scroll progress bar developed for web apps. It aims to give a user feedback as to how far they are in an article.\nInspired by \u003ca href=\"https://alligator.io\"\u003eAlligator.io\u003c/a\u003e. A brief usage can be seen below 👇🏻\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\"\u003e\n    \u003cimg alt=\"SProgress Usage\" title=\"SProgress Usage\" src=\"./assets/ezgif-5-96ed7b573113.gif\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\n**Npm or Bower**\n\nTo install the package via npm, simply run the command below\n\n```bash\n$ npm install sprogress --save\n```\n\n```bash\n$ yarn add sprogress -S\n```\n\n**Via CDN links**\n\nYou can also make use of the cdn links if you dont want to install the package. Add the following to your `html` file\n\n```javascript\n\u003cscript src=\"https://unpkg.com/sprogress@1.0.2/lib/sprogress.min.js\"\u003e\u003c/script\u003e\n```\n\n### Usage\n\nAfter installing the package, you can simply make use of it by call the `init` function provided.\n\n```javascript\nimport SProgress from 'sprogress';\n\nSProgress.init({});\n```\n\nThe `init` function takes in an object which is used to customize the SProgress bar. More on that below\n\n**N.B** - If you are using the CDN, you don't need to call the init method simply add the `script` tag and you all set 😁\n\n## Events\n\n`SProgress` also triggers the `scrollDistanceEvent` event when the specified `scrollDistanceTarget` is reached by the progress bar. This can be useful if you want to display\na feature to the user(maybe a newsletter modal) when they are half way into the page/article.\n\n**`Event`** - `scrollDistanceEvent`\n\n### Implementation\n\n```javascript\nimport SProgress from 'sprogress';\n\nSProgress.init({\n\tscrollDistanceTarget: 60,\n});\n\ndocument.addEventListener('scrollDistanceEvent', displayNewsLetterModal, {\n\tonce: true,\n});\n```\n\n**N.B** - The `once` object passed to the `addEventListener` in other to invoke the `handler` only once. Highly recommended\nif you don't want the handler trigger more than once. \u003ca href=\"https://developers.google.com/web/updates/2016/10/addeventlistener-once\" target=\"_blank\"\u003eHave a look here to learn more\u003c/a\u003e\n\n## Options\n\nThe following are the options that `SProgress` supports:-\n\n### color\n\n**`String`**\n\nThis basically customizes the color of the progress bar.\n\n### height\n\n**`Integer`**\n\nThis can be used to manipulates the height of the progress bar.\n\n### scrollDistanceTarget\n\n**`Integer`**\n\nThis is used to specify a certain distance for the `scrollDistanceEvent` to fire.\n\n## Customization\n\nWith SProgress, the following properties can be customized:-\n\n### Color\n\n**`String`**\n\n```javascript\n  import SProgress from 'sprogress';\n\n  SProgress.init({\n    color: // Your color here in hex |rgb |rgba format\n  });\n```\n\n### Height\n\n**`Integer`**\n\n```javascript\nimport SProgress from 'sprogress';\n\nSProgress.init({\n\theight: 10,\n});\n```\n\n### Using Classname\n\nThe `default` classname for the progress bar is `scroll-progress` and with that you can create you very own css file and manipulate the class to best suit your needs.\n\n```css\n.scroll-progress {\n\t/* CSS styles here */\n}\n```\n\n## Contributions\n\nLooking to contribute, then\n\n-   simply clone or fork this repo\n-   create a branch for your `bug-fix`, `feature` or `cleanup`\n-   raise a pull request\n-   if deemed worthy 😁 the branch will be merged ASAP.\n\n## Issues\n\nAs they say, `Software is written by humans and therefore has bugs` so if you notice any bug while using the library, do raise an issue\n\n```javascript\n/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n *                                                                                              *\n *                                                                                              *\n *                        ____  ____                                                            *\n *                       / ___||  _ \\ _ __ ___   __ _ _ __ ___  ___ ___                         *\n *                       \\___ \\| |_) | '__/ _ \\ / _` | '__/ _ \\/ __/ __|                        *\n *                        ___) |  __/| | | (_) | (_| | | |  __/\\__ \\__ \\                        *\n *                       |____/|_|   |_|  \\___/ \\__, |_|  \\___||___/___/                        *\n *                                              |___/                                           *\n *                                                                                              *\n *                                  Copyrights © 2019                                           *\n *                             \u003cAuthor name=\"Daniel Eze\"                                        *\n *                                url=\"https://twitter.com/theghostyced\" /\u003e                     *\n *                                                                                              *\n *                                                                                              *\n *  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheghostyced%2Fsprogress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheghostyced%2Fsprogress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheghostyced%2Fsprogress/lists"}