back to home

CodeByZach / pace

Automatically add a progress bar to your site.

15,637 stars
1,862 forks
278 issues
CSSJavaScript

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing CodeByZach/pace in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/CodeByZach/pace)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

PACE ==== An automatic web page progress bar. Demo Documentation Include pace.js and the theme css of your choice on your page (as early as possible), and you're done! Pace will automatically monitor your ajax requests, event loop lag, document ready state, and elements on your page to decide the progress. On ajax navigation it will begin again! If you use AMD or Browserify, require pace.js and call as early in the loading process as possible. Example ------- Configuration ------------- Pace is fully automatic, no configuration is necessary to get started. If you would like to make some tweaks, here's how: You can set before bringing in the file: You can also put options on the script tag: If you're using AMD or Browserify, you can pass your options to : Themes ------ Pace includes a bunch of themes to get you started. Just include the appropriate css file. Send us a PR with any interesting themes you create. If you have minor styling changes and don't want to extend theme css, you can add custom class names to the progress bar using the "className" option: Collectors ---------- Collectors are the bits of code which gather progress information. Pace includes four default collectors: • Ajax Monitors all ajax requests on the page • Elements Checks for the existence of specific elements on the page • Document Checks the document readyState • Event Lag Checks for event loop lag signaling that javascript is being executed They can each be configured or disabled through configuration options of the same name. Add your own classes to to add more sources. Each source should either have a property, or a property which is a list of objects with properties. Pace will automatically handle all scaling to make the progress changes look smooth to the user. Elements -------- Elements being rendered to the screen is one way for us to decide that the page has been rendered. If you would like to use that source of information (not required at all), specify one or more selectors. You can comma separate the selectors to properly handle error states, where the progress bar should disappear, but the element we are looking for may never appear: Pace will consider the elements test successful when each selector matches something. For this example, when either or exist, and either or exist. Restart Rules ------------- Most users want the progress bar to automatically restart when a pushState event occurs (generally means ajax navigation is occuring). You can disable this: You can also have pace restart on every ajax request which lasts longer than x ms. You'll want to disable this if you make ajax requests the user doesn't need to know about, like precaching: You can always trigger a restart manually by calling See the source for a full list of options. API --- Pace exposes the following methods: • : Show the progress bar and start updating. Called automatically if you don't use AMD or CommonJS. • : Show the progress bar if it's hidden and start reporting the progress from scratch. Called automatically whenever or is called by default. • : Hide the progress bar and stop updating it. • : Explicitly track one or more requests, see Tracking below • : Explicitly ignore one or more requests, see Tracking below Events ------ Pace fires the following events: • : When pace is initially started, or as a part of a restart • : When pace is manually stopped, or as a part of a restart • : When pace is restarted (manually, or by a new AJAX request) • : When pace is finished • : When the pace is hidden (can be later than , based on and ) You can bind onto events using the , and methods: • : Call (optionally with context) when is triggered • : Unbind the provided and combination. • : Bind to the next (and only the next) incidence of Tracking -------- By default, Pace will show any ajax requests which begin as a part of a normal or ajax-y page load, or which last longer than 500ms. You can disable all ajax tracking by setting to false: You can disable ajax tracking except on page navigation by setting to false: You can manually disable tracking for a specific request or requests by triggering them within a callback: You can force the progress bar to be shown for a specific request by triggering them within a callback: You can also ignore URLs based on a pattern: Dependencies ------------ None! Support ------- Pace is designed to support IE8+ (standards mode), FF 3.5+, Chrome, Safari 4+, Opera 10.5+, and all modern mobile browsers. If you run into a compatibility issue, or can make a case for supporting something else, please create an issue. Size ---- pace.js is 4kb minified and gzipped. The themes vary between 0.5 and 4kb. Issues ------ We have obviously not tested this on every website. If you run into an issue, or find a way the automatic detection could be better, please create an Issue. If you can include a test case, that's even better. Credits ------- HubSpot CodeByZach Javascript by Zack Bloom CSS by Adam Schwartz Themes inspired by Mary Lou Project inspired by nprogress