Card.vue 2.2 KB

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