├── .babelrc ├── .bitmap ├── .browserslistrc ├── .circleci └── config.yml ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .prettierrc.json ├── LICENSE ├── README.md ├── _config.yml ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── components │ ├── CircleLoader.vue │ ├── DefaultLoader.vue │ ├── DualRingLoader.vue │ ├── EllipsisLoader.vue │ ├── FacebookLoader.vue │ ├── GridLoader.vue │ ├── HeartLoader.vue │ ├── HourglassLoader.vue │ ├── LineLoader.vue │ ├── OrbitalsLoader.vue │ ├── RingLoader.vue │ ├── RippleLoader.vue │ ├── RollerLoader.vue │ ├── SpinnerLoader.vue │ └── index.js ├── helpers │ ├── calcPropertyValue.js │ └── validateDuration.js ├── index.js ├── install.js └── main.js └── vue.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@vue/app" 5 | ] 6 | ] 7 | } -------------------------------------------------------------------------------- /.bitmap: -------------------------------------------------------------------------------- 1 | /* THIS IS A BIT-AUTO-GENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. */ 2 | 3 | { 4 | "joshk.vue-spinners-css/circle-loader@1.1.5": { 5 | "files": [ 6 | { 7 | "name": "CircleLoader.vue", 8 | "relativePath": "src/components/CircleLoader.vue", 9 | "test": false 10 | } 11 | ], 12 | "mainFile": "src/components/CircleLoader.vue", 13 | "origin": "AUTHORED", 14 | "exported": true 15 | }, 16 | "joshk.vue-spinners-css/default-loader@1.1.5": { 17 | "files": [ 18 | { 19 | "relativePath": "src/components/DefaultLoader.vue", 20 | "test": false, 21 | "name": "DefaultLoader.vue" 22 | } 23 | ], 24 | "mainFile": "src/components/DefaultLoader.vue", 25 | "origin": "AUTHORED", 26 | "exported": true 27 | }, 28 | "joshk.vue-spinners-css/dual-ring-loader@1.1.5": { 29 | "files": [ 30 | { 31 | "relativePath": "src/components/DualRingLoader.vue", 32 | "test": false, 33 | "name": "DualRingLoader.vue" 34 | } 35 | ], 36 | "mainFile": "src/components/DualRingLoader.vue", 37 | "origin": "AUTHORED", 38 | "exported": true 39 | }, 40 | "joshk.vue-spinners-css/ellipsis-loader@1.1.5": { 41 | "files": [ 42 | { 43 | "relativePath": "src/components/EllipsisLoader.vue", 44 | "test": false, 45 | "name": "EllipsisLoader.vue" 46 | } 47 | ], 48 | "mainFile": "src/components/EllipsisLoader.vue", 49 | "origin": "AUTHORED", 50 | "exported": true 51 | }, 52 | "joshk.vue-spinners-css/facebook-loader@1.1.5": { 53 | "files": [ 54 | { 55 | "relativePath": "src/components/FacebookLoader.vue", 56 | "test": false, 57 | "name": "FacebookLoader.vue" 58 | } 59 | ], 60 | "mainFile": "src/components/FacebookLoader.vue", 61 | "origin": "AUTHORED", 62 | "exported": true 63 | }, 64 | "joshk.vue-spinners-css/grid-loader@1.1.5": { 65 | "files": [ 66 | { 67 | "relativePath": "src/components/GridLoader.vue", 68 | "test": false, 69 | "name": "GridLoader.vue" 70 | } 71 | ], 72 | "mainFile": "src/components/GridLoader.vue", 73 | "origin": "AUTHORED", 74 | "exported": true 75 | }, 76 | "joshk.vue-spinners-css/heart-loader@1.1.5": { 77 | "files": [ 78 | { 79 | "relativePath": "src/components/HeartLoader.vue", 80 | "test": false, 81 | "name": "HeartLoader.vue" 82 | } 83 | ], 84 | "mainFile": "src/components/HeartLoader.vue", 85 | "origin": "AUTHORED", 86 | "exported": true 87 | }, 88 | "joshk.vue-spinners-css/helpers/calc-property-value@1.1.5": { 89 | "files": [ 90 | { 91 | "relativePath": "src/helpers/calcPropertyValue.js", 92 | "test": false, 93 | "name": "calcPropertyValue.js" 94 | } 95 | ], 96 | "mainFile": "src/helpers/calcPropertyValue.js", 97 | "origin": "AUTHORED", 98 | "exported": true 99 | }, 100 | "joshk.vue-spinners-css/helpers/validate-duration@1.1.5": { 101 | "files": [ 102 | { 103 | "relativePath": "src/helpers/validateDuration.js", 104 | "test": false, 105 | "name": "validateDuration.js" 106 | } 107 | ], 108 | "mainFile": "src/helpers/validateDuration.js", 109 | "origin": "AUTHORED", 110 | "exported": true 111 | }, 112 | "joshk.vue-spinners-css/hourglass-loader@1.1.5": { 113 | "files": [ 114 | { 115 | "relativePath": "src/components/HourglassLoader.vue", 116 | "test": false, 117 | "name": "HourglassLoader.vue" 118 | } 119 | ], 120 | "mainFile": "src/components/HourglassLoader.vue", 121 | "origin": "AUTHORED", 122 | "exported": true 123 | }, 124 | "joshk.vue-spinners-css/line-loader@1.1.5": { 125 | "files": [ 126 | { 127 | "relativePath": "src/components/LineLoader.vue", 128 | "test": false, 129 | "name": "LineLoader.vue" 130 | } 131 | ], 132 | "mainFile": "src/components/LineLoader.vue", 133 | "origin": "AUTHORED", 134 | "exported": true 135 | }, 136 | "joshk.vue-spinners-css/orbitals-loader@1.1.5": { 137 | "files": [ 138 | { 139 | "relativePath": "src/components/OrbitalsLoader.vue", 140 | "test": false, 141 | "name": "OrbitalsLoader.vue" 142 | } 143 | ], 144 | "mainFile": "src/components/OrbitalsLoader.vue", 145 | "origin": "AUTHORED", 146 | "exported": true 147 | }, 148 | "joshk.vue-spinners-css/ring-loader@1.1.5": { 149 | "files": [ 150 | { 151 | "relativePath": "src/components/RingLoader.vue", 152 | "test": false, 153 | "name": "RingLoader.vue" 154 | } 155 | ], 156 | "mainFile": "src/components/RingLoader.vue", 157 | "origin": "AUTHORED", 158 | "exported": true 159 | }, 160 | "joshk.vue-spinners-css/ripple-loader@1.1.5": { 161 | "files": [ 162 | { 163 | "relativePath": "src/components/RippleLoader.vue", 164 | "test": false, 165 | "name": "RippleLoader.vue" 166 | } 167 | ], 168 | "mainFile": "src/components/RippleLoader.vue", 169 | "origin": "AUTHORED", 170 | "exported": true 171 | }, 172 | "joshk.vue-spinners-css/roller-loader@1.1.5": { 173 | "files": [ 174 | { 175 | "relativePath": "src/components/RollerLoader.vue", 176 | "test": false, 177 | "name": "RollerLoader.vue" 178 | } 179 | ], 180 | "mainFile": "src/components/RollerLoader.vue", 181 | "origin": "AUTHORED", 182 | "exported": true 183 | }, 184 | "joshk.vue-spinners-css/spinner-loader@1.1.5": { 185 | "files": [ 186 | { 187 | "relativePath": "src/components/SpinnerLoader.vue", 188 | "test": false, 189 | "name": "SpinnerLoader.vue" 190 | } 191 | ], 192 | "mainFile": "src/components/SpinnerLoader.vue", 193 | "origin": "AUTHORED", 194 | "exported": true 195 | }, 196 | "version": "14.7.6" 197 | } -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # Javascript Node CircleCI 2.0 configuration file 2 | # 3 | # Check https://circleci.com/docs/2.0/language-javascript/ for more details 4 | # 5 | version: 2 6 | jobs: 7 | build:lib: 8 | docker: 9 | # specify the version you desire here 10 | - image: circleci/node:8.12.0 11 | 12 | # Specify service dependencies here if necessary 13 | # CircleCI maintains a library of pre-built images 14 | # documented at https://circleci.com/docs/2.0/circleci-images/ 15 | # - image: circleci/mongo:3.4.4 16 | 17 | working_directory: ~/repo 18 | 19 | steps: 20 | - checkout 21 | 22 | # Download and cache dependencies 23 | - restore_cache: 24 | keys: 25 | - v1-dependencies-{{ checksum "package.json" }} 26 | # fallback to using the latest cache if no exact match is found 27 | - v1-dependencies- 28 | 29 | - run: npm config set '@bit:registry' https://node.bit.dev && npm install 30 | 31 | - save_cache: 32 | paths: 33 | - node_modules 34 | key: v1-dependencies-{{ checksum "package.json" }} 35 | 36 | # run build:lib! 37 | - run: npm run build:lib 38 | build:bit: 39 | docker: 40 | # specify the version you desire here 41 | - image: circleci/node:8.12.0 42 | 43 | # Specify service dependencies here if necessary 44 | # CircleCI maintains a library of pre-built images 45 | # documented at https://circleci.com/docs/2.0/circleci-images/ 46 | # - image: circleci/mongo:3.4.4 47 | 48 | working_directory: ~/repo 49 | 50 | steps: 51 | - checkout 52 | 53 | # Download and cache dependencies 54 | - restore_cache: 55 | keys: 56 | - v1-dependencies-{{ checksum "package.json" }} 57 | # fallback to using the latest cache if no exact match is found 58 | - v1-dependencies- 59 | 60 | - run: npm config set '@bit:registry' https://node.bit.dev 61 | - run: npm install && sudo npm i bit-bin -g 62 | - run: bit config set analytics_reporting false && bit config set error_reporting false && bit config set user.token ${BIT_TOKEN} 63 | - run: bit import 64 | 65 | - save_cache: 66 | paths: 67 | - node_modules 68 | key: v1-dependencies-{{ checksum "package.json" }} 69 | 70 | # run build:lib! 71 | - run: npm run build:bit 72 | 73 | workflows: 74 | version: 2 75 | build:lib_and_build:bit: 76 | jobs: 77 | - build:lib 78 | - build:bit -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | build/*.js -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 4, 4 | "semi": false, 5 | "singleQuote": true, 6 | "printWidth": 120 7 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Josh Kuttler 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. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vue Spinners CSS Loaders ([React](https://github.com/JoshK2/react-spinners-css), [Angular](https://github.com/JoshK2/ng-spinners)) 2 | [](https://circleci.com/gh/JoshK2/vue-spinners-css) 3 | [](https://bit.dev/joshk/vue-spinners-css) 4 | [](https://www.npmjs.com/package/vue-spinners-css) 5 | [](https://github.com/JoshK2/vue-spinners-css/stargazers) 6 | [](https://github.com/prettier/prettier) 7 | [](https://raw.githubusercontent.com/JoshK2/vue-spinners-css/master/LICENSE) 8 | [](https://twitter.com/JoshKuttler) 9 | 10 |
13 | 14 | Amazing collection of Vue spinners components with pure css. 15 | The Vue spinners are based on loading.io and from all over the web. 16 | 17 | - 💅No extra CSS imports 18 | - ✂️Zero dependencies 19 | - 📦Spinners can be installing separately 20 | 21 | ## [Live Demo](https://bit.dev/joshk/vue-spinners-css) 22 | 23 | Browse components and explore their props with [Bit](https://bit.dev/joshk/vue-spinners-css). 24 | Install specific vue spinner component with npm, yarn, unpkg or bit without having to install the whole project. 25 | [Install components and live demo](https://bit.dev/joshk/vue-spinners-css) 26 | 27 | ## 🚀 List of Spinners - PropTypes and Default Props 28 | 29 | Each component accepts a `color` prop, and `loading` prop. 30 | The default `color` prop is `#7f58af`. 31 | The default `loading` prop is `true`. 32 | Component that accepts size prop have a default size in pixel. 33 | Component that accepts duration prop have a default duration in seconds. 34 | 35 | | Spinner | color: string | loading: boolean | size: number | duration: string | 36 | | ---------------- | ------------ | ----------------- | ------------ | ---------------- | 37 | | Circle Spinner | `#7f58af` | `true` | `64` | `2.4s` | 38 | | Default Spinner | `#7f58af` | `true` | `80` | `1.2s` | 39 | | DualRing Spinner | `#7f58af` | `true` | `80` | `1.2s` | 40 | | Ellipsis Spinner | `#7f58af` | `true` | | | 41 | | Facebook Spinner | `#7f58af` | `true` | `80` | `1.2s` | 42 | | Grid Spinner | `#7f58af` | `true` | `80` | `1.2s` | 43 | | Heart Spinner | `#7f58af` | `true` | `80` | `1.2s` | 44 | | Hourglass Spinner| `#7f58af` | `true` | `80` | `1.2s` | 45 | | Ring Spinner | `#7f58af` | `true` | `80` | `1.2s` | 46 | | Ripple Spinner | `#7f58af` | `true` | `80` | `1s` | 47 | | Roller Spinner | `#7f58af` | `true` | `80` | `1.2s` | 48 | | Spinner Spinner | `#7f58af` | `true` | `80` | `1.2s` | 49 | | Orbitals Spinner | `#7f58af` | `true` | `80` | `4s` | 50 | | Line Spinner | `#7f58af` | `true` | `80` | `1.2s` | 51 | 52 | ## 📦 Installation 53 | ### Using [npm](https://www.npmjs.com/package/vue-spinners-css) to install vue-spinners-css: 54 | 55 | ```bash 56 | $ npm i --save vue-spinners-css 57 | ``` 58 | 59 | ### Play and install vue spinners with Bit 60 | 61 | Install specific vue spinner component with bit, npm or yarn without having to install the whole project. 62 | Using [bit](https://bit.dev/joshk/vue-spinners-css) to play with live demo, and try the spinners before install. 63 | 64 | set npm regisetry config(one time action): 65 | ```bash 66 | npm config set '@bit:registry' https://node.bit.dev 67 | ``` 68 | and use your favorite package manager: 69 | ```bash 70 | npm i @bit/joshk.vue-spinners-css.facebook-loader 71 | yarn add @bit/joshk.vue-spinners-css.facebook-loader 72 | bit import joshk.vue-spinners-css/facebook-loader 73 | ``` 74 | 75 | ## 💻 Usage Examples 76 | 77 | you can use a random color from [jotils](https://bit.dev/joshk/jotils/get-random-color) 78 | 79 | ### Vue Global Registration 80 | ```javascript 81 | import Vue from 'vue' 82 | import * as VueSpinnersCss from "vue-spinners-css"; 83 | 84 | Vue.use(VueSpinnersCss) 85 | 86 | // Each spinner can now be used in your templates anywhere in the app! 87 | ``` 88 | 89 | ### Vue Local Registration 90 | ```html 91 | 92 |