-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
243 lines (217 loc) · 9.96 KB
/
index.html
File metadata and controls
243 lines (217 loc) · 9.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" href="favicons/favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" sizes="180x180" href="favicons/apple-touch-icon.png">
<link rel="manifest" href="favicons/site.webmanifest">
<link href="https://fonts.googleapis.com/css2?family=Inter&display=swap" rel="stylesheet">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Mess Manager</title>
<link rel="stylesheet" href="style.css">
<script src="https://unpkg.com/html5-qrcode" type="text/javascript"></script>
<script src="https://unpkg.com/peerjs@1.5.4/dist/peerjs.min.js"></script>
</head>
<body>
<div class="app-container">
<div class="floating-header-wrapper">
<div class="floating-header-inner">
<nav class="floating-nav" id="nav-tabs">
<div class="nav-brand">Mess Manager</div>
<div id="sync-indicator" class="sync-indicator disconnected" title="Click to configure P2P sync">
<span class="sync-dot"></span>
<span class="sync-text">Offline</span>
</div>
<div class="tab-group">
<div class="tab current" data-target="preparation">Preparation</div>
<div class="tab" data-target="sales">Sales</div>
<div class="tab" data-target="summary">Summary</div>
</div>
</nav>
<div class="floating-actions">
<button id="reset-btn" class="action-btn" title="Reset Data">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
<path d="M3 3v5h5" />
</svg>
</button>
<button id="import-btn" class="action-btn" title="Import Data">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
<polyline points="7 10 12 15 17 10" />
<line x1="12" y1="15" x2="12" y2="3" />
</svg>
</button>
<input type="file" id="import-file" accept=".json" style="display: none;">
<button id="export-btn" class="action-btn" title="Export Data">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
<polyline points="17 8 12 3 7 8" />
<line x1="12" y1="3" x2="12" y2="15" />
</svg>
</button>
<button id="barcode-btn" class="action-btn" title="Barcode Scanner">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 5v14" />
<path d="M8 5v14" />
<path d="M12 5v14" />
<path d="M17 5v14" />
<path d="M21 5v14" />
</svg>
</button>
<button id="cart-toggle-btn" class="action-btn" title="Toggle Cart">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="9" cy="21" r="1"></circle>
<circle cx="20" cy="21" r="1"></circle>
<path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
</svg>
</button>
</div>
</div>
</div>
<main class="main-content">
<div class="content current" id="preparation">
<div class="items-grid" id="items-grid">
<!-- Items will be dynamically generated here -->
</div>
</div>
<div class="content" id="sales">
<div class="items-grid" id="sales-items-grid">
<!-- Items will be dynamically generated here -->
</div>
</div>
<div class="content" id="summary">
<div class="items-grid" id="summary-items-grid">
<!-- Items will be dynamically generated here -->
</div>
</div>
</main>
<div id="grand-total-container">
<span class="label">Total Profit</span>
<span class="amount">$0.00</span>
</div>
<!-- Shopping Cart Panel -->
<div id="cart-panel" class="cart-panel hidden">
<div class="cart-header">
<h3>Current Order</h3>
<div style="display: flex; align-items: center; gap: 12px;">
<span id="cart-total-badge" class="cart-badge">0 items</span>
<button id="cart-close-btn" class="icon-btn">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
</div>
<div id="cart-items" class="cart-items">
<!-- Cart items will be generated here -->
</div>
<div class="cart-footer">
<div class="cart-total">
<span>Total:</span>
<span id="cart-total-amount">$0.00</span>
</div>
<button id="confirm-sale-btn" class="action-btn primary full-width">Confirm Sale</button>
</div>
</div>
</div>
<!-- Scanner Modal -->
<div id="scanner-modal" class="modal hidden">
<div class="modal-content">
<button id="close-scanner" class="close-btn">×</button>
<div id="reader"></div>
<div class="scanner-controls">
<button id="change-camera-btn" class="action-btn" title="Change Camera">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" />
<circle cx="12" cy="13" r="4" />
</svg>
</button>
<button id="flip-camera-btn" class="action-btn" title="Mirror Camera">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 12H2" />
<path d="M5.45 5.11L2 12l3.45 6.89" />
<path d="M18.55 5.11L22 12l-3.45 6.89" />
</svg>
</button>
</div>
<p class="scanner-instruction">Point camera at a barcode</p>
<!-- Bind Barcode UI -->
<div id="bind-ui" class="hidden">
<h3>Unknown Barcode</h3>
<p>Code: <span id="scanned-code-display" class="code-highlight"></span></p>
<p class="instruction-text">Select an item to link this barcode to:</p>
<select id="bind-item-select"></select>
<div class="bind-actions">
<button id="confirm-bind-btn" class="action-btn primary">Link Item</button>
<button id="cancel-bind-btn" class="action-btn secondary">Cancel</button>
</div>
</div>
</div>
</div>
<!-- Sync Settings Modal (P2P) -->
<div id="sync-modal" class="modal hidden">
<div class="modal-content sync-settings">
<button id="close-sync-modal" class="close-btn">×</button>
<h3>Server Settings</h3>
<!-- Setup Phase (Visible when offline) -->
<div id="sync-setup-ui">
<div class="join-section">
<label for="sync-server-url" style="display:block; margin-bottom:8px;">Connect to ID:</label>
<div class="join-input-row" style="display:flex; gap:8px; flex-direction: column;">
<div style="display:flex; gap:8px;">
<input type="text" id="sync-server-url" placeholder="e.g. RFJXKL" maxlength="6"
style="text-transform: uppercase; flex:1;" />
<button id="connect-sync-btn" class="action-btn primary" style="flex:1;">Connect</button>
</div>
<button id="connect-camera-btn" class="action-btn secondary full-width">Connect Camera</button>
</div>
</div>
<div class="divider"
style="display:flex; align-items:center; text-align:center; margin: 20px 0; color:#94a3b8;">
<span style="flex:1; border-bottom:1px solid #e2e8f0;"></span>
<span style="padding:0 10px; font-size:12px; font-weight:500;">OR</span>
<span style="flex:1; border-bottom:1px solid #e2e8f0;"></span>
</div>
<div class="host-section">
<button id="start-host-btn" class="action-btn primary full-width">Start Hosting</button>
<p class="help-text" style="text-align:center; margin-top:8px;">Host a session for others to join.</p>
</div>
</div>
<!-- Active Phase (Visible when connected/hosting) -->
<div id="sync-active-ui" class="hidden">
<!-- Host Info -->
<div id="host-active-info" class="hidden">
<div class="sync-status-detail" style="margin-bottom:8px;">
<span>Your Number:</span>
<span id="host-number-display" style="font-weight:bold;">0</span>
</div>
<div class="sync-status-detail host-address" style="margin-bottom:16px;">
<span>Your ID:</span>
<span id="host-peer-id" style="font-weight:bold; font-size:1.2em;">...</span>
</div>
<div class="connected-peers" style="margin-bottom:20px;">
<span>Connected Peers:</span>
<span id="connected-peers-count">0</span>
</div>
<button id="stop-host-btn" class="action-btn secondary full-width">Stop Hosting</button>
</div>
<!-- Client Info -->
<div id="client-active-info" class="hidden">
<div class="sync-status-detail" style="margin-bottom:8px;">
<span>Your Number:</span>
<span id="client-number-display" style="font-weight:bold;">...</span>
</div>
<div class="sync-status-detail" style="margin-bottom:20px;">
<span>Status:</span>
<span id="sync-status-text">Connected</span>
</div>
<button id="disconnect-sync-btn" class="action-btn secondary full-width">Disconnect</button>
</div>
</div>
</div>
</div>
<script src="main.js"></script>
</body>
</html>