Comparatif.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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 type { 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-family: "Barlow", serif;
  110. font-style: normal;
  111. font-weight: 400;
  112. font-size: 30px;
  113. line-height: 34px;
  114. }
  115. tr {
  116. height: 3rem;
  117. text-align: center;
  118. }
  119. tbody tr:nth-child(even) {
  120. background-color: var(--secondary-color);
  121. }
  122. td {
  123. padding-right: 5rem;
  124. }
  125. td:first-child {
  126. text-align: left;
  127. padding-left: 20px;
  128. font-family: "Barlow", serif;
  129. font-style: normal;
  130. font-weight: 600;
  131. font-size: 12px;
  132. line-height: 16px;
  133. letter-spacing: 0.18em;
  134. text-transform: uppercase;
  135. color: var(--on-neutral-color-alt);
  136. }
  137. .standard {
  138. font-style: normal;
  139. font-weight: 600;
  140. font-size: 12px;
  141. line-height: 16px;
  142. text-align: center;
  143. letter-spacing: 0.18em;
  144. text-transform: uppercase;
  145. color: var(--primary-color);
  146. padding-right: 5rem;
  147. margin-bottom: 1rem;
  148. }
  149. .from,
  150. .ttc {
  151. font-weight: 300;
  152. font-size: 12px;
  153. line-height: 14px;
  154. text-align: center;
  155. color: var(--on-neutral-color-alt);
  156. padding-right: 5rem;
  157. }
  158. .ttc {
  159. text-transform: uppercase;
  160. }
  161. .price,
  162. .month {
  163. font-size: 30px;
  164. line-height: 34px;
  165. text-align: center;
  166. color: var(--on-neutral-color-alt);
  167. }
  168. .month {
  169. padding-right: 5rem;
  170. }
  171. </style>