diff --git a/README.md b/README.md index 9bb9018..34c669e 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,104 @@ Documentation and Demo --------------------- Documentation and demo can be found [here](http://pathgather.github.io/please-wait/). +## Table of Contents +- [Installation](#installation) +- [Usage](#usage) +- [API](#api) +- [Customization](#customization) +- [Browser Compatibility](#browser-compatibility) +- [Contributing](#contributing) +- [Changelog](#changelog) + +## Installation + +You can install PleaseWait.js using npm: + +```bash +npm install please-wait +``` + +## Usage + +After installing the package, you can import and use it in your JavaScript file: + +```javascript +import pleaseWait from 'please-wait'; + +const loading_screen = pleaseWait({ + logo: "path/to/your/logo.png", + backgroundColor: '#f46d3b', + loadingHtml: "
" +}); + +// Later, when your application is ready: +loading_screen.finish(); +``` + +## API + +- `pleaseWait(options)`: Initialize the loading screen +- `loading_screen.finish()`: Hide the loading screen +- `loading_screen.updateOption(option, value)`: Update a single option +- `loading_screen.updateOptions(options)`: Update multiple options + +## Customization + +PleaseWait.js offers several customization options: + +- `backgroundColor`: Set the background color of the loading screen +- `logo`: Path to your logo image +- `loadingHtml`: Custom HTML for the loading message +- `template`: Custom HTML template for the entire loading screen + +Example: + +```javascript +pleaseWait({ + logo: "images/logo.png", + backgroundColor: '#000000', + loadingHtml: "