Comparatif.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <LayoutContainer>
  3. <v-row class="row-custom">
  4. <table class="table-comparatif">
  5. <thead>
  6. <tr>
  7. <th class="thead" />
  8. <th class="thead">
  9. <p class="standard" :style="{ color: color }">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="thead premium-column">
  17. <p class="standard" :style="{ color: color }">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 class="table-body">
  27. <tr
  28. v-for="(row, index) in tableData"
  29. :key="row.id"
  30. class="table-row"
  31. :style="{
  32. backgroundColor: index % 2 !== 0 ? stripeColor : 'white',
  33. }"
  34. >
  35. <td class="table-data-left">{{ row.column1 }}</td>
  36. <td class="table-data-second">
  37. <v-icon
  38. v-if="row.column2 === 'check'"
  39. size="18"
  40. class="far fa-check-circle"
  41. />
  42. <v-icon
  43. v-else-if="row.column2 === 'cross'"
  44. size="18"
  45. class="far fa-times-circle"
  46. color="red"
  47. />
  48. <span v-else>{{ row.column2 }}</span>
  49. </td>
  50. <td class="table-data-second">
  51. <v-icon
  52. v-if="row.column3 === 'check'"
  53. size="18"
  54. class="far fa-check-circle"
  55. />
  56. <v-icon
  57. v-else-if="row.column3 === 'cross'"
  58. size="18"
  59. class="far fa-times-circle"
  60. color="red"
  61. />
  62. <span v-else>{{ row.column3 }}</span>
  63. </td>
  64. </tr>
  65. </tbody>
  66. </table>
  67. </v-row>
  68. </LayoutContainer>
  69. </template>
  70. <script setup>
  71. import { ref } from "vue";
  72. const props = defineProps({
  73. standardPrice: {
  74. type: String,
  75. default: "32,90€",
  76. },
  77. premiumPrice: {
  78. type: String,
  79. default: "46,20€",
  80. },
  81. color: {
  82. type: String,
  83. default: "#0e2d32",
  84. },
  85. stripeColor: {
  86. type: String,
  87. default: "rgba(32, 147, 190, 0.2)",
  88. },
  89. tableData: {
  90. type: Array,
  91. default: () => [],
  92. },
  93. });
  94. </script>
  95. <style scoped>
  96. .table-data-second {
  97. padding-right: 5rem;
  98. }
  99. .standard {
  100. font-family: "Barlow";
  101. font-style: normal;
  102. font-weight: 600;
  103. font-size: 12px;
  104. line-height: 16px;
  105. text-align: center;
  106. letter-spacing: 0.18em;
  107. text-transform: uppercase;
  108. color: #0e2d32;
  109. padding-right: 5rem;
  110. margin-bottom: 1rem;
  111. }
  112. .from,
  113. .ttc {
  114. font-family: "Barlow";
  115. font-style: normal;
  116. font-weight: 300;
  117. font-size: 12px;
  118. line-height: 14px;
  119. text-align: center;
  120. color: #454545;
  121. padding-right: 5rem;
  122. }
  123. .ttc {
  124. text-transform: uppercase;
  125. }
  126. .price,
  127. .month {
  128. font-family: "Barlow";
  129. font-style: normal;
  130. font-weight: 400;
  131. font-size: 30px;
  132. line-height: 34px;
  133. text-align: center;
  134. color: #454545;
  135. }
  136. .month {
  137. padding-right: 5rem;
  138. }
  139. .table-data-left {
  140. text-align: left;
  141. padding-left: 20px;
  142. font-family: "Barlow";
  143. font-style: normal;
  144. font-weight: 600;
  145. font-size: 12px;
  146. line-height: 16px;
  147. letter-spacing: 0.18em;
  148. text-transform: uppercase;
  149. color: #454545;
  150. }
  151. .table-data {
  152. text-align: left;
  153. padding-left: 20px;
  154. font-family: "Barlow";
  155. font-style: normal;
  156. font-weight: 600;
  157. font-size: 12px;
  158. line-height: 16px;
  159. letter-spacing: 0.18em;
  160. text-transform: uppercase;
  161. color: #454545;
  162. }
  163. .thead {
  164. background-color: #fff;
  165. height: 8rem;
  166. font-family: "Barlow";
  167. font-style: normal;
  168. font-weight: 400;
  169. font-size: 30px;
  170. line-height: 34px;
  171. }
  172. .table-comparatif {
  173. width: 70%;
  174. margin-top: 1rem;
  175. margin-right: auto;
  176. margin-left: auto;
  177. border: none;
  178. border-collapse: collapse;
  179. }
  180. .table-body .table-row:nth-child(odd) {
  181. background-color: rgba(190, 32, 77, 0.2);
  182. }
  183. </style>