improved transitions.

This commit is contained in:
Federico Zivolo 2014-08-25 13:57:22 +02:00
parent c2d4a54b53
commit 96d11df81f
3 changed files with 99 additions and 95 deletions

View File

@ -36,7 +36,7 @@
opacity: 1;
}
.ripple.ripple-out {
-webkit-transition: opacity 1s linear 0s !important;
transition: opacity 0.8s linear 0s !important;
-webkit-transition: opacity 0.1s linear 0s !important;
transition: opacity 0.1s linear 0s !important;
opacity: 0;
}

View File

@ -37,7 +37,7 @@
opacity: 1;
}
.ripple.ripple-out {
-webkit-transition: opacity 1s linear 0s !important;
transition: opacity 0.8s linear 0s !important;
-webkit-transition: opacity 0.1s linear 0s !important;
transition: opacity 0.1s linear 0s !important;
opacity: 0;
}

View File

@ -3,6 +3,10 @@ var ripples = {
init : function(withRipple) {
"use strict";
// animations time
var rippleOutTime = 100,
rippleStartTime = 500;
// Helper to bind events on dynamically created elements
var bind = function(event, selector, callback) {
document.addEventListener(event, function(e) {
@ -52,7 +56,7 @@ var ripples = {
$ripple.dataset.animating = 0;
document.dispatchEvent(rippleEnd);
}, 500);
}, rippleStartTime);
};
@ -63,7 +67,7 @@ var ripples = {
// Let ripple fade out (with CSS)
setTimeout(function() {
$ripple.remove();
}, 1000);
}, rippleOutTime);
};
// Helper, need to know if mouse is up or down