<template>
    <transition
        appear
        name="custom-classes-transition"
        enter-active-class="animated fadeIn faster"
        leave-active-class="animated fadeOut faster"
    >
        <popup v-if="show" :is-pass="true">
            <div class="ui-message-tips">
                <!-- <img class="ui-bg" :src="require(`@/assets/images/project/icon/tips.png`)" alt=""> -->
                <div class="brightness"></div>
                <span v-html="content"></span>
            </div>
        </popup>
    </transition>
</template>
<script>
import Popup from "./popup";
export default {
    name: "ui-tips",
    components: {
        Popup
    },
    data() {
        return {
            show: false,
            duration: 2000,
            content: ""
        };
    },
    mounted() {
        setTimeout(() => {
            this.show = false;
            this.$nextTick(function() {
                document.body.removeChild(this.$el);
                this.$destroy(true);
            });
        }, this.duration);
    }
};
</script>
<style lang="less" scoped>
.ui-message-tips {
    position: absolute;
    left: 50%;
    top: 50%;
    color: #fff;
    padding: 20px 50px;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    pointer-events: none;
    width: 402px;
    height: 132px;
    background: linear-gradient(180deg, rgba(166,192,232,0.4) 0%, rgba(16,25,38,0.7) 3%, #171F2A 39%, rgba(19,28,40,0.85) 39%, rgba(54,58,64,0.91) 85%, rgba(80,81,83,0.47) 99%, rgba(230,236,245,0.14) 100%);
    box-shadow: inset 0px 2px 2px 1px rgba(255,255,255,0.4);
    opacity: 1;
    backdrop-filter: blur(10px);
    .ui-bg{
        width: 100%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        width: 100%;
    }
    .brightness{
        width: 100%;
        height: 100%;
        &::before{
            content: '';
            backdrop-filter: blur(20px) brightness(90%);
        }
    }
    >span{
        font-size: 26px;
        letter-spacing: 2px;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        display: inline-block;
        width: 100%;
    }
}

@media screen and (max-width: 600px) {
    .ui-message-tips {
        max-width: 80%;
        .ui-bg{
            width: 100%;
            height: 100%;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
            width: 100%;
        }
    }
}

</style>