<template>
    <div class="container">
        <div class="dot"></div>
        <div class="pulse"></div>
        <div class="content" v-for="(item , index) in worn" :key="index">{{item}}</div>
    </div>
</template>

<script>
    export default {
        props: {
            worn: Array,
        },
    }
</script>
<style scoped>
    @keyframes warn {
        0% {
            transform: scale(0.3);
            -webkit-transform: scale(0.3);
            opacity: 0.0;
        }

        25% {
            transform: scale(0.3);
            -webkit-transform: scale(0.3);
            opacity: 0.1;
        }

        50% {
            transform: scale(0.5);
            -webkit-transform: scale(0.5);
            opacity: 0.3;
        }

        75% {
            transform: scale(0.8);
            -webkit-transform: scale(0.8);
            opacity: 0.5;
        }

        100% {
            transform: scale(1);
            -webkit-transform: scale(1);
            opacity: 0.0;
        }
    }

    @keyframes warn1 {
        0% {
            transform: scale(0.3);
            -webkit-transform: scale(0.3);
            opacity: 0.0;
        }

        25% {
            transform: scale(0.3);
            -webkit-transform: scale(0.3);
            opacity: 0.1;
        }

        50% {
            transform: scale(0.3);
            -webkit-transform: scale(0.3);
            opacity: 0.3;
        }

        75% {
            transform: scale(0.5);
            -webkit-transform: scale(0.5);
            opacity: 0.5;
        }

        100% {
            transform: scale(0.8);
            -webkit-transform: scale(0.8);
            opacity: 0.0;
        }
    }

    .container {
        position: absolute;
        width: 40px;
        height: 40px;
        z-index: 99;
        /*border: 1px solid #000; hovertree.com */
    }

    .content{
        position: relative;
        display: none;
        z-index: 9999;
    }

    .container:hover .content{
        /* position: absolute;  */
        padding: 10px;
        width: 200px;
        color: #000000;
        background-color: #ffffff;
        display: block;
        min-height: 20px;
        z-index: 9999;
        margin-left: 40px;
    }

    /* 保持大小不变的小圆圈 何问起 */
    .dot {
        position: absolute;
        width: 8px;
        height: 8px;
        left: 42px;
        top: 42px;
        -webkit-border-radius: 50%;
        -moz-border-radius: 50%;
        /* border: 2px solid rgba(255,0,0,.5); */
        border-radius: 50%;
        z-index: 2;
        background-color: rgba(255,0,0,.8);
    }

    /* 产生动画（向外扩散变大）的圆圈  */
    .pulse {
        position: absolute;
        width: 80px;
        height: 80px;
        left: 2px;
        top: 2px;
        border: 3px solid rgba(255,0,0,.8);
        -webkit-border-radius: 50%;
        -moz-border-radius: 50%;
        border-radius: 50%;
        z-index: 1;
        opacity: 0;
        -webkit-animation: warn 1.5s linear;
        -moz-animation: warn 1.5s linear;
        animation: warn 1.5s linear;
        -webkit-animation-iteration-count: infinite;
        -moz-animation-iteration-count: infinite;
        animation-iteration-count: infinite;
        box-shadow: 1px 1px 15px rgba(255,0,0,.8);
    }
</style>