From 578f35dd8ca0da6bfb1df48abe86493258e0c0f2 Mon Sep 17 00:00:00 2001
From: theodorejb
- Run
+ 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:
+
+ 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:
+
+ Note that the UMD version is only available as a temporary workaround.
+ Longer term it is recommended to migrate to the standard ES6 module.
+
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 @@ Features
Installation
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
+
+ <script type="module" src="node_modules/spin.js/spin.js"></script>
+
+
+ var spinner = new Spin.Spinner(opts).spin(target);
+
+CSS
Usage
element is passed as argument, the spinner is added as first child and horizontally and vertically centered.
- 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. -
-
In order to manually insert the spinner into the DOM you can invoke the spin()
method