| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405 |
- <template>
- <LayoutContainer>
- <div class="premium-container">
- <v-row class="center-90">
- <table v-if="mdAndUp">
- <thead>
- <tr>
- <th />
- <th>
- <p class="standard">Standard</p>
- <p v-if="showFrom" class="from">À partir de</p>
- <p class="price">
- {{ standardPrice }} <span class="ttc">ttc</span>
- </p>
- <p class="month">/mois *</p>
- </th>
- <th class="premium-column">
- <p class="standard">Premium</p>
- <p v-if="showFrom" class="from">À partir de</p>
- <p class="price">
- {{ premiumPrice }} <span class="ttc">ttc</span>
- </p>
- <p class="month">/mois *</p>
- </th>
- </tr>
- </thead>
- <tbody>
- <tr v-for="item in items" :key="item.label">
- <td class="label-column">
- {{ item.label }}
- </td>
- <td>
- <v-icon
- v-if="item.includedInStandard === true"
- icon="far fa-check-circle"
- size="18"
- />
- <v-icon
- v-else-if="item.includedInStandard === false"
- icon="far fa-times-circle"
- size="18"
- color="red"
- />
- <span v-else>
- {{ item.includedInStandard }}
- </span>
- </td>
- <td>
- <v-icon
- v-if="item.includedInPremium === true"
- icon="far fa-check-circle"
- size="18"
- />
- <v-icon
- v-else-if="item.includedInPremium === false"
- icon="far fa-times-circle"
- size="18"
- color="red"
- />
- <span v-else>
- {{ item.includedInPremium }}
- </span>
- </td>
- </tr>
- </tbody>
- </table>
- <div v-else>
- <div class="d-flex flex-row flex-grow-1 justify-center mt-2">
- <v-btn
- :disabled="carouselPos === 0"
- icon="fas fa-chevron-left"
- class="mr-6"
- aria-label="Précédent"
- @click="goToPrevious"
- />
- <v-btn
- :disabled="carouselPos === 1"
- icon="fas fa-chevron-right"
- aria-label="Suivant"
- @click="goToNext"
- />
- </div>
- <v-carousel
- v-model="carouselPos"
- :hide-delimiters="true"
- :show-arrows="false"
- :height="height"
- >
- <v-carousel-item>
- <h4>Standard</h4>
- <div>
- <p class="from">À partir de</p>
- <p class="price">
- {{ standardPrice }} <span class="ttc">ttc</span>
- <span class="month">/mois</span>
- </p>
- </div>
- <table>
- <tbody>
- <tr v-for="item in items" :key="item.label">
- <td class="label-column">
- {{ item.label }}
- </td>
- <td>
- <v-icon
- v-if="item.includedInStandard === true"
- icon="far fa-check-circle"
- size="18"
- />
- <v-icon
- v-else-if="item.includedInStandard === false"
- icon="far fa-times-circle"
- size="18"
- color="red"
- />
- <span v-else>
- {{ item.includedInStandard }}
- </span>
- </td>
- </tr>
- </tbody>
- </table>
- </v-carousel-item>
- <v-carousel-item>
- <h4>Premium</h4>
- <div>
- <p class="from">À partir de</p>
- <p class="price">
- {{ premiumPrice }} <span class="ttc">ttc</span>
- <span class="month">/mois</span>
- </p>
- </div>
- <table>
- <tbody>
- <tr v-for="item in items" :key="item.label">
- <td class="label-column">
- {{ item.label }}
- </td>
- <td>
- <v-icon
- v-if="item.includedInPremium === true"
- icon="far fa-check-circle"
- size="18"
- />
- <v-icon
- v-else-if="item.includedInPremium === false"
- icon="far fa-times-circle"
- size="18"
- color="red"
- />
- <span v-else>
- {{ item.includedInPremium }}
- </span>
- </td>
- </tr>
- </tbody>
- </table>
- </v-carousel-item>
- </v-carousel>
- </div>
- <div class="asterisk">
- <span> * Tarif public 2025. Abonnement payable annuellement. </span>
- </div>
- </v-row>
- </div>
- </LayoutContainer>
- </template>
- <script setup lang="ts">
- import { useDisplay } from 'vuetify'
- import type { PropType } from 'vue'
- import type { ComparisonItem } from '~/types/interface'
- const { mdAndUp } = useDisplay()
- const props = defineProps({
- standardPrice: {
- type: String,
- required: true,
- },
- premiumPrice: {
- type: String,
- required: true,
- },
- items: {
- type: Array as PropType<Array<ComparisonItem>>,
- required: true,
- },
- showFrom: {
- type: Boolean,
- required: false,
- default: false,
- },
- })
- const height = computed(() => 150 + props.items.length * 48)
- const carouselPos = ref(0)
- const goToPrevious = () => {
- carouselPos.value = 0
- }
- const goToNext = () => {
- carouselPos.value = 1
- }
- </script>
- <style scoped lang="scss">
- .v-row {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: center;
- }
- table {
- width: 70%;
- margin-top: 1rem;
- margin-right: auto;
- margin-left: auto;
- border: none;
- border-collapse: collapse;
- @media (max-width: 940px) {
- width: 100%;
- }
- }
- th {
- height: 8rem;
- font-weight: 400;
- font-size: 30px;
- line-height: 34px;
- @media (max-width: 600px) {
- font-size: 18px;
- }
- }
- tr {
- height: 3rem;
- text-align: center;
- }
- tbody tr:nth-child(even) {
- background-color: var(--secondary-color);
- }
- td {
- padding-right: 5rem;
- @media (max-width: 600px) {
- padding-right: 0;
- }
- }
- td:first-child {
- text-align: left;
- padding-left: 20px;
- font-weight: 600;
- font-size: 12px;
- line-height: 16px;
- letter-spacing: 0.18em;
- text-transform: uppercase;
- color: var(--on-neutral-color-alt);
- @media (max-width: 600px) {
- padding-left: 5px;
- }
- }
- .standard {
- font-weight: 600;
- font-size: 12px;
- line-height: 16px;
- text-align: center;
- letter-spacing: 0.18em;
- text-transform: uppercase;
- padding-right: 5rem;
- margin-bottom: 1rem;
- }
- .from,
- .ttc {
- font-weight: 300;
- font-size: 12px;
- line-height: 14px;
- text-align: center;
- color: var(--on-neutral-color-alt);
- padding-right: 5rem;
- }
- .ttc {
- text-transform: uppercase;
- }
- .price,
- .month {
- font-size: 30px;
- line-height: 34px;
- text-align: center;
- color: var(--on-neutral-color-alt);
- }
- .month {
- padding-right: 5rem;
- @media (max-width: 600px) {
- padding-right: 0;
- }
- }
- .v-carousel {
- h4 {
- text-align: center;
- margin: 24px auto 12px auto;
- text-transform: uppercase;
- letter-spacing: 0.25em;
- }
- p {
- padding-right: 0;
- }
- .price {
- margin-top: 12px;
- }
- .ttc {
- padding-right: 10px;
- }
- }
- .asterisk {
- display: flex;
- margin: 4px auto 0 auto;
- width: 70%;
- justify-content: flex-end;
- font-style: italic;
- }
- table tr th:nth-child(3),
- table tr td:nth-child(3) {
- border-left: 2px solid black;
- border-right: 2px solid black;
- width: 15rem;
- padding: 1rem;
- position: relative;
- }
- table tr:nth-child(1) th:nth-child(3) {
- border-bottom: none !important;
- }
- .premium-column {
- position: relative;
- z-index: 10;
- border-radius: 0 15px 15px 0;
- }
- .premium-column p,
- .premium-column .month,
- .premium-column .price {
- border: none !important;
- }
- thead th:nth-child(3) {
- border-top: 2px solid black;
- }
- tbody tr:last-child td:nth-child(3) {
- border-bottom: 2px solid black;
- border-radius: 0 0 15px 0;
- }
- .premium-column p,
- .premium-column .month,
- .premium-column .price,
- .premium-column .ttc {
- margin: 0;
- padding: 0;
- }
- </style>
|