Card.vue 2.2 KB

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