@import '../base';

.spinner {
    margin: 0 auto;
    position: relative;
    border-radius: 100%;
    border-style: solid;
    border-top-style: solid;
    border-width: 4px;
    border-top-width: 4px;
    border-top-color: $white;
    height: 15px;
    width: 15px;
    display: inline-block;
    animation: spin 0.6s infinite linear;
    -webkit-animation: spin 0.6s infinite linear;
}

.primary {
    .spinner {
        border-width: 4px;
        border-color: rgba($white, 0.3);
        border-top-width: 4px;
        border-top-color: $white;
    }

    &.small .spinner {
        border-width: 2px;
        border-top-width: 2px;
    }
}

.secondary {
    .spinner {
        border-width: 4px;
        border-color: rgba($primary-color, 0.3);
        border-top-width: 4px;
        border-top-color: $primary-color;
    }

    &.small .spinner {
        border-width: 2px;
        border-top-width: 2px;
    }
}

.processing {
    .contents {
        opacity: 0;
        transform: scale(0.5);
    }
    .spinner {
        transform: none;
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(359deg);
    }
}

@-webkit-keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(359deg);
    }
}
