Skip to content

Commit 6b32f3e

Browse files
committed
Change animations duration
1 parent ac75e52 commit 6b32f3e

9 files changed

Lines changed: 27 additions & 25 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/***********************************************
2+
* Animation Settings
3+
***********************************************/
4+
5+
function animate(options) {
6+
var animationName = "animated " + options.name;
7+
var animationEnd = "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";
8+
$(options.selector)
9+
.addClass(animationName)
10+
.one(animationEnd,
11+
function(){
12+
$(this).removeClass(animationName);
13+
}
14+
);
15+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.animated {
2+
animation-duration: .5s;
3+
animation-delay: .1s;
4+
}

src/app/_common/header/nav/nav.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ $(function() {
22
$('.nav-profile > li > a').on('click', function() {
33
var $el = $(this).next();
44

5-
setAnimation({
5+
animate({
66
name: 'flipInX',
77
selector: $el
88
});

src/app/pages/error.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$(function() {
2-
setAnimation({
2+
animate({
33
name: 'flipInY',
44
selector: '.error-card > .error-title-block'
55
});
@@ -8,7 +8,7 @@ $(function() {
88
setTimeout(function(){
99
var $el = $('.error-card > .error-container');
1010

11-
setAnimation({
11+
animate({
1212
name: 'fadeInUp',
1313
selector: $el
1414
});

src/auth/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$(function() {
2-
setAnimation({
2+
animate({
33
name: 'pulse',
44
selector: '.auth-container > .card'
55
});

src/auth/login/login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $(function() {
2222
agree: "Please accept our policy"
2323
},
2424
invalidHandler: function() {
25-
setAnimation({
25+
animate({
2626
name: 'shake',
2727
selector: '.auth-container > .card'
2828
});

src/auth/reset/reset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $(function() {
1818
}
1919
},
2020
invalidHandler: function() {
21-
setAnimation({
21+
animate({
2222
name: 'shake',
2323
selector: '.auth-container > .card'
2424
});

src/auth/signup/signup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $(function() {
7575
agree: "Please accept our policy"
7676
},
7777
invalidHandler: function() {
78-
setAnimation({
78+
animate({
7979
name: 'shake',
8080
selector: '.auth-container > .card'
8181
});

src/main.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,4 @@ $(function() {
1313
NProgress.start();
1414

1515
// end loading bar
16-
NProgress.done();
17-
18-
19-
/***********************************************
20-
* Animation Settings
21-
***********************************************/
22-
23-
function setAnimation(options) {
24-
var animationName = "animated " + options.name;
25-
var animationEnd = "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";
26-
$(options.selector)
27-
.addClass(animationName)
28-
.one(animationEnd,
29-
function(){
30-
$(this).removeClass(animationName);
31-
}
32-
);
33-
}
16+
NProgress.done();

0 commit comments

Comments
 (0)