5.0.3 • Published 2 years ago

@cycjimmy/h5-preloader v5.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
2 years ago

H5 Preloader

libraries dependency status libraries sourcerank Coverage Status Release date rollup semantic-release jest npm license

Resources pre-load for h5 page. Demo

Install

NPM version NPM bundle size npm download

# via npm
$ npm install @cycjimmy/h5-preloader --save

# or via yarn
$ yarn add @cycjimmy/h5-preloader

Usage

import h5Preloader from '@cycjimmy/h5-preloader';

h5Preloader({
  type: 'progressBar',
  progressBar: {
    eProgressBar: ...,
    eProgressBarPercent: ...
  },
  resources: [
    ...
  ],
  hookWhenProgressComplete: () => 
    ...
  },
}).load();
  • h5Preloader config:

    • resources: Require Resource paths array.
    • type: Option Set type of progress. Currently only supports 'progressBar'. Default 'progressBar'.
    • progressBar: Option Progress bar config
      • eProgressBar: Element Element of Progress bar.
      • eProgressBarPercent: Element Element for showing percent.
    • hookWhenProgressComplete: Option The hook function when the progress complete.
    • autoComplete: Option Whether to automatic operation the hook function when the progress complete. Default true
  • h5Preloader instance supports the following methods:

    • load(): Start preloader.
    • progressComplete(): Call the progress complete function manually.

CDN

jsdelivr

To use via a CDN include this in your HTML:

<script src="https://cdn.jsdelivr.net/npm/@cycjimmy/h5-preloader@5/dist/h5-preloader.umd.min.js"></script>
5.0.3

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

4.0.0

2 years ago

5.0.0

2 years ago

3.0.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago