An open API service indexing awesome lists of open source software.

https://github.com/zachleat/throbber

A loading indicator overlay for images (and maybe other things later).
https://github.com/zachleat/throbber

Last synced: about 1 year ago
JSON representation

A loading indicator overlay for images (and maybe other things later).

Awesome Lists containing this project

README

          

# `` Web Component

A web component to add a little baby rainbow gradient overlay until all of the images nested inside have finished loading. Works best with expensive dynamically generated images (like screenshots).

* [Demos](https://zachleat.github.io/throbber/demo.html)
* Used on the registration flow for [`conf.11ty.dev`](https://conf.11ty.dev/)

## Features

* Customize minimum `delay` before the loading indicator is shown.
* Customize loading indicator bar height.

## Installation

You can install via `npm` ([`@zachleat/throbber`](https://www.npmjs.com/package/@zachleat/throbber)) or download the `throbber.js` JavaScript file manually.

```shell
npm install @zachleat/throbber --save
```

Add `throbber.js` to your site’s JavaScript assets.

## Usage

```html

```

### Change minimum delay

The minimum time before the loading indicator is shown. `delay` is in milliseconds (0.5 seconds shown).

```html

```

### Customize appearance

Dark background while the image is loading, loading indicator fills up the component:

```html

```

Use your own custom gradient:

```html

```