railrush-express / index.html
thundercode's picture
make everything more user friendly for both desktop and mobile interface
608ef78 verified
Raw
History Blame Contribute Delete
16.3 kB
<!DOCTYPE html>
<html lang="en" class="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RailRush Express | Modern Train Booking</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
primary: {
light: '#3949AB',
dark: '#5C6BC0'
},
accent: '#FFCA28',
background: {
light: '#F9FAFB',
dark: '#1E1E1E'
}
},
fontFamily: {
sans: ['Inter', 'Roboto', 'sans-serif']
},
borderRadius: {
'material': '12px'
},
boxShadow: {
'material': '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
'material-lg': '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)'
}
}
}
}
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
body {
font-family: 'Inter', sans-serif;
transition: background-color 0.3s ease;
}
.material-card {
border-radius: 12px;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.material-card:hover {
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
.chip {
border-radius: 16px;
padding: 4px 12px;
font-size: 14px;
display: inline-flex;
align-items: center;
}
.fab {
width: 56px;
height: 56px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 24px;
right: 24px;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
transition: transform 0.2s ease;
}
.fab:hover {
transform: scale(1.1);
}
.seat {
width: 32px;
height: 32px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
}
.seat:hover {
transform: scale(1.1);
}
.seat-available {
background-color: #4CAF50;
}
.seat-selected {
background-color: #FFCA28;
}
.seat-booked {
background-color: #757575;
}
</style>
</head>
<body class="bg-background-light dark:bg-background-dark min-h-screen">
<!-- Top App Bar -->
<header class="bg-primary-light dark:bg-primary-dark text-white p-4 shadow-md">
<div class="flex justify-between items-center max-w-6xl mx-auto">
<div class="flex items-center space-x-2">
<i data-feather="train" class="w-6 h-6"></i>
<h1 class="text-xl font-bold">RailRush Express</h1>
</div>
<div class="flex items-center space-x-4">
<button id="theme-toggle" class="p-2 rounded-full hover:bg-opacity-20 hover:bg-white">
<i data-feather="moon" class="w-5 h-5 hidden dark:block"></i>
<i data-feather="sun" class="w-5 h-5 block dark:hidden"></i>
</button>
<div class="relative">
<div class="w-8 h-8 rounded-full bg-accent flex items-center justify-center cursor-pointer">
<i data-feather="user" class="w-4 h-4 text-gray-800"></i>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<main class="max-w-6xl mx-auto px-4 py-6">
<!-- Search Section -->
<section class="material-card bg-white dark:bg-gray-800 p-6 mb-6">
<h2 class="text-xl font-semibold mb-4 dark:text-white">Search Trains</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
<div>
<label class="block text-sm font-medium mb-1 dark:text-gray-300">From Station</label>
<div class="relative">
<input type="text" class="w-full p-3 border rounded-material bg-gray-50 dark:bg-gray-700 dark:border-gray-600 dark:text-white" placeholder="Delhi">
<i data-feather="search" class="absolute right-3 top-3 text-gray-400"></i>
</div>
</div>
<div>
<label class="block text-sm font-medium mb-1 dark:text-gray-300">To Station</label>
<div class="relative">
<input type="text" class="w-full p-3 border rounded-material bg-gray-50 dark:bg-gray-700 dark:border-gray-600 dark:text-white" placeholder="Mumbai">
<i data-feather="search" class="absolute right-3 top-3 text-gray-400"></i>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
<div>
<label class="block text-sm font-medium mb-1 dark:text-gray-300">Date</label>
<div class="relative">
<input type="date" class="w-full p-3 border rounded-material bg-gray-50 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
</div>
</div>
<div>
<label class="block text-sm font-medium mb-1 dark:text-gray-300">Class</label>
<select class="w-full p-3 border rounded-material bg-gray-50 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
<option>All Classes</option>
<option>AC First Class (1A)</option>
<option>AC 2 Tier (2A)</option>
<option>AC 3 Tier (3A)</option>
<option>Sleeper (SL)</option>
<option>Second Sitting (2S)</option>
</select>
</div>
<div>
<label class="block text-sm font-medium mb-1 dark:text-gray-300">Quota</label>
<select class="w-full p-3 border rounded-material bg-gray-50 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
<option>General</option>
<option>Tatkal</option>
<option>Premium Tatkal</option>
<option>Ladies</option>
</select>
</div>
</div>
<button class="w-full md:w-auto bg-primary-light dark:bg-primary-dark text-white py-3 px-6 rounded-material font-medium hover:bg-opacity-90 transition">
Search Trains
</button>
</section>
<!-- Recent Searches -->
<section>
<h2 class="text-lg font-semibold mb-4 dark:text-white">Recent Searches</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<!-- Recent Search Card 1 -->
<div class="material-card bg-white dark:bg-gray-800 p-4">
<div class="flex justify-between items-start mb-2">
<div>
<h3 class="font-medium dark:text-white">Delhi to Mumbai</h3>
<p class="text-sm text-gray-500 dark:text-gray-400">Rajdhani Express (12952)</p>
</div>
<span class="chip bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">Yesterday</span>
</div>
<div class="flex justify-between items-center mt-4">
<div>
<p class="text-sm text-gray-500 dark:text-gray-400">Departure</p>
<p class="font-medium dark:text-white">16:25</p>
</div>
<div class="flex flex-col items-center">
<div class="w-16 h-px bg-gray-300 dark:bg-gray-600"></div>
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">16h 35m</p>
</div>
<div>
<p class="text-sm text-gray-500 dark:text-gray-400">Arrival</p>
<p class="font-medium dark:text-white">09:00</p>
</div>
</div>
<div class="flex justify-between items-center mt-4">
<div class="flex space-x-2">
<span class="chip bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">3A</span>
<span class="chip bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">General</span>
</div>
<button class="text-primary-light dark:text-accent font-medium">Book Now</button>
</div>
</div>
<!-- Recent Search Card 2 -->
<div class="material-card bg-white dark:bg-gray-800 p-4">
<div class="flex justify-between items-start mb-2">
<div>
<h3 class="font-medium dark:text-white">Bangalore to Chennai</h3>
<p class="text-sm text-gray-500 dark:text-gray-400">Shatabdi Express (12028)</p>
</div>
<span class="chip bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">2 days ago</span>
</div>
<div class="flex justify-between items-center mt-4">
<div>
<p class="text-sm text-gray-500 dark:text-gray-400">Departure</p>
<p class="font-medium dark:text-white">06:00</p>
</div>
<div class="flex flex-col items-center">
<div class="w-16 h-px bg-gray-300 dark:bg-gray-600"></div>
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">5h 15m</p>
</div>
<div>
<p class="text-sm text-gray-500 dark:text-gray-400">Arrival</p>
<p class="font-medium dark:text-white">11:15</p>
</div>
</div>
<div class="flex justify-between items-center mt-4">
<div class="flex space-x-2">
<span class="chip bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">CC</span>
<span class="chip bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">Tatkal</span>
</div>
<button class="text-primary-light dark:text-accent font-medium">Book Now</button>
</div>
</div>
</div>
</section>
</main>
<!-- Enhanced Bottom Navigation (Mobile) -->
<nav class="md:hidden fixed bottom-0 w-full bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 flex justify-around py-3 z-50">
<a href="#" class="flex flex-col items-center text-primary-light dark:text-accent px-4 py-1 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
<i data-feather="home" class="w-6 h-6"></i>
<span class="text-xs mt-1 font-medium">Home</span>
</a>
<a href="book.html" class="flex flex-col items-center text-gray-500 dark:text-gray-400 px-4 py-1 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
<i data-feather="book-open" class="w-6 h-6"></i>
<span class="text-xs mt-1 font-medium">Bookings</span>
</a>
<a href="status.html" class="flex flex-col items-center text-gray-500 dark:text-gray-400 px-4 py-1 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
<i data-feather="map-pin" class="w-6 h-6"></i>
<span class="text-xs mt-1 font-medium">Status</span>
</a>
<a href="profile.html" class="flex flex-col items-center text-gray-500 dark:text-gray-400 px-4 py-1 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
<i data-feather="user" class="w-6 h-6"></i>
<span class="text-xs mt-1 font-medium">Profile</span>
</a>
</nav>
<!-- Enhanced Navigation Rail (Tablet/Desktop) -->
<nav class="hidden md:flex fixed left-0 top-0 h-full w-24 py-6 flex-col items-center bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700 z-40">
<div class="mb-10 mt-4">
<i data-feather="train" class="w-10 h-10 text-primary-light dark:text-accent"></i>
</div>
<div class="flex flex-col items-center space-y-10 w-full">
<a href="#" class="flex flex-col items-center text-primary-light dark:text-accent w-full py-3 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
<i data-feather="home" class="w-7 h-7"></i>
<span class="text-sm mt-1 font-medium">Home</span>
</a>
<a href="book.html" class="flex flex-col items-center text-gray-500 dark:text-gray-400 w-full py-3 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
<i data-feather="book-open" class="w-7 h-7"></i>
<span class="text-sm mt-1 font-medium">Bookings</span>
</a>
<a href="status.html" class="flex flex-col items-center text-gray-500 dark:text-gray-400 w-full py-3 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
<i data-feather="map-pin" class="w-7 h-7"></i>
<span class="text-sm mt-1 font-medium">Status</span>
</a>
<a href="profile.html" class="flex flex-col items-center text-gray-500 dark:text-gray-400 w-full py-3 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
<i data-feather="user" class="w-7 h-7"></i>
<span class="text-sm mt-1 font-medium">Profile</span>
</a>
</div>
</nav>
<!-- Enhanced Floating Action Button -->
<button class="fab bg-primary-light dark:bg-accent text-white shadow-lg hover:shadow-xl transition-all z-40">
<i data-feather="search" class="w-6 h-6"></i>
</button>
<script>
// Theme toggle
const themeToggle = document.getElementById('theme-toggle');
const html = document.documentElement;
themeToggle.addEventListener('click', () => {
html.classList.toggle('dark');
localStorage.theme = html.classList.contains('dark') ? 'dark' : 'light';
});
// Check for saved theme preference
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
html.classList.add('dark');
} else {
html.classList.remove('dark');
}
// Feather icons
feather.replace();
</script>
</body>
</html>