<template>
  <div
    class="base-element-listeningPractice"
    :style="{
      top: elementInfo.top + 'px',
      left: elementInfo.left + 'px',
      width: elementInfo.width + 'px',
      height: elementInfo.height + 'px'
    }"
  >
    <div class="rotate-wrapper" :style="{ transform: `rotate(${elementInfo.rotate}deg)` }">
      <div class="element-content">
        <img class="img" :src="elementInfo.instrumentImg" alt="" />
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import type { PPTListeningPracticeElement } from "@/types/slides"

defineProps<{
  elementInfo: PPTListeningPracticeElement
}>()
</script>

<style lang="scss" scoped>
.base-element-listeningPractice {
  position: absolute;
}
.rotate-wrapper {
  width: 100%;
  height: 100%;
}
.element-content {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: url("./listeningPracticeList/imgs/musicBg.png") no-repeat;
  background-size: 100% 100%;
  position: relative;
  .img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}
</style>
