├── LICENSE ├── README.md ├── demo.html ├── package.json ├── style.css └── style.less /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Jason Miller 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `` [![NPM](http://img.shields.io/npm/v/progress-spinner.svg)](https://www.npmjs.com/package/progress-spinner) 2 | 3 | > A simple, CSS-only indeterminate spinner custom element. 4 | 5 | **Demo:** [codepen.io/developit/pen/xwJqeO](http://codepen.io/developit/pen/xwJqeO?editors=110) 6 | 7 | ![preview](https://i.gyazo.com/444842e7b26bab5ca2255b6131c969ec.gif) 8 | 9 | ## Usage 10 | 11 | Just import the CSS however you like, then use it: 12 | 13 | ```html 14 | 15 | 16 | 17 | 18 | 19 | ``` 20 | 21 | ## License 22 | 23 | MIT 24 | -------------------------------------------------------------------------------- /demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | progress-spinner element demo 5 | 6 | 31 | 32 | 33 |
34 |

<progress-spinner>

35 | 36 |
37 | 38 |
39 |

<progress-spinner dark>

40 | 41 |
42 | 43 |
44 |

<progress-spinner style="font-size:50px">

45 | 46 |
47 | 48 |

Dotted:

49 | 50 |
51 |

<progress-spinner>

52 | 53 |
54 | 55 |
56 |

<progress-spinner dark>

57 | 58 |
59 | 60 |
61 |

<progress-spinner style="font-size:50px">

62 | 63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "progress-spinner", 3 | "version": "1.1.0", 4 | "description": "A simple, CSS-only indeterminate spinner custom element.", 5 | "main": "style.css", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/developit/progress-spinner.git" 12 | }, 13 | "keywords": [ 14 | "spinner", 15 | "loading", 16 | "css", 17 | "style" 18 | ], 19 | "author": "Jason Miller ", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/developit/progress-spinner/issues" 23 | }, 24 | "homepage": "https://github.com/developit/progress-spinner#readme" 25 | } 26 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | progress-spinner { 2 | display: inline-block; 3 | width: 1em; 4 | height: 1em; 5 | border: 1px solid transparent; 6 | border-top-color: rgba(0, 0, 0, 0.6); 7 | border-radius: 50%; 8 | -webkit-animation: rotate 800ms linear infinite; 9 | animation: rotate 800ms linear infinite; 10 | } 11 | progress-spinner[dark] { 12 | border-top-color: rgba(255, 255, 255, 0.6); 13 | } 14 | progress-spinner[dotted] { 15 | border-width: 0; 16 | border-style: dotted; 17 | border-top-width: 2px; 18 | } 19 | @-webkit-keyframes rotate { 20 | 0% { 21 | -webkit-transform: rotate(0deg); 22 | transform: rotate(0deg); 23 | } 24 | 100% { 25 | -webkit-transform: rotate(360deg); 26 | transform: rotate(360deg); 27 | } 28 | } 29 | @keyframes rotate { 30 | 0% { 31 | -webkit-transform: rotate(0deg); 32 | transform: rotate(0deg); 33 | } 34 | 100% { 35 | -webkit-transform: rotate(360deg); 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /style.less: -------------------------------------------------------------------------------- 1 | progress-spinner { 2 | display: inline-block; 3 | width: 1em; 4 | height: 1em; 5 | border: 1px solid transparent; 6 | border-top-color: rgba(0,0,0,0.6); 7 | border-radius: 50%; 8 | animation: rotate 800ms linear infinite; 9 | 10 | &[dark] { 11 | border-top-color: rgba(255,255,255,0.6); 12 | } 13 | 14 | &[dotted] { 15 | border-width: 0; 16 | border-style: dotted; 17 | border-top-width: 2px; 18 | } 19 | } 20 | 21 | @keyframes rotate { 22 | 0% { transform: rotate(0deg); } 23 | 100% { transform: rotate(360deg); } 24 | } 25 | --------------------------------------------------------------------------------