fullSizeBannerText1.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <section
  3. class="img--section--full"
  4. :class="mask"
  5. :data-type="type"
  6. :data-text-location="textLocation"
  7. >
  8. <div :style="{ height: height + 'px' }">
  9. <picture>
  10. <source media="(max-width: 768px)" :srcset="`${imagePath}?width=768`" />
  11. <source media="(max-width: 1024px)" :srcset="`${imagePath}?width=1024`" />
  12. <source media="(max-width: 1440px)" :srcset="`${imagePath}?width=1440`" />
  13. <source media="(min-width: 1440px)" :srcset="`${imagePath}?width=1920`" />
  14. <img data-object-fit="true" :src="imagePath" :alt="altText" loading="lazy" />
  15. </picture>
  16. <div class="alt--text" v-if="altText" :style="'color:' + textColor">
  17. {{ altText }}
  18. </div>
  19. <div class="sub--title" v-if="subTitle" :style="'color:' + textColor">
  20. {{ subTitle }}
  21. </div>
  22. <div class="btn--wrapper" v-if="btnText">
  23. <NuxtLink :to="btnLink" :target="btnTarget" class="default--round--btn reverse">
  24. {{ btnText }}
  25. </NuxtLink>
  26. <NuxtLink
  27. v-if="btnText2"
  28. :to="btnText2"
  29. :target="btnTarget2"
  30. class="default--round--btn"
  31. >
  32. {{ btnText2 }}
  33. </NuxtLink>
  34. </div>
  35. </div>
  36. </section>
  37. </template>
  38. <script setup>
  39. // Props 정의
  40. const props = defineProps({
  41. height: {
  42. type: String,
  43. default: "100vh",
  44. },
  45. imagePath: {
  46. type: String,
  47. default: "/img/exclusive/1920X1080_exclusive_edited_v2.jpg",
  48. },
  49. mask: {
  50. type: String,
  51. default: "",
  52. validator: (value) => ["", "hidden"].includes(value),
  53. },
  54. textLocation: {
  55. type: String,
  56. default: "bottom",
  57. validator: (value) => ["bottom", "top", "left", "right"].includes(value),
  58. },
  59. textColor: {
  60. type: String,
  61. default: "#fff",
  62. validator: (value) => ["#fff", "#020203"].includes(value),
  63. },
  64. altText: {
  65. type: String,
  66. default: "",
  67. },
  68. subTitle: {
  69. type: String,
  70. default: "",
  71. },
  72. btnText: {
  73. type: String,
  74. default: "",
  75. },
  76. btnLink: {
  77. type: String,
  78. default: "",
  79. },
  80. btnTarget: {
  81. type: String,
  82. default: "",
  83. },
  84. btnText2: {
  85. type: String,
  86. default: "",
  87. },
  88. btnLink2: {
  89. type: String,
  90. default: "",
  91. },
  92. btnTarget2: {
  93. type: String,
  94. default: "",
  95. },
  96. type: {
  97. type: String,
  98. default: "contain", // 'horz' , 'vert'
  99. validator: (value) => ["contain", "cover"].includes(value),
  100. },
  101. });
  102. </script>