Spinner again
authorBen Doumenc <bdoumenc@parkeon.com>
Sun, 19 Jul 2015 17:07:47 +0000 (19:07 +0200)
committerBen Doumenc <bdoumenc@parkeon.com>
Sun, 19 Jul 2015 17:07:47 +0000 (19:07 +0200)
r15k/www/app/components/spinner.jsx [new file with mode: 0644]

diff --git a/r15k/www/app/components/spinner.jsx b/r15k/www/app/components/spinner.jsx
new file mode 100644 (file)
index 0000000..c1dad3e
--- /dev/null
@@ -0,0 +1,24 @@
+/** @jsx React.DOM */
+
+define(['react'], function(React){
+    var Spinner = React.createClass({
+        render: function() {
+            var bars = [];
+            var props = this.props;
+
+            for (var i = 0; i < 12; i++) {
+                var 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>
+            );
+        }
+    });
+    return Spinner;
+});