-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
258 lines (237 loc) · 12.4 KB
/
index.html
File metadata and controls
258 lines (237 loc) · 12.4 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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Canary Films Receipt Printer</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
<h1>Canary Films Receipt Printer</h1>
<p>Support Independent Filmmaking</p>
<!-- Mode Toggle -->
<div class="mode-toggle">
<button id="receiptModeBtn" class="mode-btn mode-receipt active">Receipt Mode</button>
<button id="imageModeBtn" class="mode-btn mode-image">Image Mode</button>
</div>
</header>
<main>
<div class="panels">
<!-- Receipt Mode Content -->
<div id="receiptModeContent" class="mode-content active">
<!-- Left Panel: Configuration -->
<section class="config-panel">
<div class="config-section">
<h3>Business Information</h3>
<div class="input-group">
<label for="businessName">Name</label>
<input type="text" id="businessName" value="CANARY FILMS">
</div>
<div class="input-group">
<label for="businessAddress">Address</label>
<textarea id="businessAddress" rows="2">7 Somers Crescent
Forrest ACT 2603</textarea>
</div>
<div class="input-group">
<label for="businessEmail">Email</label>
<input type="text" id="businessEmail" value="tickets@canaryfilms.org">
</div>
</div>
<div class="config-section">
<h3>Transaction</h3>
<div class="flex-row">
<div class="input-group">
<label for="transactionNumber">#</label>
<input type="text" id="transactionNumber" value="1234">
</div>
<div class="input-group">
<label>Date/Time</label>
<div class="read-only-field" id="dateTimeField"></div>
</div>
</div>
</div>
<div class="config-section">
<h3>Items</h3>
<div id="itemsList"></div>
<div class="item-entry">
<div class="flex-row">
<div class="input-group">
<input type="text" id="newItemName" placeholder="Item name">
</div>
<div class="input-group input-group-small">
<input type="number" id="newItemPrice" placeholder="0.00" step="0.01">
</div>
<button id="addItemBtn" class="btn-primary">Add</button>
</div>
</div>
</div>
<div class="config-section">
<h3>Payment</h3>
<div class="flex-row">
<div class="input-group">
<label for="tipAmount">Tip</label>
<input type="number" id="tipAmount" value="0.00" step="0.01">
</div>
<div class="input-group">
<label for="paymentMethod">Method</label>
<select id="paymentMethod">
<option value="CASH">Cash</option>
<option value="CREDIT" selected>Credit Card</option>
<option value="DEBIT">Debit</option>
<option value="MOBILE">Mobile Pay</option>
</select>
</div>
</div>
<div class="flex-row">
<div class="input-group">
<label for="amountPaid">Paid</label>
<input type="number" id="amountPaid" value="0.00" step="0.01">
</div>
<div class="input-group">
<label>Change</label>
<div class="read-only-field" id="changeAmount">$0.00</div>
</div>
</div>
</div>
<div class="config-section">
<h3>Footer</h3>
<div class="input-group">
<textarea id="footerMessage" rows="3">Thanks for visiting Canary Films.
Please visit again.
https://canaryfilms.org
Support Independent Filmmaking</textarea>
</div>
</div>
<div class="action-buttons">
<button id="resetBtn" class="btn-secondary">Reset</button>
<button id="connectReceiptBtn" class="btn btn-primary connect-btn">Connect Printer</button>
<button id="printReceiptBtn" class="btn-primary" disabled>Print</button>
</div>
</section>
<!-- Right Panel: Receipt Preview -->
<section class="preview-panel">
<div class="preview-header">
<h2>Print Preview</h2>
</div>
<div class="receipt-wrapper">
<div class="receipt-container" id="receiptContainer">
<div class="receipt" id="receiptPreview">
<!-- Receipt will be rendered here -->
</div>
</div>
<div class="receipt-summary" id="receiptSummary">
<!-- Summary info will be placed here -->
</div>
</div>
</section>
</div>
<!-- Image Mode Content -->
<div id="imageModeContent" class="mode-content">
<!-- Left Panel: Image Configuration -->
<section class="config-panel image-config-panel">
<div class="config-section">
<h3>Image Source</h3>
<div class="input-group">
<label for="imageUpload">Upload Image</label>
<div class="file-upload-container">
<input type="file" id="imageUpload" accept="image/*">
</div>
</div>
<div class="input-group">
<label>Rotation</label>
<div class="rotation-controls">
<button id="rotateLeftBtn" class="btn-icon" title="Rotate Left (90° Counter-Clockwise)">
<span class="rotation-icon">↺</span>
</button>
<span id="rotationDisplay">0°</span>
<button id="rotateRightBtn" class="btn-icon" title="Rotate Right (90° Clockwise)">
<span class="rotation-icon">↻</span>
</button>
</div>
</div>
</div>
<div class="config-section">
<h3>Image Processing</h3>
<div class="input-group">
<label for="ditherMethod">Dithering Method</label>
<select id="ditherMethod">
<option value="threshold">Threshold</option>
<option value="floydSteinberg" selected>Floyd-Steinberg</option>
<option value="atkinson">Atkinson</option>
<option value="halftone">Halftone</option>
<option value="none">None</option>
</select>
</div>
<div class="input-group">
<label for="thresholdValue">Threshold</label>
<input type="range" id="thresholdValue" min="0" max="255" value="128">
<span id="thresholdDisplay">128</span>
</div>
<div class="input-group">
<label for="imageInvert">Invert Image</label>
<input type="checkbox" id="imageInvert">
</div>
</div>
<div class="config-section">
<h3>Size & Positioning</h3>
<div class="input-group">
<label for="imageWidth">Width (px)</label>
<input type="number" id="imageWidth" value="384" min="1" max="384" step="1">
</div>
<div class="input-group">
<label for="autoscaleImage">Auto Scale to Width</label>
<input type="checkbox" id="autoscaleImage" checked>
</div>
<div class="input-group">
<label for="imagePadding">Padding (px)</label>
<input type="number" id="imagePadding" value="10" min="0" max="100" step="1">
</div>
</div>
<div class="action-buttons">
<button id="resetImageBtn" class="btn-secondary">Reset</button>
<button id="connectImageBtn" class="btn btn-primary connect-btn">Connect Printer</button>
<button id="printImageBtn" class="btn-primary" disabled>Print</button>
</div>
</section>
<!-- Right Panel: Image Preview -->
<section class="preview-panel image-preview-panel">
<div class="preview-header">
<h2>Print Preview</h2>
</div>
<div class="image-wrapper" id="dropZone">
<div class="image-container" id="imageContainer">
<canvas id="imagePreview"></canvas>
<div id="imagePreviewMessage">Drop image here or click the upload button</div>
</div>
<div class="image-summary" id="imageSummary">
<!-- Image info will be placed here -->
</div>
</div>
</section>
</div>
<!-- Printer Log Panel (shared between modes) -->
<section class="log-panel">
<div class="log-controls">
<h2>Printer Log</h2>
<button id="clearLogBtn">Clear Log</button>
</div>
<div class="log-wrapper" id="logWrapper">
<!-- Log entries will be added here -->
</div>
<div class="progress-container" id="printProgress">
<div class="progress-bar" id="printProgressBar"></div>
</div>
</section>
</div>
</main>
<footer>
<p>Canary Films Receipt Printer | <a href="https://canaryfilms.org" target="_blank">canaryfilms.org</a></p>
<div class="battery-indicator" id="batteryIndicator">
<span class="battery-icon">🔋</span>
<span class="battery-level" id="batteryLevel">--</span>
</div>
</footer>
<script type="module" src="js/main.js"></script>
</body>
</html>