Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Membership page added with its content #316

Merged
merged 6 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 28 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,17 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
</tr>
<tr>
<td align="center">
<a href="https://github.com/PavanTeja2005">
<img src="https://avatars.githubusercontent.com/u/98730339?v=4" width="100;" alt="PavanTeja2005"/>
<a href="https://github.com/Jay-1409">
<img src="https://avatars.githubusercontent.com/u/166749819?v=4" width="100;" alt="Jay-1409"/>
<br />
<sub><b>PavanTeja2005</b></sub>
<sub><b>Jay shah</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/vishnuprasad2004">
<img src="https://avatars.githubusercontent.com/u/116942066?v=4" width="100;" alt="vishnuprasad2004"/>
<br />
<sub><b>Vishnu Prasad Korada</b></sub>
</a>
</td>
<td align="center">
Expand All @@ -259,10 +266,10 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
</a>
</td>
<td align="center">
<a href="https://github.com/vishnuprasad2004">
<img src="https://avatars.githubusercontent.com/u/116942066?v=4" width="100;" alt="vishnuprasad2004"/>
<a href="https://github.com/PavanTeja2005">
<img src="https://avatars.githubusercontent.com/u/98730339?v=4" width="100;" alt="PavanTeja2005"/>
<br />
<sub><b>Vishnu Prasad Korada</b></sub>
<sub><b>PavanTeja2005</b></sub>
</a>
</td>
<td align="center">
Expand All @@ -279,15 +286,15 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
<sub><b>Navneet Dadhich</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Aditya90456">
<img src="https://avatars.githubusercontent.com/u/153073510?v=4" width="100;" alt="Aditya90456"/>
<br />
<sub><b>Aditya Bakshi</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/tanishirai">
<img src="https://avatars.githubusercontent.com/u/178164785?v=4" width="100;" alt="tanishirai"/>
Expand Down Expand Up @@ -323,15 +330,15 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
<sub><b>Sawan kushwah </b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/devxMani">
<img src="https://avatars.githubusercontent.com/u/122438942?v=4" width="100;" alt="devxMani"/>
<br />
<sub><b>MANI </b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Ayush215mb">
<img src="https://avatars.githubusercontent.com/u/154300084?v=4" width="100;" alt="Ayush215mb"/>
Expand All @@ -346,6 +353,13 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
<sub><b>Ali Gates</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/chikatlarakesh">
<img src="https://avatars.githubusercontent.com/u/178009894?v=4" width="100;" alt="chikatlarakesh"/>
<br />
<sub><b>CHIKATLA RAKESH</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/mishradev1">
<img src="https://avatars.githubusercontent.com/u/118660840?v=4" width="100;" alt="mishradev1"/>
Expand All @@ -360,22 +374,15 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
<sub><b>Jai Dhingra</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Jay-1409">
<img src="https://avatars.githubusercontent.com/u/166749819?v=4" width="100;" alt="Jay-1409"/>
<br />
<sub><b>Jay shah</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Mohitranag18">
<img src="https://avatars.githubusercontent.com/u/152625405?v=4" width="100;" alt="Mohitranag18"/>
<br />
<sub><b>Mohit Rana </b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/MutiatBash">
<img src="https://avatars.githubusercontent.com/u/108807732?v=4" width="100;" alt="MutiatBash"/>
Expand Down Expand Up @@ -411,6 +418,8 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
<sub><b>Vaibhav-Kumar-K-R</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/lade6501">
<img src="https://avatars.githubusercontent.com/u/83055827?v=4" width="100;" alt="lade6501"/>
Expand Down
162 changes: 162 additions & 0 deletions frontend/src/components/Membership.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/* eslint-disable prettier/prettier */
import React, { useState } from 'react';
import { motion } from 'framer-motion';
import { GiCheckMark } from 'react-icons/gi';
import { useNavigate } from 'react-router-dom';

const membershipData = [
{
title: "Foods + Games Membership",
features: [
"Access to both the food menu and gaming lounge",
"Special discounts on selected food items",
"Free gaming credits each month",
"Exclusive access to members-only events"
],
price: "$50/month",
},
{
title: "Games Only Membership",
features: [
"Unlimited access to all games",
"Free gaming credits every week",
"Invitations to members-only gaming tournaments"
],
price: "$30/month",
},
{
title: "Customizable Add-ons",
features: [
"Free food on game days",
"Extra gaming time",
"Birthday party discounts",
"Free gaming credits every week",
"Invitations to members-only gaming tournaments",
"Exclusive access to members-only events"
],
price: "Varies",
},
];
RamakrushnaBiswal marked this conversation as resolved.
Show resolved Hide resolved

const containerVariants = {
hidden: { opacity: 0, y: 50 },
visible: {
opacity: 1,
y: 0,
transition: {
type: "spring",
stiffness: 50,
damping: 20,
staggerChildren: 0.2,
},
},
};

const cardVariants = {
hidden: { opacity: 0, y: 50 },
visible: { opacity: 1, y: 0 },
};

const Membership = () => {
const navigate = useNavigate();
const [isModalOpen, setIsModalOpen] = useState(false);
const [selectedFeatures, setSelectedFeatures] = useState({});

const handleFeatureChange = (feature) => {
setSelectedFeatures((prev) => ({
...prev,
[feature]: !prev[feature],
}));
};

const handleNext = () => {
navigate('/signup');
};

return (
<motion.div
className="w-full h-auto bg-[#f7e8c3] py-16"
initial="hidden"
animate="visible"
variants={containerVariants}
>
<div className="flex flex-col items-center mb-12">
<h1 className="text-5xl md:text-7xl font-bold text-black tracking-wide mb-6">Membership Plans</h1>
<p className="md:text-2xl text-xl font-sans text-gray-700 text-center max-w-3xl">
Choose the plan that suits your needs and start enjoying exclusive perks!
</p>
</div>

<div className="flex flex-wrap justify-center gap-8 px-4">
{membershipData.map((plan, index) => (
<motion.div
key={index}
className="bg-black bg-opacity-70 shadow-2xl rounded-3xl p-8 max-w-sm w-full transform transition duration-500 hover:scale-105"
whileHover={{ scale: 1.05 }}
variants={cardVariants}
>
<h2 className="text-3xl font-extrabold text-white mb-4">{plan.title}</h2>
<ul className="mb-6">
{plan.features.map((feature, idx) => (
<li key={idx} className="flex items-center mb-2 text-lg text-gray-200">
<GiCheckMark className="text-green-400 mr-2" /> {feature}
</li>
))}
</ul>
<div className="text-2xl font-semibold text-white mb-6">{plan.price}</div>
{plan.title === "Customizable Add-ons" ? (
<button
className="bg-gradient-to-r from-yellow-500 to-orange-500 text-white py-2 px-8 rounded-full hover:from-orange-500 hover:to-yellow-500 transition-all"
onClick={() => setIsModalOpen(true)}
>
Customize Add-ons
</button>
) : (
<button
className="bg-gradient-to-r from-yellow-500 to-orange-500 text-white py-2 px-8 rounded-full hover:from-orange-500 hover:to-yellow-500 transition-all"
onClick={() => navigate('/signup')}
>
Sign Up
</button>
)}
</motion.div>
))}
</div>

{isModalOpen && (
<div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50">
<div className="bg-white p-8 rounded-lg shadow-lg max-w-md w-full">
<h2 className="text-2xl font-bold mb-4">Select Your Add-ons</h2>
<div className="flex flex-col mb-6">
{membershipData[2].features.map((feature, idx) => (
<label key={idx} className="flex items-center mb-2">
<input
type="checkbox"
checked={selectedFeatures[feature] || false}
onChange={() => handleFeatureChange(feature)}
className="mr-2"
/>
{feature}
</label>
))}
</div>
<button
className="bg-gradient-to-r from-yellow-500 to-orange-500 text-white py-2 px-4 rounded-full hover:from-orange-500 hover:to-yellow-500 transition-all"
onClick={handleNext}
>
Next
</button>
<button
className="ml-2 bg-gray-300 text-gray-700 py-2 px-4 rounded-full hover:bg-gray-400 transition-all"
onClick={() => setIsModalOpen(false)}
>
Cancel
</button>
</div>
</div>
)}
</motion.div>
);
};

export default Membership;
2 changes: 2 additions & 0 deletions frontend/src/components/Shared/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const Navbar = () => {
{ name: 'MENU', path: '/menu' },
{ name: 'RESERVATION', path: '/reservation' },
{ name: 'BOARDGAMES', path: '/boardgame' },
{ name: 'MEMBERSHIP', path: '/membership' }, // Add Membership here
RamakrushnaBiswal marked this conversation as resolved.
Show resolved Hide resolved
];

useEffect(() => {
setToken(Cookies.get('authToken'));
});
RamakrushnaBiswal marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/router/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import ResetPassword from '../components/Pages/ResetPassword';
import Admin from '../components/Pages/Admin';
import VerifyOtp from '../components/Pages/VerifyOtp';
import EmailVerify from '../components/Pages/EmailVerify';

import Membership from '../components/Membership';
const router = createBrowserRouter(
createRoutesFromElements(
<Route path="/" element={<App />}>
<Route path="/" element={<App />}>
<Route index={true} path="/" element={<Home />} />
<Route path="/about" element={<About />} />
<Route path="/menu" element={<Menu />} />
Expand All @@ -38,6 +38,8 @@ const router = createBrowserRouter(
<Route path="/admin" element={<Admin />} />
<Route path="/verifyotp/:id" element={<VerifyOtp />} />
<Route path="/email-verify" element={<EmailVerify />} />
<Route path="/membership" element={<Membership />} />

</Route>
)
);
Expand Down
Loading