Banner.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <LayoutContainer>
  3. <v-row>
  4. <v-col cols="12">
  5. <div class="banner-container">
  6. <img
  7. :src="imageSrc"
  8. :alt="imageAlt"
  9. :class="['cover-image', reverseImage ? 'reverse' : '']"
  10. />
  11. <div v-if="logoSrc" class="details-square">
  12. <v-row>
  13. <div class="content-row">
  14. <img
  15. src="/images/logiciels/icons/la-musique.svg"
  16. alt="icon instrument de musique"
  17. class="custom-icon"
  18. />
  19. <p class="description">
  20. {{ squareText }}
  21. </p>
  22. </div>
  23. </v-row>
  24. </div>
  25. <div v-if="logoSrc" :class="'logo-square' + (logoAltTheme ? ' alt-theme' : '')">
  26. <img :src="logoSrc" :alt="logoAlt"/>
  27. </div>
  28. <div class="image-text mt-12">
  29. <slot name="watermark" />
  30. </div>
  31. </div>
  32. </v-col>
  33. </v-row>
  34. </LayoutContainer>
  35. </template>
  36. <script setup lang="ts">
  37. const props = defineProps({
  38. imageSrc: {
  39. type: String,
  40. required: true
  41. },
  42. imageAlt: {
  43. type: String,
  44. default: ""
  45. },
  46. squareText: {
  47. type: String,
  48. default: "École de musique, d'art, de danse, de cirque, conservatoires et MJC"
  49. },
  50. logoSrc: {
  51. type: String as PropType<string | null>,
  52. required: false,
  53. default: null
  54. },
  55. logoAlt: {
  56. type: String,
  57. required: false,
  58. default: ""
  59. },
  60. logoAltTheme: {
  61. type: Boolean,
  62. default: false
  63. },
  64. reverseImage: {
  65. type: Boolean,
  66. default: false
  67. }
  68. });
  69. </script>
  70. <style scoped lang="scss">
  71. .banner-container {
  72. position: relative;
  73. overflow: hidden;
  74. .image-text {
  75. position: absolute;
  76. top: 40px;
  77. left: 20px;
  78. color: white;
  79. font-size: 3rem;
  80. width: 30rem;
  81. font-style: italic;
  82. font-weight: 300;
  83. line-height: 40px;
  84. }
  85. }
  86. .cover-image {
  87. width: 100%;
  88. min-height: 400px;
  89. max-height: 400px;
  90. object-fit: cover;
  91. object-position: center var(--banner-center-image);
  92. transition: transform 0.2s;
  93. margin: 0 auto;
  94. }
  95. .reverse {
  96. transform: scaleX(-1);
  97. }
  98. .custom-icon {
  99. width: 3rem;
  100. height: 3rem;
  101. margin-top: .5rem;
  102. }
  103. .details-square {
  104. position: absolute;
  105. bottom: 0.4rem;
  106. right: 0;
  107. width: 13rem;
  108. height: 10rem;
  109. background: var(--secondary-color);
  110. }
  111. .logo-square {
  112. position: absolute;
  113. bottom: 0.4rem;
  114. right: 13rem;
  115. width: 13rem;
  116. height: 10rem;
  117. img {
  118. width: 100%;
  119. height: 50%;
  120. margin-top: 2.5rem;
  121. }
  122. }
  123. .logo-square:not(.alt-theme) {
  124. background: var(--primary-color);
  125. }
  126. .description {
  127. color: var(--on-secondary-color);
  128. font-weight: 300;
  129. font-size: 0.8rem;
  130. text-align: center;
  131. display: flex;
  132. align-items: center;
  133. margin: 0.5rem 2rem 1rem;
  134. }
  135. .content-row {
  136. margin-top: 2rem;
  137. display: flex;
  138. flex-direction: column;
  139. justify-content: space-around;
  140. align-items: center;
  141. height: 100%;
  142. }
  143. .icon {
  144. margin-left: 2rem;
  145. margin-right: 2rem;
  146. }
  147. </style>