Banner.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. @media (max-width: 600px) {
  95. min-height: 0;
  96. }
  97. }
  98. .reverse {
  99. transform: scaleX(-1);
  100. }
  101. .custom-icon {
  102. width: 3rem;
  103. height: 3rem;
  104. margin-top: .5rem;
  105. }
  106. .details-square {
  107. position: absolute;
  108. bottom: 0;
  109. right: 0;
  110. width: 13rem;
  111. height: 10rem;
  112. background: var(--secondary-color);
  113. @media (max-width: 600px) {
  114. width: 50%;
  115. }
  116. }
  117. .logo-square {
  118. position: absolute;
  119. bottom: 0;
  120. right: 10rem;
  121. width: 13rem;
  122. height: 10rem;
  123. img {
  124. width: 100%;
  125. height: 50%;
  126. margin-top: 2.5rem;
  127. }
  128. @media (max-width: 600px) {
  129. right: 50%;
  130. width: 50%;
  131. }
  132. }
  133. .logo-square:not(.alt-theme) {
  134. background: var(--primary-color);
  135. }
  136. .description {
  137. color: var(--on-secondary-color);
  138. font-weight: 300;
  139. font-size: 0.8rem;
  140. text-align: center;
  141. display: flex;
  142. align-items: center;
  143. margin: 0.5rem 2rem 1rem;
  144. }
  145. .content-row {
  146. margin-top: 2rem;
  147. display: flex;
  148. flex-direction: column;
  149. justify-content: space-around;
  150. align-items: center;
  151. height: 100%;
  152. }
  153. .icon {
  154. margin-left: 2rem;
  155. margin-right: 2rem;
  156. }
  157. </style>