Skip to content

armgit / anime

Public Imported from GitHub
0

JavaScript animation engine

Better blur animation

Julian Garnier80938628a7b8
diff --git a/website/css/styles.css b/website/css/styles.css
index 48289092..eace324b 100644
--- a/website/css/styles.css
+++ b/website/css/styles.css
@@ -102,8 +102,8 @@ a {
/* blur effects only on Chrome */
@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) {
- .sphere { filter: url(#sphereBlur); }
- .logo-letter { filter: url(#blur); }
+ .sphere.blurred { filter: url(#sphereBlur); }
+ .anime-logo-signs.blurred .logo-letter { filter: url(#blur); }
}
.bounce {
diff --git a/website/js/scripts.js b/website/js/scripts.js
index 25b01fa7..f7a8eaec 100644
--- a/website/js/scripts.js
+++ b/website/js/scripts.js
@@ -40,6 +40,9 @@ var logoAnimation = (function() {
easing: 'easeInOutCirc',
delay: function(el, i) {
return i * 35
+ },
+ begin: function() {
+ document.querySelector('.sphere').classList.add('blurred');
}
});
@@ -86,13 +89,19 @@ var logoAnimation = (function() {
strokeDashoffset: [anime.setDashoffset, 0],
easing: 'easeInOutSine',
duration: function(el) { return getPathDuration(el, 2) },
- delay: function(el, i) { return 250 + anime.random(0, 200) }
+ delay: function(el, i) { return 250 + anime.random(0, 200) },
+ begin: function() {
+ document.querySelector('.anime-logo-signs').classList.add('blurred');
+ }
})
.add({
targets: '#blur feGaussianBlur',
stdDeviation: 0,
easing: 'linear',
duration: 500,
+ complete: function() {
+ document.querySelector('.anime-logo-signs').classList.remove('blurred');
+ }
}, '-=750')
.add({
targets: ['.logo-letter', '.dot'],