@kasko/fe-loading-indicator 1.1.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/loader.js CHANGED
@@ -1,13 +1,18 @@
1
1
  module.exports = function (config = {}) {
2
- let result = '<style title="li-loader">@keyframes spinner-loader{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}.hidden{display:none}#loader-wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1500}#loader-wrapper:not(.li-loaded){background:#222;opacity:.9}#loader,#loader::after,#loader::before{border-radius:50%;border:3px solid transparent}#loader{display:block;width:150px;height:150px;margin:-75px 0 0 -75px;z-index:1501;position:relative;left:50%;top:50%;border-top-color:"@color1";animation:spin 2s linear infinite}#loader::after,#loader::before{content:"";position:absolute;top:5px;left:5px;right:5px;bottom:5px;border-top-color:"@color2";animation:spin 3s linear infinite}#loader::after{top:15px;left:15px;right:15px;bottom:15px;border-top-color:"@color3";animation:spin 1.5s linear infinite}#loader-wrapper .loader-section{position:fixed;top:0;width:50%;height:100%;z-index:1500;transform:translateX(0)}.li-loaded .loader-section{background:#222;opacity:.9}#loader-wrapper .loader-section.section-left{left:0}#loader-wrapper .loader-section.section-right{right:0}#loader-wrapper.li-loaded .loader-section.section-left{transform:translateX(-100%);transition:all .7s .3s cubic-bezier(.645,.045,.355,1)}#loader-wrapper.li-loaded .loader-section.section-right{transform:translateX(100%);transition:all .7s .3s cubic-bezier(.645,.045,.355,1)}.li-loaded #loader{opacity:0;transition:all .3s ease-out}#loader-wrapper.li-loaded{visibility:hidden}.spinner-loader:not(:requigray){animation:spinner-loader 1500ms infinite linear;border-radius:.5em;box-shadow:#025983 1.5em 0 0 0,#025983 1.1em 1.1em 0 0,#025983 0 1.5em 0 0,#025983 -1.1em 1.1em 0 0,#025983 -1.5em 0 0 0,#025983 -1.1em -1.1em 0 0,#025983 0 -1.5em 0 0,#025983 1.1em -1.1em 0 0;display:inline-block;font-size:10px;width:1em;height:1em;margin:1.5em;overflow:hidden;text-indent:100%}</style> <div id="loader-wrapper" class="hidden"> <div id="loader"></div> <div class="loader-section section-left"></div> <div class="loader-section section-right"></div> </div> <script>function LoadingIndicator(){this.init=function(){var o=document.getElementById("loader-wrapper");o&&o.classList.remove("hidden")},this.hide=function(){const o=document.getElementById("loader-wrapper");o&&o.classList.add("li-loaded")},this.setColors=function(o){for(var t,e=0;e<document.styleSheets.length;e++){var n=document.styleSheets.item(e);if("li-loader"===n.title){t=n;break}}t&&(t.insertRule("#loader { border-top-color:"+o[0]+"!important;}"),t.insertRule("#loader::before { border-top-color:"+o[1]+"!important;}"),t.insertRule("#loader::after { border-top-color:"+o[2]+"!important;}"))}}const loadingIndicator=new LoadingIndicator;window.LoadingIndicator=loadingIndicator,window.LoadingIndicator.init();</script> ';
2
+ let result = '<style title="li-loader">@keyframes spinner-loader{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}.hidden{display:none}#kasko-loader-wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1500}#kasko-loader-wrapper:not(.li-loaded){background:"@overlaycolor";opacity:.9}#kasko-loader{display:block;position:relative;left:50%;top:50%;width:150px;height:150px;margin:-75px 0 0 -75px;border-radius:50%;border:3px solid transparent;border-top-color:"@color1";animation:spin 2s linear infinite;z-index:1501}#kasko-loader::after,#kasko-loader::before{content:"";position:absolute;top:5px;left:5px;right:5px;bottom:5px;border-radius:50%;border:3px solid transparent;border-top-color:"@color2";animation:spin 3s linear infinite}#kasko-loader::after{top:15px;left:15px;right:15px;bottom:15px;border-top-color:"@color3";animation:spin 1.5s linear infinite}#kasko-loader-wrapper .loader-section{position:fixed;top:0;width:50%;height:100%;z-index:1500;transform:translateX(0)}.li-loaded .loader-section{background:"@overlaycolor";opacity:.9}#kasko-loader-wrapper .loader-section.section-left{left:0}#kasko-loader-wrapper .loader-section.section-right{right:0}#kasko-loader-wrapper.li-loaded .loader-section.section-left{transform:translateX(-100%);transition:all .7s .3s cubic-bezier(.645,.045,.355,1)}#kasko-loader-wrapper.li-loaded .loader-section.section-right{transform:translateX(100%);transition:all .7s .3s cubic-bezier(.645,.045,.355,1)}.li-loaded #kasko-loader{opacity:0;transition:all .3s ease-out}#kasko-loader-wrapper.li-loaded{visibility:hidden}.spinner-loader:not(:requigray){animation:spinner-loader 1500ms infinite linear;border-radius:.5em;box-shadow:#025983 1.5em 0 0 0,#025983 1.1em 1.1em 0 0,#025983 0 1.5em 0 0,#025983 -1.1em 1.1em 0 0,#025983 -1.5em 0 0 0,#025983 -1.1em -1.1em 0 0,#025983 0 -1.5em 0 0,#025983 1.1em -1.1em 0 0;display:inline-block;font-size:10px;width:1em;height:1em;margin:1.5em;overflow:hidden;text-indent:100%}</style> <div id="kasko-loader-wrapper" class="hidden"> <div id="kasko-loader"></div> <div class="loader-section section-left"></div> <div class="loader-section section-right"></div> </div> <script>function LoadingIndicator(){this.init=function(){var o=document.getElementById("loader-wrapper");o&&o.classList.remove("hidden")},this.hide=function(){const o=document.getElementById("loader-wrapper");o&&o.classList.add("li-loaded")},this.setColors=function(o){for(var t,e=0;e<document.styleSheets.length;e++){var n=document.styleSheets.item(e);if("li-loader"===n.title){t=n;break}}t&&(t.insertRule("#loader { border-top-color:"+o[0]+"!important;}"),t.insertRule("#loader::before { border-top-color:"+o[1]+"!important;}"),t.insertRule("#loader::after { border-top-color:"+o[2]+"!important;}"))}}const loadingIndicator=new LoadingIndicator;window.LoadingIndicator=loadingIndicator,window.LoadingIndicator.init();</script> ';
3
3
 
4
4
  if (!config.colors) {
5
- config.colors = ['#ebbb2a', '#fff', '#a07c0f']
5
+ config.colors = ['#ebbb2a', '#fff', '#a07c0f'];
6
+ }
7
+
8
+ if (!config.overlayColor) {
9
+ config.overlayColor = '#222';
6
10
  }
7
11
 
8
12
  config.colors.forEach((color, index) => {
9
13
  result = result.replace('\"@color' + (index + 1) + '\"', color);
10
14
  });
11
15
 
16
+ result = result.replace(/\"@overlaycolor\"/g, config.overlayColor);
12
17
  return result;
13
18
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kasko/fe-loading-indicator",
3
3
  "shortname": "fe-loading-indicator",
4
- "version": "1.1.2",
4
+ "version": "1.3.0",
5
5
  "description": "Kasko frontend loading indicator",
6
6
  "license": "UNLICENSED",
7
7
  "main": "index.js",
@@ -16,10 +16,10 @@
16
16
  "dependencies": {},
17
17
  "devDependencies": {
18
18
  "gulp": "^3.9.1",
19
- "gulp-clean": "^0.3.2",
19
+ "gulp-clean": "^0.4.0",
20
20
  "gulp-csso": "^3.0.0",
21
21
  "gulp-less": "^3.3.2",
22
- "gulp-minify": "^1.0.0",
22
+ "gulp-minify": "^2.1.0",
23
23
  "gulp-replace": "^0.6.1",
24
24
  "run-sequence": "^2.2.0"
25
25
  },
package/src/loader.html CHANGED
@@ -1,6 +1,6 @@
1
1
  <link rel="stylesheet" href="loader.css">
2
- <div id="loader-wrapper" class="hidden">
3
- <div id="loader"></div>
2
+ <div id="kasko-loader-wrapper" class="hidden">
3
+ <div id="kasko-loader"></div>
4
4
  <div class="loader-section section-left"></div>
5
5
  <div class="loader-section section-right"></div>
6
6
  </div>
package/src/loader.less CHANGED
@@ -12,7 +12,7 @@
12
12
  display: none;
13
13
  }
14
14
 
15
- #loader-wrapper {
15
+ #kasko-loader-wrapper {
16
16
  position: fixed;
17
17
  top: 0;
18
18
  left: 0;
@@ -21,12 +21,12 @@
21
21
  z-index: 1500;
22
22
  }
23
23
 
24
- #loader-wrapper:not(.li-loaded) {
25
- background: #222;
24
+ #kasko-loader-wrapper:not(.li-loaded) {
25
+ background: "@overlaycolor";
26
26
  opacity: .9;
27
27
  }
28
28
 
29
- #loader {
29
+ #kasko-loader {
30
30
  display: block;
31
31
  position: relative;
32
32
  left: 50%;
@@ -41,7 +41,7 @@
41
41
  z-index: 1501;
42
42
  }
43
43
 
44
- #loader::before {
44
+ #kasko-loader::before {
45
45
  content: "";
46
46
  position: absolute;
47
47
  top: 5px;
@@ -54,7 +54,7 @@
54
54
  animation: spin 3s linear infinite;
55
55
  }
56
56
 
57
- #loader::after {
57
+ #kasko-loader::after {
58
58
  content: "";
59
59
  position: absolute;
60
60
  top: 15px;
@@ -77,7 +77,7 @@
77
77
  }
78
78
  }
79
79
 
80
- #loader-wrapper .loader-section {
80
+ #kasko-loader-wrapper .loader-section {
81
81
  position: fixed;
82
82
  top: 0;
83
83
  width: 50%;
@@ -87,36 +87,36 @@
87
87
  }
88
88
 
89
89
  .li-loaded .loader-section {
90
- background: #222;
90
+ background: "@overlaycolor";
91
91
  opacity: .9;
92
92
  }
93
93
 
94
- #loader-wrapper .loader-section.section-left {
94
+ #kasko-loader-wrapper .loader-section.section-left {
95
95
  left: 0;
96
96
  }
97
97
 
98
- #loader-wrapper .loader-section.section-right {
98
+ #kasko-loader-wrapper .loader-section.section-right {
99
99
  right: 0;
100
100
  }
101
101
 
102
102
  /* Loaded */
103
103
 
104
- #loader-wrapper.li-loaded .loader-section.section-left {
104
+ #kasko-loader-wrapper.li-loaded .loader-section.section-left {
105
105
  transform: translateX(-100%);
106
106
  transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
107
107
  }
108
108
 
109
- #loader-wrapper.li-loaded .loader-section.section-right {
109
+ #kasko-loader-wrapper.li-loaded .loader-section.section-right {
110
110
  transform: translateX(100%);
111
111
  transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
112
112
  }
113
113
 
114
- .li-loaded #loader {
114
+ .li-loaded #kasko-loader {
115
115
  opacity: 0;
116
116
  transition: all 0.3s ease-out;
117
117
  }
118
118
 
119
- #loader-wrapper.li-loaded {
119
+ #kasko-loader-wrapper.li-loaded {
120
120
  visibility: hidden;
121
121
  }
122
122