diff --git a/client/src/components/animations.jsx b/client/src/components/animations.jsx index c8e7bb43..571c57dd 100644 --- a/client/src/components/animations.jsx +++ b/client/src/components/animations.jsx @@ -11,6 +11,7 @@ const Block = require('./anims/block'); const Buff = require('./anims/buff'); const Debuff = require('./anims/debuff'); const Curse = require('./anims/curse'); +const Haste = require('./anims/haste'); const Stun = require('./anims/stun'); const Heal = require('./anims/heal'); const Hex = require('./anims/hex'); @@ -111,6 +112,7 @@ function animations(props) { case 'Slay': return ; case 'Heal': return ; case 'Hex': return ; + case 'Haste': return ; case 'Siphon': return ; case 'SiphonTick': return ; case 'Stun': return ; diff --git a/client/src/components/anims/bash.jsx b/client/src/components/anims/bash.jsx index 57fae4aa..b02ef747 100644 --- a/client/src/components/anims/bash.jsx +++ b/client/src/components/anims/bash.jsx @@ -14,7 +14,7 @@ class Bash extends Component { render() { return ( + + + + + + + + + + + ); + } + + componentDidMount() { + this.animations.push(anime({ + targets: ['#haste'], + opacity: 1, + + easing: 'easeOutExpo', + delay: TIMES.TARGET_DELAY_MS, + duration: TIMES.TARGET_DELAY_MS, + })); + + this.animations.push(anime({ + targets: ['#haste'], + transform: 'perspective(500px)', + easing: 'easeOutExpo', + duration: TIMES.START_SKILL, + })); + + this.animations.push(anime({ + targets: ['#hasteFilter feTurbulence', ' #hasteFilter feDisplacementMap'], + baseFrequency: 0, + scale: 1, + easing: 'easeOutSine', + + delay: TIMES.TARGET_DELAY_MS, + duration: TIMES.TARGET_DURATION_MS, + })); + } + + // this is necessary because + // skipping / timing / unmounting race conditions + // can cause the animations to cut short, this will ensure the values are reset + // because preact will recycle all these components + componentWillUnmount() { + for (let i = this.animations.length - 1; i >= 0; i--) { + this.animations[i].reset(); + } + } +} + +module.exports = Haste; diff --git a/client/src/components/anims/stun.jsx b/client/src/components/anims/stun.jsx index 41e72c3d..adaf2b8d 100644 --- a/client/src/components/anims/stun.jsx +++ b/client/src/components/anims/stun.jsx @@ -23,24 +23,23 @@ class Stun extends Component { id="stun" xmlns="http://www.w3.org/2000/svg" viewBox="-291 -291 582 582"> - - - - - - - + + + + ); @@ -66,13 +65,12 @@ class Stun extends Component { })); this.animations.push(anime({ - targets: ['#stunFilter feTurbulence', '#stunFilter feDisplacementMap'], - baseFrequency: 0, - scale: 1, - easing: 'easeOutSine', - - delay: TIMES.TARGET_DELAY_MS, - duration: TIMES.TARGET_DURATION_MS, + targets: ['#stun'], + scale: [1, 0.8], + strokeWidth: 0, + easing: 'easeInOutSine', + direction: 'alternate', + duration: TIMES.START_SKILL, })); }