Created
December 31, 2017 20:21
-
-
Save zurfyx/59c45870f8906c82a87195aef16a0f01 to your computer and use it in GitHub Desktop.
GDAX-like table effect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div className="table"> | |
<div className="row table-header"> | |
<div>Timestamp</div> | |
<div>Temperature</div> | |
<div>Distance</div> | |
</div> | |
{this.state.data.map((entry, i) => ( | |
<div key={entry.timestamp} className={ | |
`row | |
${i === this.state.data.length - 1 ? 'last' : '' } | |
${entry.trigger === '1' ? 'trigger' : ''} | |
`}> | |
<div>{dateFormat(entry.timestamp*1000, "HH:MM:ss")}</div> | |
<div>{entry.temperature}º</div> | |
<div>{entry.distance}cm</div> | |
</div> | |
))} | |
</div> | |
/* App.css | |
@keyframes fadeIn { | |
from { background-color: #00B285 } | |
to { } | |
} | |
.row { | |
background-color: #343d46; | |
width: 100%; | |
display: flex; | |
animation: fadeIn 1s; | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment