Banner.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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"
  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. });
  65. </script>
  66. <style scoped lang="scss">
  67. .banner-container {
  68. position: relative;
  69. overflow: hidden;
  70. .image-text {
  71. position: absolute;
  72. top: 40px;
  73. left: 20px;
  74. color: white;
  75. font-size: 3rem;
  76. width: 30rem;
  77. font-style: italic;
  78. font-weight: 300;
  79. line-height: 40px;
  80. }
  81. }
  82. .cover-image {
  83. width: 100%;
  84. min-height: 400px;
  85. max-height: 400px;
  86. object-fit: cover;
  87. object-position: center var(--banner-center-image);
  88. transition: transform 0.2s;
  89. margin: 0 auto;
  90. transform: scaleX(-1);
  91. }
  92. .custom-icon {
  93. width: 3rem;
  94. height: 3rem;
  95. margin-top: .5rem;
  96. }
  97. .details-square {
  98. position: absolute;
  99. bottom: 0.4rem;
  100. right: 0;
  101. width: 13rem;
  102. height: 10rem;
  103. background: var(--secondary-color);
  104. }
  105. .logo-square {
  106. position: absolute;
  107. bottom: 0.4rem;
  108. right: 13rem;
  109. width: 13rem;
  110. height: 10rem;
  111. img {
  112. width: 100%;
  113. height: 50%;
  114. margin-top: 2.5rem;
  115. }
  116. }
  117. .logo-square:not(.alt-theme) {
  118. background: var(--primary-color);
  119. }
  120. .description {
  121. color: var(--on-secondary-color);
  122. font-weight: 300;
  123. font-size: 0.8rem;
  124. text-align: center;
  125. display: flex;
  126. align-items: center;
  127. margin: 0.5rem 2rem 1rem;
  128. }
  129. .content-row {
  130. margin-top: 2rem;
  131. display: flex;
  132. flex-direction: column;
  133. justify-content: space-around;
  134. align-items: center;
  135. height: 100%;
  136. }
  137. .icon {
  138. margin-left: 2rem;
  139. margin-right: 2rem;
  140. }
  141. </style>