Create a meeting room booking system with conflict resolution.
- User
Create a meeting room booking system with conflict resolution.
Assistant
The user wants a meeting room booking system with conflict resolution. This is a practical business application that should have:
-
Core Features:
- Meeting room display and selection
- Date and time selection
- Booking creation with validation
- Conflict detection and resolution
- Visual calendar/timeline view
- Real-time availability updates
-
Conflict Resolution:
- Detect overlapping bookings
- Suggest alternative times
- Allow users to see conflicts visually
- Options to resolve: choose different time, different room, or override (with permission)
-
Visual Design:
- Clean, professional business aesthetic
- Timeline/week view for room schedules
- Color-coded availability
- Smooth animations and transitions
- Interactive elements
-
Technical Implementation:
- In-memory data structure for rooms and bookings
- Conflict detection algorithm
- Time slot generation
- Alternative time suggestions
Let me design a modern, sophisticated interface with:
- Dark theme with a professional accent color (teal/cyan)
- Grid-based room timeline view
- Booking form with validation
- Conflict modal with resolution options
- Smooth animations and micro-interactions
I'll use:
- A distinctive font pairing (Space Grotesk for headings, DM Sans for body)
- Deep dark background with subtle gradients
- Teal/cyan accent for interactive elements
- Grid-based timeline visualization
- Cards with subtle depth
Let me code this out...
Meeting Room Booking System
A sophisticated booking interface with real-time conflict detection, visual timeline, and smart resolution suggestions.
Design Approach
- Aesthetic: Professional dark theme with cyan accents for a modern tech feel
- Typography: Space Grotesk (display) + DM Sans (UI) for clarity and character
- Interaction: Timeline drag interactions, conflict resolution modal, smooth state transitions
- Conflict Resolution: Visual overlap detection + alternative time suggestions
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>RoomBook - Meeting Room Booking</title> <script src="https://cdn.tailwindcss.com"></script> <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&display=swap" rel="stylesheet"> <style> :root { --bg: #0a0e14; --bg-elevated: #12171f; --card: #1a2029; --card-hover: #222a36; --border: #2a3441; --fg: #e8ecf1; --fg-muted: #7a8599; --accent: #00d4aa; --accent-dim: rgba(0, 212, 170, 0.15); --conflict: #ff6b6b; --conflict-dim: rgba(255, 107, 107, 0.15); --warning: #ffc857; } * { box-sizing: border-box; } body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--fg); min-height: 100vh; } h1, h2, h3, h4, h5 { font-family: 'Space Grotesk', sans-serif; } /* Background pattern */ .bg-pattern { background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 170, 0.08), transparent), radial-gradient(circle at 20% 80%, rgba(0, 212, 170, 0.03), transparent 40%); } /* Grid pattern overlay */ .grid-overlay { background-image: linear-gradient(rgba(42, 52, 65, 0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(42, 52, 65, 0.3) 1px, transparent 1px); background-size: 60px 60px; } /* Custom scrollbar */ ::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-track { background: var(--bg-elevated); } ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: var(--fg-muted); } /* Animations */ @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } @keyframes slideInRight { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } } @keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.4); } 50% { box-shadow: 0 0 20px 5px rgba(0, 212, 170, 0.2); } } @keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } } .animate-in { animation: fadeInUp 0.5s ease-out forwards; } .stagger-1 { animation-delay: 0.1s; opacity: 0; } .stagger-2 { animation-delay: 0.2s; opacity: 0; } .stagger-3 { animation-delay: 0.3s; opacity: 0; } .stagger-4 { animation-delay: 0.4s; opacity: 0; } @media (prefers-reduced-motion: reduce) { .animate-in, .stagger-1, .stagger-2, .stagger-3, .stagger-4 { animation: none; opacity: 1; } } /* Timeline styles */ .time-slot { transition: all 0.2s ease; } .time-slot:hover { background: var(--accent-dim); } .time-slot.selected { background: var(--accent); color: var(--bg); } .booking-block { transition: all 0.3s ease; } .booking-block:hover { transform: scale(1.02); z-index: 10; } .booking-block.conflict { animation: shake 0.4s ease; } /* Form inputs */ .input-field { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--fg); transition: all 0.2s ease; } .input-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); } .input-field::placeholder { color: var(--fg-muted); } /* Button styles */ .btn-primary { background: var(--accent); color: var(--bg); font-weight: 600; transition: all 0.2s ease; } .btn-primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); } .btn-primary:active { transform: translateY(0); } .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; } .btn-secondary { background: var(--card); border: 1px solid var(--border); color: var(--fg); transition: all 0.2s ease; } .btn-secondary:hover { background: var(--card-hover); border-color: var(--fg-muted); } /* Modal */ .modal-backdrop { background: rgba(10, 14, 20, 0.85); backdrop-filter: blur(8px); } .modal-content { animation: fadeInUp 0.3s ease; } /* Room card */ .room-card { transition: all 0.3s ease; } .room-card:hover { border-color: var(--accent); transform: translateY(-2px); } .room-card.selected { border-color: var(--accent); background: var(--accent-dim); } /* Suggestion card */ .suggestion-card { transition: all 0.2s ease; cursor: pointer; } .suggestion-card:hover { background: var(--accent-dim); border-color: var(--accent); } /* Focus states */ .focus-ring:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-dim), 0 0 0 1px var(--accent); } /* Toast notification */ .toast { animation: slideInRight 0.3s ease; } </style> </head> <body class="bg-pattern"> <div class="grid-overlay min-h-screen"> <!-- Header --> <header class="border-b border-[--border] bg-[--bg-elevated]/80 backdrop-blur-sm sticky top-0 z-40"> <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"> <div class="flex items-center justify-between"> <div class="flex items-center gap-3 animate-in stagger-1"> <div class="w-10 h-10 rounded-lg bg-[--accent] flex items-center justify-center"> <svg class="w-6 h-6 text-[--bg]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/> </svg> </div> <div> <h1 class="text-xl font-bold tracking-tight">RoomBook</h1> <p class="text-xs text-[--fg-muted]">Meeting Room Booking</p> </div> </div> <div class="flex items-center gap-4 animate-in stagger-2"> <div class="text-right hidden sm:block"> <p class="text-sm font-medium" id="currentDate"></p> <p class="text-xs text-[--fg-muted]" id="currentTime"></p> </div> <button class="w-10 h-10 rounded-lg bg-[--card] border border-[--border] flex items-center justify-center hover:bg-[--card-hover] transition-colors focus-ring" aria-label="Notifications"> <svg class="w-5 h-5 text-[--fg-muted]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/> </svg> </button> </div> </div> </div> </header> <main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"> <div class="grid lg:grid-cols-3 gap-8"> <!-- Left Panel - Booking Form --> <div class="lg:col-span-1 space-y-6"> <!-- New Booking Card --> <div class="bg-[--card] rounded-2xl border border-[--border] p-6 animate-in stagger-1"> <h2 class="text-lg font-semibold mb-4 flex items-center gap-2"> <svg class="w-5 h-5 text-[--accent]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/> </svg> New Booking </h2> <form id="bookingForm" class="space-y-4"> <div> <label class="block text-sm font-medium text-[--fg-muted] mb-2">Meeting Title</label> <input type="text" id="meetingTitle" class="input-field w-full px-4 py-3 rounded-lg focus-ring" placeholder="Q4 Planning Session" required> </div> <div> <label class="block text-sm font-medium text-[--fg-muted] mb-2">Organizer</label> <input type="text" id="organizer" class="input-field w-full px-4 py-3 rounded-lg focus-ring" placeholder="Your name" required> </div> <div> <label class="block text-sm font-medium text-[--fg-muted] mb-2">Date</label> <input type="date" id="meetingDate" class="input-field w-full px-4 py-3 rounded-lg focus-ring" required> </div> <div class="grid grid-cols-2 gap-3"> <div> <label class="block text-sm font-medium text-[--fg-muted] mb-2">Start Time</label> <select id="startTime" class="input-field w-full px-4 py-3 rounded-lg focus-ring" required> <!-- Populated by JS --> </select> </div> <div> <label class="block text-sm font-medium text-[--fg-muted] mb-2">End Time</label> <select id="endTime" class="input-field w-full px-4 py-3 rounded-lg focus-ring" required> <!-- Populated by JS --> </select> </div> </div> <div> <label class="block text-sm font-medium text-[--fg-muted] mb-2">Attendees</label> <input type="number" id="attendees" class="input-field w-full px-4 py-3 rounded-lg focus-ring" placeholder="5" min="1" max="50" required> </div> <button type="submit" class="btn-primary w-full py-3 rounded-lg focus-ring flex items-center justify-center gap-2"> <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/> </svg> Check Availability </button> </form> </div> <!-- Room Selection --> <div class="bg-[--card] rounded-2xl border border-[--border] p-6 animate-in stagger-2"> <h2 class="text-lg font-semibold mb-4 flex items-center gap-2"> <svg class="w-5 h-5 text-[--accent]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/> </svg> Select Room </h2> <div id="roomList" class="space-y-3"> <!-- Populated by JS --> </div> </div> </div> <!-- Right Panel - Timeline & Bookings --> <div class="lg:col-span-2 space-y-6"> <!-- Timeline View --> <div class="bg-[--card] rounded-2xl border border-[--border] p-6 animate-in stagger-3"> <div class="flex items-center justify-between mb-6"> <h2 class="text-lg font-semibold flex items-center gap-2"> <svg class="w-5 h-5 text-[--accent]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/> </svg> Room Schedule </h2> <div class="flex items-center gap-2 text-sm"> <span class="flex items-center gap-1"> <span class="w-3 h-3 rounded bg-[--accent]"></span> Available </span> <span class="flex items-center gap-1"> <span class="w-3 h-3 rounded bg-[--conflict]"></span> Booked </span> </div> </div> <!-- Timeline Header --> <div class="overflow-x-auto"> <div class="min-w-[600px]"> <div class="flex border-b border-[--border] pb-2 mb-4"> <div class="w-24 flex-shrink-0 text-sm font-medium text-[--fg-muted]">Room</div> <div class="flex-1 flex" id="timelineHeader"> <!-- Time slots header --> </div> </div> <!-- Timeline Rows --> <div id="timelineBody" class="space-y-2"> <!-- Room rows --> </div> </div> </div> </div> <!-- Upcoming Bookings --> <div class="bg-[--card] rounded-2xl border border-[--border] p-6 animate-in stagger-4"> <h2 class="text-lg font-semibold mb-4 flex items-center gap-2"> <svg class="w-5 h-5 text-[--accent]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/> </svg> Today's Bookings </h2> <div id="bookingsList" class="space-y-3"> <!-- Populated by JS --> </div> </div> </div> </div> </main> </div> <!-- Conflict Resolution Modal --> <div id="conflictModal" class="fixed inset-0 z-50 hidden items-center justify-center p-4"> <div class="modal-backdrop absolute inset-0" onclick="closeModal()"></div> <div class="modal-content bg-[--card] rounded-2xl border border-[--border] p-6 max-w-lg w-full relative z-10"> <div class="flex items-start gap-4 mb-6"> <div class="w-12 h-12 rounded-xl bg-[--conflict-dim] flex items-center justify-center flex-shrink-0"> <svg class="w-6 h-6 text-[--conflict]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/> </svg> </div> <div> <h3 class="text-xl font-semibold mb-1">Booking Conflict Detected</h3> <p class="text-[--fg-muted]" id="conflictMessage">This room is already booked during the selected time.</p> </div> </div> <div class="mb-6"> <h4 class="text-sm font-medium text-[--fg-muted] mb-3">Conflicting with:</h4> <div id="conflictDetails" class="bg-[--bg-elevated] rounded-lg p-4 border border-[--border]"> <!-- Conflict details --> </div> </div> <div class="mb-6"> <h4 class="text-sm font-medium text-[--fg-muted] mb-3">Suggested Alternatives:</h4> <div id="alternatives" class="space-y-2"> <!-- Alternative options --> </div> </div> <div class="flex gap-3"> <button onclick="closeModal()" class="btn-secondary flex-1 py-3 rounded-lg focus-ring"> Cancel </button> <button onclick="forceBooking()" class="flex-1 py-3 rounded-lg bg-[--conflict] text-white font-semibold hover:brightness-110 transition-all focus-ring"> Book Anyway </button> </div> </div> </div> <!-- Toast Container --> <div id="toastContainer" class="fixed bottom-4 right-4 z-50 space-y-2"></div> <script> // ==================== DATA ==================== const rooms = [ { id: 1, name: 'Board Room', capacity: 20, floor: '3F', features: ['Video Conf', 'Whiteboard', 'Catering'] }, { id: 2, name: 'Innovation Lab', capacity: 12, floor: '2F', features: ['Video Conf', ' projector'] }, { id: 3, name: 'Huddle Space A', capacity: 6, floor: '1F', features: ['TV Screen'] }, { id: 4, name: 'Huddle Space B', capacity: 6, floor: '1F', features: ['TV Screen'] }, { id: 5, name: 'Training Room', capacity: 30, floor: '4F', features: ['Video Conf', 'Projector', 'Whiteboard'] } ]; let bookings = [ { id: 1, roomId: 1, title: 'Executive Strategy', organizer: 'Sarah Chen', date: getTodayStr(), startTime: '09:00', endTime: '10:30', attendees: 12 }, { id: 2, roomId: 1, title: 'Product Review', organizer: 'Mike Johnson', date: getTodayStr(), startTime: '14:00', endTime: '15:00', attendees: 8 }, { id: 3, roomId: 2, title: 'Design Sprint', organizer: 'Lisa Park', date: getTodayStr(), startTime: '10:00', endTime: '12:00', attendees: 10 }, { id: 4, roomId: 3, title: '1:1 Meeting', organizer: 'Tom Wilson', date: getTodayStr(), startTime: '11:00', endTime: '11:30', attendees: 2 }, { id: 5, roomId: 5, title: 'Team Training', organizer: 'HR Dept', date: getTodayStr(), startTime: '13:00', endTime: '16:00', attendees: 25 } ]; let selectedRoom = null; let pendingBooking = null; const timeSlots = []; const bookingColors = ['#00d4aa', '#6366f1', '#f59e0b', '#ec4899', '#8b5cf6']; // ==================== UTILITIES ==================== function getTodayStr() { return new Date().toISOString().split('T')[0]; } function generateTimeSlots() { for (let h = 7; h <= 19; h++) { timeSlots.push(`${h.toString().padStart(2, '0')}:00`); } } function timeToMinutes(time) { const [h, m] = time.split(':').map(Number); return h * 60 + m; } function formatTime(time) { const [h, m] = time.split(':'); const hour = parseInt(h); const ampm = hour >= 12 ? 'PM' : 'AM'; const displayHour = hour > 12 ? hour - 12 : hour === 0 ? 12 : hour; return `${displayHour}:${m} ${ampm}`; } function updateDateTime() { const now = new Date(); const dateEl = document.getElementById('currentDate'); const timeEl = document.getElementById('currentTime'); if (dateEl) { dateEl.textContent = now.toLocaleDateString('en-US', { weekday: 'long', month: 'short', day: 'numeric' }); } if (timeEl) { timeEl.textContent = now.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' }); } } function showToast(message, type = 'success') { const container = document.getElementById('toastContainer'); const toast = document.createElement('div'); toast.className = `toast px-4 py-3 rounded-lg border flex items-center gap-3 ${ type === 'success' ? 'bg-[--accent-dim] border-[--accent] text-[--accent]' : 'bg-[--conflict-dim] border-[--conflict] text-[--conflict]' }`; toast.innerHTML = ` <svg class="w-5 h-5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"> ${type === 'success' ? '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>' : '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>' } </svg> <span class="text-sm font-medium">${message}</span> `; container.appendChild(toast); setTimeout(() => { toast.style.opacity = '0'; toast.style.transform = 'translateX(20px)'; toast.style.transition = 'all 0.3s ease'; setTimeout(() => toast.remove(), 300); }, 3000); } // ==================== ROOM RENDERING ==================== function renderRooms() { const container = document.getElementById('roomList'); container.innerHTML = rooms.map(room => ` <button type="button" onclick="selectRoom(${room.id})" class="room-card w-full text-left p-4 rounded-xl border border-[--border] bg-[--bg-elevated] focus-ring ${selectedRoom === room.id ? 'selected' : ''}" aria-pressed="${selectedRoom === room.id}" > <div class="flex items-center justify-between mb-2"> <span class="font-semibold">${room.name}</span> <span class="text-xs text-[--fg-muted] bg-[--card] px-2 py-1 rounded">${room.floor}</span> </div> <div class="flex items-center gap-2 text-xs text-[--fg-muted]"> <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"/> </svg> <span>Up to ${room.capacity} people</span> </div> </button> `).join(''); } function selectRoom(roomId) { selectedRoom = roomId; renderRooms(); renderTimeline(); } // ==================== TIMELINE RENDERING ==================== function renderTimeline() { const headerContainer = document.getElementById('timelineHeader'); const bodyContainer = document.getElementById('timelineBody'); const dateStr = document.getElementById('meetingDate')?.value || getTodayStr(); // Render header headerContainer.innerHTML = timeSlots.map(slot => ` <div class="flex-1 text-center text-xs text-[--fg-muted]">${formatTime(slot)}</div> `).join(''); // Render rows for each room bodyContainer.innerHTML = rooms.map(room => { const roomBookings = bookings.filter(b => b.roomId === room.id && b.date === dateStr); const isSelected = selectedRoom === room.id; return ` <div class="flex items-center ${isSelected ? 'ring-2 ring-[--accent] rounded-lg' : ''}"> <div class="w-24 flex-shrink-0 text-sm font-medium pr-2 truncate">${room.name}</div> <div class="flex-1 flex relative h-12 bg-[--bg-elevated] rounded-lg overflow-hidden"> ${timeSlots.map((slot, idx) => ` <div class="flex-1 border-r border-[--border]/30 last:border-r-0 time-slot h-full" data-time="${slot}" data-room="${room.id}"></div> `).join('')} ${roomBookings.map(booking => { const startIdx = timeSlots.findIndex(t => t >= booking.startTime); const endIdx = timeSlots.findIndex(t => t >= booking.endTime); const startOffset = startIdx >= 0 ? startIdx : 0; const span = Math.max(1, (endIdx >= 0 ? endIdx : timeSlots.length) - startIdx); const colorIdx = booking.id % bookingColors.length; return ` <div class="booking-block absolute top-1 bottom-1 rounded-md px-2 flex items-center overflow-hidden cursor-pointer" style="left: calc(${startOffset} * (100% / ${timeSlots.length})); width: calc(${span} * (100% / ${timeSlots.length})); background: ${bookingColors[colorIdx]}20; border-left: 3px solid ${bookingColors[colorIdx]}" title="${booking.title} - ${booking.organizer}" onclick="showBookingDetails(${booking.id})"> <span class="text-xs font-medium truncate" style="color: ${bookingColors[colorIdx]}">${booking.title}</span> </div> `; }).join('')} </div> </div> `; }).join(''); } // ==================== BOOKINGS LIST ==================== function renderBookingsList() { const container = document.getElementById('bookingsList'); const dateStr = document.getElementById('meetingDate')?.value || getTodayStr(); const todayBookings = bookings .filter(b => b.date === dateStr) .sort((a, b) => timeToMinutes(a.startTime) - timeToMinutes(b.startTime)); if (todayBookings.length === 0) { container.innerHTML = ` <div class="text-center py-8 text-[--fg-muted]"> <svg class="w-12 h-12 mx-auto mb-3 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/> </svg> <p>No bookings for today</p> </div> `; return; } container.innerHTML = todayBookings.map(booking => { const room = rooms.find(r => r.id === booking.roomId); const colorIdx = booking.id % bookingColors.length; return ` <div class="flex items-center gap-4 p-4 rounded-xl bg-[--bg-elevated] border border-[--border] hover:border-[--fg-muted] transition-colors"> <div class="w-1 h-12 rounded-full" style="background: ${bookingColors[colorIdx]}"></div> <div class="flex-1 min-w-0"> <h4 class="font-medium truncate">${booking.title}</h4> <p class="text-sm text-[--fg-muted]">${room?.name || 'Unknown'} - ${booking.attendees} attendees</p> </div> <div class="text-right flex-shrink-0"> <p class="font-medium">${formatTime(booking.startTime)}</p> <p class="text-sm text-[--fg-muted]">to ${formatTime(booking.endTime)}</p> </div> <button onclick="deleteBooking(${booking.id})" class="w-8 h-8 rounded-lg hover:bg-[--conflict-dim] flex items-center justify-center transition-colors focus-ring" aria-label="Delete booking"> <svg class="w-4 h-4 text-[--fg-muted] hover:text-[--conflict]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/> </svg> </button> </div> `; }).join(''); } function showBookingDetails(bookingId) { const booking = bookings.find(b => b.id === bookingId); if (booking) { const room = rooms.find(r => r.id === booking.roomId); showToast(`${booking.title} in ${room?.name} (${formatTime(booking.startTime)} - ${formatTime(booking.endTime)})`, 'success'); } } function deleteBooking(bookingId) { bookings = bookings.filter(b => b.id !== bookingId); renderTimeline(); renderBookingsList(); showToast('Booking deleted successfully', 'success'); } // ==================== CONFLICT DETECTION ==================== function checkConflict(roomId, date, startTime, endTime, excludeId = null) { const startMins = timeToMinutes(startTime); const endMins = timeToMinutes(endTime); return bookings.find(b => { if (b.roomId !== roomId || b.date !== date || b.id === excludeId) return false; const bStart = timeToMinutes(b.startTime); const bEnd = timeToMinutes(b.endTime); return (startMins < bEnd && endMins > bStart); }); } function findAlternatives(roomId, date, startTime, endTime, attendees) { const alternatives = []; const duration = timeToMinutes(endTime) - timeToMinutes(startTime); const startMins = timeToMinutes(startTime); // Check same room, different times for (let offset = -120; offset <= 120; offset += 30) { const newStart = startMins + offset; const newEnd = newStart + duration; if (newStart >= 420 && newEnd <= 1200) { // Between 7:00 and 19:00 const newStartTime = `${Math.floor(newStart / 60).toString().padStart(2, '0')}:${(newStart % 60).toString().padStart(2, '0')}`; const newEndTime = `${Math.floor(newEnd / 60).toString().padStart(2, '0')}:${(newEnd % 60).toString().padStart(2, '0')}`; if (!checkConflict(roomId, date, newStartTime, newEndTime)) { alternatives.push({ roomId, roomName: rooms.find(r => r.id === roomId)?.name, startTime: newStartTime, endTime: newEndTime, sameRoom: true }); if (alternatives.filter(a => a.sameRoom).length >= 2) break; } } } // Check other rooms at same time const suitableRooms = rooms.filter(r => r.id !== roomId && r.capacity >= attendees && !checkConflict(r.id, date, startTime, endTime) ); suitableRooms.slice(0, 3).forEach(room => { alternatives.push({ roomId: room.id, roomName: room.name, startTime, endTime, sameRoom: false }); }); return alternatives.slice(0, 4); } // ==================== MODAL ==================== function showConflictModal(conflict, alternatives) { const modal = document.getElementById('conflictModal'); const conflictRoom = rooms.find(r => r.id === conflict.roomId); document.getElementById('conflictMessage').textContent = `${conflictRoom?.name || 'The room'} is already booked during your selected time slot.`; document.getElementById('conflictDetails').innerHTML = ` <div class="flex items-center gap-3"> <div class="w-10 h-10 rounded-lg bg-[--conflict-dim] flex items-center justify-center"> <svg class="w-5 h-5 text-[--conflict]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/> </svg> </div> <div> <p class="font-medium">${conflict.title}</p> <p class="text-sm text-[--fg-muted]">${conflict.organizer} - ${formatTime(conflict.startTime)} to ${formatTime(conflict.endTime)}</p> </div> </div> `; document.getElementById('alternatives').innerHTML = alternatives.length > 0 ? alternatives.map((alt, idx) => ` <button onclick="applyAlternative(${alt.roomId}, '${alt.startTime}', '${alt.endTime}')" class="suggestion-card w-full text-left p-3 rounded-lg border border-[--border] bg-[--bg-elevated] focus-ring"> <div class="flex items-center justify-between"> <div class="flex items-center gap-2"> ${alt.sameRoom ? '<span class="text-xs bg-[--accent-dim] text-[--accent] px-2 py-0.5 rounded">Same Room</span>' : '<span class="text-xs bg-[--card] text-[--fg-muted] px-2 py-0.5 rounded">Different Room</span>' } <span class="font-medium">${alt.roomName}</span> </div> <span class="text-sm text-[--fg-muted]">${formatTime(alt.startTime)} - ${formatTime(alt.endTime)}</span> </div> </button> `).join('') : '<p class="text-[--fg-muted] text-sm">No alternatives available. Try a different date or time.</p>'; modal.classList.remove('hidden'); modal.classList.add('flex'); } function closeModal() { const modal = document.getElementById('conflictModal'); modal.classList.add('hidden'); modal.classList.remove('flex'); pendingBooking = null; } function applyAlternative(roomId, startTime, endTime) { document.getElementById('startTime').value = startTime; document.getElementById('endTime').value = endTime; selectRoom(roomId); closeModal(); showToast('Alternative selected. Click "Check Availability" to confirm.', 'success'); } function forceBooking() { if (pendingBooking) { createBooking(pendingBooking, true); } closeModal(); } // ==================== FORM HANDLING ==================== function populateTimeSelects() { const startSelect = document.getElementById('startTime'); const endSelect = document.getElementById('endTime'); const options = timeSlots.map(slot => `<option value="${slot}">${formatTime(slot)}</option>` ).join(''); startSelect.innerHTML = options; endSelect.innerHTML = options; // Set defaults startSelect.value = '09:00'; endSelect.value = '10:00'; } function handleFormSubmit(e) { e.preventDefault(); const title = document.getElementById('meetingTitle').value; const organizer = document.getElementById('organizer').value; const date = document.getElementById('meetingDate').value; const startTime = document.getElementById('startTime').value; const endTime = document.getElementById('endTime').value; const attendees = parseInt(document.getElementById('attendees').value); if (!selectedRoom) { showToast('Please select a room', 'error'); return; } if (timeToMinutes(endTime) <= timeToMinutes(startTime)) { showToast('End time must be after start time', 'error'); return; } const selectedRoomData = rooms.find(r => r.id === selectedRoom); if (selectedRoomData && attendees > selectedRoomData.capacity) { showToast(`Room capacity exceeded (max ${selectedRoomData.capacity})`, 'error'); return; } const conflict = checkConflict(selectedRoom, date, startTime, endTime); if (conflict) { pendingBooking = { roomId: selectedRoom, title, organizer, date, startTime, endTime, attendees }; const alternatives = findAlternatives(selectedRoom, date, startTime, endTime, attendees); showConflictModal(conflict, alternatives); } else { createBooking({ roomId: selectedRoom, title, organizer, date, startTime, endTime, attendees }); } } function createBooking(data, isOverride = false) { const newBooking = { id: Date.now(), ...data }; bookings.push(newBooking); renderTimeline(); renderBookingsList(); const room = rooms.find(r => r.id === data.roomId); showToast( isOverride ? `Booking created (override) in ${room?.name}` : `Successfully booked ${room?.name}`, 'success' ); // Reset form document.getElementById('bookingForm').reset(); document.getElementById('meetingDate').value = getTodayStr(); populateTimeSelects(); pendingBooking = null; } // ==================== INITIALIZATION ==================== function init() { generateTimeSlots(); // Set default date const dateInput = document.getElementById('meetingDate'); dateInput.value = getTodayStr(); dateInput.min = getTodayStr(); populateTimeSelects(); renderRooms(); renderTimeline(); renderBookingsList(); updateDateTime(); // Update time every minute setInterval(updateDateTime, 60000); // Form submission document.getElementById('bookingForm').addEventListener('submit', handleFormSubmit); // Update timeline when date changes dateInput.addEventListener('change', () => { renderTimeline(); renderBookingsList(); }); } // Start app when DOM is ready document.addEventListener('DOMContentLoaded', init); </script> </body> </html>Key Features
Visual Design
- Dark professional theme with cyan accent - not the typical purple gradient
- Layered backgrounds with subtle grid pattern and gradient glows
- Space Grotesk display font for technical authority
- Color-coded bookings for easy visual distinction
Core Functionality
- Room Selection - Cards with capacity and floor information
- Visual Timeline - Horizontal time slots showing availability per room
- Booking Form - Complete meeting details with validation
- Conflict Detection - Real-time overlap checking algorithm
Conflict Resolution
- Modal popup when conflicts detected
- Shows conflicting meeting details
- Smart alternatives - suggests:
- Same room at different times (±2 hours)
- Different rooms at the same time
- "Book Anyway" override option for urgent needs
Interactions
- Staggered entrance animations
- Hover effects on timeline bookings
- Toast notifications for feedback
- Room selection highlighting
- Responsive design (works on mobile)
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.