dsi-icl/optimise

View on GitHub
packages/optimise-ui/src/components/loadBar/loadBar.module.css

Summary

Maintainability
Test Coverage
.loader {
    display: inline-block;
    position: relative;
    width: 100%;
    height: 2.7em;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.2);
}

.loader::before,
.loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateX(-100%);
    transform-origin: 0 0;
}

.loader::before {
    background-color: rgba(255, 255, 255, 0.2);
    animation: loading 1000ms 500ms cubic-bezier(0.23, 1, 0.32, 1);
    animation-iteration-count: infinite;
}

.loader::after {
    background-color: var(--color-accent);
    animation: accent 1000ms 500ms cubic-bezier(0.23, 1, 0.32, 1);
    animation-iteration-count: infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }

    20% {
        transform: translateX(0);
    }

    60% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes accent {
    0% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(100%);
    }
}