-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
560 lines (523 loc) · 29.5 KB
/
Copy pathindex.html
File metadata and controls
560 lines (523 loc) · 29.5 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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Google Search Console verification -->
<meta name="google-site-verification" content="3KxqtSEWNgakHePmf3Z9XVF58O-wwhlb26sSIvsKMGk">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-V2R8ZN22RS"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-V2R8ZN22RS');
</script>
<!-- Primary SEO -->
<title>Stdin — Learn Python by Doing</title>
<meta name="description" content="Learn Python by doing. Solve 285 Python projects in a live in-browser interpreter — from Hello World to dynamic programming. Create a free account to track streaks, compete on the leaderboard, and sync progress across devices. No installs required.">
<meta name="keywords" content="learn python, python practice, python projects, python exercises, python coding, python in browser, python interpreter, pyodide, coding challenges, python beginner, python advanced, python leaderboard, coding streak, python online compiler">
<meta name="author" content="corecommit">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://stdin.vercel.app/">
<!-- Preconnect to CDN origins for faster resource loading -->
<link rel="preconnect" href="https://cdnjs.cloudflare.com">
<link rel="preconnect" href="https://cdn.jsdelivr.net">
<link rel="preconnect" href="https://fonts.googleapis.com">
<!-- Open Graph (Facebook, Discord, WhatsApp, LinkedIn) -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://stdin.vercel.app/">
<meta property="og:title" content="Stdin — Learn Python by Doing">
<meta property="og:description" content="285 Python projects. Live in-browser Python 3.12 interpreter. Free accounts, daily streaks, and a global leaderboard. No installs, no setup — just code.">
<meta property="og:image" content="https://stdin.vercel.app/og-image.svg">
<meta property="og:image:type" content="image/svg+xml">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Stdin — Learn Python by Doing">
<meta name="twitter:description" content="285 Python projects. Live in-browser Python 3.12 interpreter. Free accounts, daily streaks, and a global leaderboard. No installs, no setup — just code.">
<meta name="twitter:image" content="https://stdin.vercel.app/og-image.svg">
<!-- JSON-LD Structured Data -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "Stdin",
"url": "https://stdin.vercel.app/",
"description": "Learn Python by doing. Solve 285 Python projects in a live in-browser interpreter — from Hello World to dynamic programming. Create a free account to track streaks, compete on the leaderboard, and sync progress across devices.",
"applicationCategory": "EducationalApplication",
"operatingSystem": "Any",
"browserRequirements": "Requires a modern browser with WebAssembly support",
"dateModified": "2026-03-24",
"inLanguage": "en",
"isAccessibleForFree": true,
"featureList": [
"285 Python projects across 4 difficulty levels",
"Live Python 3.12 interpreter via WebAssembly",
"Interactive terminal with input() support",
"Auto-verification of solutions",
"Global leaderboard with solve times",
"Free account registration with streak tracking",
"Progress sync across devices",
"No installation required"
],
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"author": {
"@type": "Person",
"name": "corecommit",
"url": "https://github.com/corecommit"
},
"keywords": "Python, learn Python, coding practice, programming exercises, in-browser Python, Pyodide, WebAssembly, leaderboard, coding streak"
}
</script>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='6' fill='%23141414'/><rect x='1' y='1' width='30' height='30' rx='5' fill='none' stroke='%23333' stroke-width='1'/><polyline points='10,10 5,16 10,22' fill='none' stroke='%23d8d8d8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/><polyline points='22,10 27,16 22,22' fill='none' stroke='%23d8d8d8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/><line x1='18' y1='9' x2='14' y2='23' stroke='%23d8d8d8' stroke-width='2' stroke-linecap='round'/></svg>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/hint/show-hint.min.css">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Loading screen — shown until Pyodide is ready -->
<div class="boot-screen" id="boot-screen">
<div class="boot-inner">
<div class="boot-logo"><i class="fa-solid fa-terminal"></i></div>
<div class="boot-name">stdin</div>
<div class="boot-bar-wrap">
<div class="boot-bar" id="boot-bar"></div>
</div>
<div class="boot-status" id="boot-status">Loading Python runtime…</div>
</div>
</div>
<div id="progress-bar"></div>
<header>
<div class="header-left">
<button class="hamburger" id="hamburger-btn" onclick="toggleSidebar()" title="Toggle sidebar" aria-label="Toggle sidebar">
<i class="fa-solid fa-bars"></i>
</button>
<div class="logo" onclick="goHome()" title="Back to home" style="cursor:pointer"><i class="fa-solid fa-terminal"></i> stdin</div>
</div>
<div class="header-right">
<span id="solved-count" class="hbadge"><i class="fa-solid fa-circle-check"></i><span class="solved-nums"> 0 / 0</span><span class="solved-text"> solved</span></span>
<span class="hbadge"><i class="fa-brands fa-python"></i> 3.12</span>
<a class="hbadge hbadge-commit" id="commit-badge" href="https://github.com/corecommit/Stdin/commits" target="_blank" rel="noopener" title="View commits on GitHub">
<i class="fa-solid fa-code-branch"></i>
<span id="commit-sha">…</span>
</a>
<button class="hbadge hbadge-btn" id="changelog-btn" onclick="toggleChangelog()" title="Changelog">
<i class="fa-solid fa-clock-rotate-left"></i><span class="cl-btn-label"> Changelog</span>
</button>
<a class="hbadge hbadge-gh" href="https://github.com/corecommit/Stdin" target="_blank" rel="noopener" title="View on GitHub">
<i class="fa-brands fa-github"></i>
</a>
<span class="hbadge pyodide-status" id="pyodide-badge" title="Python runtime status">
<i class="fa-solid fa-circle-notch spin" id="pyodide-badge-icon"></i>
<span id="pyodide-badge-text">loading…</span>
</span>
<button class="hbadge hbadge-signin" id="auth-signin-btn" onclick="openAuthModal()" style="display:none" title="Sign in or register">
<i class="fa-solid fa-arrow-right-to-bracket"></i> Sign in
</button>
<div class="auth-user-badge" id="auth-user-badge" style="display:none" onclick="toggleUserMenu()" role="button" tabindex="0">
<i class="fa-solid fa-user"></i>
<span id="auth-username-display"></span>
<i class="fa-solid fa-chevron-down" style="font-size:8px"></i>
<div class="auth-user-menu" id="auth-user-menu">
<button class="auth-menu-item" onclick="event.stopPropagation(); openGlobalLeaderboard(); closeUserMenu()">
<i class="fa-solid fa-trophy"></i> Leaderboard
</button>
<button class="auth-menu-item danger" onclick="event.stopPropagation(); doLogout()">
<i class="fa-solid fa-arrow-right-from-bracket"></i> Sign out
</button>
</div>
</div>
</div>
</header>
<!-- Mobile sidebar overlay -->
<div class="sidebar-overlay" id="sidebar-overlay" onclick="closeSidebar()"></div>
<div class="app">
<aside class="sidebar" id="sidebar">
<div class="sidebar-top">
<div class="sidebar-header">
<div class="sidebar-label"><i class="fa-solid fa-list"></i> Projects</div>
<button class="sidebar-close" onclick="closeSidebar()" title="Close sidebar">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="search-wrap">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="text" id="search-input" placeholder="Search projects…" autocomplete="off" aria-label="Search projects">
<button class="search-clear" id="search-clear" onclick="clearSearch()" title="Clear search" style="display:none">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<div class="filter-bar">
<button class="filter-btn" id="filter-btn" onclick="toggleFilterPanel()" aria-haspopup="true" aria-expanded="false" title="Filter projects">
<i class="fa-solid fa-sliders"></i>
<span>Filter</span>
<span class="filter-badge" id="filter-badge" style="display:none"></span>
</button>
<button class="filter-clear-btn" id="filter-clear-btn" onclick="clearAllFilters()" title="Clear all filters" style="display:none">
<i class="fa-solid fa-xmark"></i>
</button>
</div>
<!-- Filter dropdown panel -->
<div class="filter-panel" id="filter-panel" aria-hidden="true">
<div class="filter-section">
<div class="filter-section-label">Difficulty</div>
<div class="filter-chips" id="diff-chips">
<button class="fchip fchip-all active" data-diff="all" onclick="setFilter('all',this)">All</button>
<button class="fchip fchip-easy" data-diff="easy" onclick="setFilter('easy',this)">Easy</button>
<button class="fchip fchip-medium" data-diff="medium" onclick="setFilter('medium',this)">Medium</button>
<button class="fchip fchip-hard" data-diff="hard" onclick="setFilter('hard',this)">Hard</button>
<button class="fchip fchip-expert" data-diff="expert" onclick="setFilter('expert',this)">Expert</button>
</div>
</div>
<div class="filter-section">
<div class="filter-section-label">Topic</div>
<div class="filter-chips" id="topic-filter-row">
<!-- populated by JS -->
</div>
</div>
</div>
</div>
<div class="project-list" id="proj-list"></div>
<div class="sidebar-footer">
<button class="btn-reset-progress" onclick="confirmResetProgress()" title="Reset all solved progress">
<i class="fa-solid fa-rotate-left"></i> Reset Progress
</button>
</div>
</aside>
<main class="main-panel">
<!-- WELCOME -->
<div class="welcome" id="welcome">
<div class="welcome-mark"><i class="fa-solid fa-code"></i></div>
<h1>stdin</h1>
<p>Learn Python by doing. Write and execute real code in a live in-browser interpreter — no installs, no server required.</p>
<div class="stats-row" id="welcome-stats">
<!-- populated dynamically -->
</div>
<div class="welcome-streak" id="welcome-streak" style="display:none">
<i class="fa-solid fa-fire"></i>
<span id="streak-count"></span>
<span class="streak-label">day streak</span>
</div>
<div class="welcome-actions">
<button class="welcome-btn" id="welcome-start-btn" onclick="startFirstUnsolved()">
<i class="fa-solid fa-arrow-right"></i> Start coding
</button>
<button class="welcome-btn welcome-btn-ghost" onclick="openRandomProject()">
<i class="fa-solid fa-shuffle"></i> Random
</button>
<button class="welcome-btn welcome-btn-ghost" onclick="toggleSidebar()">
<i class="fa-solid fa-list"></i> Browse
</button>
</div>
<div class="topic-progress-row" id="topic-progress-row">
<!-- populated dynamically -->
</div>
<div class="welcome-meta">
<a class="welcome-meta-item" href="https://github.com/corecommit/Stdin" target="_blank" rel="noopener" title="View on GitHub">
<i class="fa-brands fa-github"></i> GitHub
</a>
<button class="welcome-meta-item" onclick="toggleChangelog()">
<i class="fa-solid fa-clock-rotate-left"></i> Changelog
</button>
<button class="welcome-meta-item" onclick="openGlobalLeaderboard()">
<i class="fa-solid fa-trophy"></i> Leaderboard
</button>
<span class="welcome-meta-item welcome-meta-sha">
<i class="fa-solid fa-code-branch"></i>
<a id="welcome-commit-sha" href="https://github.com/corecommit/Stdin/commits" target="_blank" rel="noopener">…</a>
</span>
</div>
</div>
<!-- PROJECT VIEW -->
<div class="project-view" id="project-view" style="display:none">
<div class="pv-header">
<div class="pv-left">
<div class="pv-title" id="pv-title">—</div>
<div class="pv-meta">
<span id="pv-diff" class="diff-pill"></span>
<span id="pv-topic" class="topic-pill"></span>
<span id="pv-num" class="pv-num-pill"></span>
<span id="pv-author" class="pv-author-pill" style="display:none"></span>
</div>
</div>
<div class="pv-actions">
<button class="btn btn-ghost" onclick="prevProject()" id="prev-btn" title="Previous project (Alt+Left)">
<i class="fa-solid fa-chevron-left"></i><span class="btn-label"> Prev</span>
</button>
<button class="btn btn-ghost" onclick="nextProject()" id="next-btn" title="Next project (Alt+Right)">
<span class="btn-label">Next </span><i class="fa-solid fa-chevron-right"></i>
</button>
<button class="btn btn-solved" id="solved-btn" style="cursor:default" title="Run your code with correct output to unlock">
<i class="fa-regular fa-circle"></i><span class="btn-label"> Not solved</span>
</button>
</div>
</div>
<div class="tab-bar" role="tablist" aria-label="Project sections">
<div class="tab active" role="tab" tabindex="0" aria-selected="true" aria-controls="panel-problem" data-tab="problem" onclick="switchTab('problem')" onkeydown="if(event.key==='Enter'||event.key===' ')switchTab('problem')"><i class="fa-regular fa-file-lines" aria-hidden="true"></i> <span class="tab-label">Problem</span></div>
<div class="tab" role="tab" tabindex="0" aria-selected="false" aria-controls="panel-editor" data-tab="editor" onclick="switchTab('editor')" onkeydown="if(event.key==='Enter'||event.key===' ')switchTab('editor')"><i class="fa-solid fa-code" aria-hidden="true"></i> <span class="tab-label">Editor</span></div>
<div class="tab" role="tab" tabindex="0" aria-selected="false" aria-controls="panel-solution" data-tab="solution" onclick="switchTab('solution')" onkeydown="if(event.key==='Enter'||event.key===' ')switchTab('solution')"><i class="fa-regular fa-lightbulb" aria-hidden="true"></i> <span class="tab-label">Solution</span></div>
<div class="tab" role="tab" tabindex="0" aria-selected="false" aria-controls="panel-leaderboard" data-tab="leaderboard" onclick="switchTab('leaderboard')" onkeydown="if(event.key==='Enter'||event.key===' ')switchTab('leaderboard')"><i class="fa-solid fa-trophy" aria-hidden="true"></i> <span class="tab-label">Leaderboard</span></div>
</div>
<div class="content-area">
<!-- Problem -->
<div class="tab-panel active" id="panel-problem" role="tabpanel" aria-labelledby="tab-problem">
<div class="problem-scroll" id="problem-content"></div>
</div>
<!-- Editor -->
<div class="tab-panel" id="panel-editor" role="tabpanel" aria-labelledby="tab-editor" style="overflow:hidden" hidden>
<div class="editor-panel">
<div class="editor-bar">
<div class="editor-bar-left">
<span class="lang-tag"><i class="fa-brands fa-python"></i> Python 3</span>
<span class="filename">solution.py</span>
<span class="shortcut"><i class="fa-solid fa-keyboard"></i> Ctrl+Enter to run</span>
</div>
<div class="editor-bar-right">
<button class="btn btn-ghost" onclick="resetCode()" title="Reset to starter code">
<i class="fa-solid fa-rotate-left"></i><span class="btn-label"> Reset</span>
</button>
<button class="btn btn-stop" id="stop-btn" onclick="stopCode()" title="Stop execution" style="display:none">
<i class="fa-solid fa-stop"></i><span class="btn-label"> Stop</span>
</button>
<button class="btn btn-submit" id="submit-btn" onclick="submitToLeaderboard()" style="display:none" title="Submit your solve time to the leaderboard">
<i class="fa-solid fa-upload"></i><span class="btn-label"> Submit</span>
</button>
<button class="btn btn-run" id="run-btn" onclick="runCode()">
<i class="fa-solid fa-play"></i><span class="btn-label"> Run</span>
</button>
</div>
</div>
<!-- Resize handle -->
<div id="cm-wrap"></div>
<div class="resize-handle" id="resize-handle" title="Drag to resize">
<div class="resize-handle-bar"></div>
</div>
<!-- Terminal -->
<div class="terminal-pane" id="terminal-pane" onclick="focusTermInput()">
<div class="terminal-bar">
<span class="terminal-label"><i class="fa-solid fa-square-terminal"></i> Terminal</span>
<div class="terminal-bar-right">
<button class="term-clear-btn" onclick="event.stopPropagation(); clearTerminal()" title="Clear terminal">
<i class="fa-solid fa-trash-can"></i>
</button>
<span class="exec-time" id="exec-time" style="display:none"></span>
<div class="status-row">
<span class="status-dot idle" id="status-dot"></span>
<span id="status-text">idle</span>
</div>
</div>
</div>
<div class="terminal-body" id="terminal-body">
<div class="term-placeholder"><i class="fa-regular fa-circle-play"></i> Run your code to see output here…</div>
</div>
<div class="terminal-input-row" id="terminal-input-row">
<span class="term-prompt" id="term-prompt-text"></span>
<input type="text" id="terminal-input" class="terminal-input-field"
autocomplete="off" spellcheck="false" autocorrect="off"
placeholder="waiting for program…" disabled>
</div>
</div>
</div>
</div>
<!-- Solution -->
<div class="tab-panel" id="panel-solution" role="tabpanel" aria-labelledby="tab-solution" hidden>
<div class="solution-scroll">
<div id="sol-lock" class="solution-lock">
<div class="lock-mark"><i class="fa-solid fa-lock"></i></div>
<p class="lock-text">Try to solve it yourself first. When you're ready, reveal the reference solution.</p>
<div class="sol-lock-warning">
<i class="fa-solid fa-triangle-exclamation"></i>
Revealing the solution will disqualify this problem from the leaderboard.
</div>
<button class="btn-reveal" onclick="revealSolution()"><i class="fa-solid fa-unlock"></i> Reveal solution</button>
</div>
<div id="sol-code-block" class="sol-code-block">
<div class="section-block">
<div class="section-title-row">
<div class="section-title"><i class="fa-solid fa-code"></i> Solution</div>
<button class="btn-copy" id="copy-btn" onclick="copySolution()" title="Copy code">
<i class="fa-regular fa-copy"></i> Copy
</button>
</div>
<pre class="solution-pre" id="sol-pre"></pre>
</div>
<div class="section-block">
<div class="section-title"><i class="fa-regular fa-comment-dots"></i> Explanation</div>
<div class="solution-explanation" id="sol-explanation"></div>
</div>
</div>
</div>
</div>
<!-- Leaderboard -->
<div class="tab-panel" id="panel-leaderboard" role="tabpanel" aria-labelledby="tab-leaderboard" hidden>
<div class="lb-panel" id="lb-panel">
<div class="lb-loading"><i class="fa-solid fa-circle-notch spin"></i> Loading…</div>
</div>
</div>
</div>
</div>
</main>
</div>
<!-- Auth modal -->
<div class="modal-backdrop" id="auth-modal" style="display:none" role="dialog" aria-modal="true" aria-label="Sign in" aria-hidden="true">
<div class="auth-modal">
<!-- Step 1: Pitch -->
<div class="auth-step" id="auth-step-pitch">
<div class="auth-step-header">
<div class="auth-pitch-logo"><i class="fa-solid fa-terminal"></i></div>
<div class="auth-pitch-name">stdin</div>
<p class="auth-pitch-sub">Before you dive in — here's why creating a free account is worth it.</p>
</div>
<ul class="auth-pitch-list">
<li><i class="fa-solid fa-trophy"></i><span><strong>Leaderboard</strong> — compete for fastest solve times per problem</span></li>
<li><i class="fa-solid fa-ranking-star"></i><span><strong>Global rankings</strong> — see where you stand against everyone</span></li>
<li><i class="fa-solid fa-rotate"></i><span><strong>Sync across devices</strong> — your progress follows you everywhere</span></li>
<li><i class="fa-solid fa-fire"></i><span><strong>Streak tracking</strong> — keep your daily coding streak alive</span></li>
<li><i class="fa-solid fa-shield-halved"></i><span><strong>Your data, your account</strong> — tied to your username, not a device</span></li>
</ul>
<div class="auth-step-actions">
<button class="auth-submit" onclick="switchAuthStep('form')">
Continue <i class="fa-solid fa-arrow-right"></i>
</button>
<button class="auth-skip" onclick="skipAuth()">Continue as guest <i class="fa-solid fa-arrow-right"></i></button>
</div>
</div>
<!-- Step 2: Form -->
<div class="auth-step" id="auth-step-form" style="display:none">
<div class="auth-step-nav">
<button class="auth-back" onclick="switchAuthStep('pitch')">
<i class="fa-solid fa-arrow-left"></i> Back
</button>
<div class="auth-step-dots">
<span class="auth-dot"></span>
<span class="auth-dot active"></span>
</div>
</div>
<div class="auth-tabs">
<button class="auth-tab active" id="auth-tab-login" onclick="switchAuthTab('login')">Sign in</button>
<button class="auth-tab" id="auth-tab-register" onclick="switchAuthTab('register')">Register</button>
</div>
<!-- Login form -->
<div class="auth-form" id="auth-form-login">
<div class="auth-field">
<label class="auth-label">Username</label>
<input type="text" class="auth-input" id="login-username" placeholder="your username" autocomplete="username" spellcheck="false">
</div>
<div class="auth-field">
<label class="auth-label">Password</label>
<div class="auth-input-wrap">
<input type="password" class="auth-input" id="login-password" placeholder="••••••••" autocomplete="current-password">
<button type="button" class="auth-eye" onclick="togglePasswordVis('login-password', this)" tabindex="-1">
<i class="fa-regular fa-eye"></i>
</button>
</div>
</div>
<div class="auth-error" id="login-error"></div>
<button class="auth-submit" id="login-submit" onclick="doLogin()">
<i class="fa-solid fa-arrow-right-to-bracket"></i> Sign in
</button>
</div>
<!-- Register form -->
<div class="auth-form" id="auth-form-register" style="display:none">
<div class="auth-field">
<label class="auth-label">Username</label>
<input type="text" class="auth-input" id="reg-username" placeholder="pick a username" autocomplete="username" spellcheck="false" maxlength="20">
<span class="auth-hint">2–20 chars, letters/numbers/dash/underscore</span>
</div>
<div class="auth-field">
<label class="auth-label">Password</label>
<div class="auth-input-wrap">
<input type="password" class="auth-input" id="reg-password" placeholder="••••••••" autocomplete="new-password">
<button type="button" class="auth-eye" onclick="togglePasswordVis('reg-password', this)" tabindex="-1">
<i class="fa-regular fa-eye"></i>
</button>
</div>
</div>
<div class="auth-field">
<label class="auth-label">Confirm password</label>
<div class="auth-input-wrap">
<input type="password" class="auth-input" id="reg-confirm" placeholder="••••••••" autocomplete="new-password">
<button type="button" class="auth-eye" onclick="togglePasswordVis('reg-confirm', this)" tabindex="-1">
<i class="fa-regular fa-eye"></i>
</button>
</div>
</div>
<div class="auth-error" id="reg-error"></div>
<button class="auth-submit" id="reg-submit" onclick="doRegister()">
<i class="fa-solid fa-user-plus"></i> Create account
</button>
</div>
</div>
</div>
</div>
<!-- Global leaderboard panel -->
<div class="cl-backdrop" id="glb-backdrop" onclick="closeGlobalLeaderboard()"></div>
<div class="cl-panel" id="glb-panel" aria-hidden="true" role="dialog" aria-label="Global Leaderboard">
<div class="cl-header">
<div class="cl-title"><i class="fa-solid fa-trophy"></i> Leaderboard</div>
<div class="cl-header-right">
<button class="cl-close" onclick="closeGlobalLeaderboard()"><i class="fa-solid fa-xmark"></i></button>
</div>
</div>
<div class="glb-tabs">
<button class="glb-tab active" data-glb="most-solved" onclick="switchGlbTab('most-solved', this)">Most Solved</button>
<button class="glb-tab" data-glb="fastest" onclick="switchGlbTab('fastest', this)">Fastest Avg</button>
<button class="glb-tab" data-glb="recent" onclick="switchGlbTab('recent', this)">Recent</button>
</div>
<div class="cl-body" id="glb-body">
<div class="cl-loading"><i class="fa-solid fa-circle-notch spin"></i> Loading…</div>
</div>
</div>
<!-- Confirm reset modal -->
<div class="modal-backdrop" id="reset-modal" style="display:none" role="dialog" aria-modal="true" aria-labelledby="reset-modal-title" aria-hidden="true">
<div class="modal">
<div class="modal-icon"><i class="fa-solid fa-triangle-exclamation"></i></div>
<div class="modal-title" id="reset-modal-title">Reset all progress?</div>
<div class="modal-body">This will clear all solved projects. This action cannot be undone.</div>
<div class="modal-actions">
<button class="btn btn-ghost" onclick="closeResetModal()"><i class="fa-solid fa-xmark"></i> Cancel</button>
<button class="btn btn-danger" onclick="doResetProgress()"><i class="fa-solid fa-rotate-left"></i> Reset</button>
</div>
</div>
</div>
<!-- Changelog panel -->
<div class="cl-backdrop" id="cl-backdrop" onclick="closeChangelog()"></div>
<div class="cl-panel" id="cl-panel" aria-hidden="true" role="dialog" aria-label="Changelog">
<div class="cl-header">
<div class="cl-title"><i class="fa-solid fa-clock-rotate-left"></i> Changelog</div>
<div class="cl-header-right">
<a class="cl-gh-link" href="https://github.com/corecommit/Stdin/commits" target="_blank" rel="noopener" title="View on GitHub"><i class="fa-brands fa-github"></i></a>
<button class="cl-close" onclick="closeChangelog()"><i class="fa-solid fa-xmark"></i></button>
</div>
</div>
<div class="cl-body" id="cl-body">
<div class="cl-loading"><i class="fa-solid fa-circle-notch spin"></i> Loading…</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<!-- Pyodide -->
<script src="https://cdn.jsdelivr.net/pyodide/v0.25.1/full/pyodide.js"></script>
<!-- CodeMirror -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/python/python.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/hint/show-hint.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/edit/matchbrackets.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/edit/closebrackets.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/runmode/runmode.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/selection/active-line.min.js"></script>
<!-- App -->
<script src="Projects/easy.js"></script>
<script src="Projects/medium.js"></script>
<script src="Projects/hard.js"></script>
<script src="Projects/expert.js"></script>
<script src="projects.js"></script>
<script src="app.js"></script>
</body>
</html>