@import "../styles/base/fn.wxss";

.@{wuxClassNamePrefix}-spin {
	position: relative;
    display: inline-block;

    &__spinning {
        opacity: 1;
        position: static;
        display: inline-block;
        vertical-align: middle;
        text-align: center;
        font-size: 14px;
        line-height: 1.5;
        color: #108ee9;

        &--nested {
            vertical-align: middle;
            text-align: center;
            font-size: 14px;
            line-height: 1.5;
            color: #108ee9;
            display: block;
            position: absolute;
            height: 100%;
            max-height: 320px;
            width: 100%;
            z-index: 4;
        }
    }

    &--nested {
        display: block;
    }

    &--nested &__tip {
        position: absolute;
        top: 50%;
        width: 100%;
        padding-top: 6px;
        text-shadow: 0 1px 2px #fff;
    }

    &__dots {
        overflow: hidden;
        display: inline-block;
        width: 20px;
        height: 20px;
        transform: rotate(45deg);
        animation: rotate 1.2s infinite linear;
    }

    &--nested &__dots {
        position: absolute;
        top: 50%;
        left: 50%;
        margin: -10px;
    }

    &__dot {
        width: 9px;
        height: 9px;
        border-radius: 100%;
        background-color: #108ee9;
        transform: scale(.75);
        display: block;
        position: absolute;
        opacity: .3;
        animation: spinMove 1s infinite linear alternate;
        transform-origin: 50% 50%;
        text-indent: -999em;

        &:first-child {
            left: 0;
            top: 0;
        }

        &:nth-child(2) {
            right: 0;
            top: 0;
            animation-delay: .4s;
        }

        &:nth-child(3) {
            right: 0;
            bottom: 0;
            animation-delay: .8s;
        }

        &:nth-child(4) {
            left: 0;
            bottom: 0;
            animation-delay: 1.2s;
        }
    }

    &--show-text&--nested &__dots {
        margin-top: -20px;
    }

    &__container {
        position: relative;
        transition: opacity .3s;
        zoom: 1;

        &--blur {
            overflow: hidden;
            opacity: .5;
            filter: blur(.5px);
            transform: translateZ(0);

            /*&:after {
                content: "";
                position: absolute;
                left: 0;
                right: 0;
                top: 0;
                bottom: 0;
                background: #fff;
                opacity: .3;
                transition: all .3s;
                z-index: 10;
            }*/
        }
    }

    &--small &__tip {
        padding-top: 3px;
    }

    &--small &__dots {
        width: 14px;
        height: 14px;
    }

    &--small&--nested &__dots {
        margin: -7px;
    }

    &--small &__dot {
        width: 6px;
        height: 6px;
    }

    &--small&--show-text&--nested &__dots {
        margin-top: -17px;
    }

    &--large &__tip {
        padding-top: 12px;
    }

    &--large &__dots {
        width: 32px;
        height: 32px;
    }

    &--large&--nested &__dots {
        margin: -16px;
    }

    &--large &__dot {
        width: 14px;
        height: 14px;
    }

    &--large&--show-text&--nested &__dots {
        margin-top: -26px;
    }
}

@keyframes rotate {
    to {
        transform: rotate(405deg);
    }
}

@keyframes spinMove {
	to {
		opacity: 1;
	}
}
