-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqr-codes.html
More file actions
333 lines (290 loc) · 10.4 KB
/
Copy pathqr-codes.html
File metadata and controls
333 lines (290 loc) · 10.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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EnRICH QR Codes - Care Home Referral Portal</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<style>
:root {
--enrich-purple: #8B2A7D;
--enrich-blue: #2D7BC4;
--enrich-navy: #1E3A5F;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Calibri', 'Gill Sans', 'Segoe UI', Helvetica, Arial, sans-serif;
background: #f5f5f5;
color: var(--enrich-navy);
padding: 20px;
}
.header {
text-align: center;
padding: 20px;
background: var(--enrich-purple);
color: white;
border-radius: 12px;
margin-bottom: 30px;
}
.header h1 {
font-size: 2rem;
margin-bottom: 0.5rem;
}
.header p {
opacity: 0.9;
}
.controls {
text-align: center;
margin-bottom: 30px;
padding: 20px;
background: white;
border-radius: 12px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.controls button {
background: var(--enrich-purple);
color: white;
border: none;
padding: 12px 30px;
font-size: 1rem;
font-weight: 600;
border-radius: 8px;
cursor: pointer;
margin: 5px;
transition: all 0.3s ease;
}
.controls button:hover {
background: #6B1F5F;
transform: translateY(-2px);
}
.controls button.blue {
background: var(--enrich-blue);
}
.controls button.blue:hover {
background: #1E5A94;
}
.qr-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 20px;
}
.qr-card {
background: white;
border-radius: 12px;
padding: 25px;
text-align: center;
box-shadow: 0 2px 15px rgba(0,0,0,0.1);
page-break-inside: avoid;
break-inside: avoid;
}
.qr-card h3 {
color: var(--enrich-purple);
font-size: 1.1rem;
margin-bottom: 15px;
min-height: 2.5em;
display: flex;
align-items: center;
justify-content: center;
}
.qr-container {
display: flex;
justify-content: center;
margin: 15px 0;
}
.qr-container canvas, .qr-container img {
border: 3px solid var(--enrich-purple);
border-radius: 8px;
padding: 10px;
background: white;
}
.pin-display {
background: linear-gradient(135deg, var(--enrich-purple) 0%, #6B1F5F 100%);
color: white;
font-size: 1.8rem;
font-weight: 700;
letter-spacing: 8px;
padding: 12px 20px;
border-radius: 8px;
margin: 15px 0;
}
.url-display {
font-size: 0.75rem;
color: #666;
word-break: break-all;
margin-top: 10px;
padding: 8px;
background: #f8f9fa;
border-radius: 6px;
}
.instructions {
background: #fff3cd;
border: 1px solid #ffc107;
border-radius: 8px;
padding: 15px 20px;
margin-bottom: 20px;
font-size: 0.95rem;
}
.instructions strong {
color: var(--enrich-navy);
}
.logo-placeholder {
width: 60px;
height: 60px;
margin: 0 auto 10px;
}
.logo-placeholder img {
width: 100%;
height: 100%;
object-fit: contain;
}
/* Print styles */
@media print {
body {
background: white;
padding: 0;
}
.header, .controls, .instructions {
display: none !important;
}
.qr-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
}
.qr-card {
box-shadow: none;
border: 2px solid #ddd;
padding: 15px;
page-break-inside: avoid;
}
.qr-card h3 {
font-size: 0.95rem;
}
.pin-display {
font-size: 1.4rem;
letter-spacing: 6px;
padding: 8px 15px;
}
.url-display {
font-size: 0.65rem;
}
}
/* Single card print */
@media print {
.print-single .qr-grid {
display: block;
}
.print-single .qr-card {
width: 100%;
max-width: 400px;
margin: 0 auto;
}
}
</style>
</head>
<body>
<div class="header">
<h1>EnRICH QR Codes</h1>
<p>Care Home Referral Portal Access Codes</p>
</div>
<div class="instructions">
<strong>Instructions:</strong> Each QR code below links directly to the EnRICH referral portal with the care home's PIN pre-filled.
Print individual cards to display in each care home. Staff can scan the QR code to access the referral form instantly.
</div>
<div class="controls">
<button onclick="window.print()">🖨︠Print All QR Codes</button>
<button class="blue" onclick="downloadAllAsImages()">📥 Download All as Images</button>
</div>
<div class="qr-grid" id="qr-grid">
<!-- QR codes will be generated here -->
</div>
<script>
const baseUrl = "https://mjb302.github.io/enrich/referral.html";
const careHomes = [
{ pin: '24569', name: 'Brook House Care Home' },
{ pin: '13330', name: 'Cambridge Grove Care Home' },
{ pin: '61396', name: 'Cambridge Manor Care Home' },
{ pin: '30250', name: 'Hatley Court' },
{ pin: '34568', name: 'Heathlands House' },
{ pin: '47230', name: 'Highfield Care Home' },
{ pin: '26985', name: 'Lily House' },
{ pin: '18134', name: 'Maycroft Care Home' },
{ pin: '63882', name: 'Southwell Court' },
{ pin: '69642', name: 'Vera James House' },
{ pin: '53033', name: 'Waterbeach Lodge' },
{ pin: '30831', name: 'Langdon House' },
{ pin: '65203', name: 'Alex Wood House' },
{ pin: '22990', name: 'Etheldred House Care Home' },
{ pin: '88733', name: 'Hilton Park - Oaklands' },
{ pin: '84852', name: 'Home Meadow' },
{ pin: '48884', name: 'Primrose Croft Care Home' },
{ pin: '16274', name: 'Melbourn Springs Care Home' },
{ pin: '70781', name: 'Home Close' },
{ pin: '31180', name: 'Cleves Place' },
{ pin: '27124', name: 'Queens Court' },
{ pin: '81751', name: 'Townsend Manor' },
{ pin: '57391', name: 'Fitzwilliam House Care Home' },
{ pin: '39121', name: 'Bramley Court' },
{ pin: '70148', name: 'Cottenham Court Care Home' },
{ pin: '62340', name: 'Woodlands Care Centre' },
{ pin: '47903', name: 'The Cambridgeshire Care Home' },
{ pin: '78498', name: 'Melwood Grange' },
{ pin: '36675', name: 'Midfield Lodge' },
{ pin: '70896', name: 'Symonds House' },
{ pin: '17371', name: 'Orchard House Residential Care Home' }
];
function generateQRCodes() {
const grid = document.getElementById('qr-grid');
grid.innerHTML = '';
careHomes.forEach((home, index) => {
const url = `${baseUrl}?pin=${home.pin}`;
const card = document.createElement('div');
card.className = 'qr-card';
card.id = `card-${home.pin}`;
card.innerHTML = `
<div class="logo-placeholder">
<img src="EnRICH_Logo_solid.png" alt="EnRICH" onerror="this.style.display='none'">
</div>
<h3>${home.name}</h3>
<div class="qr-container" id="qr-${home.pin}"></div>
<div class="pin-display">${home.pin}</div>
<p style="font-size: 0.85rem; color: #666;">Scan to make a referral</p>
<div class="url-display">${url}</div>
`;
grid.appendChild(card);
// Generate QR code
new QRCode(document.getElementById(`qr-${home.pin}`), {
text: url,
width: 180,
height: 180,
colorDark: "#8B2A7D",
colorLight: "#ffffff",
correctLevel: QRCode.CorrectLevel.H
});
});
}
function downloadAllAsImages() {
careHomes.forEach((home, index) => {
setTimeout(() => {
const canvas = document.querySelector(`#qr-${home.pin} canvas`);
if (canvas) {
const link = document.createElement('a');
link.download = `EnRICH_QR_${home.name.replace(/[^a-zA-Z0-9]/g, '_')}.png`;
link.href = canvas.toDataURL('image/png');
link.click();
}
}, index * 200); // Stagger downloads
});
}
// Generate QR codes on page load
document.addEventListener('DOMContentLoaded', generateQRCodes);
</script>
</body>
</html>