-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
301 lines (267 loc) · 8.91 KB
/
Copy pathindex.html
File metadata and controls
301 lines (267 loc) · 8.91 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Batata Split 🥔</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><text y='32' font-size='32'>🥔</text></svg>" type="image/svg+xml">
<style>
body {
font-family: Arial, sans-serif;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background: #f5f5f5;
}
.hidden {
display: none !important;
}
.card {
background: white;
border-radius: 12px;
padding: 30px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
}
.card-title {
margin-top: 0;
color: #333;
font-size: 1.8em;
margin-bottom: 25px;
}
input[type="text"],
input[type="number"],
textarea {
width: 100%;
padding: 12px;
margin-bottom: 15px;
border: 2px solid #ddd;
border-radius: 8px;
font-size: 16px;
transition: border-color 0.3s, background-color 0.3s;
}
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
outline: none;
border-color: #4CAF50;
}
input[disabled],
textarea[disabled] {
background-color: #f5f5f5;
border-color: #ddd;
color: #666;
cursor: not-allowed;
}
.button-card {
background: #4CAF50;
color: white;
border: none;
padding: 12px 24px;
border-radius: 8px;
font-size: 16px;
cursor: pointer;
transition: transform 0.2s, background-color 0.2s;
margin: 5px;
}
.button-card:hover {
background: #45a049;
transform: translateY(-2px);
}
.button-card:disabled {
background: #cccccc;
cursor: not-allowed;
transform: none;
}
.mode-selection {
display: flex;
justify-content: center;
gap: 20px;
margin: 40px 0;
}
.mode-button {
background: white;
border: none;
padding: 30px;
border-radius: 12px;
font-size: 20px;
cursor: pointer;
transition: transform 0.2s, box-shadow 0.2s;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
min-width: 200px;
}
.mode-button:hover {
transform: translateY(-5px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.seed-phrase-input {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 20px;
padding: 15px;
background: #f8f8f8;
border-radius: 8px;
border: 2px solid #ddd;
}
.seed-word {
position: relative;
background: white;
padding: 10px 15px;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
display: flex;
align-items: center;
min-width: 120px;
flex: 1 0 auto;
max-width: calc(25% - 10px);
box-sizing: border-box;
}
.seed-word-number {
color: #999;
font-size: 12px;
margin-right: 8px;
min-width: 20px;
flex-shrink: 0;
}
.seed-word input {
border: none;
outline: none;
padding-left: 5;
margin: 0;
font-size: 16px;
width: 100%;
background: transparent;
min-width: 0; /* Allows input to shrink */
}
.seed-word input:focus {
border: none;
}
.seed-word.filled {
background: #e8f5e9;
border: 1px solid #81c784;
}
#secretInput {
display: none;
}
.shares-selector {
margin: 20px 0;
padding: 20px;
background: #f8f8f8;
border-radius: 8px;
border: 2px solid #ddd;
}
.shares-selector label {
display: block;
margin-bottom: 10px;
color: #666;
font-size: 14px;
}
.shares-selector-controls {
display: flex;
align-items: center;
gap: 15px;
}
.shares-selector input[type="range"] {
flex: 1;
height: 8px;
background: #ddd;
border-radius: 4px;
outline: none;
transition: background 0.2s;
}
.shares-selector input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 24px;
height: 24px;
background: #4CAF50;
border-radius: 50%;
cursor: pointer;
transition: transform 0.2s;
}
.shares-selector input[type="range"]::-webkit-slider-thumb:hover {
transform: scale(1.1);
}
.shares-selector input[type="number"] {
width: 80px;
text-align: center;
font-size: 18px;
font-weight: bold;
padding: 8px;
border: 2px solid #ddd;
border-radius: 6px;
color: #4CAF50;
}
.shares-info {
margin-top: 15px;
padding: 12px;
background: white;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
font-size: 16px;
color: #666;
}
.shares-info strong {
color: #4CAF50;
}
</style>
</head>
<body>
<h1 style="text-align: center; font-size: 2.5em;">🥔 Batata Split 🥔</h1>
<div class="mode-selection" id="modeSelection">
<button class="mode-button" onclick="showSection('createSection')">🥔 Create Split</button>
<button class="mode-button" onclick="showSection('recoverSection')">🔄 Recover Split</button>
</div>
<div id="createSection" class="hidden">
<div class="card">
<h2 class="card-title">🥔 Create a new split</h2>
<input type="text" id="secretTitle" placeholder="Give your split a name" required>
<div class="seed-phrase-container">
<div class="seed-phrase-input" id="seedPhraseInput">
<!-- Will be populated by JavaScript -->
</div>
</div>
<input type="hidden" id="secretInput">
<div class="shares-selector">
<label>Number of shares to generate:</label>
<div class="shares-selector-controls">
<input type="range" id="sharesSlider" min="3" max="10" value="3">
<input type="number" id="numShares" min="3" max="10" value="3">
</div>
<div class="shares-info">
Will need <strong id="requiredShares">2</strong> shares to reconstruct the secret
</div>
</div>
<button id="splitBtn" class="button-card">Generate Shares 🥔</button>
<div id="encryptionKey"></div>
<div id="sharesList" style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;"></div>
</div>
</div>
<div id="recoverSection" class="hidden">
<div class="card">
<h2 class="card-title">🔄 Recover your secret</h2>
<div class="recovery-input">
<input type="text" id="recoveryWords" placeholder="Enter the 3 recovery words (space-separated)" style="width: 100%; margin-bottom: 20px;">
</div>
<div class="scan-option-buttons">
<button class="button-card" onclick="startCamera()">📷 Scan with Camera</button>
<button class="button-card" onclick="showFileUpload()">📁 Upload QR Images</button>
</div>
<div id="camera-container">
<video></video>
<p id="camera-status" style="text-align: center; color: #666;"></p>
</div>
<div id="fileUploadArea" style="display: none;">
<input type="file" id="qrFileInput" accept="image/*" multiple>
<div id="preview-area"></div>
<div id="shares-preview"></div>
</div>
<button id="recoverBtn" class="button-card">Recover Secret 🥔</button>
<textarea id="recoveredSecret" rows="4" readonly></textarea>
</div>
</div>
<script src="bundle.js"></script>
</body>
</html>