diff --git a/index.html b/index.html index 5dba1f5..dbd1380 100644 --- a/index.html +++ b/index.html @@ -88,8 +88,33 @@

Features

Installation

- Run npm install spin.js (recommended), or save the spin.js file in your repo. + Run npm install spin.js, or save the spin.js and spin.css files in your repository.

+ +

JS bundling

+

+ For best performance and compatibility, it is recommended to use a module bundler such as + Parcel, Rollup, + or Webpack to create a production-ready code bundle. + However, in modern browsers it is also possible to directly load the module via a script tag: +

+
+  <script type="module" src="node_modules/spin.js/spin.js"></script>
+
+

+ If for some reason you can't use ES6 modules or a module bundler, download + spin.umd.js and save it in your repository. + The UMD script can be used as follows: +

+
+  var spinner = new Spin.Spinner(opts).spin(target);
+
+

+ Note that the UMD version is only available as a temporary workaround. + Longer term it is recommended to migrate to the standard ES6 module. +

+ +

CSS

Load the spin.css file to include the default animation presets. You could alternatively create a custom CSS keyframe animation (in your own CSS file) @@ -136,17 +161,6 @@

Usage

element is passed as argument, the spinner is added as first child and horizontally and vertically centered.

-

Bundling

-

- Not all browsers support native ES6 module imports yet, so it is recommended to use a module bundler such as - Webpack or - Rollup to create a production-ready code bundle. -

-

- If for some reason you can't use ES6 modules or a module bundler, download - spin.umd.js and save it in your repo. -

-

Manual insertion

In order to manually insert the spinner into the DOM you can invoke the spin() method