Skip to content

Commit f14a4cd

Browse files
committed
Updated transition time
1 parent fc25b3c commit f14a4cd

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

loader.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
background-color: rgba(0, 0, 0, 0.5);
1010
display: block;
1111

12-
-webkit-transition: ease-in-out 0.3s;
13-
-moz-transition: ease-in-out 0.3s;
14-
-o-transition: ease-in-out 0.3s;
15-
-ms-transition: ease-in-out 0.3s;
16-
transition: ease-in-out 0.3s;
12+
-webkit-transition: ease-in-out 0.1s;
13+
-moz-transition: ease-in-out 0.1s;
14+
-o-transition: ease-in-out 0.1s;
15+
-ms-transition: ease-in-out 0.1s;
16+
transition: ease-in-out 0.1s;
1717

1818
-webkit-box-sizing: border-box;
1919
-moz-box-sizing: border-box;
@@ -47,11 +47,11 @@ body.loader .loader_website span {
4747
margin-left: -24px;
4848
top: -50px;
4949

50-
-webkit-transition: ease-in-out 0.3s;
51-
-moz-transition: ease-in-out 0.3s;
52-
-o-transition: ease-in-out 0.3s;
53-
-ms-transition: ease-in-out 0.3s;
54-
transition: ease-in-out 0.3s;
50+
-webkit-transition: ease-in-out 0.1s;
51+
-moz-transition: ease-in-out 0.1s;
52+
-o-transition: ease-in-out 0.1s;
53+
-ms-transition: ease-in-out 0.1s;
54+
transition: ease-in-out 0.1s;
5555

5656
-webkit-box-shadow: #000 0px 5px 10px -5px;
5757
-moz-box-shadow: #000 0px 5px 10px -5px;

loader.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ var Loader = {
44
body: null,
55
html: '<span><svg width="40" height="40" version="1.1" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="15"></svg></span>',
66
cssClass: 'loader',
7-
open: function () {
7+
check: function () {
88
if (this.body == null) {
99
this.body = document.getElementsByTagName('body')[0];
1010
}
11+
},
12+
open: function () {
13+
this.check();
1114
if (!this.isOpen()) {
1215
this.loader = document.createElement('div');
1316
this.loader.setAttribute('id', 'loader');
@@ -21,18 +24,21 @@ var Loader = {
2124
return this;
2225
},
2326
close: function () {
27+
this.check();
2428
if (this.isOpen()) {
2529
this.body.classList.remove(this.cssClass);
2630
setTimeout(function () {
2731
Loader.loader.remove();
28-
}, 300);
32+
}, 100);
2933
}
3034
return this;
3135
},
3236
isOpen: function () {
37+
this.check();
3338
return this.body.classList.contains(this.cssClass);
3439
},
3540
ifOpened: function (callback, close) {
41+
this.check();
3642
if (this.isOpen()) {
3743
if (!!close)
3844
this.close();
@@ -43,6 +49,7 @@ var Loader = {
4349
return this;
4450
},
4551
ifClosed: function (callback, open) {
52+
this.check();
4653
if (!this.isOpen()) {
4754
if (!!open)
4855
this.open();

0 commit comments

Comments
 (0)