mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Update index.html
getting rid of magic numbers
This commit is contained in:
@@ -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>);
|
||||
|
||||
Reference in New Issue
Block a user