- HUD now displays "Payfrit Tasks - <BusinessName>" by fetching from getBusiness API - Fixed portal Task HUD button to link to /hud/index.html instead of /hud/ Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
332 lines
7.5 KiB
HTML
332 lines
7.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
|
<title>Payfrit HUD</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
background: #000;
|
|
color: #fff;
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
height: 100vh;
|
|
overflow: hidden;
|
|
user-select: none;
|
|
-webkit-user-select: none;
|
|
}
|
|
|
|
.header {
|
|
position: absolute;
|
|
top: 20px;
|
|
left: 20px;
|
|
right: 20px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
z-index: 100;
|
|
}
|
|
|
|
.header h1 {
|
|
font-size: 14px;
|
|
font-weight: 300;
|
|
color: #666;
|
|
letter-spacing: 2px;
|
|
text-transform: uppercase;
|
|
margin: 0;
|
|
}
|
|
|
|
.clock {
|
|
font-size: 24px;
|
|
font-weight: 200;
|
|
color: #444;
|
|
}
|
|
|
|
.task-container {
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
top: 0;
|
|
display: flex;
|
|
align-items: flex-end;
|
|
justify-content: center;
|
|
gap: 8px;
|
|
padding: 20px;
|
|
padding-top: 100px;
|
|
}
|
|
|
|
.task-bar {
|
|
width: 60px;
|
|
min-width: 40px;
|
|
max-width: 100px;
|
|
flex: 1;
|
|
background: linear-gradient(to top, var(--task-color) 0%, var(--task-color-light) 100%);
|
|
border-radius: 4px 4px 0 0;
|
|
position: relative;
|
|
transition: height 0.3s ease-out;
|
|
cursor: pointer;
|
|
box-shadow: 0 0 10px var(--task-color-glow);
|
|
}
|
|
|
|
.task-bar:hover {
|
|
opacity: 0.9;
|
|
transform: scaleX(1.05);
|
|
}
|
|
|
|
.task-bar:active {
|
|
transform: scaleX(0.95);
|
|
}
|
|
|
|
.task-bar.flashing {
|
|
animation: flash 0.5s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes flash {
|
|
0%, 100% { opacity: 1; }
|
|
50% { opacity: 0.3; }
|
|
}
|
|
|
|
.task-bar .task-label {
|
|
position: absolute;
|
|
bottom: 8px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
font-size: 10px;
|
|
font-weight: 600;
|
|
color: rgba(255,255,255,0.9);
|
|
text-shadow: 0 1px 2px rgba(0,0,0,0.5);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.task-bar .task-time {
|
|
position: absolute;
|
|
top: 8px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
font-size: 11px;
|
|
font-weight: 500;
|
|
color: rgba(255,255,255,0.8);
|
|
}
|
|
|
|
.task-bar .task-id {
|
|
position: absolute;
|
|
bottom: 24px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
font-size: 16px;
|
|
font-weight: 700;
|
|
color: #fff;
|
|
}
|
|
|
|
/* Task detail overlay */
|
|
.task-overlay {
|
|
display: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba(0,0,0,0.9);
|
|
z-index: 1000;
|
|
justify-content: center;
|
|
align-items: center;
|
|
padding: 20px;
|
|
}
|
|
|
|
.task-overlay.visible {
|
|
display: flex;
|
|
}
|
|
|
|
.task-detail {
|
|
background: #1a1a1a;
|
|
border-radius: 12px;
|
|
padding: 24px;
|
|
max-width: 400px;
|
|
width: 100%;
|
|
border: 1px solid #333;
|
|
}
|
|
|
|
.task-detail h2 {
|
|
font-size: 24px;
|
|
margin-bottom: 16px;
|
|
color: var(--detail-color, #fff);
|
|
}
|
|
|
|
.task-detail .detail-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 8px 0;
|
|
border-bottom: 1px solid #333;
|
|
}
|
|
|
|
.task-detail .detail-label {
|
|
color: #888;
|
|
}
|
|
|
|
.task-detail .detail-value {
|
|
color: #fff;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.task-detail .actions {
|
|
display: flex;
|
|
gap: 12px;
|
|
margin-top: 24px;
|
|
}
|
|
|
|
.task-detail button {
|
|
flex: 1;
|
|
padding: 16px;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: transform 0.1s;
|
|
}
|
|
|
|
.task-detail button:active {
|
|
transform: scale(0.98);
|
|
}
|
|
|
|
.task-detail .btn-accept {
|
|
background: #22c55e;
|
|
color: #fff;
|
|
}
|
|
|
|
.task-detail .btn-close {
|
|
background: #333;
|
|
color: #fff;
|
|
}
|
|
|
|
/* Empty state */
|
|
.empty-state {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
text-align: center;
|
|
color: #333;
|
|
}
|
|
|
|
.empty-state .icon {
|
|
font-size: 64px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.empty-state p {
|
|
font-size: 18px;
|
|
color: #444;
|
|
}
|
|
|
|
/* Dynamic color from API (overrides category defaults) */
|
|
.task-bar {
|
|
--task-color: var(--bar-color, #888888);
|
|
--task-color-light: var(--bar-color, #aaaaaa);
|
|
--task-color-glow: var(--bar-color, rgba(136, 136, 136, 0.3));
|
|
}
|
|
|
|
/* Category color fallbacks (used when --bar-color not set) */
|
|
.task-bar[data-category="1"]:not([style*="--bar-color"]) {
|
|
--task-color: #ef4444;
|
|
--task-color-light: #f87171;
|
|
--task-color-glow: rgba(239, 68, 68, 0.3);
|
|
}
|
|
.task-bar[data-category="2"]:not([style*="--bar-color"]) {
|
|
--task-color: #f59e0b;
|
|
--task-color-light: #fbbf24;
|
|
--task-color-glow: rgba(245, 158, 11, 0.3);
|
|
}
|
|
.task-bar[data-category="3"]:not([style*="--bar-color"]) {
|
|
--task-color: #22c55e;
|
|
--task-color-light: #4ade80;
|
|
--task-color-glow: rgba(34, 197, 94, 0.3);
|
|
}
|
|
.task-bar[data-category="4"]:not([style*="--bar-color"]) {
|
|
--task-color: #3b82f6;
|
|
--task-color-light: #60a5fa;
|
|
--task-color-glow: rgba(59, 130, 246, 0.3);
|
|
}
|
|
.task-bar[data-category="5"]:not([style*="--bar-color"]) {
|
|
--task-color: #8b5cf6;
|
|
--task-color-light: #a78bfa;
|
|
--task-color-glow: rgba(139, 92, 246, 0.3);
|
|
}
|
|
.task-bar[data-category="6"]:not([style*="--bar-color"]) {
|
|
--task-color: #ec4899;
|
|
--task-color-light: #f472b6;
|
|
--task-color-glow: rgba(236, 72, 153, 0.3);
|
|
}
|
|
|
|
/* Connection status */
|
|
.status-indicator {
|
|
position: fixed;
|
|
bottom: 10px;
|
|
right: 10px;
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
background: #22c55e;
|
|
}
|
|
|
|
.status-indicator.disconnected {
|
|
background: #ef4444;
|
|
animation: pulse 1s infinite;
|
|
}
|
|
|
|
@keyframes pulse {
|
|
0%, 100% { opacity: 1; }
|
|
50% { opacity: 0.5; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="header">
|
|
<h1>Payfrit Tasks<span id="businessName"></span></h1>
|
|
<div class="clock" id="clock">--:--:--</div>
|
|
</div>
|
|
|
|
<div class="task-container" id="taskContainer">
|
|
<div class="empty-state" id="emptyState">
|
|
<div class="icon">✓</div>
|
|
<p>All caught up!</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="task-overlay" id="taskOverlay">
|
|
<div class="task-detail" id="taskDetail">
|
|
<h2 id="detailTitle">Task Details</h2>
|
|
<div class="detail-row">
|
|
<span class="detail-label">Category</span>
|
|
<span class="detail-value" id="detailCategory">-</span>
|
|
</div>
|
|
<div class="detail-row">
|
|
<span class="detail-label">Created</span>
|
|
<span class="detail-value" id="detailCreated">-</span>
|
|
</div>
|
|
<div class="detail-row">
|
|
<span class="detail-label">Waiting</span>
|
|
<span class="detail-value" id="detailWaiting">-</span>
|
|
</div>
|
|
<div class="detail-row">
|
|
<span class="detail-label">Details</span>
|
|
<span class="detail-value" id="detailInfo">-</span>
|
|
</div>
|
|
<div class="actions">
|
|
<button class="btn-close" onclick="closeOverlay()">Close</button>
|
|
<button class="btn-accept" onclick="acceptTask()">Accept Task</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="status-indicator" id="statusIndicator"></div>
|
|
|
|
<script src="hud.js"></script>
|
|
</body>
|
|
</html>
|