<script setup>
defineProps({
  noBg: {
    type: Boolean,
    default: false,
  },
  type: {
    type: Number,
    default: 0,
  },
});
const bubbleTypes = [
  "../static/long-bubble.png",
  "../static/long-bubble-middle.png",
  "https://static.shelingxingqiu.com/shootmini/static/long-bubble-tall.png",
];
</script>

<template>
  <view class="container">
    <image src="https://static.shelingxingqiu.com/shootmini/static/shooter.png" mode="widthFix" />
    <view>
      <image
        v-if="!noBg"
        :src="bubbleTypes[type]"
        :style="{ top: type === 2 ? '-6%' : '-13%' }"
        mode="widthFix"
      />
      <slot />
    </view>
  </view>
</template>

<style scoped>
.container {
  display: flex;
  align-items: center;
  padding: 0 15px;
  width: clac(100% - 30px);
}
.container > image {
  width: 20%;
}
.container > view {
  position: relative;
  width: 80%;
  min-height: 55px;
  display: flex;
  flex-direction: column;
}
.container > view > image {
  position: absolute;
  left: -7%;
  width: 108%;
}
.container > view {
  color: #fff;
  font-size: 28rpx;
}
</style>
