-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscan.html
More file actions
152 lines (118 loc) · 3.82 KB
/
Copy pathscan.html
File metadata and controls
152 lines (118 loc) · 3.82 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>NetDAG Scan</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body class="scan-page">
<section class="scan-shell">
<div class="scan-top">
<img src="images/ndg-logo.png" alt="NetDAG Logo" class="scan-logo">
<h1 class="scan-title">NetDAG Scan</h1>
<a href="provenance.html#prov-mvp-demo" class="scan-back-link">
← Back to Provenance
</a>
<p class="scan-sub">
Verify product authenticity instantly.
</p>
</div>
<div class="scan-card">
<div class="scan-camera-note">
Scan this QR code with your phone camera to instantly verify product authenticity.
</div>
<div class="scan-divider">or</div>
<input
type="text"
id="scanRecordInput"
class="scan-input"
placeholder="Paste Record ID"
value="NDG-PROV-MQ3LDJQS-Y85GOE"
autocomplete="off"
spellcheck="false"
>
<button id="scanVerifyBtn" class="scan-secondary-btn">
Verify Record
</button>
<div class="scan-qr-box">
<div id="scanQrCode"></div>
<div class="scan-live-badge">
● LIVE ON-CHAIN VERIFICATION
</div>
<p class="scan-qr-note">
Scan this QR code with your phone camera to instantly open the public
NetDAG verification page for this product record.
</p>
</div>
<div class="scan-demo-note">
Only valid NetDAG Provenance records will return a positive authenticity confirmation.
</div>
<div class="scan-note">
NetDAG Provenance is currently onboarding manufacturing and supply-chain partners.
Public verification remains active during rollout.
</div>
<div class="scan-app-footer">
<span>Scan</span>
<span>Verify</span>
<span>Trust</span>
</div>
</div>
</section>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const DEMO_RECORD_ID = "NDG-PROV-MQ3LDJQS-Y85GOE";
const scanInput = document.getElementById("scanRecordInput");
const verifyBtn = document.getElementById("scanVerifyBtn");
const scanQrCode = document.getElementById("scanQrCode");
function buildVerifyUrl(recordId) {
const cleanId = String(recordId || "").trim().toUpperCase();
return (
"https://www.netdag.com/provenance.html?id=" +
encodeURIComponent(cleanId) +
"#prov-mvp-demo"
);
}
function buildProvenanceUrl(recordId) {
const cleanId = String(recordId || "").trim().toUpperCase();
return (
"provenance.html?id=" +
encodeURIComponent(cleanId) +
"#prov-mvp-demo"
);
}
function goToVerify(recordId) {
const cleanId = String(recordId || "").trim().toUpperCase();
if (!cleanId) {
alert("Please enter a Record ID.");
return;
}
window.location.href = buildProvenanceUrl(cleanId);
}
if (scanInput) {
const params = new URLSearchParams(window.location.search);
const incomingId =
params.get("id") ||
params.get("record") ||
params.get("verify");
scanInput.value = incomingId || DEMO_RECORD_ID;
}
if (verifyBtn && scanInput) {
verifyBtn.addEventListener("click", function () {
goToVerify(scanInput.value);
});
}
if (scanQrCode && window.QRCode) {
scanQrCode.innerHTML = "";
new QRCode(scanQrCode, {
text: buildVerifyUrl(DEMO_RECORD_ID),
width: 180,
height: 180,
correctLevel: QRCode.CorrectLevel.H
});
}
});
</script>
</body>
</html>