<template>
    <div class="container" @click="openUrl">
        <div id="bottom-layer" class="image-layer">
            <img src="/public/static/bottom.gif" style="height: 100%;" alt="底图">
        </div>
        <div id="center-layer" class="image-layer">
            <img src="/public/static/center.png" style="width: 50%;" alt="内容图">
        </div>
        <div id="top-layer" class="image-layer">
            <img src="/public/static/111.gif" style="height: 100%;" id="play-once" alt="开门动画">
        </div>
    </div>
</template>

<script>
export default {
    methods: {
        openUrl() {
            window.location.href = "https://jinrigushitwo.gushitv.com/h5/#/";
        }
    },
    mounted() {
        // 页面加载后延迟1秒显示中间层
        setTimeout(() => {
            document.getElementById('center-layer').style.opacity = '1';
        }, 1000);
    }
}
</script>

<style scoped>
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#bottom-layer {
    z-index: 1;
}

#center-layer {
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

#top-layer {
    z-index: 3;
}
</style>
