|
1 | | -# CSS-Spinner |
| 1 | +# css-spinner |
2 | 2 |
|
3 | 3 | [Live Demo](https://loading.io/css/) |
4 | 4 |
|
5 | | -collection of 12 small, elegant pure css spinners for your website loading animation. |
| 5 | +Collection of 12 small, elegant pure css spinners for your website's loading animation. |
6 | 6 |
|
7 | | - |
| 7 | + |
8 | 8 |
|
9 | 9 |
|
10 | 10 | ## Features |
11 | 11 |
|
12 | 12 | * vanilla - no external dependency and no additional library required. |
13 | 13 | * standalone - use any of them separately. |
14 | | - * customizable - use Stylus variables to quickly customize them to fit your need. |
15 | | - * easy to use - simple as copy and paste while also simple to use with pug mixins. |
| 14 | + * customizable - use Stylus variables to quickly customize them to fit your needs. |
| 15 | + * easy to use - simply copy & paste while also easy to use with pug mixins. |
16 | 16 | * small - average size 1K per spinner unminimized, unzipped |
17 | 17 |
|
18 | 18 | ## Usage |
19 | 19 |
|
20 | | -[loading.io](https://loading.io/css/) provides a [web interface](https://loading.io/css/) to quickly choose and copy your desired spinners, yet you can still find the source code in this repository. The simplest usage is as: |
| 20 | +[loading.io](https://loading.io/) provides a [web interface](https://loading.io/css/) to quickly choose and copy your desired spinners, yet you can still find the source code in this repository. The basic usage is as: |
21 | 21 |
|
22 | | -1. Find and download the html file of desired loader under [build/](https://github.com/loadingio/css-spinner/tree/master/build) folder. |
| 22 | +1. Find and download the html files of desired loader under [dist](https://github.com/loadingio/css-spinner/tree/master/dist/) folder. |
23 | 23 | 2. Copy its content to the place you want to use this loader. |
24 | | -3. Done. |
25 | 24 |
|
26 | | -Separated CSS and HTML files are also available under [build](https://github.com/loadingio/css-spinner/tree/master/build) folder so that you can reuse the css to reduce payload size. |
| 25 | +Separated CSS and HTML files are also available under [build](https://github.com/loadingio/css-spinner/tree/master/dist/entries) folder for reusing CSS codes to reduce payload size. |
27 | 26 |
|
28 | 27 | We also provide stylus and pug source files for better integrating these spinners into your project. Find corresponding stylus and pug files for your desired spinners under [src/](https://github.com/loadingio/css-spinner/tree/master/src) folders. |
29 | 28 |
|
30 | | -Additionally, you will need [vars.styl](https://github.com/loadingio/css-spinner/blob/master/vars.styl) and [basic.styl](https://github.com/loadingio/css-spinner/blob/master/basic.styl) if you are going to build by yourself. See following section for more detail. |
| 29 | +To use stylus files alone, you will have to provide variables listed in [vars.styl](https://github.com/loadingio/css-spinner/blob/master/vars.styl). |
31 | 30 |
|
32 | 31 |
|
33 | | -## Customization |
| 32 | +## Build |
34 | 33 |
|
35 | | -To customize speed and color of a loader, first ensure you have stylus install locally ( you will need npm too ): |
| 34 | +You can also customize all these loaders by building them yourself. |
36 | 35 |
|
37 | | - npm install -g stylus |
| 36 | + * First, update `vars.styl` based on your needs. |
| 37 | + * make sure required packages are installed by `npm install`. You will need NPM / NodeJS pre-installed. |
| 38 | + * build with this command: `npm run build` |
| 39 | + - generated files will be in `dist/` folder. |
38 | 40 |
|
39 | 41 |
|
40 | | -then, edit vars.styl with your desired configuration. for now you can edit the following style of a spinner: |
41 | | - |
42 | | - * size |
43 | | - * color |
44 | | - * speed |
45 | | - |
46 | | - |
47 | | -once you've done with the editing, run stylus to build yourself a css file: |
48 | | - |
49 | | - stylus -o . --import vars.styl --import basic.styl src/<desired-loader>/main.styl |
50 | | - |
51 | | - |
52 | | -use the generated main.css together with build/<desired-loader>/main.html to add this loader in your project. |
53 | | - |
54 | | - |
55 | | -Browser Compatibility |
56 | | ----------------- |
| 42 | +## Browser Compatibility |
57 | 43 |
|
58 | 44 | These spinners use CSS Animation and Transformation which is widely supported by major modern browsers except IE<=9. To support older browsers like IE9, please use [loading.io](https://loading.io/animation/icon/) to generate alternative GIF Loaders instead. |
59 | 45 |
|
60 | 46 |
|
61 | 47 |
|
62 | | -License |
63 | | ----------------- |
| 48 | +## License |
64 | 49 |
|
65 | 50 | All loader files here are released under CC0 License. However, you could attribute to this link: [loading.io css spinner ( https://loading.io/css/ )](https://loading.io/css/) to give loading.io a thumbs-up. |
66 | 51 |
|
| 52 | +Other source codes are released under MIT License. |
| 53 | + |
67 | 54 |
|
68 | | -Other Resources |
69 | | ----------------- |
| 55 | +## Other Resources |
70 | 56 |
|
71 | 57 | If you want to make custom css loading animation, loading.io also provides [loading.css](https://loading.io/animation/) - A pure CSS loading animation library, and a [helper GIF builder](https://loading.io/animation/icon/). Don't forget to check it out and share your customized loader with us! |
72 | 58 |
|
0 commit comments