fullSizeBannerText1.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. <div v-if="cautionText" class="caution--text--small" v-html="cautionText"></div>
  37. </section>
  38. </template>
  39. <script setup>
  40. // Props 정의
  41. const props = defineProps({
  42. height: {
  43. type: String,
  44. default: "100vh",
  45. },
  46. imagePath: {
  47. type: String,
  48. default: "/img/exclusive/1920X1080_exclusive_edited_v2.jpg",
  49. },
  50. mask: {
  51. type: String,
  52. default: "",
  53. validator: (value) => ["", "hidden"].includes(value),
  54. },
  55. textLocation: {
  56. type: String,
  57. default: "bottom",
  58. validator: (value) => ["bottom", "top", "left", "right"].includes(value),
  59. },
  60. textColor: {
  61. type: String,
  62. default: "#fff",
  63. validator: (value) => ["#fff", "#020203"].includes(value),
  64. },
  65. altText: {
  66. type: String,
  67. default: "",
  68. },
  69. subTitle: {
  70. type: String,
  71. default: "",
  72. },
  73. btnText: {
  74. type: String,
  75. default: "",
  76. },
  77. btnLink: {
  78. type: String,
  79. default: "",
  80. },
  81. btnTarget: {
  82. type: String,
  83. default: "",
  84. },
  85. btnText2: {
  86. type: String,
  87. default: "",
  88. },
  89. btnLink2: {
  90. type: String,
  91. default: "",
  92. },
  93. btnTarget2: {
  94. type: String,
  95. default: "",
  96. },
  97. type: {
  98. type: String,
  99. default: "contain", // 'horz' , 'vert'
  100. validator: (value) => ["contain", "cover"].includes(value),
  101. },
  102. cautionText: {
  103. type: String,
  104. default: "",
  105. },
  106. });
  107. </script>