<script setup lang="ts">
import { $getWechat } from '@/commons/utils.ts'
import { onMounted, ref } from 'vue';

defineProps<{
    imageUrls: Record<string, string>
    userJoinStatus: boolean
}>();
const nickname = ref('');
const avatar = ref('');
onMounted(() => {
    const wechat = $getWechat();
    nickname.value = wechat.nickname;
    avatar.value = wechat.avatar;
});
</script>

<template>
    <div class="h5-page game-stage">
        <div class="game-desc" @click="$emit('touchGameRule')">游戏规则</div>
        <div class="img-logo"></div>
        <div class="img-title"></div>
        <!-- <div class="img-avatar" :style="`background: url(${avatar});border-radius:66px;width:132px;height:132px;`">
        </div> -->
        <div class="txt-contdown">游戏等待开始倒计时&nbsp;<b style="font-weight: 900;">60</b>&nbsp;秒 </div>
        <!-- <div class="txt-contdown"></div> -->
        <!-- <div class="txt-nickname">{{ nickname }}</div> -->
        <div class="txt-loading">您已成功加入游戏等待主持人开始</div>
        <div class="txt-loading2">游戏即将开始 敬请期待</div>
        <!-- <div class="bg-bottom"></div> -->
        <!-- <div class="loading-gu"></div> -->
    </div>
</template>

<style scoped>
.game-stage {
    position: absolute;
    width: 750px;
    height: 1624px;
    padding: 0;
}

.game-desc {
    position: absolute;
    top: 40%;
    left: var(--stage-viewport-left, 0);
    display: flex;
    width: 58px;
    height: 158px;
    padding-top: 10px;
    align-items: center;
    justify-content: center;
    border-radius: 0 12px 12px 0;
    background: rgba(40, 12, 8, 0.52);
    color: rgba(255, 255, 255, 0.9);
    font-size: 25px;
    letter-spacing: 10px;
    line-height: 1.25;
    text-align: center;
    text-orientation: upright;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
}

.bg-bottom {
    position: absolute;
    bottom: 0;
    left: var(--stage-viewport-left, 0);
    width: var(--stage-viewport-width, 750px);
    height: 479px;
    background: v-bind('imageUrls.bg2') center/cover;
    opacity: 0.6;
}

.img-logo {
    position: absolute;
    top: 66px;
    left: 50%;
    width: 428px;
    height: 77px;
    background: v-bind('imageUrls.logo') center/cover;
    transform: translateX(-50%);
}

.img-title {
    position: absolute;
    top: 200px;
    left: 50%;
    background: v-bind('imageUrls.title') center/cover;
    width: 536px;
    height: 237px;
    transform: translateX(-50%);
}

.img-avatar {
    position: absolute;
    bottom: 11%;
    left: 50%;
    /* width: 148px;
    height: 148px;
    background: v-bind('avatar') center/cover; */
    transform: translateX(-50%);
}

.txt-contdown {
    position: absolute;
    left: 124px;
    top: 475px;
    width: 502px;
    height: 90px;
    font-weight: bold;
    font-size: 36px;
    color: #B90103;
    line-height: 88px;
    text-align: center;
    background: v-bind('imageUrls.contdown') center/cover;
}

.txt-nickname {
    position: absolute;
    bottom: 10%;
    left: 50%;
    color: #FFFFFF;
    font-size: 18px;
    font-weight: bold;
    transform: translateX(-50%);
}


@keyframes loading-text-scale {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.08);
    }
}


.txt-loading {
    position: absolute;
    bottom: 4.74%;
    left: 50%;
    width: 288px;
    color: #6F0000;
    font-size: 25pt;
    font-weight: bold;
    text-align: center;
    transform: translateX(-50%);
    font-weight: 500;
    font-size: 36px;
    color: #FFFFFF;
    line-height: 50px;
    animation: loading-text-scale 1.2s ease-in-out infinite;
}

.txt-loading2 {
    width: 750px;
    height: 126px;
    color: white;
    position: absolute;
    z-index: -1;
    top: 786px;
    left: 50%;
    transform: translate(-50%);
    line-height: 118px;
    text-align: center;
    font-weight: 500;
    font-size: 46px;
    color: #FFFFFF;
    letter-spacing: 5px;
    background: v-bind('imageUrls.startBg') center/cover;
}

.loading-gu {
    position: absolute;
    bottom: 100px;
    left: 50%;
    width: 600px;
    height: 534px;
    background: v-bind('imageUrls.gu') center/cover;
    transform: translateX(-50%);
}
</style>
