Comparatif.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <LayoutContainer>
  3. <v-row>
  4. <table>
  5. <thead>
  6. <tr>
  7. <th/>
  8. <th>
  9. <p class="standard">Standard</p>
  10. <p class="from">À partir de</p>
  11. <p class="price">
  12. {{ standardPrice }} <span class="ttc">ttc</span>
  13. </p>
  14. <p class="month">/mois</p>
  15. </th>
  16. <th class="premium-column">
  17. <p class="standard">Premium</p>
  18. <p class="from">À partir de</p>
  19. <p class="price">
  20. {{ premiumPrice }} <span class="ttc">ttc</span>
  21. </p>
  22. <p class="month">/mois</p>
  23. </th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. <tr
  28. v-for="(item, index) in items"
  29. :key="item.label"
  30. >
  31. <td class="label-column">
  32. {{ item.label }}
  33. </td>
  34. <td>
  35. <v-icon
  36. v-if="item.includedInStandard === true"
  37. icon="far fa-check-circle"
  38. size="18"
  39. />
  40. <v-icon
  41. v-else-if="item.includedInStandard === false"
  42. icon="far fa-times-circle"
  43. size="18"
  44. color="red"
  45. />
  46. <span v-else>
  47. {{ item.includedInStandard }}
  48. </span>
  49. </td>
  50. <td>
  51. <v-icon
  52. v-if="item.includedInPremium === true"
  53. icon="far fa-check-circle"
  54. size="18"
  55. />
  56. <v-icon
  57. v-else-if="item.includedInPremium === false"
  58. icon="far fa-times-circle"
  59. size="18"
  60. color="red"
  61. />
  62. <span v-else>
  63. {{ item.includedInPremium }}
  64. </span>
  65. </td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. </v-row>
  70. </LayoutContainer>
  71. </template>
  72. <script setup lang="ts">
  73. import { ComparisonItem } from "~/types/interface";
  74. const props = defineProps({
  75. standardPrice: {
  76. type: String,
  77. required: true
  78. },
  79. premiumPrice: {
  80. type: String,
  81. required: true
  82. },
  83. items: {
  84. type: Array as PropType<Array<ComparisonItem>>,
  85. required: true
  86. }
  87. });
  88. </script>
  89. <style scoped lang="scss">
  90. .v-row {
  91. align-items: center;
  92. display: flex;
  93. flex-direction: row;
  94. justify-content: center;
  95. margin-left: auto;
  96. margin-right: auto;
  97. width: 90%;
  98. }
  99. table {
  100. width: 70%;
  101. margin-top: 1rem;
  102. margin-right: auto;
  103. margin-left: auto;
  104. border: none;
  105. border-collapse: collapse;
  106. }
  107. th {
  108. height: 8rem;
  109. font-weight: 400;
  110. font-size: 30px;
  111. line-height: 34px;
  112. }
  113. tr {
  114. height: 3rem;
  115. text-align: center;
  116. }
  117. tbody tr:nth-child(even) {
  118. background-color: var(--secondary-color);
  119. }
  120. td {
  121. padding-right: 5rem;
  122. }
  123. td:first-child {
  124. text-align: left;
  125. padding-left: 20px;
  126. font-weight: 600;
  127. font-size: 12px;
  128. line-height: 16px;
  129. letter-spacing: 0.18em;
  130. text-transform: uppercase;
  131. color: var(--on-neutral-color-alt);
  132. }
  133. .standard {
  134. font-weight: 600;
  135. font-size: 12px;
  136. line-height: 16px;
  137. text-align: center;
  138. letter-spacing: 0.18em;
  139. text-transform: uppercase;
  140. color: var(--primary-color);
  141. padding-right: 5rem;
  142. margin-bottom: 1rem;
  143. }
  144. .from,
  145. .ttc {
  146. font-weight: 300;
  147. font-size: 12px;
  148. line-height: 14px;
  149. text-align: center;
  150. color: var(--on-neutral-color-alt);
  151. padding-right: 5rem;
  152. }
  153. .ttc {
  154. text-transform: uppercase;
  155. }
  156. .price,
  157. .month {
  158. font-size: 30px;
  159. line-height: 34px;
  160. text-align: center;
  161. color: var(--on-neutral-color-alt);
  162. }
  163. .month {
  164. padding-right: 5rem;
  165. }
  166. </style>