From 56f181cb8e843cc8b64618a16ed19c59c5f77de1 Mon Sep 17 00:00:00 2001 From: emily Date: Fri, 28 Apr 2017 08:10:10 +0100 Subject: [PATCH] changes vase SVG to inline SVG instead, related #269 --- .../rate-goal/animations/cactus.jsx | 72 +++++++++++-------- 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/app/components/rate-goal/animations/cactus.jsx b/app/components/rate-goal/animations/cactus.jsx index be1e455..b47c578 100644 --- a/app/components/rate-goal/animations/cactus.jsx +++ b/app/components/rate-goal/animations/cactus.jsx @@ -38,16 +38,16 @@ const createAnimation = ({target, options, }) => { let t1 = new TimelineMax(); const getFrames = (frames, score, previousScore) => - score > previousScore - ? frames.slice(previousScore, score + 1) - : frames.slice(score, previousScore + 1).reverse(); + score > previousScore + ? frames.slice(previousScore, score + 1) + : frames.slice(score, previousScore + 1).reverse(); const bodySequence = getFrames(bodyFrames, options.score, options.previousScore); const armsSequence = getFrames(armFrames, options.score, options.previousScore); bodySequence.forEach((frame, index) => { t1.to(cactus3, 0.1, frame, ) - .to(arms, 0.1, armsSequence[index], '-=0.5'); + .to(arms, 0.1, armsSequence[index], '-=0.5'); }); t1.eventCallback('onComplete', options.setPreviousScore()); @@ -67,8 +67,8 @@ class Cactus extends React.Component { componentWillMount() { this.timerID = setInterval( - () => this.tick(), - 100); + () => this.tick(), + 100); } componentWillUnmount() { @@ -97,36 +97,50 @@ class Cactus extends React.Component { render() { return ( -
- +
+ + cactus_1 + Created with Sketch. + + + + + + + + + + + + - cactus_3 - Created with Sketch. - - - - - - - - - - - - - - - - - + cactus_3 + Created with Sketch. + + + + + + + + + + + + + + + + + -
+
); } -} + } Cactus.propTypes = { previousScore: React.PropTypes.int,