Card.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. },
  45. extraHeader: {
  46. type: String,
  47. required: false,
  48. },
  49. color: {
  50. type: String,
  51. required: true,
  52. },
  53. list: {
  54. type: Array,
  55. required: true,
  56. },
  57. })
  58. </script>
  59. <style scoped lang="scss">
  60. .card {
  61. border-width: 1px;
  62. border-top-width: 4px;
  63. height: 100%;
  64. display: flex;
  65. flex-direction: column;
  66. height: 100%;
  67. position: relative;
  68. .title {
  69. padding-top: 10px;
  70. white-space: normal;
  71. text-transform: uppercase;
  72. }
  73. .subtitle {
  74. text-transform: uppercase;
  75. font-weight: bold;
  76. font-size: 1.25rem;
  77. opacity: unset;
  78. }
  79. //1280 1670
  80. :deep(.v-btn) {
  81. padding: 10px;
  82. width: 100%;
  83. @media (min-width: 1280px) and (max-width: 1670px) {
  84. letter-spacing: 0px;
  85. font-size: 11px;
  86. }
  87. }
  88. }
  89. .card-content {
  90. display: flex;
  91. flex-direction: column;
  92. flex: 1 1 auto;
  93. padding: 10px;
  94. }
  95. .card-actions {
  96. margin-top: auto; // pousse les actions en bas
  97. display: flex;
  98. flex-direction: column;
  99. }
  100. .extraBorder {
  101. text-align: center;
  102. text-transform: uppercase;
  103. margin: auto;
  104. border-radius: 0px 0px 5px 5px;
  105. width: 90%;
  106. padding: 2px 10px 2px 10px;
  107. font-weight: bold;
  108. display: block;
  109. }
  110. .card.border-primary {
  111. border-color: rgb(var(--v-theme-primary));
  112. }
  113. .card.border-artist {
  114. border-color: rgb(var(--v-theme-artist));
  115. }
  116. .card.border-school {
  117. border-color: rgb(var(--v-theme-school));
  118. }
  119. .extraBorder.extraBorder-artist {
  120. background: rgb(var(--v-theme-artist));
  121. }
  122. .extraBorder.extraBorder-school {
  123. background: rgb(var(--v-theme-school));
  124. color: #fff;
  125. }
  126. .margin-sup {
  127. margin-top: 30px;
  128. }
  129. </style>