_img-viewer.scss 4.47 KB
.img-viewer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    width: 100%;
    height: 100%;
    padding: 0 20px;
    opacity: 0;
    visibility: hidden;
    background: rgba(3, 9, 15, 0.6);
    backdrop-filter: blur(10px);
    transition: .3s;
    overflow-y: auto;

    @media (min-width: 1200px) {
        padding: 0 100px;
    }

    &.active {
        opacity: 1;
        visibility: visible;
    }


    &__wrap {
        position: relative;
        max-width: 1010px;
        width: 100%;
        height: 310px;
        margin: auto;
        box-shadow: 0px 4px 32px rgba(14, 56, 94, 0.12);

        @media (min-width: 640px) {
            height: 67.5%;
        }
    }

    &__close {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 5;
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;

        svg {
            fill: $white;
            transition: .3s;
        }

        &:hover {
            svg {
                @media (min-width: 1200px) {
                    fill: $main;
                }
            }
        }
    }

    &__thumbs {
        position: absolute;
        z-index: 5;
        bottom: 16px;
        left: 20px;
        max-width: 224px;
        width: 100%;

        @media (min-width: 640px) {
            left: 0;
            right: 0;
            bottom: 20px;
            margin: 0 auto;
            max-width: 380px;
        }
    }

    &__thumbs-swiper {

        .swiper-slide {
            height: 46px;
            border-radius: 10px;
            overflow: hidden;
            user-select: none;
            cursor: pointer;

            @media (min-width: 640px) {
                height: 80px;
            }

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }
        }
    }

    &__slider {
        height: 100%;

        .swiper-button-prev,
        .swiper-button-next {
            display: none;

            @media (min-width: 1200px) {
                display: flex;
                top: 50%;
                transform: translateY(-50%);
                width: 40px;
                height: 40px;
                border-radius: 10px;
                border: 1px solid $white;
                margin: 0;
                transition: .3s;
            }

            &:after {
                display: none;
            }

            svg {
                stroke: $white;
                transition: .3s;
            }

            &:hover {
                @media (min-width: 1200px) {
                    background-color: $white;
                }

                svg {
                    @media (min-width: 1200px) {
                        stroke: $main;
                    }
                }
            }
        }

        .swiper-button-prev {
            left: -70px;
        }

        .swiper-button-next {
            svg {
                transform: rotate(180deg);
            }

            right: -70px;
        }

    }

    &__slider-swiper {
        height: 100%;
        border-radius: 20px;

        .swiper-slide {
            position: relative;
            border-radius: 20px;
            overflow: hidden;
            user-select: none;

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }

            &::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: rgba(3, 9, 15, 0.3);
            }
        }
    }

    &__caption {
        position: absolute;
        top: calc(100% + 12px);
        left: 0;
        right: 0;
        z-index: 5;
        color: $white;
        font-size: 16px;
        line-height: 22px;
        font-weight: 600;
        text-align: center;
        user-select: none;

        @media (min-width: 640px) {
            top: 102.3%;
        }
    }

    &__sizeoff {
        position: absolute;
        right: 20px;
        bottom: 20px;
        z-index: 1;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #EDF7FF;
        opacity: 0.8;
        border-radius: 5px;
        transition: .3s;

        &:hover {
            @media (min-width: 1200px) {
                opacity: 1;
            }
        }
    }
}