-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquant.html
More file actions
161 lines (139 loc) · 7.02 KB
/
quant.html
File metadata and controls
161 lines (139 loc) · 7.02 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="manifest" href="manifest.json">
<title>Quantum Risk Simulator</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
body { background: #000; color: #fff; font-family: sans-serif; margin: 0; padding: 0; }
header { padding: 40px 20px; text-align: center; }
.logo-link img { height: 50px; margin-bottom: 15px; }
.header-title { display: block; font-size: 1.4em; letter-spacing: 4px; text-transform: uppercase; color: #fff; margin-bottom: 10px; }
.container { width: 90%; max-width: 800px; margin: 0 auto; padding: 10px; }
.controls { display: flex; flex-direction: column; gap: 40px; margin: 40px 0; }
@media (min-width: 600px) {
.controls { flex-direction: row; justify-content: space-between; }
.slider-unit { width: 45%; }
}
details { margin-top: 10px; cursor: pointer; border-top: 1px solid #111; padding-top: 8px; }
summary { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: #333; list-style: none; transition: color 0.3s; outline: none; }
summary:hover { color: #888; }
summary::-webkit-details-marker { display: none; }
.details-content { font-size: 11px; color: #555; line-height: 1.6; padding-top: 8px; font-family: monospace; }
.label { color: #555; font-size: 10px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; display: block; }
input[type="range"] { width: 100%; -webkit-appearance: none; background: #222; height: 1px; outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: #00ff00; border-radius: 50%; cursor: pointer; }
.val-display { color: #00ff00; margin-top: 10px; font-family: monospace; font-size: 13px; }
.gap-warning { text-align: center; font-size: 11px; letter-spacing: 2px; margin-bottom: 30px; font-weight: bold; min-height: 1.5em; }
canvas { max-width: 100% !important; height: auto !important; margin-bottom: 20px; }
.footer { text-align: center; color: #222; font-size: 9px; margin-top: 60px; padding-bottom: 40px; }
</style>
</head>
<body>
<script src="pwa-init.js"></script>
<header>
<a href="index.html" class="logo-link">
<img src="logo.png" alt="Logo" onerror="this.style.display='none'">
<span class="header-title">Quantum Risk Simulator</span>
</a>
<div style="max-width: 600px; margin: 0 auto;">
<details>
<summary>Platform Overview</summary>
<div class="details-content">
A probabilistic model designed to visualize the systemic gap between quantum cryptanalysis development and market-wide post-quantum migration.
</div>
</details>
</div>
</header>
<canvas id="mainChart"></canvas>
<div class="container">
<div id="gapAlert" class="gap-warning">SYSTEM ONLINE</div>
<div class="controls">
<div class="slider-unit">
<span class="label">Breakthrough Horizon</span>
<input type="range" id="qTime" min="3" max="25" step="1" value="12">
<div id="qTimeVal" class="val-display">Target: 2038</div>
<details>
<summary>Parameter Info</summary>
<div class="details-content">
<strong>Variable Logic:</strong> Estimated year when a Cryptographically Relevant Quantum Computer (CRQC) achieves the capacity to compromise ECDSA-256 via Shor's algorithm. This is the "T-Zero" event where current public-key infrastructure is mathematically compromised.
</div>
</details>
</div>
<div class="slider-unit">
<span class="label">Adaptation Latency</span>
<input type="range" id="mDelay" min="0" max="10" step="1" value="3">
<div id="mDelayVal" class="val-display" style="color:#0088ff">Lag: 3 years</div>
<details>
<summary>Parameter Info</summary>
<div class="details-content">
<strong>Market Inertia:</strong> The duration between the initial quantum threat manifestation and the achievement of critical mass in post-quantum migration. High latency indicates a slow institutional response, leading to a wider "Vulnerability Gap."
</div>
</details>
</div>
</div>
<details style="text-align: center;">
<summary>Visual Data Legend</summary>
<div class="details-content">
Solid line (Green): Quantum computational advantage progression.<br>
Dashed line (Blue): Global institutional resilience and PQC adoption rate.
</div>
</details>
<div class="footer">
Simulation model accurate as of Jan 2026. Keep your distance from unencrypted data.
</div>
</div>
<script>
const ctx = document.getElementById('mainChart').getContext('2d');
const qIn = document.getElementById('qTime');
const mIn = document.getElementById('mDelay');
let chart = new Chart(ctx, {
type: 'line',
data: {
labels: Array.from({length: 25}, (_, i) => 2026 + i),
datasets: [{
label: 'Threat', borderColor: '#00ff00', data: [], borderWidth: 1.5, pointRadius: 0, tension: 0.4
}, {
label: 'Resilience', borderColor: '#0088ff', data: [], borderWidth: 1.5, borderDash: [5, 5], pointRadius: 0, tension: 0.4
}]
},
options: {
responsive: true,
scales: {
y: { display: false, max: 100, min: 0 },
x: { grid: { display: false }, ticks: { color: '#333', font: { size: 10 } } }
},
plugins: { legend: { display: false } }
}
});
function update() {
const tBreak = parseInt(qIn.value);
const delay = parseInt(mIn.value);
const qData = [];
const mData = [];
let maxGap = 0;
for (let x = 0; x < 25; x++) {
let qVal = 100 / (1 + Math.exp(-0.85 * (x - tBreak)));
let mVal = 100 / (1 + Math.exp(-0.85 * (x - (tBreak + delay))));
qData.push(qVal);
mData.push(mVal);
if (qVal - mVal > maxGap) maxGap = qVal - mVal;
}
chart.data.datasets[0].data = qData;
chart.data.datasets[1].data = mData;
chart.update();
document.getElementById('qTimeVal').innerText = `Target: ${2026 + tBreak}`;
document.getElementById('mDelayVal').innerText = `Lag: ${delay} YR`;
const alert = document.getElementById('gapAlert');
alert.innerText = maxGap > 40 ? "CRITICAL VULNERABILITY" : (maxGap > 15 ? "ELEVATED RISK" : "STABLE TRANSITION");
alert.style.color = maxGap > 40 ? "#ff0055" : (maxGap > 15 ? "#ffaa00" : "#00ff00");
}
qIn.oninput = update;
mIn.oninput = update;
update();
</script>
</body>
</html>
</html>