fgnass / spin.js

A spinning activity indicator
http://spin.js.org
MIT License
9.3k stars 1.02k forks source link

Feature requests #366

Closed alpha-and-omega closed 5 years ago

alpha-and-omega commented 5 years ago

Thank you for this awesome spinner! I have 3 feature requests to make your spinner even better: 1) provide precompiled spin.es5.min.js version - this is major request. And two minor features: 2) add "delay" option, to show spinner after small delay. Users hate spinners, so why show it immidiately ? Show it after 1-1.5 seconds delay. 3) add "click" callback. Users hate when something goes wrong and they can't do anything. I will stop spinner on click, but this should be simple configurable callback.

theodorejb commented 5 years ago

Thanks for the feedback!

  1. It was an intentional decision to not include a minified file in the package since this would bloat the size with a file that not everyone needs. The npm package does include a pre-compiled JavaScript module which can be used natively in any modern browser. If you still need to support IE 11, I recommend using Rollup or Webpack to create a bundle which you can then minify.
  2. spin.js includes methods to start and stop the spinner whenever you want. If you want to start it after a delay, feel free to do so!
  3. You should be able to do this already by putting the spinner in an element with a click event listener that stops the spinner.

The basic philosophy behind spin.js is to provide a lightweight module with simple API for controlling the low-level functionality. Extra features can then be easily added on top in other packages (Ladda, for example).