box.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <div
  3. class="box"
  4. :style="`width:${width}px;height:${height}px`"
  5. >
  6. <div class="box-top">
  7. {{ name }}
  8. <img :src="img32">
  9. <img :src="img31">
  10. <img :src="img33">
  11. </div>
  12. <div class="box-content">
  13. <slot />
  14. </div>
  15. </div>
  16. </template>
  17. <script setup lang='ts'>
  18. import img32 from '@/assets/img/32.svg'
  19. import img31 from '@/assets/img/31.svg'
  20. import img33 from '@/assets/img/33.svg'
  21. defineProps<{
  22. width: number,
  23. height: number,
  24. name: string
  25. }>()
  26. </script>
  27. <style lang="scss" scoped>
  28. .box {
  29. width: 100%;
  30. height: 100%;
  31. &-top {
  32. width: 100%;
  33. height: 40px;
  34. font-weight: 700;
  35. font-style: oblique;
  36. white-space: nowrap;
  37. text-shadow: 1px 1px 10px rgba(0, 255, 255, 0.6980392157);
  38. font-size: 24px;
  39. color: white;
  40. line-height: 40px;
  41. text-indent: 73px;
  42. position: relative;
  43. img {
  44. position: absolute;
  45. left: 0;
  46. top: 0;
  47. width: 100%;
  48. height: 100%;
  49. z-index: -1;
  50. &:first-child {
  51. top: -10px;
  52. width: 60px;
  53. height: 60px;
  54. }
  55. &:last-child {
  56. width: auto;
  57. height: 50%;
  58. left: unset;
  59. right: 45px;
  60. top: 50%;
  61. transform: translate(0, -50%);
  62. }
  63. }
  64. }
  65. &-content {
  66. height: calc(100% - 60px);
  67. background: linear-gradient(180deg, rgba(33, 133, 232, 0.0902) 0%, rgba(0, 170, 255, 0) 99%);
  68. }
  69. }
  70. </style>