<template>
    <div class="add_file" v-show="show_addFile">
        <div class="main">
            <div class="folder" :class="{folder2:!closeAni}">
                <van-button round type="info" size="small" block>新建文件夹</van-button>
            </div>
            <div class="divider" :class="{divider2:!closeAni}">
                <van-divider :style="{borderColor:'#cccccc',margin:'30px 0'}"/>
            </div>
            <div class="file" :class="{file2:!closeAni}">
                <van-button plain round type="info" size="small" block style="margin-bottom:20px">新建富文本</van-button>
                <van-button plain round type="info" size="small" block>新建Markdown</van-button>
            </div>
        </div>
        <div class="footer">
            <i class="icon-19" :class="{icon19:!closeAni}" @click="closeAdd"></i>
        </div>
    </div>
</template>

<script>
    export default {
        name: "add_file",
        props:['show_addFile'],
        data(){
            return{
                closeAni:true,  //关闭页面
            }
        },
        methods:{
            closeAdd(){
                this.closeAni = false;
                setTimeout(()=>{
                    this.$emit('update:show_addFile',false);
                    this.closeAni = true;
                },300)
            }
        },
    }
</script>

<style scoped lang="less">
    @basefont:50;
    .add_file{
        width:100%;
        height:100vh;
        position:fixed;
        top:0;
        z-index:9;
        background-color:#f8f8f8;
        .main{
            padding:50% 100rem /@basefont;
            >div{
                height:50rem /@basefont;
            }
        }
        .footer{
            width:100%;
            height:100rem /@basefont;
            display:flex;
            align-items:center;
            justify-content:space-around;
            position:absolute;
            bottom:0;
            background-color:#f8f8f8;
        }
    }
    .icon-19{
        font-size:60rem /@basefont;
        color: #cccccc;
        transform: rotate(45deg);
        animation:rotate .3s;
    }
    .icon19{
        transition:all .3s;
        transform: rotate(0deg);
    }
    @keyframes rotate {
        0%{transform: rotate(0)}
        100%{transform: rotate(45deg)}
    }
    .folder{
        animation:main .3s;
    }
    .divider{
        animation:main .5s;
    }
    .file{
        animation:main .7s;
    }
    .folder2{
        animation:main2 .6s;transform: translateY(2000%)
    }
    .divider2{
        animation:main2 .4s;transform: translateY(2000%)
    }
    .file2{
        animation:main2 .2s;transform: translateY(2000%)
    }
    @keyframes main {
        0%{transform: translateY(600%)}
        50%{transform: translateY(-50%)}
        100%{transform: translateY(0)}
    }
    @keyframes main2 {
        0%{transform: translateY(0)}
        100%{transform: translateY(2000%)}
    }
</style>