Skip to content

Commit

Permalink
implements #469 for landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
jainaryan04 committed Nov 4, 2024
1 parent 14da9f5 commit fea54e9
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 40 deletions.
52 changes: 26 additions & 26 deletions frontend/src/Pages/Herosection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Herosection = () => {
return (
<>
<div className="relative z-50 flex items-center justify-between gap-[88vw]">
<div className="flex flex-row gap-x-2">
<div className="flex flex-col gap-x-2">
<Navbar />
<ThemeToggle />
</div>
Expand All @@ -68,7 +68,7 @@ const Herosection = () => {
</div>

<button type="submit" onClick={UserCLick} className="">
<FaUserAlt className="bg-blue-200 border-2 text-blue-600 border-blue-200 rounded-full w-[55px] h-[55px] p-2 shadow-lg mr-2" />
<FaUserAlt className="bg-blue-200 dark:bg-black border-2 text-blue-600 dark:text-white border-blue-200 rounded-full w-[55px] h-[55px] p-2 shadow-lg mr-2" />
</button>
</div>
</div>
Expand All @@ -79,7 +79,7 @@ const Herosection = () => {
<GoogleTranslate />
</div>

<h1 className="pl-4 text-4xl font-black text-center text-white ">
<h1 className="pl-4 text-4xl font-black text-center text-white">
Namaste !! Yatree{" "}
</h1>
<div className="relative flex items-center justify-center bg-center bg-cover herosection">
Expand All @@ -94,7 +94,7 @@ const Herosection = () => {
</div>
<br></br>

<div className="grid grid-cols-3 gap-2 pb-10 mt-32 md:flex md:flex-row md:justify-evenly justify-items-center ">
<div className="dark:bg-black grid grid-cols-3 gap-2 pb-10 mt-32 md:flex md:flex-row md:justify-evenly justify-items-center ">
<div
type="submit"
onClick={ContributorCLick}
Expand All @@ -104,11 +104,11 @@ const Herosection = () => {
src={contributorsvg}
alt=""
className="
bg-blue-200 border-2 border-blue-100 rounded-full
bg-blue-200 border-2 border-blue-100 rounded-full dark:bg-black
w-[64px] h-[64px] p-2
"
/>
<h1 className="text-xs font-bold text-black">Contributors</h1>
<h1 className="text-xs font-bold text-black dark:text-white">Contributors</h1>
</div>

<div
Expand All @@ -120,10 +120,10 @@ const Herosection = () => {
src={navigationsvg}
alt=""
srcset=""
className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg"
className="dark:bg-black bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg"
/>
<button className="w-24 py-1 mt-2 font-semibold text-white transition-all duration-300 ease-in-out bg-blue-500 rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50">
<h1 className="font-bold text-white">Navigation</h1>
<button className="w-24 py-1 mt-2 font-semibold text-white transition-all duration-300 ease-in-out bg-blue-500 dark:bg-white rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50">
<h1 className="font-bold text-white dark:text-black">Navigation</h1>
</button>
</div>
<div
Expand All @@ -135,14 +135,14 @@ const Herosection = () => {
src={bookingsvg}
alt=""
srcset=""
className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg "
className="bg-blue-200 border-2 dark:bg-black border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg "
/>
<button
type="submit"
onClick={BookingCLick}
className="w-20 py-1 mt-2 font-semibold text-white transition-all duration-300 ease-in-out bg-blue-500 rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50"
className="w-20 py-1 mt-2 font-semibold dark:bg-white text-white transition-all duration-300 ease-in-out bg-blue-500 rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50"
>
<h1 className="font-bold text-white">Booking</h1>
<h1 className="font-bold text-white dark:text-black">Booking</h1>
</button>
</div>
<div
Expand All @@ -154,10 +154,10 @@ const Herosection = () => {
src={stationsvg}
alt=""
srcset=""
className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg"
className="bg-blue-200 dark:bg-black border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg"
/>
<button className="w-20 py-1 mt-2 font-semibold text-white transition-all duration-300 ease-in-out bg-blue-500 rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50">
<h1 className="font-bold text-white">Station</h1>
<button className="w-20 py-1 mt-2 font-semibold text-white transition-all duration-300 ease-in-out bg-blue-500 dark:bg-white rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50">
<h1 className="font-bold text-white dark:text-black">Station</h1>
</button>
</div>
<div
Expand All @@ -169,15 +169,15 @@ const Herosection = () => {
src={mapsvg}
alt=""
srcset=""
className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg"
className="bg-blue-200 dark:bg-black border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg"
/>{" "}
<button
type="submit"
onClick={MapCLick}
className="w-20 py-1 mt-2 font-semibold text-white transition-all duration-300 ease-in-out bg-blue-500 rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50"
className="w-20 py-1 mt-2 font-semibold text-white transition-all duration-300 ease-in-out bg-blue-500 dark:bg-white rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50"
>
{" "}
<h1 className="font-bold text-white">3D Map</h1>
<h1 className="font-bold text-white dark:text-black">3D Map</h1>
</button>
</div>

Expand All @@ -190,15 +190,15 @@ const Herosection = () => {
src={schedulesvg}
alt=""
srcset=""
className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg"
className="bg-blue-200 dark:bg-black border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg"
/>
<button
type="submit"
onClick={ScheduleCLick}
className="w-20 py-1 mt-2 font-semibold text-white transition-all duration-300 ease-in-out bg-blue-500 rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50"
className="w-20 py-1 mt-2 font-semibold text-white transition-all duration-300 ease-in-out bg-blue-500 dark:bg-white rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50"
>
{" "}
<h1 className="font-bold text-white">Schedule</h1>
<h1 className="font-bold text-white dark:text-black">Schedule</h1>
</button>
</div>

Expand All @@ -211,22 +211,22 @@ const Herosection = () => {
src={noticationsvg}
alt=""
srcset=""
className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg "
className="bg-blue-200 dark:bg-black border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg "
/>{" "}
<button
type="submit"
onClick={NotificationCLick}
className="w-24 py-1 mt-2 font-semibold text-white transition-all duration-300 ease-in-out bg-blue-500 rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50"
className="w-24 py-1 mt-2 font-semibold text-white transition-all duration-300 ease-in-out bg-blue-500 dark:bg-white rounded-lg shadow-md cursor-pointer hover:bg-blue-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50"
>
{" "}
<h1 className="font-bold text-white">Notification</h1>
<h1 className="font-bold text-white dark:text-black">Notification</h1>
</button>
</div>
</div>
<div className="fixed flex flex-col items-center justify-center py-8 my-auto rounded-full cursor-pointer right-5 -bottom-8 md:-bottom-7">
<div className="fixed dark:bg-black flex flex-col items-center justify-center py-8 my-auto rounded-full cursor-pointer right-5 -bottom-8 md:-bottom-7">
<Popup />
<Chatbot />
<h1 className="text-xs font-bold text-black">Saarthi</h1>
<h1 className="text-xs font-bold text-black dark:text-white">Saarthi</h1>
</div>
</>
);
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/Pages/hamburger.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ const Hamburger = () => {

return (
<div>
<SearchContainer>
<SearchIcon onClick={toggleSearch} />
<SearchContainer className="dark:bg-black">
<SearchIcon onClick={toggleSearch} className="dark:text-white"/>
<SearchInput
isFocused={isFocused}
type="text"
Expand All @@ -226,6 +226,7 @@ const Hamburger = () => {
onChange={handleSearchChange}
onFocus={handleFocus}
onBlur={handleBlur}
className="dark:bg-black dark:text-white dark:placeholder:text-gray-300"
/>
{showSearch && searchTerm && <ClearIcon onClick={clearSearch} />}
</SearchContainer>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const Navbar = () => {
return (
<>
{/* Navigation Toggle for All Screens (Mobile and Larger Screens) */}
<div className="flex items-center justify-between p-4 bg-blue-500">
<div className="flex items-center justify-between p-4 bg-blue-500 dark:bg-black">
<button onClick={toggleMenu}>
{isOpen ? <FaTimes className="text-2xl text-black" /> : <FaBars className="text-2xl text-white" />}
</button>
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/components/popup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ const Popup = () => {

return (
isVisible && (
<div className="fixed bottom-5 right-5 flex items-center justify-center bg-[rgba(252,249,249,0.8)] z-[100000] rounded-lg shadow-lg w-[400px] p-5">
<div className="relative flex flex-col w-full bg-[#f0eeee] rounded-lg overflow-hidden">
<div className="fixed bottom-5 right-5 flex items-center justify-center bg-[rgba(252,249,249,0.8)] dark:bg-black z-[100000] rounded-lg shadow-lg w-[400px] p-5">
<div className="relative flex flex-col w-full bg-[#f0eeee] dark:bg-gray-600 rounded-lg overflow-hidden">
<button
className="absolute top-3 right-3 text-black font-bold text-2xl z-[1001]"
className="absolute top-3 right-3 text-black dark:text-white font-bold text-2xl z-[1001]"
onClick={handleClose}
>
X
Expand All @@ -40,26 +40,26 @@ const Popup = () => {
<img src={railwaysImage} alt="Railways" className="w-full h-full object-cover rounded-1/2" />
</div>
<div className="w-full p-4 flex flex-col items-center justify-center">
<h1 className="text-2xl font-bold text-center text-[#131010] mb-2">Welcome to Station Saarthi</h1>
<h2 className="text-lg font-semibold text-center text-[#261d1d] mb-4">Travel without stress. Sign in now!</h2>
<h1 className="text-2xl font-bold text-center text-[#131010] dark:text-white mb-2">Welcome to Station Saarthi</h1>
<h2 className="text-lg font-semibold text-center text-[#261d1d] dark:text-white mb-4">Travel without stress. Sign in now!</h2>
<form onSubmit={handleSubmit} className="w-full flex flex-col items-center">
<input
type="email"
id="popup-email"
className="p-2 w-4/5 border border-gray-400 rounded-md mb-4 text-base"
className="p-2 w-4/5 border dark:bg-gray-400 dark:placeholder:text-white border-gray-400 rounded-md mb-4 text-base"
placeholder="Enter Email"
value={email}
onChange={(e) => setEmail(e.target.value)}
required
/>
<button
type="submit"
className="w-4/5 p-2 bg-blue-600 text-white rounded-md text-base font-bold cursor-pointer"
className="w-4/5 p-2 bg-blue-600 dark:bg-gray-900 text-white rounded-md text-base font-bold cursor-pointer"
>
Sign me up!
</button>
</form>
<p className="text-xs text-center text-[#0e0a0a] mt-4">
<p className="text-xs text-center text-[#0e0a0a] dark:text-white mt-4">
By signing in, I agree to Station Saarthi's{' '}
<a href="#" className="text-blue-500">Terms of Service</a> and{' '}
<a href="#" className="text-blue-500">Privacy Policy</a>.
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/hooks/useDarkMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ const useDarkMode = () => {
const root = document.documentElement;
const isDark = theme === 'dark';
root.classList.toggle('dark', isDark);
console.log(`Theme set to ${theme}, dark mode is ${isDark ? 'enabled' : 'disabled'}`);
localStorage.setItem('theme', theme);
}, [theme]);


return [theme, setTheme];
};
Expand Down
7 changes: 4 additions & 3 deletions frontend/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
darkMode: 'class',
theme: {
extend: {},
extend: {
},
},
plugins: [],
}

};

0 comments on commit fea54e9

Please sign in to comment.