strike stuff

This commit is contained in:
ntr
2019-09-16 15:26:44 +10:00
parent 0edfe55387
commit 50f2afd657
4 changed files with 26 additions and 19 deletions
+11 -4
View File
@@ -20,6 +20,12 @@ class Strike extends Component {
}
render() {
// const { x, y } = (this.props && this.props.direction) || { x: 0, y: 0 };
// const angle = (Math.atan(y / x) * (180 / Math.PI)) + 90;
// console.log(x, -y);
// console.log(angle);
// can't get this shit to work
return (
<svg
class='strike-anim'
@@ -32,8 +38,9 @@ class Strike extends Component {
<feDisplacementMap in2="turbulence" in="SourceGraphic" scale="1" xChannelSelector="R" yChannelSelector="G"></feDisplacementMap>
</filter>
<g>
<rect x="200" y="400"
width="12" height="100" stroke-width="0" fill={COLOURS.RED} style={{ filter: 'url("#strikeFilter")' }} />
<rect x="200" y="400"
width="12" height="100" stroke-width="0" fill={COLOURS.RED} style={{ filter: 'url("#strikeFilter")' }}
/>
</g>
</svg>
);
@@ -43,11 +50,11 @@ class Strike extends Component {
this.animations.push(anime({
targets: ['#strike rect'],
easing: 'easeOutExpo',
y: [400, 200, 200],
y: [800, 100, 100],
x: [200, 0, 200],
height: [200, 10, 0],
width: [20, 400, 0],
delay: TIMES.TARGET_DELAY_MS,
delay: TIMES.TARGET_DELAY_MS / 2,
duration: TIMES.TARGET_DURATION_MS,
}));