jamestomasino/stutter

View on GitHub
src-content/style.scss

Summary

Maintainability
Test Coverage
@import "themes/themes";

#__stutter {
    all: initial;
    background: var(--barBG);
    border-radius: 15px;
    border: 2px solid var(--barBorder);
    display: block;
    height: 50px;
    line-height: 1em !important;
    margin-left: 15px;
    position: fixed;
    text-align: center;
    top: calc(50vh - 25px);
    left: 0;
    width: calc(100% - 35px);
    max-width: calc(100vw - 35px);
    z-index: 999999999;
    box-sizing: border-box;

    * {
        all: unset;
    }

    @for $i from 0 through 100 {
        &[data-progress='#{$i}'] {
            background: linear-gradient(to right, var(--barBG) 0%, var(--barBG) #{$i+'%'}, var(--progressColor) #{$i+'%'}, var(--progressColor) 100%);
        }
    }

    .__stutter_screen {
        position: absolute;
        height: 200vh;
        width: 200vw;
        top: -100vh;
        left: -100vw;
        background-color: var(--bgScreen);
        pointer-events: none;
        z-index: -1;
    }

    .__stutter_text {
        display: block;
        line-height: 1em !important;
        padding-top: 8px;
        position: relative;
        box-sizing: border-box;
        user-select: none;
        width: 100%;

        .__stutter_pausebtn {
            display: block;
            position: absolute;
            box-sizing: border-box;
            width: 100%;
            left: 0;
            top: 0;
            width: 100%;
            height: 50px;
        }

        .__stutter_left {
            color: var(--textColor) !important;
            display: block;
            font-family: Arial, sans-serif !important;
            font-size: 30px !important;
            line-height: 1em !important;
            pointer-events: none;
            position: absolute;
            box-sizing: border-box;
            right: 66%;
            text-align: right;
            z-index: 90;
        }

        .__stutter_right {
            color: var(--textColor) !important;
            display: block;
            font-family: Arial, sans-serif !important;
            font-size: 30px !important;
            left: 34%;
            line-height: 1em !important;
            pointer-events: none;
            position: absolute;
            box-sizing: border-box;
            text-align: left;
            z-index: 90;

            .__stutter_center {
                color: var(--textHighlight) !important;
                font-family: Arial, sans-serif !important;
                font-size: 30px !important;
                line-height: 1em !important;
                box-sizing: border-box;
                pointer-events: none;
                z-index: 90;
            }

            .__stutter_remainder {
                color: var(--textColor) !important;
                font-family: Arial, sans-serif !important;
                font-size: 30px !important;
                box-sizing: border-box;
                line-height: 1em !important;
                pointer-events: none;
                z-index: 90;
            }

            .__stutter_flanker {
                color: var(--textColor) !important;
                opacity: 0.5 !important;
                font-family: Arial, sans-serif !important;
                font-size: 30px !important;
                box-sizing: border-box;
                line-height: 1em !important;
                pointer-events: none;
                z-index: 90;
            }
        }

        .__stutter_options {
            color: var(--buttonColor) !important;
            cursor: pointer;
            display: block;
            font-family: Arial, sans-serif !important;
            font-size: 30px !important;
            left: 15px;
            line-height: 1em !important;
            position: absolute;
            box-sizing: border-box;
            text-align: left;
            user-select: none;
        }

        .__stutter_drag {
            color: var(--buttonColor) !important;
            cursor: pointer;
            display: block;
            font-family: Arial, sans-serif !important;
            font-size: 16px !important;
            padding-top: 3px;
            left: 17px;
            top: -25px;
            line-height: 1em !important;
            position: absolute;
            box-sizing: border-box;
            text-align: center;
            user-select: none;
            cursor: pointer;
            width: 25px;
            height: 25px;
            background-color: var(--barBG);
            border: 2px solid var(--barBorder);
            border-bottom: 0;
        }

        .__stutter_duration {
            color: var(--buttonColor) !important;
            display: block;
            position: absolute;
            box-sizing: border-box;
            right: 50px;
            top: 12px;
            text-align: right;
            user-select: none;
            font-size: 1px !important;
            line-height: 1px !important;
            z-index: 1;

            .__stutter_duration_time,
            .__stutter_duration_wpm {
                display: block;
                color: var(--buttonColor) !important;
                box-sizing: border-box;
                font-family: Arial, sans-serif !important;
                font-size: 11px !important;
                line-height: 1em !important;
            }
        }

        .__stutter_close {
            color: var(--buttonColor) !important;
            cursor: pointer;
            display: block;
            font-family: Arial, sans-serif !important;
            font-size: 30px !important;
            line-height: 1em !important;
            position: absolute;
            box-sizing: border-box;
            right: 15px;
            text-align: right;
            user-select: none;
            z-index: 100;
        }
    }

    .__stutter_pause {
        display: none;
        position: absolute;
        box-sizing: border-box;
        border-color: transparent transparent transparent var(--textHighlight);
        cursor: pointer;
        pointer-events: none;
        border-style: double;
        z-index: 100;
        height: 32px;
        left: calc(50% - 30px);
        border-width: 0 0 0 36px;
    }

    &.__stutter_paused {
        .__stutter_pause {
            display: block;
        }

        .__stutter_text {
            .__stutter_left,
            .__stutter_center,
            .__stutter_flanker,
            .__stutter_remainder {
                color: transparent !important;
                text-shadow: 0 0 5px var(--pausedTextColor);
            }
        }
    }
}

@media screen and (min-width: 700px) {
    #__stutter {
        height: 80px;
        top: calc(50vh - 40px);

        .__stutter_text {
            padding-top: 5px;
            font-size: 60px !important;

            .__stutter_pausebtn {
                height: 80px;
            }

            .__stutter_left {
                right: 53%;
                font-size: 60px !important;
            }

            .__stutter_right {
                left: 47%;
                font-size: 60px !important;

                .__stutter_center,
                .__stutter_flanker,
                .__stutter_remainder {
                    font-size: 60px !important;
                }
            }

            .__stutter_duration {
                right: 15px;
                top: 45px;

                .__stutter_duration_time,
                .__stutter_duration_wpm {
                    display: inline;
                    font-family: Arial, sans-serif !important;
                    font-size: 16px !important;
                    line-height: 1em !important;
                }
            }
        }

        .__stutter_pause {
            height: 60px;
            left: calc(50% - 35px);
            border-width: 0 0 0 60px;
            margin-top: 3px;
        }
    }
}