clear dom anim classes with small delay between resolutions

This commit is contained in:
Mashy
2019-07-08 15:29:45 +10:00
parent 41eb476c31
commit 2acb4d276f
5 changed files with 26 additions and 20 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ const { TIMES } = require('../constants');
function animations(props) {
const { game, account, resolution, player, construct, avatarAnimation, setAvatarAnimation } = props;
if (!resolution) return false;
if (!resolution || resolution === 'clear') return false;
const [, event] = resolution.event;
if (!event || !event.skill) return false;
if (!resolution.target) return false;
-1
View File
@@ -55,7 +55,6 @@ class Strike extends Component {
<feGaussianBlur stdDeviation="4"/>
<feTurbulence type="turbulence" baseFrequency="0.01" numOctaves="3" result="turbulence"/>
<feDisplacementMap in2="turbulence" in="SourceGraphic" scale="1" xChannelSelector="A" yChannelSelector="A"/>
</filter>
{this.charges}
</svg>
+19 -13
View File
@@ -81,23 +81,29 @@ class TargetSvg extends Component {
return <path d={path} />;
}
const arrows = resolution
? null
: outgoing.map(getPath);
if (resolution === 'clear') return false;
if (!resolution) {
return (
<svg id="targeting"
viewBox={`0 0 ${width} ${height}`}
preserveAspectRatio="none"
class="targeting-arrows">
{outgoing.map(getPath)}
</svg>
);
}
let skill = '';
if (resolution) {
if (resolution.event[1]) ([, { skill }] = resolution.event);
}
const resolutionText = resolution
? <text x={`${(width / 2) - 50}`} y={`${(height / 2) + 16}`} font-family="Jura" font-size="2em"> {skill} </text>
: null;
if (resolution.event[1]) ([, { skill }] = resolution.event);
return (
<svg id="targeting" viewBox={`0 0 ${width} ${height}`} preserveAspectRatio="none" class="targeting-arrows">
{arrows}
{resolutionText}
<text
x={`${(width / 2) - 50}`}
y={`${(height / 2) + 16}`}
font-family="Jura"
font-size="2em">
{skill}
</text>
</svg>
);
}