Skip to content

armgit / anime

Public Imported from GitHub
0

JavaScript animation engine

Cleanup website animation

Julian Garnier48515b88f74a
diff --git a/index.html b/index.html
index 86893ec7..75ff4ac0 100644
--- a/index.html
+++ b/index.html
@@ -21,11 +21,7 @@
<svg class="filters" version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter id="blur" class="filter">
- <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
- <feBlend in="SourceGraphic" in2="blur" />
- </filter>
- <filter id="sphereBlur" class="filter">
- <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
+ <feGaussianBlur in="SourceGraphic" stdDeviation="0" result="blur" />
<feBlend in="SourceGraphic" in2="blur" />
</filter>
</defs>
diff --git a/website/css/styles.css b/website/css/styles.css
index eace324b..36c0db87 100644
--- a/website/css/styles.css
+++ b/website/css/styles.css
@@ -97,13 +97,14 @@ a {
.logo-letter {
overflow: visible;
+ transform: translate3d(0,0,0);
}
/* blur effects only on Chrome */
@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) {
- .sphere.blurred { filter: url(#sphereBlur); }
- .anime-logo-signs.blurred .logo-letter { filter: url(#blur); }
+ .blurred { filter: url(#blur); }
+ .logo-letter.blurred { filter: url(#letterBlur); }
}
.bounce {
@@ -119,6 +120,7 @@ a {
.line {
stroke-width: 2;
/*stroke: #FFF;*/
+ transform: translate3d(0,0,0);
}
.letter-a .line:nth-child(1) { stroke: #1CE2B2; }
@@ -149,6 +151,7 @@ a {
width: 400px;
height: 400px;
margin: -200px 0 0 -200px;
+ transform: translate3d(0,0,0);
}
/* Logo nav */
diff --git a/website/js/scripts.js b/website/js/scripts.js
index f7a8eaec..eab3353d 100644
--- a/website/js/scripts.js
+++ b/website/js/scripts.js
@@ -42,7 +42,17 @@ var logoAnimation = (function() {
return i * 35
},
begin: function() {
- document.querySelector('.sphere').classList.add('blurred');
+ anime({
+ targets: '#blur feGaussianBlur',
+ stdDeviation: [
+ {value: 30, duration: 750, easing: 'easeOutSine'},
+ {value: 10, duration: 800, easing: 'easeInOutSine'}
+ ],
+ delay: 750,
+ begin: function() {
+ document.querySelector('.sphere').classList.add('blurred');
+ }
+ })
}
});
@@ -84,36 +94,39 @@ var logoAnimation = (function() {
logoAnimationTL
.add({
- targets: '.line',
- strokeWidth: function() { return [anime.random(1, 12), 4] },
- strokeDashoffset: [anime.setDashoffset, 0],
- easing: 'easeInOutSine',
- duration: function(el) { return getPathDuration(el, 2) },
- delay: function(el, i) { return 250 + anime.random(0, 200) },
- begin: function() {
- document.querySelector('.anime-logo-signs').classList.add('blurred');
- }
+ targets: '.logo-letter',
+ translateX: function(el) {
+ if (el.classList.contains('letter-a')) return [-256, 56];
+ if (el.classList.contains('letter-n')) return [56, 56];
+ if (el.classList.contains('letter-i')) return [56, 56];
+ if (el.classList.contains('letter-m')) return [0, 0];
+ if (el.classList.contains('letter-e')) return [256, -56];
+ },
+ translateY: function(el) {
+ if (el.classList.contains('letter-a')) return [0, 0];
+ if (el.classList.contains('letter-n')) return [200, 0];
+ if (el.classList.contains('letter-i')) return [-200, 0];
+ if (el.classList.contains('letter-m')) return [200, 0];
+ if (el.classList.contains('letter-e')) return [0, 0];
+ },
+ easing: 'easeOutElastic(.8, 1.2)',
+ duration: 1200,
+ delay: function(el, i, t) { return i * 40 },
})
.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'],
- translateZ: [.1, 0],
- duration: 500
- }, '-=500')
+ targets: '.line',
+ strokeWidth: [0, 4],
+ strokeDashoffset: [anime.setDashoffset, 0],
+ easing: 'easeInOutQuad',
+ duration: function(el) { return 200 + getPathDuration(el, 2) },
+ delay: function(el, i, t) { return ((Math.ceil((i+1)/3) * 1) * 1) + (i * 10) },
+ }, 0)
.add({
targets: '.letter-m .line',
strokeDasharray: 0,
easing: 'linear',
duration: .1,
- }, '-=100')
+ }, '-=500')
.add({
targets: '.dot',
easing: 'cubicBezier(0.350, 0.560, 0.305, 1)',
@@ -122,13 +135,13 @@ var logoAnimation = (function() {
translateZ: 0,
scaleY: [4, .7],
scaleX: { value: 1.3, delay: 100, duration: 200},
- }, '-=100')
+ }, '-=500')
.add({
targets: '.letter-m .line',
easing: 'easeOutElastic(1, .8)',
duration: 600,
d: function(el) { return el.dataset.d2 }
- }, '-=190')
+ }, '-=290')
.add({
targets: ['.letter-a', '.letter-n', '.letter-i'],
translateX: 0,
@@ -155,7 +168,6 @@ var logoAnimation = (function() {
{ value: [1, 1.5], duration: 50, easing: 'easeInSine' },
{ value: 1, duration: 50, easing: 'easeOutSine' }
],
- // easing: 'cubicBezier(0.000, 0.740, 1.000, 0.255)',
easing: 'cubicBezier(0.000, 0.740, 1.000, 0.255)',
duration: 800,
}, '-=650')