public/js/spin.js
/**
 * Internal method that draws the individual lines.
 */
Internal method that draws the individual lines.
Internal method that draws the individual lines .
function drawLines(el, opts) {
    var borderRadius = Math.round(opts.corners * opts.width * 500) / 1000 + 'px';
    var shadow = 'none';
    if (opts.shadow === true) {
        shadow = '0 2px 4px #000'; 
    } else if (typeof opts.shadow === 'string') {
        shadow = opts.shadow;
    }
    var shadows = parseBoxShadow(shadow);
    for (var i = 0; i < opts.lines; i++) {
        var degrees = ~~(360 / opts.lines * i + opts.rotate);
        var backgroundLine = css(document.createElement('div'), {
            position: 'absolute',
            top: -opts.width / 2 + "px",
            width: opts.length + opts.width + 'px',
            height: opts.width + 'px',
            background: getColor(opts.fadeColor, i),
            borderRadius: borderRadius,
            transformOrigin: 'left',
            transform: "rotate(" + degrees + "deg) translateX(" + opts.radius + "px)"
        });
        var line = css(document.createElement('div'), {
            width: '100%',
            height: '100%',
            background: getColor(opts.color, i),
            borderRadius: borderRadius,
            boxShadow: normalizeShadow(shadows, degrees),
            opacity: opts.opacity
        });
        backgroundLine.appendChild(line);
        el.appendChild(backgroundLine);
    }
}
function drawLines ( el , opts ) { var borderRadius = Math . round ( opts . corners * opts . width * 500 ) / 1000 + 'px' ; var shadow = 'none' ; if ( opts . shadow === true ) { shadow = '0 2px 4px #000' ; } else if ( typeof opts . shadow === 'string' ) { shadow = opts . shadow ; } var shadows = parseBoxShadow ( shadow ) ; for ( var i = 0 ; i < opts . lines ; i ++ ) { var degrees = ~ ~ ( 360 / opts . lines * i + opts . rotate ) ; var backgroundLine = css ( document . createElement ( 'div' ) , { position : 'absolute' , top : - opts . width / 2 + "px" , width : opts . length + opts . width + 'px' , height : opts . width + 'px' , background : getColor ( opts . fadeColor , i ) , borderRadius : borderRadius , transformOrigin : 'left' , transform : "rotate(" + degrees + "deg) translateX(" + opts . radius + "px)" } ) ; var line = css ( document . createElement ( 'div' ) , { width : '100%' , height : '100%' , background : getColor ( opts . color , i ) , borderRadius : borderRadius , boxShadow : normalizeShadow ( shadows , degrees ) , opacity : opts . opacity } ) ; backgroundLine . appendChild ( line ) ; el . appendChild ( backgroundLine ) ; } }
Internal method that draws the individual lines.
Internal method that draws the individual lines .
// default shadow