<script setup lang="ts">
defineOptions({ name: 'BoardBg' })
const OSS_URL = import.meta.env.VITE_OSS_URL
const top_url = `${OSS_URL}/subject/book_shelf_top.svg`
const bottom_url = `${OSS_URL}/subject/book_shelf_bottom.svg`
const left_url = `${OSS_URL}/subject/book_shelf_left.svg`
</script>

<template>
  <div class="board-bg">
    <div class="board-top">
      <img :src="top_url" alt="" />
      <img :src="top_url" alt="" />
    </div>
    <div class="board-inner">
      <img :src="left_url" class="board-left" />
      <img :src="bottom_url" class="board-bottom" />
    </div>
    <div class="board-content">
      <slot />
    </div>
  </div>
</template>

<style lang="scss" scoped>
.board-bg {
  position: relative;
  margin: 0 auto;
  background-color: rgb(249, 253, 255);
  border-radius: 3.33vh;
  // padding: 4.17vh 3.33vh 3.33vh;
  box-shadow: 0 0.33vh 0.33vh 0 rgba(0, 0, 0, 0.25);

  .board-inner {
    pointer-events: none;
    width: 100%;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;

    .board-left {
      position: absolute;
      opacity: 20%;
      transform: rotate(-30deg) scale(1.2);
      left: 35px;
      width: 34vh;
      height: 38.58vh;
    }

    .board-bottom {
      position: absolute;
      opacity: 20%;
      right: 20px;
      bottom: 1.67vh;
      width: 28.83vh;
      height: 24.75vh;
    }
  }

  .board-top {
    pointer-events: none;
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 267px;
    top: -2.67vh;

    img {
      width: 3.67vh;
      height: 6.42vh;
    }
  }

  .board-content {
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}
</style>
