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

47 lines
747 B
Vue
Raw Normal View History

2025-05-10 16:57:36 +08:00
<script setup>
import { ref } from "vue";
const props = defineProps({
type: {
type: Number,
default: 0,
},
});
const bgs = ref(["../static/app-bg.png", "../static/app-bg2.png"]);
</script>
2025-05-01 16:17:51 +08:00
<template>
<view class="background">
2025-05-27 12:38:39 +08:00
<image class="bg-image" :src="bgs[type]" mode="widthFix" />
2025-05-10 16:57:36 +08:00
<view class="bg-overlay" v-if="type === 0"></view>
2025-05-01 16:17:51 +08:00
</view>
</template>
<style scoped>
.background {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
2025-05-01 16:36:24 +08:00
z-index: -1;
2025-05-01 16:17:51 +08:00
}
.bg-image {
width: 100%;
height: 100%;
}
.bg-overlay {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
2025-05-10 16:57:36 +08:00
background: linear-gradient(
to bottom,
2025-05-27 12:38:39 +08:00
rgba(26, 26, 26, 0.2),
rgba(0, 0, 0, 0.2)
2025-05-10 16:57:36 +08:00
);
2025-05-01 16:17:51 +08:00
}
2025-05-10 16:57:36 +08:00
</style>