@import "tirefire/colors";

.timer {
    background: -webkit-linear-gradient(left, $secondary_light_grey 50%, $clear 50%);
    border-radius: 100%;
    height: calc(var(--size) * 1px);
    width: calc(var(--size) * 1px);
    position: relative;
    -webkit-animation: time calc(var(--duration) * 1s) steps(1000, start);
      -webkit-mask: radial-gradient(transparent 50%, #000 50%);
      mask: radial-gradient(transparent 50%, #000 50%);
}
.mask {
    border-radius: 100% 0 0 100% / 50% 0 0 50%;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 50%;
    -webkit-animation: mask calc(var(--duration) * 1s) steps(500, start);
    -webkit-transform-origin: 100% 50%;
}
@-webkit-keyframes time {
    100% {
        -webkit-transform: rotate(360deg);
    }
}
@-webkit-keyframes mask {
    0% {
        background: $clear;
        -webkit-transform: rotate(0deg);
    }
    50% {
        background: $clear;
        -webkit-transform: rotate(-180deg);
    }
    50.01% {
        background: $secondary_light_grey;
        -webkit-transform: rotate(0deg);
    }
    100% {
        background: $secondary_light_grey;
        -webkit-transform: rotate(-180deg);
    }
}

.alert .timer {
    --size: 10;
    --duration: 5;
    padding: 6px;
    margin: 6px;
}
