Banner.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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>
  29. </v-col>
  30. </v-row>
  31. </LayoutContainer>
  32. </template>
  33. <script setup lang="ts">
  34. const props = defineProps({
  35. imageSrc: {
  36. type: String,
  37. required: true
  38. },
  39. imageAlt: {
  40. type: String,
  41. default: ""
  42. },
  43. squareText: {
  44. type: String,
  45. default: "École de musique, d'art, de danse, de cirque, conservatoires et MJC"
  46. },
  47. logoSrc: {
  48. type: String as PropType<string | null>,
  49. required: false,
  50. default: null
  51. },
  52. logoAlt: {
  53. type: String,
  54. required: false,
  55. default: ""
  56. },
  57. logoAltTheme: {
  58. type: Boolean,
  59. default: false
  60. }
  61. });
  62. </script>
  63. <style scoped lang="scss">
  64. .banner-container {
  65. position: relative;
  66. overflow: hidden;
  67. }
  68. .cover-image {
  69. width: 100%;
  70. min-height: 400px;
  71. max-height: 400px;
  72. object-fit: cover;
  73. object-position: center 20%;
  74. transition: transform 0.2s;
  75. margin: 0 auto;
  76. transform: scaleX(-1);
  77. }
  78. .custom-icon {
  79. width: 3rem;
  80. height: 3rem;
  81. margin-top: .5rem;
  82. }
  83. .details-square {
  84. position: absolute;
  85. bottom: 0.4rem;
  86. right: 0;
  87. width: 13rem;
  88. height: 10rem;
  89. background: var(--secondary-color);
  90. }
  91. .logo-square {
  92. position: absolute;
  93. bottom: 0.4rem;
  94. right: 13rem;
  95. width: 13rem;
  96. height: 10rem;
  97. img {
  98. width: 100%;
  99. height: 50%;
  100. margin-top: 2.5rem;
  101. }
  102. }
  103. .logo-square:not(.alt-theme) {
  104. background: var(--primary-color);
  105. }
  106. .description {
  107. color: var(--on-secondary-color);
  108. font-weight: 300;
  109. font-size: 0.8rem;
  110. text-align: center;
  111. display: flex;
  112. align-items: center;
  113. margin: 0.5rem 2rem 1rem;
  114. }
  115. .content-row {
  116. margin-top: 2rem;
  117. display: flex;
  118. flex-direction: column;
  119. justify-content: space-around;
  120. align-items: center;
  121. height: 100%;
  122. }
  123. .icon {
  124. margin-left: 2rem;
  125. margin-right: 2rem;
  126. }
  127. </style>