anim colour changes

This commit is contained in:
Mashy 2019-06-24 22:34:56 +10:00
parent 0e1098fa55
commit 93a915646a
2 changed files with 9 additions and 3 deletions

View File

@ -7,7 +7,6 @@ const { randomPoints } = require('../../utils');
const duration = TIMES.START_SKILL; const duration = TIMES.START_SKILL;
function projectile(x, y, radius, colour) { function projectile(x, y, radius, colour) {
return ( return (
<circle <circle
@ -69,6 +68,14 @@ class AttackCharge extends Component {
rotate: Math.random() * 180 + 270, rotate: Math.random() * 180 + 270,
}); });
} }
const projectiles = document.querySelectorAll('#projectile');
projectiles.forEach(proj => {
const colour = Math.random() >= 0.5 ? '#a52a2a' : '#3498db';
anime.set(proj, {
stroke: colour,
});
});
anime.set('.skill-anim', { anime.set('.skill-anim', {
translateY: -200, translateY: -200,
translateX: 0, translateX: 0,
@ -94,7 +101,6 @@ class AttackCharge extends Component {
easing: 'easeInQuad', easing: 'easeInQuad',
}); });
const projectiles = document.querySelectorAll('#projectile');
projectiles.forEach(proj => anime({ projectiles.forEach(proj => anime({
targets: proj, targets: proj,
cx: Math.random() * 250 + 25, cx: Math.random() * 250 + 25,

View File

@ -37,7 +37,7 @@ class AttackCharge extends Component {
super(); super();
this.team = props.team; this.team = props.team;
// this.colour = props.colour; // this.colour = props.colour;
this.colour = '#c5a443'; this.colour = '#a52a2a';
const points = new Array(30).fill(0); const points = new Array(30).fill(0);
this.charges = points.map(() => projectile(150, 420, 7, '#1FF01F')); this.charges = points.map(() => projectile(150, 420, 7, '#1FF01F'));
} }