SOURCE

console 命令行工具 X clear

                    
>
console
function showDialog() {
    $$(".dialog").removeClass("hide");
    $$(".dialog").addClass("show");
    $("dialogMask").style.opacity = "1";
    $("dialogMask").style.zIndex = "99999999";
}

function hideDialog() {
    $$(".dialog").removeClass("show");
    $$(".dialog").addClass("hide");
    $("dialogMask").style.opacity = "0";
    $("dialogMask").style.zIndex = "-10";
}
<div class="btn" onclick="showDialog()">
    显示对话框
</div>
<br/>
<br/>
<br/>
<br/>
<div id="dialogMask">
    <br/>
    <div class="dialog">
        <div onclick="hideDialog()">
            隐藏对话框
        </div>
    </div>
</div>
#dialogMask {
    z-index: -10;
    background: rgba(255, 255, 255, 0.89);
    position: absolute;
    left: 0;
    right: 0;
    top: 0px;
    bottom: 0;
    opacity: 0;
    transition: 0.5s;
}

.dialog {
    opacity: 0;
    margin: auto;
    width: 250px;
    height: 300px;
    margin-top: 10%;
    border-radius: 10px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    -webkit-box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    div {
        cursor:default ;
        width: 100px;
        height: 100px;
        margin: 50px auto;
        color: #fff;
        background: #c7cbff;
        border-radius: 50%;
        line-height: 100px;
        text-align: center;
        &:hover {
            background: #aaafef;
        }
    }
}

@keyframes showDialog {
    from {
        opacity: 0;
        margin-top: 30px;
    }
    to {
        opacity: 1;
        margin-top: 0px;
    }
}

@keyframes hideDialog {
    from {
        opacity: 1;
        margin-top: 0px;
    }
    to {
        opacity: 0;
        margin-top: 30px;
    }
}

.show {
    animation: showDialog 0.5s ease 1 forwards;
}

.hide {
    animation: hideDialog 0.5s ease 1 forwards;
}


.btn {
    display: block;
    margin-top: 5px;
    padding: 12px 2px;
    font-size: 14px;
    text-decoration: none;
    color: #1ba4f6;
    width: 100px;
    border: 1px solid #1ba4f6;
    text-align: center;
    border-radius: 25px;
    margin: auto;
    margin-top:80px;
    cursor:default;
}