Skip to content

Commit

Permalink
adds arrow animation above line chart
Browse files Browse the repository at this point in the history
whole line chart is clickable and links to line-chart-detail view
related ##286
  • Loading branch information
emilyb7 committed Apr 27, 2017
1 parent 98af69a commit 45e9571
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/components/view-goal/view-goal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ const viewGoal = ({ currentGoal, rateGoal, stepLineChartDetail, }) => {
<p
id="line-chart-title-text"
onClick={ stepLineChartDetail }
>Your progress so far&nbsp;&gt;</p>
>Your progress so far&nbsp;</p>
<div className="arrow arrow-1" />
</div>
<div className="line-chart-inner">
<div className="line-chart-inner" onClick={ stepLineChartDetail }>
<LineChart
ratings={ latestRatings }
avatar={ currentGoal.avatar }
Expand Down
51 changes: 51 additions & 0 deletions app/scss/_view-goal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,54 @@ $contentMaxWidth: 400px;
.view-goal-buttonContainer {
height: 80px;
}

/* arrow stuff */

$ani-speed: 2s;
$ani-delay: 1s;

.arrow {
opacity: 1;
position: absolute;
left: 55%;
top: 56%;

animation: arrow-movement $ani-speed ease-in-out 3;

&:before, &:after {
background: transparent;
content: '>';
display: block;
height: 1px;
position: absolute;
top: 0;
left: 0;
width: 3px;
}

&:before {
transform-origin: top left;
color: transparent;
}

&:after {
transform-origin: top right;
color: $light;
}
}

// Animation
@keyframes arrow-movement {
0% {
opacity: 0;
left: 50%;
}

70% {
opacity: 1;
}

100% {
opacity: 0;
}
}

0 comments on commit 45e9571

Please sign in to comment.