Card.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <v-card
  3. elevation="2"
  4. outlined
  5. shaped
  6. class="card"
  7. :class="{ ['border-' + color]: true }"
  8. >
  9. <span
  10. v-if="extraHeader"
  11. class="extraBorder"
  12. :class="'extraBorder-' + color"
  13. >{{ extraHeader }}</span
  14. >
  15. <div class="card-content">
  16. <!-- Titre -->
  17. <v-card-title class="title" :class="{ ['margin-sup']: !extraHeader }">
  18. {{ title }}
  19. </v-card-title>
  20. <v-card-subtitle class="subtitle">
  21. {{ subTitle }}
  22. <slot name="card.subTitle" />
  23. </v-card-subtitle>
  24. <!-- Texte -->
  25. <v-card-text>
  26. <LayoutPagesSubscriptionList :elements="list" :color="color" />
  27. </v-card-text>
  28. <!-- Actions -->
  29. <v-card-actions class="mb-3 card-actions">
  30. <slot name="card.action" />
  31. </v-card-actions>
  32. </div>
  33. </v-card>
  34. </template>
  35. <script setup lang="ts">
  36. const props = defineProps({
  37. title: {
  38. type: String,
  39. required: true,
  40. },
  41. subTitle: {
  42. type: String,
  43. required: false,
  44. default: ''
  45. },
  46. extraHeader: {
  47. type: String,
  48. required: false,
  49. default: ''
  50. },
  51. color: {
  52. type: String,
  53. required: true,
  54. },
  55. list: {
  56. type: Array,
  57. required: true,
  58. },
  59. })
  60. </script>
  61. <style scoped lang="scss">
  62. .card {
  63. border-width: 1px;
  64. border-top-width: 4px;
  65. height: 100%;
  66. display: flex;
  67. flex-direction: column;
  68. height: 100%;
  69. position: relative;
  70. .title {
  71. padding-top: 10px;
  72. white-space: normal;
  73. text-transform: uppercase;
  74. }
  75. .subtitle {
  76. text-transform: uppercase;
  77. font-weight: bold;
  78. font-size: 1.25rem;
  79. opacity: unset;
  80. }
  81. //1280 1670
  82. :deep(.v-btn) {
  83. padding: 10px;
  84. width: 100%;
  85. @media (min-width: 1280px) and (max-width: 1670px) {
  86. letter-spacing: 0px;
  87. font-size: 11px;
  88. }
  89. }
  90. }
  91. .card-content {
  92. display: flex;
  93. flex-direction: column;
  94. flex: 1 1 auto;
  95. padding: 10px;
  96. }
  97. .card-actions {
  98. margin-top: auto; // pousse les actions en bas
  99. display: flex;
  100. flex-direction: column;
  101. }
  102. .extraBorder {
  103. text-align: center;
  104. text-transform: uppercase;
  105. margin: auto;
  106. border-radius: 0px 0px 5px 5px;
  107. width: 90%;
  108. padding: 2px 10px 2px 10px;
  109. font-weight: bold;
  110. display: block;
  111. }
  112. .card.border-primary {
  113. border-color: rgb(var(--v-theme-primary));
  114. }
  115. .card.border-artist {
  116. border-color: rgb(var(--v-theme-artist));
  117. }
  118. .card.border-school {
  119. border-color: rgb(var(--v-theme-school));
  120. }
  121. .extraBorder.extraBorder-artist {
  122. background: rgb(var(--v-theme-artist));
  123. }
  124. .extraBorder.extraBorder-school {
  125. background: rgb(var(--v-theme-school));
  126. color: #fff;
  127. }
  128. .margin-sup {
  129. margin-top: 30px;
  130. }
  131. </style>