Update index.html

getting rid of magic numbers
This commit is contained in:
Ilya Shuklin
2015-04-14 16:55:12 +03:00
parent be03fa7f46
commit 0447f1e792

View File

@@ -54,10 +54,10 @@
var children = [];
var pos = 0;
var colors = ['red', 'gray', 'blue'];
for (var i = this.state.current; i < this.state.current + 3; i++) {
for (var i = this.state.current; i < this.state.current + colors.length; i++) {
var style = {
left: pos * 128,
background: colors[i % 3]
background: colors[i % colors.length]
};
pos++;
children.push(<div key={i} className="animateItem" style={style}>{i}</div>);