forked from chenglou/react-spinner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.jsx
More file actions
32 lines (26 loc) · 702 Bytes
/
index.jsx
File metadata and controls
32 lines (26 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from 'react';
class Spinner extends React.Component {
constructor(props) {
super(props);
}
render() {
let bars = [];
const props = this.props;
for (let i = 0; i < 12; i++) {
let barStyle = {};
barStyle.WebkitAnimationDelay = barStyle.animationDelay =
(i - 12) / 10 + 's';
barStyle.WebkitTransform = barStyle.transform =
'rotate(' + (i * 30) + 'deg) translate(146%)';
bars.push(
<div style={barStyle} className="react-spinner_bar" key={i} />
);
}
return (
<div {...props} className={(props.className || '') + ' react-spinner'}>
{bars}
</div>
);
}
};
export default Spinner;