JSFiddle - React, Tailwind, and code Playground
by tobyworth
HTML
<div id="foo"></div>
<script src="http://fgnass.github.io/spin.js/spin.min.js"></script>
CSS
.foo{
width:100%;
height:100%;
}
JavaScript
var opts = {
lines: 13, // The number of lines to draw
length: 0, // The length of each line
width: 30, // The line thickness
radius: 28, // The radius of the inner circle
corners: 1, // Corner roundness (0..1)
rotate: 270, // The rotation offset
direction: 1, // 1: clockwise, -1: counterclockwise
// color: ['#0f0','#0ff','#00f','#0ff'],
//color: ['#ff0','#f0f','#f3f','#f6f','#f9f','#fbf','#fef','#eff','#bff','#9ff' ,'#6ff','#3ff','#0ff'],
color: ['#ff0','#f0f','#f3f','#faf','#fff','#fff','#fff','#fff','#fff','#fff' ,'#aff','#3ff','#0ff'],
speed: 1.3, // Rounds per second
trail: 0, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: true, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
top: '50%', // Top position relative to parent
left: '50%' // Left position relative to parent
};
var target = document.getElementById('foo');
var spinner = new Spinner(opts).spin(target);