├── .gitignore
├── .babelrc
├── examples-src
├── index.js
└── App.vue
├── release-minor.bat
├── release-patch.bat
├── .editorconfig
├── src
├── index.js
└── components
│ └── Spinner.vue
├── LICENSE
├── examples
├── index.html
└── examples.bundle.js
├── index.html
├── package.json
├── README.md
└── dist
├── vue-simple-spinner.min.js
└── vue-simple-spinner.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | npm-debug.log
4 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"],
3 | "plugins": [
4 | "transform-object-rest-spread"
5 | ],
6 | "comments": false
7 | }
8 |
--------------------------------------------------------------------------------
/examples-src/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | const app = new Vue({
5 | el: '#app',
6 | render: h => h(App)
7 | })
8 |
--------------------------------------------------------------------------------
/release-minor.bat:
--------------------------------------------------------------------------------
1 | call npm version minor
2 | call yarn
3 | call yarn run build
4 | call git add package.json
5 | echo **** Don't forget to update the `gh-pages` branch and run `npm publish` ****
6 |
--------------------------------------------------------------------------------
/release-patch.bat:
--------------------------------------------------------------------------------
1 | call npm version patch
2 | call yarn
3 | call yarn run build
4 | call git add package.json
5 | echo **** Don't forget to update the `gh-pages` branch and run `npm publish` ****
6 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 2
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import VueSimpleSpinner from './components/Spinner.vue'
2 |
3 | // expose component to global scope
4 | if (typeof window !== 'undefined' && window.Vue) {
5 | Vue.component('vue-simple-spinner', VueSimpleSpinner)
6 | }
7 |
8 | export { VueSimpleSpinner }
9 |
10 | export default VueSimpleSpinner
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Dave Williams
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 |
--------------------------------------------------------------------------------
/examples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | vue-simple-spinner - A simple, flexible spinner for Vue.js
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | vue-simple-spinner - A simple, flexible spinner for Vue.js
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue-simple-spinner",
3 | "version": "1.2.10",
4 | "description": "A simple, flexible spinner for Vue.js",
5 | "author": "David Z. Williams ",
6 | "main": "dist/vue-simple-spinner.js",
7 | "scripts": {
8 | "dev": "cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.dev.js --open --inline --hot",
9 | "build:debug": "cross-env NODE_ENV=debug webpack --config build/webpack.dist.js",
10 | "build:release": "cross-env NODE_ENV=production webpack --config build/webpack.dist.js",
11 | "build:examples": "webpack --config build/webpack.examples.js",
12 | "build": "npm run build:debug && npm run build:release && npm run build:examples",
13 | "clean": "rimraf ./examples/examples.bundle.css ./examples/examples.bundle.js"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "git+https://github.com/dzwillia/vue-simple-spinner.git"
18 | },
19 | "keywords": [
20 | "vue",
21 | "vuejs",
22 | "ui",
23 | "components",
24 | "spinner",
25 | "progress"
26 | ],
27 | "license": "MIT",
28 | "bugs": {
29 | "url": "https://github.com/dzwillia/vue-simple-spinner/issues"
30 | },
31 | "homepage": "https://github.com/dzwillia/vue-simple-spinner/",
32 | "dependencies": {},
33 | "devDependencies": {
34 | "autoprefixer": "^6.7.7",
35 | "babel-core": "^6.0.0",
36 | "babel-loader": "^7.1.2",
37 | "babel-plugin-transform-object-rest-spread": "^6.26.0",
38 | "babel-preset-env": "^1.6.1",
39 | "cross-env": "^3.0.0",
40 | "css-loader": "^0.25.0",
41 | "deep-assign": "^2.0.0",
42 | "extract-text-webpack-plugin": "^3.0.0",
43 | "node-sass": "^4.7.2",
44 | "rimraf": "^2.6.1",
45 | "sass-loader": "^6.0.6",
46 | "vue": "^2.2.6",
47 | "vue-loader": "^11.3.3",
48 | "vue-style-loader": "^3.0.0",
49 | "vue-template-compiler": "^2.2.6",
50 | "webpack": "^3.5.6",
51 | "webpack-bundle-analyzer": "^2.2.1",
52 | "webpack-dev-server": "^2.7.1"
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vue-simple-spinner
2 | > A simple, flexible spinner for Vue.js
3 |
4 | vue-simple-spinner is designed to be a lightweight [Vue.js](http://vuejs.org) spinner requiring minimal configuration.
5 |
6 | ## Documentation
7 | [https://github.com/dzwillia/vue-simple-spinner/](https://github.com/dzwillia/vue-simple-spinner/)
8 |
9 | ## Demo
10 |
11 | [https://dzwillia.github.io/vue-simple-spinner/examples](https://dzwillia.github.io/vue-simple-spinner/examples)
12 |
13 | ## Requirements
14 | * [Vue.js](http://vuejs.org/) (^v2.1.4)
15 |
16 | ## Browser support
17 | IE 10+ (due to [CSS animation support](https://caniuse.com/#feat=css-animation)).
18 |
19 | ## Installation
20 |
21 | ### NPM
22 |
23 | ```bash
24 | npm install vue-simple-spinner --save
25 | ```
26 |
27 | ## Usage
28 | > All styling for this component is done via computed styles in the `Spinner.vue` component and requires no external CSS files.
29 |
30 | ### ES6
31 |
32 | *The following examples can also be used with CommonJS by replacing ES6-specific syntax with CommonJS equivalents.*
33 |
34 | ```js
35 | import Vue from 'vue'
36 | import Spinner from 'vue-simple-spinner'
37 |
38 | new Vue({
39 | components: {
40 | Spinner
41 | }
42 | })
43 | ```
44 |
45 | ### Globals (script tag)
46 |
47 | Add a script tag pointing to `dist/vue-simple-spinner.min.js` *after* adding Vue.
48 |
49 | Example:
50 |
51 | ```html
52 |
53 |
54 | ...
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
68 |
69 |
70 | ```
71 |
72 | ## Examples
73 |
74 | ### Medium size
75 | ```
76 |
77 | ```
78 |
79 | ### Custom line color
80 | ```
81 |
82 | ```
83 |
84 | ### Custom font size and message
85 | ```
86 |
87 | ```
88 |
89 | [More live code examples on JSFiddle](http://jsfiddle.net/dzwillia/kc5ka8zu)
90 |
91 | ## Options
92 |
93 | | Props | Type | Values | Default |
94 | | -------------- |:-----------------|:-----------------------------------------------|:-----------------|
95 | | size | Number \| String | tiny, small, medium, large, huge, massive, {n} | 32 |
96 | | line-size | Number | Any Number | 3 |
97 | | line-bg-color | String | Color | #eee |
98 | | line-fg-color | String | Color | #2196f3 |
99 | | speed | Number | Number (in seconds) | 0.8 |
100 | | spacing | Number | Number (in pixels) | 4 |
101 | | message | String | Text to display | _(empty string)_ |
102 | | font-size | Number | Number (in pixels) | 13 |
103 | | text-fg-color | String | Color | #555 |
104 |
105 | ## License
106 | vue-simple-spinner is open source and released under the [MIT License](LICENSE).
107 |
108 | Copyright (c) 2017 [David Z Williams](https://twitter.com/padredaveo).
109 |
110 | > *PS: I would love to know if you're using vue-simple-spinner. Tweet to me at [@padredaveo](https://twitter.com/padredaveo)*.
111 |
112 |
113 |
--------------------------------------------------------------------------------
/src/components/Spinner.vue:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
134 |
135 |
145 |
--------------------------------------------------------------------------------
/dist/vue-simple-spinner.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * vue-simple-spinner v1.2.10 (https://github.com/dzwillia/vue-simple-spinner)
3 | * (c) 2018 David Z. Williams
4 | * Released under the MIT License.
5 | */
6 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueSimpleSpinner=t():e.VueSimpleSpinner=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VueSimpleSpinner=void 0;var r=n(1),i=function(e){return e&&e.__esModule?e:{default:e}}(r);"undefined"!=typeof window&&window.Vue&&Vue.component("vue-simple-spinner",i.default),t.VueSimpleSpinner=i.default,t.default=i.default},function(e,t,n){n(2);var r=n(7)(n(8),n(9),null,null);e.exports=r.exports},function(e,t,n){var r=n(3);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(5)("d89557e4",r,!0)},function(e,t,n){t=e.exports=n(4)(),t.push([e.i,".vue-simple-spinner{transition:all .3s linear}@keyframes vue-simple-spinner-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;tn.parts.length&&(r.parts.length=n.parts.length)}else{for(var o=[],i=0;i0?n("div",{staticClass:"vue-simple-spinner-text",style:e.text_style},[e._v(e._s(e.message))]):e._e()])},staticRenderFns:[]}}]).default});
--------------------------------------------------------------------------------
/examples-src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
14 |
15 |
29 |
30 |
64 |
65 |
95 |
96 |
114 |
115 |
133 |
134 |
152 |
153 |
199 |
200 |
201 |
202 | Full Power of Vue.js
203 | With the power of the Vue.js virtual DOM, properties can be updated without needing to re-render the entire component.
204 |
205 |
206 |
207 |
Values change every 4 seconds
208 |
209 |
210 |
211 |
212 | | Property |
213 | Value |
214 |
215 |
216 |
217 |
218 | | Size: |
219 | {{spinner_size}}px |
220 |
221 |
222 | | Line Size: |
223 | {{spinner_line_size}}px |
224 |
225 |
226 | | Line Foreground Color: |
227 | {{spinner_line_fg_color}} |
228 |
229 |
230 | | Line Background Color: |
231 | {{spinner_line_bg_color}} |
232 |
233 |
234 | | Speed: |
235 | {{spinner_speed}}s |
236 |
237 |
238 | | Spacing: |
239 | {{spinner_spacing}}px |
240 |
241 |
242 | | Message: |
243 | "{{spinner_message}}" |
244 |
245 |
246 | | Font Size: |
247 | {{spinner_font_size}}px |
248 |
249 |
250 | | Text Foreground Color: |
251 | {{spinner_text_fg_color}} |
252 |
253 |
254 |
255 |
256 |
257 |
261 |
262 |
263 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
347 |
348 |
386 |
--------------------------------------------------------------------------------
/dist/vue-simple-spinner.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * vue-simple-spinner v1.2.10 (https://github.com/dzwillia/vue-simple-spinner)
3 | * (c) 2018 David Z. Williams
4 | * Released under the MIT License.
5 | */
6 | (function webpackUniversalModuleDefinition(root, factory) {
7 | if(typeof exports === 'object' && typeof module === 'object')
8 | module.exports = factory();
9 | else if(typeof define === 'function' && define.amd)
10 | define([], factory);
11 | else if(typeof exports === 'object')
12 | exports["VueSimpleSpinner"] = factory();
13 | else
14 | root["VueSimpleSpinner"] = factory();
15 | })(this, function() {
16 | return /******/ (function(modules) { // webpackBootstrap
17 | /******/ // The module cache
18 | /******/ var installedModules = {};
19 | /******/
20 | /******/ // The require function
21 | /******/ function __webpack_require__(moduleId) {
22 | /******/
23 | /******/ // Check if module is in cache
24 | /******/ if(installedModules[moduleId]) {
25 | /******/ return installedModules[moduleId].exports;
26 | /******/ }
27 | /******/ // Create a new module (and put it into the cache)
28 | /******/ var module = installedModules[moduleId] = {
29 | /******/ i: moduleId,
30 | /******/ l: false,
31 | /******/ exports: {}
32 | /******/ };
33 | /******/
34 | /******/ // Execute the module function
35 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
36 | /******/
37 | /******/ // Flag the module as loaded
38 | /******/ module.l = true;
39 | /******/
40 | /******/ // Return the exports of the module
41 | /******/ return module.exports;
42 | /******/ }
43 | /******/
44 | /******/
45 | /******/ // expose the modules object (__webpack_modules__)
46 | /******/ __webpack_require__.m = modules;
47 | /******/
48 | /******/ // expose the module cache
49 | /******/ __webpack_require__.c = installedModules;
50 | /******/
51 | /******/ // define getter function for harmony exports
52 | /******/ __webpack_require__.d = function(exports, name, getter) {
53 | /******/ if(!__webpack_require__.o(exports, name)) {
54 | /******/ Object.defineProperty(exports, name, {
55 | /******/ configurable: false,
56 | /******/ enumerable: true,
57 | /******/ get: getter
58 | /******/ });
59 | /******/ }
60 | /******/ };
61 | /******/
62 | /******/ // getDefaultExport function for compatibility with non-harmony modules
63 | /******/ __webpack_require__.n = function(module) {
64 | /******/ var getter = module && module.__esModule ?
65 | /******/ function getDefault() { return module['default']; } :
66 | /******/ function getModuleExports() { return module; };
67 | /******/ __webpack_require__.d(getter, 'a', getter);
68 | /******/ return getter;
69 | /******/ };
70 | /******/
71 | /******/ // Object.prototype.hasOwnProperty.call
72 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
73 | /******/
74 | /******/ // __webpack_public_path__
75 | /******/ __webpack_require__.p = "";
76 | /******/
77 | /******/ // Load entry module and return exports
78 | /******/ return __webpack_require__(__webpack_require__.s = 0);
79 | /******/ })
80 | /************************************************************************/
81 | /******/ ([
82 | /* 0 */
83 | /***/ (function(module, exports, __webpack_require__) {
84 |
85 | "use strict";
86 |
87 |
88 | Object.defineProperty(exports, "__esModule", {
89 | value: true
90 | });
91 | exports.VueSimpleSpinner = undefined;
92 |
93 | var _Spinner = __webpack_require__(1);
94 |
95 | var _Spinner2 = _interopRequireDefault(_Spinner);
96 |
97 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
98 |
99 | if (typeof window !== 'undefined' && window.Vue) {
100 | Vue.component('vue-simple-spinner', _Spinner2.default);
101 | }
102 |
103 | exports.VueSimpleSpinner = _Spinner2.default;
104 | exports.default = _Spinner2.default;
105 |
106 | /***/ }),
107 | /* 1 */
108 | /***/ (function(module, exports, __webpack_require__) {
109 |
110 |
111 | /* styles */
112 | __webpack_require__(2)
113 |
114 | var Component = __webpack_require__(7)(
115 | /* script */
116 | __webpack_require__(8),
117 | /* template */
118 | __webpack_require__(9),
119 | /* scopeId */
120 | null,
121 | /* cssModules */
122 | null
123 | )
124 |
125 | module.exports = Component.exports
126 |
127 |
128 | /***/ }),
129 | /* 2 */
130 | /***/ (function(module, exports, __webpack_require__) {
131 |
132 | // style-loader: Adds some css to the DOM by adding a