Files
shoot-miniprograms/src/components/AppBackground.vue
2025-05-27 12:38:39 +08:00

47 lines
747 B
Vue

<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>
<template>
<view class="background">
<image class="bg-image" :src="bgs[type]" mode="widthFix" />
<view class="bg-overlay" v-if="type === 0"></view>
</view>
</template>
<style scoped>
.background {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: -1;
}
.bg-image {
width: 100%;
height: 100%;
}
.bg-overlay {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background: linear-gradient(
to bottom,
rgba(26, 26, 26, 0.2),
rgba(0, 0, 0, 0.2)
);
}
</style>