<script setup>
import { capsuleHeight } from "@/util";

const props = defineProps({
  type: {
    type: Number,
    default: 0,
  },
  bgColor: {
    type: String,
    default: "#050b19",
  },
});
</script>

<template>
  <view class="background" :style="{ backgroundColor: bgColor }">
    <image
      class="bg-image"
      v-if="type === 0"
      src="https://static.shelingxingqiu.com/shootmini/static/app-bg.png"
      mode="widthFix"
    />
    <image
      class="bg-image"
      v-if="type === 1"
      src="https://static.shelingxingqiu.com/shootmini/static/app-bg2.png"
      mode="widthFix"
    />
    <image
      class="bg-image"
      v-if="type === 2"
      src="https://static.shelingxingqiu.com/shootmini/static/app-bg3.png"
      :style="{ height: capsuleHeight + 50 + 'px' }"
    />
    <image
      class="bg-image"
      v-if="type === 3"
      src="https://static.shelingxingqiu.com/shootmini/static/app-bg4.png"
      mode="widthFix"
    />
    <image
      class="bg-image"
      v-if="type === 4"
      src="https://static.shelingxingqiu.com/shootmini/static/app-bg5.png"
      mode="widthFix"
    />
    <image
      class="bg-image"
      v-if="type === 5"
      src="https://static.shelingxingqiu.com/attachment/2026-01-05/dfgf3b5kp459tfyn0f.png"
      mode="widthFix"
    />
	<image
	  class="bg-image"
	  v-if="type === 6"
	  src="https://static.shelingxingqiu.com/shootmini/static/rank/rank-bg.png"
	  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>
