diff --git a/client/src/components/animations.jsx b/client/src/components/animations.jsx index 861f3193..f330a561 100644 --- a/client/src/components/animations.jsx +++ b/client/src/components/animations.jsx @@ -18,6 +18,7 @@ const Haste = require('./anims/haste'); const Stun = require('./anims/stun'); const Heal = require('./anims/heal'); const Hex = require('./anims/hex'); +const Hybrid = require('./anims/hybrid'); const Strike = require('./anims/strike'); const Parry = require('./anims/parry'); const Purify = require('./anims/purify'); @@ -117,7 +118,7 @@ function animations(props) { case 'Triage': return ; case 'TriageTick': return false; case 'Scatter': return false; - case 'Hybrid': return false; + case 'Hybrid': return ; case 'Taunt': return false; // Debuff base diff --git a/client/src/components/anims/hybrid.jsx b/client/src/components/anims/hybrid.jsx new file mode 100644 index 00000000..6fc77d39 --- /dev/null +++ b/client/src/components/anims/hybrid.jsx @@ -0,0 +1,98 @@ +const preact = require('preact'); +const { Component } = require('preact'); +const anime = require('animejs').default; + +const { TIMES, COLOURS } = require('../../constants'); + +class Hybrid extends Component { + constructor() { + super(); + this.animations = []; + } + + render() { + return ( + + + + + + + + + + + + + + + ); + } + + componentDidMount() { + this.animations.push(anime({ + targets: ['#hybrid'], + opacity: [ + { value: 1, delay: TIMES.TARGET_DELAY_MS, duration: TIMES.TARGET_DURATION_MS * 0.2 }, + { value: 0, delay: TIMES.TARGET_DURATION_MS * 0.6, duration: TIMES.TARGET_DURATION_MS * 0.2 }, + ], + transform: { + value: ['rotate(0)', 'rotate(360)'], + delay: TIMES.TARGET_DELAY_MS, + duration: TIMES.TARGET_DURATION_MS, + direction: 'alternate', + }, + easing: 'easeInOutSine', + })); + + this.animations.push(anime({ + targets: ['#hybrid circle.green'], + cx: [50, 250, 50, 250], + delay: TIMES.TARGET_DELAY_MS, + duration: TIMES.TARGET_DURATION_MS, + easing: 'easeInOutSine', + loop: true, + })); + + this.animations.push(anime({ + targets: ['#hybrid circle.bluewhite'], + cy: [50, 250, 50, 250], + delay: TIMES.TARGET_DELAY_MS, + duration: TIMES.TARGET_DURATION_MS, + easing: 'easeInOutSine', + loop: true, + })); + + } +} + +module.exports = Hybrid;