Spaces:
Running
Running
| <html lang="en" class="light"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Book Ticket | RailRush Express</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' | |
| } | |
| } | |
| } | |
| } | |
| } | |
| </script> | |
| <style> | |
| .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); | |
| } | |
| .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; | |
| } | |
| .sticky-bottom-bar { | |
| position: fixed; | |
| bottom: 0; | |
| left: 0; | |
| right: 0; | |
| padding: 16px; | |
| background: white; | |
| box-shadow: 0 -2px 10px rgba(0,0,0,0.1); | |
| z-index: 100; | |
| } | |
| @media (min-width: 768px) { | |
| .sticky-bottom-bar { | |
| left: 80px; | |
| } | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-background-light dark:bg-background-dark min-h-screen pb-24"> | |
| <!-- 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"> | |
| <a href="index.html"> | |
| <i data-feather="arrow-left" class="w-5 h-5"></i> | |
| </a> | |
| <h1 class="text-xl font-bold">Seat Selection</h1> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <div class="flex items-center space-x-1"> | |
| <div class="w-3 h-3 rounded-full bg-green-500"></div> | |
| <span class="text-xs">Available</span> | |
| </div> | |
| <div class="flex items-center space-x-1"> | |
| <div class="w-3 h-3 rounded-full bg-yellow-400"></div> | |
| <span class="text-xs">Selected</span> | |
| </div> | |
| <div class="flex items-center space-x-1"> | |
| <div class="w-3 h-3 rounded-full bg-gray-500"></div> | |
| <span class="text-xs">Booked</span> | |
| </div> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Content --> | |
| <main class="max-w-6xl mx-auto px-4 py-6"> | |
| <!-- Train Info Card --> | |
| <div class="material-card bg-white dark:bg-gray-800 p-4 mb-6"> | |
| <div class="flex justify-between items-center mb-3"> | |
| <div> | |
| <h2 class="font-bold dark:text-white">Rajdhani Express (12952)</h2> | |
| <p class="text-sm text-gray-500 dark:text-gray-400">Delhi → Mumbai</p> | |
| </div> | |
| <div class="text-sm"> | |
| <p class="dark:text-white">Tue, 15 Aug</p> | |
| <p class="text-gray-500 dark:text-gray-400">16:25 - 09:00</p> | |
| </div> | |
| </div> | |
| <div class="flex justify-between items-center border-t border-gray-200 dark:border-gray-700 pt-3"> | |
| <div class="flex items-center 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> | |
| <p class="text-primary-light dark:text-accent font-medium">₹1,850</p> | |
| </div> | |
| </div> | |
| <!-- Coach Selection --> | |
| <div class="mb-6"> | |
| <h3 class="text-lg font-semibold mb-3 dark:text-white">Select Coach</h3> | |
| <div class="flex overflow-x-auto space-x-2 pb-2"> | |
| <button class="px-4 py-2 bg-primary-light dark:bg-primary-dark text-white rounded-material whitespace-nowrap">A1 (3A)</button> | |
| <button class="px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-material whitespace-nowrap">B1 (3A)</button> | |
| <button class="px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-material whitespace-nowrap">A2 (2A)</button> | |
| <button class="px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-material whitespace-nowrap">B2 (2A)</button> | |
| </div> | |
| </div> | |
| <!-- Seat Selection --> | |
| <div> | |
| <h3 class="text-lg font-semibold mb-3 dark:text-white">Select Seats (Coach A1)</h3> | |
| <!-- Coach Layout --> | |
| <div class="material-card bg-white dark:bg-gray-800 p-4 mb-4"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <div> | |
| <p class="text-sm text-gray-500 dark:text-gray-400">Coach</p> | |
| <p class="font-medium dark:text-white">A1 (3AC - 72 Berths)</p> | |
| </div> | |
| <div> | |
| <p class="text-sm text-gray-500 dark:text-gray-400">Available</p> | |
| <p class="font-medium dark:text-white text-green-500">24 seats</p> | |
| </div> | |
| </div> | |
| <!-- Seat Grid --> | |
| <div class="grid grid-cols-10 gap-2 mb-4"> | |
| <!-- Row 1 --> | |
| <div class="col-span-4 flex justify-center"> | |
| <div class="seat seat-available text-white" data-seat="1">1</div> | |
| </div> | |
| <div class="col-span-2"></div> | |
| <div class="col-span-4 flex justify-center"> | |
| <div class="seat seat-available text-white" data-seat="2">2</div> | |
| </div> | |
| <!-- Row 2 --> | |
| <div class="col-span-4 flex justify-center"> | |
| <div class="seat seat-booked text-white" data-seat="3">3</div> | |
| </div> | |
| <div class="col-span-2"></div> | |
| <div class="col-span-4 flex justify-center"> | |
| <div class="seat seat-available text-white" data-seat="4">4</div> | |
| </div> | |
| <!-- Row 3 --> | |
| <div class="col-span-4 flex justify-center"> | |
| <div class="seat seat-available text-white" data-seat="5">5</div> | |
| </div> | |
| <div class="col-span-2"></div> | |
| <div class="col-span-4 flex justify-center"> | |
| <div class="seat seat-available text-white" data-seat="6">6</div> | |
| </div> | |
| <!-- Row 4 --> | |
| <div class="col-span-4 flex justify-center"> | |
| <div class="seat seat-available text-white" data-seat="7">7</div> | |
| </div> | |
| <div class="col-span-2 flex justify-center"> | |
| <div class="w-16 h-px bg-gray-300 dark:bg-gray-600 rotate-90"></div> | |
| </div> | |
| <div class="col-span-4 flex justify-center"> | |
| <div class="seat seat-available text-white" data-seat="8">8</div> | |
| </div> | |
| <!-- Row 5 --> | |
| <div class="col-span-4 flex justify-center"> | |
| <div class="seat seat-booked text-white" data-seat="9">9</div> | |
| </div> | |
| <div class="col-span-2"></div> | |
| <div class="col-span-4 flex justify-center"> | |
| <div class="seat seat-available text-white" data-seat="10">10</div> | |
| </div> | |
| </div> | |
| <!-- Berth Legend --> | |
| <div class="flex justify-center space-x-4 text-xs text-gray-500 dark:text-gray-400"> | |
| <div class="flex items-center space-x-1"> | |
| <div class="w-3 h-3 border border-gray-400"></div> | |
| <span>Lower</span> | |
| </div> | |
| <div class="flex items-center space-x-1"> | |
| <div class="w-3 h-3 border border-gray-400 border-b-0"></div> | |
| <span>Middle</span> | |
| </div> | |
| <div class="flex items-center space-x-1"> | |
| <div class="w-3 h-3 border border-gray-400 border-t-0"></div> | |
| <span>Upper</span> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Passenger Details --> | |
| <div class="material-card bg-white dark:bg-gray-800 p-4"> | |
| <h3 class="text-lg font-semibold mb-3 dark:text-white">Passenger Details</h3> | |
| <div class="space-y-3"> | |
| <div> | |
| <label class="block text-sm font-medium mb-1 dark:text-gray-300">Name</label> | |
| <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="Full Name"> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium mb-1 dark:text-gray-300">Age</label> | |
| <input type="number" class="w-full p-3 border rounded-material bg-gray-50 dark:bg-gray-700 dark:border-gray-600 dark:text-white" placeholder="Age"> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium mb-1 dark:text-gray-300">Gender</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>Male</option> | |
| <option>Female</option> | |
| <option>Other</option> | |
| </select> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium mb-1 dark:text-gray-300">Berth Preference</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>No Preference</option> | |
| <option>Lower</option> | |
| <option>Middle</option> | |
| <option>Upper</option> | |
| </select> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <!-- Enhanced Sticky Bottom Bar --> | |
| <div class="sticky-bottom-bar dark:bg-gray-800 dark:border-gray-700 shadow-lg"> | |
| <div class="flex justify-between items-center max-w-6xl mx-auto px-4"> | |
| <div> | |
| <p class="text-sm text-gray-500 dark:text-gray-400">Selected: <span class="font-medium dark:text-white" id="selected-count">0</span> seats</p> | |
| <p class="font-bold text-xl dark:text-white">₹<span id="total-price">0</span></p> | |
| </div> | |
| <button class="bg-primary-light dark:bg-accent text-white py-3 px-8 rounded-material font-medium hover:bg-opacity-90 transition shadow-md hover:shadow-lg flex items-center space-x-2"> | |
| <i data-feather="credit-card" class="w-5 h-5"></i> | |
| <span>Continue to Payment</span> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- 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="index.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="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-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="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> | |
| <script> | |
| // Seat selection logic | |
| const seats = document.querySelectorAll('.seat'); | |
| let selectedSeats = 0; | |
| const pricePerSeat = 1850; | |
| seats.forEach(seat => { | |
| seat.addEventListener('click', () => { | |
| if (seat.classList.contains('seat-available')) { | |
| seat.classList.remove('seat-available'); | |
| seat.classList.add('seat-selected'); | |
| selectedSeats++; | |
| } else if (seat.classList.contains('seat-selected')) { | |
| seat.classList.remove('seat-selected'); | |
| seat.classList.add('seat-available'); | |
| selectedSeats--; | |
| } | |
| document.getElementById('selected-count').textContent = selectedSeats; | |
| document.getElementById('total-price').textContent = selectedSeats * pricePerSeat; | |
| }); | |
| }); | |
| // 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'; | |
| }); | |
| // Feather icons | |
| feather.replace(); | |
| </script> | |
| </body> | |
| </html> | |