BaseCloudCoachElement.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div
  3. class="base-element-cloudCoach"
  4. :style="{
  5. top: elementInfo.top + 'px',
  6. left: elementInfo.left + 'px',
  7. width: elementInfo.width + 'px',
  8. height: elementInfo.height + 'px'
  9. }"
  10. >
  11. <div class="rotate-wrapper" :style="{ transform: `rotate(${elementInfo.rotate}deg)` }">
  12. <div class="element-content">
  13. <div class="title" :style="{ fontSize: 14 / scale + 'px' }">{{ elementInfo.title || "乐谱" }}</div>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script lang="ts" setup>
  19. import type { PPTCloudCoachElement } from "@/types/slides"
  20. import { ref, inject } from "vue"
  21. import { injectKeySlideScale } from "@/types/injectKey"
  22. defineProps<{
  23. elementInfo: PPTCloudCoachElement
  24. }>()
  25. const scale = inject(injectKeySlideScale) || ref(1)
  26. </script>
  27. <style lang="scss" scoped>
  28. .base-element-cloudCoach {
  29. position: absolute;
  30. }
  31. .rotate-wrapper {
  32. width: 100%;
  33. height: 100%;
  34. }
  35. .element-content {
  36. width: 100%;
  37. height: 100%;
  38. display: flex;
  39. justify-content: center;
  40. align-items: center;
  41. background: url("./cloudCoachList/imgs/musicBg.png") no-repeat;
  42. background-size: 100% 100%;
  43. .title {
  44. white-space: nowrap;
  45. overflow: hidden;
  46. text-overflow: ellipsis;
  47. padding: 0 40px;
  48. color: #fff;
  49. }
  50. }
  51. </style>