Banner.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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/components/banner/Icone_instruments_de_musique_trompette_et_tambour_avec_des_notes_de_musique.svg"
  16. alt="Icône instruments de musique trompette et tambour avec des notes 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. min-height: 400px;
  75. max-height: 400px;
  76. .image-text {
  77. position: absolute;
  78. top: 40px;
  79. left: 20px;
  80. color: white;
  81. font-size: 3rem;
  82. width: 30rem;
  83. font-style: italic;
  84. font-weight: 300;
  85. line-height: 40px;
  86. }
  87. }
  88. .cover-image {
  89. width: 100%;
  90. min-height: 400px;
  91. max-height: 400px;
  92. object-fit: cover;
  93. object-position: center var(--banner-center-image);
  94. transition: transform 0.2s;
  95. margin: 0 auto;
  96. @media (max-width: 600px) {
  97. min-height: 0;
  98. }
  99. }
  100. .reverse {
  101. transform: scaleX(-1);
  102. }
  103. .custom-icon {
  104. width: 3rem;
  105. height: 3rem;
  106. margin-top: .5rem;
  107. }
  108. .details-square {
  109. position: absolute;
  110. bottom: 0;
  111. right: 0;
  112. width: 13rem;
  113. height: 10rem;
  114. background: var(--secondary-color);
  115. @media (max-width: 600px) {
  116. width: 50%;
  117. }
  118. }
  119. .logo-square {
  120. position: absolute;
  121. bottom: 0;
  122. right: 13rem;
  123. width: 13rem;
  124. height: 10rem;
  125. img {
  126. width: 100%;
  127. height: 50%;
  128. margin-top: 2.5rem;
  129. }
  130. @media (max-width: 600px) {
  131. right: 50%;
  132. width: 50%;
  133. }
  134. }
  135. .logo-square:not(.alt-theme) {
  136. background: var(--primary-color);
  137. }
  138. .description {
  139. color: var(--on-secondary-color);
  140. font-weight: 300;
  141. font-size: 0.8rem;
  142. text-align: center;
  143. display: flex;
  144. align-items: center;
  145. margin: 0.5rem 2rem 1rem;
  146. }
  147. .content-row {
  148. margin-top: 2rem;
  149. display: flex;
  150. flex-direction: column;
  151. justify-content: space-around;
  152. align-items: center;
  153. height: 100%;
  154. }
  155. .icon {
  156. margin-left: 2rem;
  157. margin-right: 2rem;
  158. }
  159. </style>