+ pricing menu

This commit is contained in:
AntoninoP 2024-09-27 11:15:11 +02:00
parent 7119d2321c
commit 94c3655a5c
5 changed files with 95 additions and 26 deletions

BIN
src/assets/tier/basique.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
src/assets/tier/premium.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -3,13 +3,50 @@ import Navbar from '../../../components/navbar/Navbar';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import basique from '../../../assets/tier/basique.png';
import standard from '../../../assets/tier/standard.png';
import premium from '../../../assets/tier/premium.png';
const Pricing = ({ user }) => { const Pricing = ({ user }) => {
const navigate = useNavigate(); const navigate = useNavigate();
const groups = [ const groups = [
{ title: 'Gratuit', price: '0 €', features: ['Accès limité', 'Support par e-mail'] }, {
{ title: 'Standard', price: '2 €', features: ['Accès complet', 'Support prioritaire'] }, title: 'Basique',
{ title: 'Premium', price: '9 €', features: ['Accès illimité', 'Support 24/7'] }, price: '0 €',
features: [
{ name: 'Accès au serveurs vanilla', isAvailable: true },
{ name: 'Personalisation complète de vos serveurs', isAvailable: true },
{ name: 'Support par e-mail', isAvailable: true },
{ name: 'Accès au serveurs Mini-jeux', isAvailable: false },
{ name: 'Accès au serveurs de modpacks', isAvailable: false }
],
image: basique
},
{
title: 'Standard',
price: '2 €',
features: [
{ name: 'Accès au serveurs vanilla', isAvailable: true },
{ name: 'Personalisation complète de vos serveurs', isAvailable: true },
{ name: 'Support par e-mail', isAvailable: true },
{ name: 'Accès au serveurs Mini-jeux', isAvailable: true },
{ name: 'Accès au serveurs de modpacks', isAvailable: false }
],
image: standard
},
{
title: 'Premium',
price: '9 €',
features: [
{ name: 'Accès au serveurs vanilla', isAvailable: true },
{ name: 'Personalisation complète de vos serveurs', isAvailable: true },
{ name: 'Support par e-mail', isAvailable: true },
{ name: 'Accès au serveurs Mini-jeux', isAvailable: true },
{ name: 'Accès au serveurs de modpacks', isAvailable: true }
],
image: premium
},
]; ];
const handleSubscribe = (pkg) => { const handleSubscribe = (pkg) => {
@ -28,16 +65,21 @@ const Pricing = ({ user }) => {
<div className={styles.packageList}> <div className={styles.packageList}>
{groups.map((pkg, index) => ( {groups.map((pkg, index) => (
<div key={index} className={styles.packageCard}> <div key={index} className={styles.packageCard}>
<div>
<img src={pkg.image} alt={pkg.title} />
</div>
<h2 className={styles.title}>{pkg.title}</h2> <h2 className={styles.title}>{pkg.title}</h2>
<p className={styles.price}>{pkg.price}</p> <p className={styles.price}>{pkg.price}</p>
<ul className={styles.features}>
{pkg.features.map((feature, idx) => (
<li key={idx}>{feature}</li>
))}
</ul>
<button className={styles.button} onClick={() => handleSubscribe(pkg)}> <button className={styles.button} onClick={() => handleSubscribe(pkg)}>
S&apos;inscrire S&apos;inscrire
</button> </button>
<ul className={styles.features}>
{pkg.features.map((feature, idx) => (
<li key={idx} className={feature.isAvailable ? styles.featureAvailable : styles.featureUnavailable}>
{feature.isAvailable ? '✔️' : '❌'} {feature.name}
</li>
))}
</ul>
</div> </div>
))} ))}
</div> </div>

View File

@ -8,56 +8,83 @@ $secondary-color: #fff;
flex-direction: row; flex-direction: row;
gap: 2rem; gap: 2rem;
padding: 4rem; padding: 4rem;
background-color: $secondary-color;
} }
.packageList{ .packageList {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 2rem; gap: 3rem;
} }
.packageCard { .packageCard {
background-color: $primary-color; position: relative;
color: $secondary-color; background-color: white;
border-radius: .8rem; color: black;
padding: 5rem; border-radius: 0.5rem;
padding: 2rem 1rem;
text-align: center; text-align: center;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); transition: transform 0.3s, box-shadow 0.3s;
transition: transform 0.3s; border: 0.15rem solid #dfdcd5;
&:hover { &:hover {
transform: scale(1.01); transform: scale(1.01);
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}
&:hover .button {
visibility: visible;
opacity: 1;
}
img {
position: center;
width: 4.5rem;
height: auto;
} }
} }
.title { .title {
font-size: 2rem; font-size: 2rem;
margin-bottom: .6rem; margin-bottom: 2rem;
font-weight: 500;
} }
.price { .price {
font-size: 2.5rem; font-size: 2rem;
margin: 1rem 0; margin: 1rem 0;
} }
.features { .features {
list-style-type: none; list-style-type: none;
padding: 0; padding: 0;
margin: 20px 0; margin: 1.5rem 0;
text-align: left;
li { li {
margin: 5px 0; margin: .8rem 0;
} }
} }
.button { .button {
background-color: $secondary-color; visibility: hidden;
opacity: 0;
color: $primary-color; color: $primary-color;
border: none; border: none;
border-radius: 4px; border-radius: 4px;
padding: 10px 20px; padding: 10px 20px;
cursor: pointer; cursor: pointer;
font-size: 16px; font-size: 16px;
transition: background-color 0.3s; margin-top: 1rem;
background-color: #2F2F2F;
color: white;
&:hover {
background-color: darken(#2F2F2F, 10%);
}
}
@media (max-width: 700px) {
.packageList {
flex-direction: column;
}
} }