Files
shoot-miniprograms/src/components/ScreenHint.vue

90 lines
1.8 KiB
Vue
Raw Normal View History

2025-05-10 16:57:36 +08:00
<script setup>
import IconButton from "./IconButton.vue";
const props = defineProps({
show: {
type: Boolean,
default: false,
},
onClose: {
type: Function,
2025-07-03 21:12:59 +08:00
default: null,
2025-05-10 16:57:36 +08:00
},
2025-05-29 15:48:38 +08:00
mode: {
type: String,
default: "normal",
},
2025-05-10 16:57:36 +08:00
});
2025-07-03 21:12:59 +08:00
const getContentHeight = () => {
2025-07-06 00:42:10 +08:00
if (props.mode === "tall") return "50vw";
2025-07-03 21:12:59 +08:00
if (props.mode === "square") return "74vw";
return "36vw";
2025-07-03 21:12:59 +08:00
};
2025-05-10 16:57:36 +08:00
</script>
<template>
<view class="container" :style="{ display: show ? 'flex' : 'none' }">
2025-07-03 21:12:59 +08:00
<view class="scale-in" :style="{ height: getContentHeight() }">
2025-05-29 15:48:38 +08:00
<image
v-if="mode === 'normal'"
2025-07-03 21:12:59 +08:00
src="../static/screen-hint-bg.png"
mode="widthFix"
/>
<image
v-if="mode === 'tall'"
2025-05-29 15:48:38 +08:00
src="../static/coach-comment.png"
mode="widthFix"
/>
<image
v-if="mode === 'square'"
src="../static/prompt-bg-square.png"
mode="widthFix"
/>
2025-06-19 21:03:33 +08:00
<image
v-if="mode === 'small'"
src="../static/finish-frame.png"
mode="widthFix"
/>
2025-05-10 16:57:36 +08:00
<slot />
</view>
<IconButton
2025-07-03 21:12:59 +08:00
v-if="!!onClose"
2025-05-10 16:57:36 +08:00
src="../static/close-gold-outline.png"
2025-05-29 23:45:44 +08:00
:width="30"
2025-05-10 16:57:36 +08:00
:onClick="onClose"
/>
</view>
</template>
<style scoped>
.container {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
2025-06-20 11:22:41 +08:00
background-color: rgba(0, 0, 0, 0.8);
2025-05-10 16:57:36 +08:00
flex-direction: column;
justify-content: center;
align-items: center;
2025-07-21 10:40:43 +08:00
z-index: 999;
2025-05-10 16:57:36 +08:00
}
.container > view:first-child {
display: flex;
align-items: center;
2025-07-02 15:57:58 +08:00
justify-content: center;
2025-05-10 16:57:36 +08:00
position: relative;
width: 70vw;
color: #fff;
2025-07-03 21:12:59 +08:00
margin-bottom: 15px;
2025-05-10 16:57:36 +08:00
}
.container > view:first-child > image {
position: absolute;
width: 80vw;
2025-06-19 21:03:33 +08:00
left: -7%;
2025-07-03 21:12:59 +08:00
bottom: -18vw;
2025-05-10 16:57:36 +08:00
z-index: -1;
2025-06-19 21:03:33 +08:00
transform: translateY(-75px);
2025-05-10 16:57:36 +08:00
}
</style>