From e78a502a40f73b0813375df2859926b2d5f4009b Mon Sep 17 00:00:00 2001 From: Mashy Date: Thu, 28 Nov 2019 15:54:37 +1000 Subject: [PATCH] PogU --- client/assets/styles/game.less | 4 ++-- client/src/components/game.construct.jsx | 21 +++++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/client/assets/styles/game.less b/client/assets/styles/game.less index 86b9cf14..e6f1c735 100644 --- a/client/assets/styles/game.less +++ b/client/assets/styles/game.less @@ -40,7 +40,7 @@ .combat-text { left: 15%; - top: 40%; + top: 0%; } } @@ -79,7 +79,7 @@ .combat-text { left: 15%; - top: 40%; + top: 100%; } .effects { diff --git a/client/src/components/game.construct.jsx b/client/src/components/game.construct.jsx index 2f1c0617..8172c3fc 100644 --- a/client/src/components/game.construct.jsx +++ b/client/src/components/game.construct.jsx @@ -1,13 +1,13 @@ -const { connect } = require('preact-redux'); -const { Component } = require('preact'); const preact = require('preact'); +const { connect } = require('preact-redux'); +const anime = require('animejs').default; const range = require('lodash/range'); const reactStringReplace = require('react-string-replace'); const { STATS, removeTier } = require('../utils'); const { ConstructAvatar, ConstructText } = require('./construct'); const shapes = require('./shapes'); -const { INFO } = require('./../constants'); +const { INFO, TIMES } = require('./../constants'); const actions = require('../actions'); const SkillBtn = require('./skill.btn'); @@ -20,6 +20,19 @@ class combatText extends preact.Component { return false; } + componentDidUpdate(prevProps) { + const { animText, construct } = this.props; + if (animText && animText !== prevProps.animText && animText.constructId === construct.id) { + anime({ + targets: '.combat-text', + top: '40%', + duration: TIMES.POST_SKILL_DURATION_MS, + }); + + console.log('grep'); + } + } + render(props) { const { construct, animText, itemInfo } = props; if (animText && animText.constructId === construct.id) { @@ -132,7 +145,7 @@ const eventClasses = (animating, animFocus, construct, postSkill) => { return postSkill.css; }; -class GameConstruct extends Component { +class GameConstruct extends preact.Component { constructor() { super(); this.resolvedLength = 0;