Please build me a simple and extremely user-friendly website for checking-in using the system time.
Browse files- README.md +9 -6
- admin.html +320 -0
- index.html +169 -19
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Tech Support Queue Manager
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
colorTo: red
|
| 6 |
sdk: static
|
| 7 |
-
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Tech Support Queue Manager 🎫
|
| 3 |
+
colorFrom: green
|
| 4 |
+
colorTo: pink
|
|
|
|
| 5 |
sdk: static
|
| 6 |
+
emoji: 🌈
|
| 7 |
+
tags:
|
| 8 |
+
- deepsite-v4
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Tech Support Queue Manager 🎫
|
| 12 |
+
|
| 13 |
+
This project has been created with [DeepSite](https://deepsite.hf.co) AI Vibe Coding.
|
admin.html
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Tech Support Queue - Admin</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://unpkg.com/lucide@latest"></script>
|
| 9 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
| 10 |
+
<style>
|
| 11 |
+
body { font-family: 'Inter', sans-serif; }
|
| 12 |
+
.queue-item { animation: slideIn 0.3s ease-out; }
|
| 13 |
+
@keyframes slideIn {
|
| 14 |
+
from { opacity: 0; transform: translateX(-10px); }
|
| 15 |
+
to { opacity: 1; transform: translateX(0); }
|
| 16 |
+
}
|
| 17 |
+
.status-badge { transition: all 0.2s; }
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="bg-gray-100 min-h-screen">
|
| 21 |
+
|
| 22 |
+
<!-- Header -->
|
| 23 |
+
<header class="bg-white shadow-sm border-b border-gray-200 sticky top-0 z-10">
|
| 24 |
+
<div class="max-w-6xl mx-auto px-4 py-4 flex items-center justify-between">
|
| 25 |
+
<div class="flex items-center gap-3">
|
| 26 |
+
<div class="bg-indigo-600 p-2 rounded-lg">
|
| 27 |
+
<i data-lucide="list" class="w-6 h-6 text-white"></i>
|
| 28 |
+
</div>
|
| 29 |
+
<div>
|
| 30 |
+
<h1 class="text-xl font-bold text-gray-800">Support Queue</h1>
|
| 31 |
+
<p class="text-sm text-gray-500">Real-time check-in monitoring</p>
|
| 32 |
+
</div>
|
| 33 |
+
</div>
|
| 34 |
+
<div class="text-right">
|
| 35 |
+
<p class="text-2xl font-mono font-bold text-gray-800" id="clock">--:--:--</p>
|
| 36 |
+
<p class="text-xs text-gray-500" id="date">Loading...</p>
|
| 37 |
+
</div>
|
| 38 |
+
</div>
|
| 39 |
+
</header>
|
| 40 |
+
|
| 41 |
+
<!-- Main Content -->
|
| 42 |
+
<main class="max-w-6xl mx-auto px-4 py-6">
|
| 43 |
+
|
| 44 |
+
<!-- Stats Bar -->
|
| 45 |
+
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-6">
|
| 46 |
+
<div class="bg-white p-4 rounded-xl shadow-sm border border-gray-200">
|
| 47 |
+
<div class="flex items-center justify-between">
|
| 48 |
+
<div>
|
| 49 |
+
<p class="text-sm text-gray-500 mb-1">Waiting</p>
|
| 50 |
+
<p class="text-2xl font-bold text-orange-600" id="statWaiting">0</p>
|
| 51 |
+
</div>
|
| 52 |
+
<div class="w-10 h-10 bg-orange-100 rounded-full flex items-center justify-center">
|
| 53 |
+
<i data-lucide="clock" class="w-5 h-5 text-orange-600"></i>
|
| 54 |
+
</div>
|
| 55 |
+
</div>
|
| 56 |
+
</div>
|
| 57 |
+
|
| 58 |
+
<div class="bg-white p-4 rounded-xl shadow-sm border border-gray-200">
|
| 59 |
+
<div class="flex items-center justify-between">
|
| 60 |
+
<div>
|
| 61 |
+
<p class="text-sm text-gray-500 mb-1">Serving</p>
|
| 62 |
+
<p class="text-2xl font-bold text-blue-600" id="statServing">0</p>
|
| 63 |
+
</div>
|
| 64 |
+
<div class="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center">
|
| 65 |
+
<i data-lucide="loader" class="w-5 h-5 text-blue-600"></i>
|
| 66 |
+
</div>
|
| 67 |
+
</div>
|
| 68 |
+
</div>
|
| 69 |
+
|
| 70 |
+
<div class="bg-white p-4 rounded-xl shadow-sm border border-gray-200">
|
| 71 |
+
<div class="flex items-center justify-between">
|
| 72 |
+
<div>
|
| 73 |
+
<p class="text-sm text-gray-500 mb-1">Completed</p>
|
| 74 |
+
<p class="text-2xl font-bold text-green-600" id="statCompleted">0</p>
|
| 75 |
+
</div>
|
| 76 |
+
<div class="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center">
|
| 77 |
+
<i data-lucide="check-circle" class="w-5 h-5 text-green-600"></i>
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
</div>
|
| 81 |
+
|
| 82 |
+
<div class="bg-white p-4 rounded-xl shadow-sm border border-gray-200">
|
| 83 |
+
<div class="flex items-center justify-between">
|
| 84 |
+
<div>
|
| 85 |
+
<p class="text-sm text-gray-500 mb-1">Total Today</p>
|
| 86 |
+
<p class="text-2xl font-bold text-indigo-600" id="statTotal">0</p>
|
| 87 |
+
</div>
|
| 88 |
+
<div class="w-10 h-10 bg-indigo-100 rounded-full flex items-center justify-center">
|
| 89 |
+
<i data-lucide="users" class="w-5 h-5 text-indigo-600"></i>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
</div>
|
| 93 |
+
</div>
|
| 94 |
+
|
| 95 |
+
<!-- Action Bar -->
|
| 96 |
+
<div class="flex gap-3 mb-4">
|
| 97 |
+
<button onclick="clearAll()" class="px-4 py-2 bg-red-50 text-red-600 rounded-lg text-sm font-medium hover:bg-red-100 transition flex items-center gap-2">
|
| 98 |
+
<i data-lucide="trash-2" class="w-4 h-4"></i>
|
| 99 |
+
Clear All
|
| 100 |
+
</button>
|
| 101 |
+
<button onclick="exportData()" class="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200 transition flex items-center gap-2">
|
| 102 |
+
<i data-lucide="download" class="w-4 h-4"></i>
|
| 103 |
+
Export
|
| 104 |
+
</button>
|
| 105 |
+
<button onclick="loadQueue()" class="px-4 py-2 bg-indigo-50 text-indigo-600 rounded-lg text-sm font-medium hover:bg-indigo-100 transition flex items-center gap-2 ml-auto">
|
| 106 |
+
<i data-lucide="refresh-cw" class="w-4 h-4"></i>
|
| 107 |
+
Refresh
|
| 108 |
+
</button>
|
| 109 |
+
</div>
|
| 110 |
+
|
| 111 |
+
<!-- Queue List -->
|
| 112 |
+
<div class="bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden">
|
| 113 |
+
<div class="px-6 py-4 border-b border-gray-200 bg-gray-50 flex items-center justify-between">
|
| 114 |
+
<h2 class="font-semibold text-gray-800">Current Queue</h2>
|
| 115 |
+
<span class="text-xs text-gray-500 bg-white px-2 py-1 rounded border">Updates automatically</span>
|
| 116 |
+
</div>
|
| 117 |
+
|
| 118 |
+
<div id="queueList" class="divide-y divide-gray-100">
|
| 119 |
+
<!-- Queue items will be inserted here -->
|
| 120 |
+
</div>
|
| 121 |
+
|
| 122 |
+
<div id="emptyState" class="hidden py-12 text-center text-gray-500">
|
| 123 |
+
<i data-lucide="inbox" class="w-12 h-12 mx-auto mb-3 text-gray-300"></i>
|
| 124 |
+
<p>No tickets in queue</p>
|
| 125 |
+
</div>
|
| 126 |
+
</div>
|
| 127 |
+
</main>
|
| 128 |
+
|
| 129 |
+
<!-- Toast Notification -->
|
| 130 |
+
<div id="toast" class="hidden fixed bottom-4 right-4 bg-gray-800 text-white px-6 py-3 rounded-lg shadow-lg transform transition-all duration-300 translate-y-20">
|
| 131 |
+
<div class="flex items-center gap-2">
|
| 132 |
+
<i data-lucide="info" class="w-5 h-5"></i>
|
| 133 |
+
<span id="toastMessage">Notification</span>
|
| 134 |
+
</div>
|
| 135 |
+
</div>
|
| 136 |
+
|
| 137 |
+
<script>
|
| 138 |
+
// Initialize icons
|
| 139 |
+
lucide.createIcons();
|
| 140 |
+
|
| 141 |
+
// Update clock
|
| 142 |
+
function updateClock() {
|
| 143 |
+
const now = new Date();
|
| 144 |
+
document.getElementById('clock').textContent = now.toLocaleTimeString('en-US', { hour12: false });
|
| 145 |
+
document.getElementById('date').textContent = now.toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' });
|
| 146 |
+
}
|
| 147 |
+
setInterval(updateClock, 1000);
|
| 148 |
+
updateClock();
|
| 149 |
+
|
| 150 |
+
// Load and display queue
|
| 151 |
+
function loadQueue() {
|
| 152 |
+
const queue = JSON.parse(localStorage.getItem('techSupportQueue') || '[]');
|
| 153 |
+
const queueList = document.getElementById('queueList');
|
| 154 |
+
const emptyState = document.getElementById('emptyState');
|
| 155 |
+
|
| 156 |
+
// Update stats
|
| 157 |
+
const waiting = queue.filter(t => t.status === 'waiting').length;
|
| 158 |
+
const serving = queue.filter(t => t.status === 'serving').length;
|
| 159 |
+
const completed = queue.filter(t => t.status === 'completed').length;
|
| 160 |
+
|
| 161 |
+
document.getElementById('statWaiting').textContent = waiting;
|
| 162 |
+
document.getElementById('statServing').textContent = serving;
|
| 163 |
+
document.getElementById('statCompleted').textContent = completed;
|
| 164 |
+
document.getElementById('statTotal').textContent = queue.length;
|
| 165 |
+
|
| 166 |
+
if (queue.length === 0) {
|
| 167 |
+
queueList.innerHTML = '';
|
| 168 |
+
emptyState.classList.remove('hidden');
|
| 169 |
+
return;
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
emptyState.classList.add('hidden');
|
| 173 |
+
|
| 174 |
+
// Sort by timestamp (oldest first for FCFS)
|
| 175 |
+
const sortedQueue = [...queue].sort((a, b) => new Date(a.timestamp) - new Date(b.timestamp));
|
| 176 |
+
|
| 177 |
+
queueList.innerHTML = sortedQueue.map((ticket, index) => {
|
| 178 |
+
const timeAgo = getTimeAgo(new Date(ticket.timestamp));
|
| 179 |
+
const statusColors = {
|
| 180 |
+
waiting: 'bg-orange-100 text-orange-800 border-orange-200',
|
| 181 |
+
serving: 'bg-blue-100 text-blue-800 border-blue-200',
|
| 182 |
+
completed: 'bg-green-100 text-green-800 border-green-200'
|
| 183 |
+
};
|
| 184 |
+
|
| 185 |
+
const techColors = {
|
| 186 |
+
Gary: 'bg-blue-50 text-blue-700 border-blue-200',
|
| 187 |
+
Will: 'bg-green-50 text-green-700 border-green-200',
|
| 188 |
+
Tim: 'bg-purple-50 text-purple-700 border-purple-200',
|
| 189 |
+
Anyone: 'bg-orange-50 text-orange-700 border-orange-200'
|
| 190 |
+
};
|
| 191 |
+
|
| 192 |
+
return `
|
| 193 |
+
<div class="queue-item p-4 hover:bg-gray-50 transition flex items-center justify-between gap-4">
|
| 194 |
+
<div class="flex items-center gap-4 flex-1">
|
| 195 |
+
<div class="flex flex-col items-center justify-center w-12">
|
| 196 |
+
<span class="text-2xl font-bold text-gray-300">#${index + 1}</span>
|
| 197 |
+
</div>
|
| 198 |
+
|
| 199 |
+
<div class="flex-1">
|
| 200 |
+
<div class="flex items-center gap-2 mb-1">
|
| 201 |
+
<span class="font-semibold text-gray-900">${ticket.name}</span>
|
| 202 |
+
<span class="text-xs text-gray-400">• ${timeAgo}</span>
|
| 203 |
+
</div>
|
| 204 |
+
<div class="flex items-center gap-2 flex-wrap">
|
| 205 |
+
<span class="px-2 py-1 rounded-full text-xs font-medium border ${techColors[ticket.technician] || 'bg-gray-100 text-gray-700'}">
|
| 206 |
+
${ticket.technician}
|
| 207 |
+
</span>
|
| 208 |
+
<span class="px-2 py-1 rounded-full text-xs font-medium border ${statusColors[ticket.status]} status-badge">
|
| 209 |
+
${ticket.status.charAt(0).toUpperCase() + ticket.status.slice(1)}
|
| 210 |
+
</span>
|
| 211 |
+
<span class="text-xs text-gray-500 font-mono">${ticket.checkInTime}</span>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
+
</div>
|
| 215 |
+
|
| 216 |
+
<div class="flex items-center gap-2">
|
| 217 |
+
${ticket.status === 'waiting' ? `
|
| 218 |
+
<button onclick="updateStatus(${ticket.id}, 'serving')" class="p-2 text-blue-600 hover:bg-blue-50 rounded-lg transition" title="Start Serving">
|
| 219 |
+
<i data-lucide="play" class="w-5 h-5"></i>
|
| 220 |
+
</button>
|
| 221 |
+
` : ''}
|
| 222 |
+
${ticket.status === 'serving' ? `
|
| 223 |
+
<button onclick="updateStatus(${ticket.id}, 'completed')" class="p-2 text-green-600 hover:bg-green-50 rounded-lg transition" title="Complete">
|
| 224 |
+
<i data-lucide="check" class="w-5 h-5"></i>
|
| 225 |
+
</button>
|
| 226 |
+
` : ''}
|
| 227 |
+
<button onclick="deleteTicket(${ticket.id})" class="p-2 text-red-600 hover:bg-red-50 rounded-lg transition" title="Remove">
|
| 228 |
+
<i data-lucide="x" class="w-5 h-5"></i>
|
| 229 |
+
</button>
|
| 230 |
+
</div>
|
| 231 |
+
</div>
|
| 232 |
+
`;
|
| 233 |
+
}).join('');
|
| 234 |
+
|
| 235 |
+
lucide.createIcons();
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
function getTimeAgo(date) {
|
| 239 |
+
const seconds = Math.floor((new Date() - date) / 1000);
|
| 240 |
+
if (seconds < 60) return 'Just now';
|
| 241 |
+
const minutes = Math.floor(seconds / 60);
|
| 242 |
+
if (minutes < 60) return `${minutes}m ago`;
|
| 243 |
+
const hours = Math.floor(minutes / 60);
|
| 244 |
+
if (hours < 24) return `${hours}h ago`;
|
| 245 |
+
return `${Math.floor(hours / 24)}d ago`;
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
function updateStatus(id, status) {
|
| 249 |
+
let queue = JSON.parse(localStorage.getItem('techSupportQueue') || '[]');
|
| 250 |
+
const ticket = queue.find(t => t.id === id);
|
| 251 |
+
if (ticket) {
|
| 252 |
+
ticket.status = status;
|
| 253 |
+
localStorage.setItem('techSupportQueue', JSON.stringify(queue));
|
| 254 |
+
loadQueue();
|
| 255 |
+
showToast(`Ticket marked as ${status}`);
|
| 256 |
+
}
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
function deleteTicket(id) {
|
| 260 |
+
if (confirm('Remove this ticket from the queue?')) {
|
| 261 |
+
let queue = JSON.parse(localStorage.getItem('techSupportQueue') || '[]');
|
| 262 |
+
queue = queue.filter(t => t.id !== id);
|
| 263 |
+
localStorage.setItem('techSupportQueue', JSON.stringify(queue));
|
| 264 |
+
loadQueue();
|
| 265 |
+
showToast('Ticket removed');
|
| 266 |
+
}
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
function clearAll() {
|
| 270 |
+
if (confirm('Are you sure you want to clear all tickets?')) {
|
| 271 |
+
localStorage.setItem('techSupportQueue', '[]');
|
| 272 |
+
loadQueue();
|
| 273 |
+
showToast('All tickets cleared');
|
| 274 |
+
}
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
function exportData() {
|
| 278 |
+
const queue = JSON.parse(localStorage.getItem('techSupportQueue') || '[]');
|
| 279 |
+
if (queue.length === 0) {
|
| 280 |
+
showToast('No data to export');
|
| 281 |
+
return;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
const csv = [
|
| 285 |
+
['Name', 'Technician', 'Check-in Time', 'Status', 'Timestamp'].join(','),
|
| 286 |
+
...queue.map(t => [
|
| 287 |
+
t.name,
|
| 288 |
+
t.technician,
|
| 289 |
+
t.checkInTime,
|
| 290 |
+
t.status,
|
| 291 |
+
t.timestamp
|
| 292 |
+
].join(','))
|
| 293 |
+
].join('\n');
|
| 294 |
+
|
| 295 |
+
const blob = new Blob([csv], { type: 'text/csv' });
|
| 296 |
+
const url = window.URL.createObjectURL(blob);
|
| 297 |
+
const a = document.createElement('a');
|
| 298 |
+
a.href = url;
|
| 299 |
+
a.download = `tech-support-queue-${new Date().toISOString().split('T')[0]}.csv`;
|
| 300 |
+
a.click();
|
| 301 |
+
showToast('Data exported to CSV');
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
function showToast(message) {
|
| 305 |
+
const toast = document.getElementById('toast');
|
| 306 |
+
document.getElementById('toastMessage').textContent = message;
|
| 307 |
+
toast.classList.remove('translate-y-20', 'hidden');
|
| 308 |
+
setTimeout(() => {
|
| 309 |
+
toast.classList.add('translate-y-20');
|
| 310 |
+
}, 3000);
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
// Auto-refresh every 5 seconds
|
| 314 |
+
setInterval(loadQueue, 5000);
|
| 315 |
+
|
| 316 |
+
// Initial load
|
| 317 |
+
loadQueue();
|
| 318 |
+
</script>
|
| 319 |
+
</body>
|
| 320 |
+
</html>
|
index.html
CHANGED
|
@@ -1,19 +1,169 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Tech Support Check-In</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://unpkg.com/lucide@latest"></script>
|
| 9 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
| 10 |
+
<style>
|
| 11 |
+
body { font-family: 'Inter', sans-serif; }
|
| 12 |
+
.tech-card { transition: all 0.2s ease; }
|
| 13 |
+
.tech-card:hover { transform: translateY(-2px); }
|
| 14 |
+
.tech-card:active { transform: translateY(0); }
|
| 15 |
+
</style>
|
| 16 |
+
</head>
|
| 17 |
+
<body class="bg-gradient-to-br from-blue-50 to-indigo-100 min-h-screen flex items-center justify-center p-4">
|
| 18 |
+
|
| 19 |
+
<div class="max-w-md w-full bg-white rounded-2xl shadow-xl overflow-hidden">
|
| 20 |
+
<!-- Header -->
|
| 21 |
+
<div class="bg-indigo-600 p-6 text-white text-center">
|
| 22 |
+
<i data-lucide="headset" class="w-12 h-12 mx-auto mb-2"></i>
|
| 23 |
+
<h1 class="text-2xl font-bold">Tech Support</h1>
|
| 24 |
+
<p class="text-indigo-100 text-sm mt-1">Check-in for assistance</p>
|
| 25 |
+
</div>
|
| 26 |
+
|
| 27 |
+
<!-- Check-in Form -->
|
| 28 |
+
<div class="p-6 space-y-6">
|
| 29 |
+
<!-- Name Input -->
|
| 30 |
+
<div>
|
| 31 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">Your Name (Optional)</label>
|
| 32 |
+
<input type="text" id="userName" placeholder="Enter your name"
|
| 33 |
+
class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none transition">
|
| 34 |
+
</div>
|
| 35 |
+
|
| 36 |
+
<!-- Technician Selection -->
|
| 37 |
+
<div>
|
| 38 |
+
<label class="block text-sm font-medium text-gray-700 mb-3">Select Support Agent</label>
|
| 39 |
+
<div class="grid grid-cols-2 gap-3">
|
| 40 |
+
<button onclick="checkIn('Gary')" class="tech-card bg-blue-50 hover:bg-blue-100 border-2 border-blue-200 rounded-xl p-4 text-center group">
|
| 41 |
+
<div class="w-12 h-12 bg-blue-500 rounded-full flex items-center justify-center mx-auto mb-2 group-hover:bg-blue-600 transition">
|
| 42 |
+
<span class="text-white font-bold text-lg">G</span>
|
| 43 |
+
</div>
|
| 44 |
+
<span class="font-semibold text-blue-900">Gary</span>
|
| 45 |
+
</button>
|
| 46 |
+
|
| 47 |
+
<button onclick="checkIn('Will')" class="tech-card bg-green-50 hover:bg-green-100 border-2 border-green-200 rounded-xl p-4 text-center group">
|
| 48 |
+
<div class="w-12 h-12 bg-green-500 rounded-full flex items-center justify-center mx-auto mb-2 group-hover:bg-green-600 transition">
|
| 49 |
+
<span class="text-white font-bold text-lg">W</span>
|
| 50 |
+
</div>
|
| 51 |
+
<span class="font-semibold text-green-900">Will</span>
|
| 52 |
+
</button>
|
| 53 |
+
|
| 54 |
+
<button onclick="checkIn('Tim')" class="tech-card bg-purple-50 hover:bg-purple-100 border-2 border-purple-200 rounded-xl p-4 text-center group">
|
| 55 |
+
<div class="w-12 h-12 bg-purple-500 rounded-full flex items-center justify-center mx-auto mb-2 group-hover:bg-purple-600 transition">
|
| 56 |
+
<span class="text-white font-bold text-lg">T</span>
|
| 57 |
+
</div>
|
| 58 |
+
<span class="font-semibold text-purple-900">Tim</span>
|
| 59 |
+
</button>
|
| 60 |
+
|
| 61 |
+
<button onclick="checkIn('Anyone')" class="tech-card bg-orange-50 hover:bg-orange-100 border-2 border-orange-200 rounded-xl p-4 text-center group">
|
| 62 |
+
<div class="w-12 h-12 bg-orange-500 rounded-full flex items-center justify-center mx-auto mb-2 group-hover:bg-orange-600 transition">
|
| 63 |
+
<i data-lucide="users" class="w-6 h-6 text-white"></i>
|
| 64 |
+
</div>
|
| 65 |
+
<span class="font-semibold text-orange-900">Anyone</span>
|
| 66 |
+
</button>
|
| 67 |
+
</div>
|
| 68 |
+
</div>
|
| 69 |
+
|
| 70 |
+
<!-- Current Time Display -->
|
| 71 |
+
<div class="text-center p-4 bg-gray-50 rounded-lg border border-gray-200">
|
| 72 |
+
<p class="text-xs text-gray-500 uppercase tracking-wide mb-1">Current System Time</p>
|
| 73 |
+
<p id="clock" class="text-2xl font-mono font-bold text-gray-800">--:--:--</p>
|
| 74 |
+
<p id="date" class="text-sm text-gray-600 mt-1">Loading...</p>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
|
| 78 |
+
<!-- Footer -->
|
| 79 |
+
<div class="bg-gray-50 px-6 py-4 text-center border-t">
|
| 80 |
+
<a href="admin.html" class="text-sm text-indigo-600 hover:text-indigo-800 font-medium flex items-center justify-center gap-1">
|
| 81 |
+
<i data-lucide="lock" class="w-4 h-4"></i>
|
| 82 |
+
Admin Access
|
| 83 |
+
</a>
|
| 84 |
+
</div>
|
| 85 |
+
</div>
|
| 86 |
+
|
| 87 |
+
<!-- Success Modal -->
|
| 88 |
+
<div id="successModal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50">
|
| 89 |
+
<div class="bg-white rounded-2xl p-8 max-w-sm w-full text-center transform scale-100 transition-transform">
|
| 90 |
+
<div class="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
| 91 |
+
<i data-lucide="check" class="w-8 h-8 text-green-600"></i>
|
| 92 |
+
</div>
|
| 93 |
+
<h2 class="text-2xl font-bold text-gray-800 mb-2">You're Checked In!</h2>
|
| 94 |
+
<p class="text-gray-600 mb-4">Your request has been added to the queue.</p>
|
| 95 |
+
<div class="bg-gray-100 rounded-lg p-3 mb-6 text-sm">
|
| 96 |
+
<p class="font-semibold text-gray-700">Queue Position: <span id="queuePosition" class="text-indigo-600 text-lg">--</span></p>
|
| 97 |
+
<p class="text-gray-500 mt-1" id="waitTime">Estimated wait: Calculating...</p>
|
| 98 |
+
</div>
|
| 99 |
+
<button onclick="closeModal()" class="w-full bg-indigo-600 text-white py-3 rounded-lg font-semibold hover:bg-indigo-700 transition">
|
| 100 |
+
Done
|
| 101 |
+
</button>
|
| 102 |
+
</div>
|
| 103 |
+
</div>
|
| 104 |
+
|
| 105 |
+
<script>
|
| 106 |
+
// Initialize Lucide icons
|
| 107 |
+
lucide.createIcons();
|
| 108 |
+
|
| 109 |
+
// Update clock every second
|
| 110 |
+
function updateClock() {
|
| 111 |
+
const now = new Date();
|
| 112 |
+
document.getElementById('clock').textContent = now.toLocaleTimeString('en-US', {
|
| 113 |
+
hour12: false,
|
| 114 |
+
hour: '2-digit',
|
| 115 |
+
minute: '2-digit',
|
| 116 |
+
second: '2-digit'
|
| 117 |
+
});
|
| 118 |
+
document.getElementById('date').textContent = now.toLocaleDateString('en-US', {
|
| 119 |
+
weekday: 'long',
|
| 120 |
+
year: 'numeric',
|
| 121 |
+
month: 'long',
|
| 122 |
+
day: 'numeric'
|
| 123 |
+
});
|
| 124 |
+
}
|
| 125 |
+
setInterval(updateClock, 1000);
|
| 126 |
+
updateClock();
|
| 127 |
+
|
| 128 |
+
// Check-in function
|
| 129 |
+
function checkIn(technician) {
|
| 130 |
+
const name = document.getElementById('userName').value.trim() || 'Anonymous';
|
| 131 |
+
const now = new Date();
|
| 132 |
+
const ticket = {
|
| 133 |
+
id: Date.now(),
|
| 134 |
+
name: name,
|
| 135 |
+
technician: technician,
|
| 136 |
+
timestamp: now.toISOString(),
|
| 137 |
+
status: 'waiting',
|
| 138 |
+
checkInTime: now.toLocaleTimeString('en-US', { hour12: true, hour: '2-digit', minute: '2-digit', second: '2-digit' })
|
| 139 |
+
};
|
| 140 |
+
|
| 141 |
+
// Save to localStorage
|
| 142 |
+
let queue = JSON.parse(localStorage.getItem('techSupportQueue') || '[]');
|
| 143 |
+
queue.push(ticket);
|
| 144 |
+
localStorage.setItem('techSupportQueue', JSON.stringify(queue));
|
| 145 |
+
|
| 146 |
+
// Show position in queue
|
| 147 |
+
const waitingCount = queue.filter(t => t.status === 'waiting').length;
|
| 148 |
+
document.getElementById('queuePosition').textContent = waitingCount;
|
| 149 |
+
document.getElementById('waitTime').textContent = `Checked in at ${ticket.checkInTime}`;
|
| 150 |
+
|
| 151 |
+
// Show success modal
|
| 152 |
+
document.getElementById('successModal').classList.remove('hidden');
|
| 153 |
+
|
| 154 |
+
// Clear name input
|
| 155 |
+
document.getElementById('userName').value = '';
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
function closeModal() {
|
| 159 |
+
document.getElementById('successModal').classList.add('hidden');
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
// Close modal on outside click
|
| 163 |
+
document.getElementById('successModal').addEventListener('click', function(e) {
|
| 164 |
+
if (e.target === this) closeModal();
|
| 165 |
+
});
|
| 166 |
+
</script>
|
| 167 |
+
<script src="https://deepsite.hf.co/deepsite-badge.js"></script>
|
| 168 |
+
</body>
|
| 169 |
+
</html>
|