ejplatform/ej-server

View on GitHub
lib/scss/components/conversations/_card.scss

Summary

Maintainability
Test Coverage
//------------------------------------------------------------------------------
// CONVERSATION CARD
//------------------------------------------------------------------------------
@import "../../config";

$_card-width: 100%;
$_card-bg: config('ej.conversation-card.bg-image');

:root {
    --theme-color: #{color('brand')};
    --theme-light-color: #{color('brand-lighter')};
}

.conversation-card {
    @include utilities('center text-6 col items-center');

    background-color: css-var(--theme-color, color('brand'));
    border-radius: size(config('ej.conversation-card.border-radius'));
    color: css-var(--theme-light-color, color('brand-lighter'));
    width: $_card-width;
    height: 20rem;
    margin: auto;
    overflow: hidden;

    @media screen and (max-width: 800px) {
        width: 20rem;
    }

    &__tags {
        @include utilities('text-6 bold');

        @if config('ej.conversation-card.highlight-tags') {
            background-color: css-var(--theme-light-color, color('brand-lighter'));
            color: css-var(--theme-color, color('brand'));
        }
        width: 100%;
        padding: 0.1rem;

        @media screen and (max-width: 800px){
            display: flex;
            padding: .4rem 21%;
            height: 6rem;

            .span-icon {
                display: grid;
                margin: 0 auto;
            }
        }
    }
    &__statistics {
        @include utilities('list-inline pad-y1');

        > li {
            @include utilities('pad-x1');
        }
    }
    &__text {
        @include utilities('col flex-center pad-3');

        flex-grow: 1;
        padding: 1rem;

        a {
            @include utilities('text-4 sans-serif');

            color: color('white');
            font-weight: 600;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            padding: 0px 3.5px 0px 3.5px;
        }

        @media only screen and (max-width: 560px) {
            padding: .8rem;
        }
    }
    &__moderate {
        @include utilities('uppercase text-6 margin-2 bold');

        color: color('black');
        display: block;
    }
    &__button {
        @include utilities('pad-t1 margin-t1');
        padding-top: 0.8rem;

        @if $_card-bg {
            background: css-var(--theme-color, color('brand')) url("#{$_card-bg}") repeat;
        }
        background-blend-mode: luminosity;
        width: 100%;
        
        @media only screen and (max-width: 560px) {
            a {
                margin-bottom: 1.5rem;
            }
        }
    }

    .progress-bar {
        width: 10rem;

        &__progress {
            border-color: color('white');
        }
    }
}

.alternate-cards {
    margin: 0 auto;

    @include breakpoint('md') {
        align-items: center;
        display: grid;
        grid-gap: size(0.5);
        grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
        
        > * {
            justify-self: center;
            width: 100%;
            display: flex;

            @media screen and (max-width: 65.5rem) {max-width: 24rem;}

            > * {border-radius: size(0.5);}
        }
    }

    @media screen and (min-width: 158rem) {
        max-width: 150rem;
        margin-left: 0;
        grid-template-columns: repeat(6, minmax(calc((100% / 6) - .75rem), 1fr));
    }
}

.statistics-card {
    &-container {
        width: 230px;
        height: 144px;
        background: $color-theme-brand-light;
        border: 1px solid #FFFFFF;
        box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
        border-radius: 5px;
        padding-left: 18px;
    }
    &-title {
        padding-top: 24px;
        padding-bottom: 18px;
        text-align: start;
        margin-bottom: unset;
    }
    &-value {
        text-align: start;
        font-size: 1.5rem;
        line-height: 42px;
        font-weight: bold;
    }

}

.cards-divider {
    .cards-divider-body {
        background: $color-white;
        display: flex;
        height: 100%;
        flex-wrap: wrap;
        margin-top: 26px;
        margin-bottom: 23px;

        row-gap: 23px;
        column-gap: 32px;
    }

    .cards-divider-header {
        display: none;
        width: 100%;
        padding: 1rem 1rem 0 1rem;

        flex-direction: column;

        .close-btn {
            display: flex;
            justify-content: flex-end;
            padding: .5rem;
        }
        
        h2 {
            color: $color-secondary;
            text-align: center;
            margin-top: .5rem;
        }
    }

    @media screen and (max-width: 559px) {
        &.show-board-statistics {
            display: flex;
            bottom: 0;
            
            .cards-divider-header {
                display: flex;
            }
        }

        flex-direction: column;
        margin: 0;

        transition: .25s;
        
        position: fixed;
        bottom: -100%;
        left: 0;
        z-index: 1006;
        
        border-radius: 10px 10px 0 0;
        background-color: $color-white;
        width: 100%;
        max-height: 80%;

        .cards-divider-body {
            display: grid;
            justify-content: center;
            overflow-y: auto;
            margin: 0;
            padding: 1.25rem 0;
        }
        

        p {
            text-align: center;
        }

        .statistics-card-container {
            padding: 0;
        }

        .cards-divider-header {
            display: block;
        }
    }
}

.signature-text {
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 21px;
}

.signature-link {
    line-height: 21px;
    text-decoration: underline;
}

.board-statistics-container {
    text-align: start;
}