fullSizeBannerText1.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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" :style="'color:' + textColor">{{ altText }}</div>
  17. </div>
  18. </section>
  19. </template>
  20. <script setup>
  21. // Props 정의
  22. const props = defineProps({
  23. height: {
  24. type: String,
  25. default: "100vh",
  26. },
  27. imagePath: {
  28. type: String,
  29. default: "/img/exclusive/1920X1080_exclusive_edited_v2.jpg",
  30. },
  31. mask: {
  32. type: String,
  33. default: "",
  34. validator: (value) => ["", "hidden"].includes(value),
  35. },
  36. textLocation: {
  37. type: String,
  38. default: "bottom",
  39. validator: (value) => ["bottom", "top", "left", "right"].includes(value),
  40. },
  41. textColor: {
  42. type: String,
  43. default: "#fff",
  44. validator: (value) => ["#fff", "#020203"].includes(value),
  45. },
  46. altText: {
  47. type: String,
  48. default: "Banner Image",
  49. },
  50. type: {
  51. type: String,
  52. default: "contain", // 'horz' , 'vert'
  53. validator: (value) => ["contain", "cover"].includes(value),
  54. },
  55. });
  56. </script>