-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlewis.html
More file actions
588 lines (534 loc) · 19.9 KB
/
Copy pathlewis.html
File metadata and controls
588 lines (534 loc) · 19.9 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
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
<!doctype html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-T3NE3G0PNN"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-T3NE3G0PNN");
</script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="Practice Lewis dot structures — build diagrams by placing bond lines and lone-pair electrons, with instant feedback."
/>
<title>Lewis Dot Structures | STEM Study Buddy</title>
<link rel="icon" href="images/favicons/chemistry.svg" />
<script src="js/theme.js"></script>
<link rel="stylesheet" href="css/styles.css" />
<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=Plus+Jakarta+Sans:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap"
rel="stylesheet"
/>
</head>
<body class="subject-chemistry" data-page="lewis" data-subject="chemistry">
<div class="container">
<div id="loading-screen">
<div class="science-loader">
<div class="loader-ring"></div>
<div class="science-emoji">⚗️</div>
</div>
<p class="loading-text">Loading structures...</p>
</div>
<div id="lewis-error" class="load-error hidden">
<h2>Couldn't load tool</h2>
<p id="lewis-error-message"></p>
<a href="chemistry.html" class="btn btn-small nav-link"
>Back to Chemistry</a
>
</div>
<div id="lewis-mode-screen" class="mode-screen hidden">
<h2>Choose a mode</h2>
<p class="mode-intro">
Pick how you want to practice Lewis structures.
</p>
<div class="mode-options">
<button class="mode-card" data-mode="structure" type="button">
<strong>Structure Practice</strong>
<span>Draw Lewis diagrams with instant feedback.</span>
</button>
<button class="mode-card" data-mode="full" type="button">
<strong>Full Analysis</strong>
<span>
Count valence electrons, draw the structure, then analyze
resonance, geometry, polarity, and hybridization.
</span>
</button>
<button class="mode-card" data-mode="browse" type="button">
<strong>Browse Structures</strong>
<span>
Pick any molecule to practice on your own — no shuffle, no score.
</span>
</button>
</div>
</div>
<div id="lewis-browse-screen" class="lewis-browse-screen hidden">
<div class="lewis-browse-panel">
<button
id="lewis-browse-back-btn"
class="btn btn-small lewis-browse-back"
type="button"
>
← All modes
</button>
<h2>Browse structures</h2>
<p class="lewis-browse-intro mode-intro">
Pick a molecule to practice on your own. Your choice is saved in the
link so you can bookmark or share it.
</p>
<div
class="lewis-browse-style"
role="group"
aria-labelledby="lewis-browse-style-label"
>
<span class="filter-label" id="lewis-browse-style-label"
>Practice mode</span
>
<div class="lewis-browse-style-options">
<label class="lewis-browse-style-option">
<input
type="radio"
name="browse-style"
value="structure"
checked
/>
<span>Structure only</span>
</label>
<label class="lewis-browse-style-option">
<input type="radio" name="browse-style" value="full" />
<span>Full analysis</span>
</label>
</div>
</div>
<div class="quiz-search-wrap lewis-browse-search-wrap">
<label class="search-label" for="lewis-browse-search"
>Search structures</label
>
<input
id="lewis-browse-search"
class="quiz-search lewis-browse-search"
type="search"
placeholder="Name or formula…"
autocomplete="off"
/>
</div>
<div class="quiz-filter-wrap lewis-browse-difficulty-wrap">
<span class="filter-label" id="lewis-browse-difficulty-label"
>Difficulty</span
>
<div
id="lewis-browse-difficulty-filters"
class="quiz-filters"
role="group"
aria-labelledby="lewis-browse-difficulty-label"
></div>
</div>
<section id="lewis-browse-recent" class="lewis-browse-section hidden">
<h3 class="lewis-browse-section-title">Recently practiced</h3>
<div id="lewis-browse-recent-list" class="lewis-browse-list"></div>
</section>
<section class="lewis-browse-section">
<h3 class="lewis-browse-section-title">
Structures
<span id="lewis-browse-count" class="lewis-browse-count"></span>
</h3>
<p id="lewis-browse-empty" class="lewis-browse-empty hidden">
No structures match your search or difficulty filter.
</p>
<div id="lewis-browse-all-list" class="lewis-browse-groups"></div>
</section>
</div>
</div>
<div id="lewis-content" class="hidden">
<h1 id="lewis-title">Lewis Dot Structures</h1>
<p id="mode-badge" class="mode-badge hidden"></p>
<header id="lewis-task-header" class="lewis-task-header">
<p
id="question-progress"
class="question-progress lewis-task-progress"
></p>
<div class="progress-container lewis-task-progress-bar">
<div id="progress-bar"></div>
</div>
<ol
id="lewis-stage-stepper"
class="lewis-stage-stepper hidden"
aria-label="Analysis steps"
>
<li class="lewis-stage-step" data-stage="electrons">
Valence electrons
</li>
<li class="lewis-stage-arrow" aria-hidden="true">→</li>
<li class="lewis-stage-step" data-stage="diagram">Lewis diagram</li>
<li class="lewis-stage-arrow" aria-hidden="true">→</li>
<li class="lewis-stage-step" data-stage="analysis">
Molecular analysis
</li>
</ol>
<div class="instruction-container lewis-task-instructions">
<div id="instruction-text"></div>
</div>
</header>
<div id="lewis-electrons-stage" class="lewis-stage-panel hidden">
<div class="lewis-valence-prompt">
<p
id="lewis-valence-question"
class="lewis-valence-question stem-text"
></p>
<label class="lewis-valence-label" for="lewis-valence-input">
Total valence electrons
</label>
<input
id="lewis-valence-input"
class="lewis-valence-input"
type="number"
min="1"
max="99"
inputmode="numeric"
autocomplete="off"
/>
</div>
<div class="lewis-stage-actions">
<button
id="lewis-valence-check-btn"
class="btn btn-small"
type="button"
>
Check
</button>
</div>
</div>
<div id="lewis-question-area" class="lewis-question-area">
<div class="lewis-workspace">
<div class="lewis-board-wrap">
<p id="lewis-formula" class="lewis-formula stem-text"></p>
<p
id="lewis-electron-counter"
class="lewis-electron-counter hidden"
aria-live="polite"
></p>
<div id="lewis-ion-display" class="lewis-ion-display">
<span class="lewis-ion-bracket" aria-hidden="true">[</span>
<div class="lewis-ion-body">
<div
id="lewis-board"
class="lewis-board"
aria-label="Lewis diagram"
></div>
</div>
<span class="lewis-ion-bracket" aria-hidden="true">]</span>
<sup id="lewis-ion-charge" class="lewis-ion-charge"></sup>
</div>
</div>
<aside class="lewis-palette" aria-label="Drawing tools">
<p class="lewis-palette-title">Drag onto the diagram</p>
<div
class="lewis-token lewis-token--bond"
draggable="true"
data-token="bond"
role="button"
tabindex="0"
aria-label="Bond line"
>
<span class="lewis-token-glyph">−</span>
<span class="lewis-token-label">Bond</span>
</div>
<div
class="lewis-token lewis-token--lone-pair"
draggable="true"
data-token="lonePair"
role="button"
tabindex="0"
aria-label="Lone pair"
>
<span class="lewis-token-glyph lewis-token-glyph--lone-pair">
<span class="lewis-dot">·</span><span class="lewis-dot">·</span>
</span>
<span class="lewis-token-label">Lone pair</span>
</div>
<div
class="lewis-token lewis-token--erase"
data-token="erase"
role="button"
tabindex="0"
aria-label="Erase from slot"
>
<span class="lewis-token-glyph">⌫</span>
<span class="lewis-token-label">Erase</span>
</div>
<p class="lewis-palette-hint">
Select a tool, then click slots to place. Click the tool again
to deselect. Use Erase to remove one bond line or one lone pair
at a time.
</p>
</aside>
</div>
<div class="lewis-actions">
<button id="lewis-reset-btn" class="btn btn-small" type="button">
Reset diagram
</button>
<button id="lewis-check-btn" class="btn btn-small" type="button">
Check
</button>
<button
id="lewis-diagram-skip-btn"
class="btn btn-small hidden"
type="button"
>
Skip
</button>
</div>
</div>
<div id="lewis-analysis-stage" class="lewis-stage-panel hidden">
<div class="lewis-analysis-workspace">
<aside
id="lewis-analysis-reference"
class="lewis-analysis-reference"
aria-label="Reference Lewis structure"
>
<p class="lewis-analysis-reference-label">Reference structure</p>
<div
id="lewis-analysis-reference-board-wrap"
class="lewis-board-wrap lewis-board-wrap--example lewis-board-wrap--analysis-ref"
></div>
</aside>
<div class="lewis-analysis-main">
<form
id="lewis-analysis-form"
class="lewis-analysis-form"
novalidate
>
<div
class="lewis-analysis-field"
data-analysis-field="electronDomains"
>
<label
class="lewis-analysis-question"
for="lewis-electron-domains"
>
Number of electron domains (central atom)
</label>
<input
id="lewis-electron-domains"
class="lewis-analysis-number-input"
type="number"
inputmode="numeric"
min="1"
max="6"
step="1"
placeholder="e.g. 4"
required
/>
</div>
<div
class="lewis-analysis-field"
data-analysis-field="resonance"
>
<span class="lewis-analysis-question"
>Does this species have resonance?</span
>
<div
class="lewis-analysis-options"
role="group"
aria-label="Resonance"
>
<label class="lewis-analysis-option">
<input type="radio" name="resonance" value="yes" />
<span>Yes</span>
</label>
<label class="lewis-analysis-option">
<input type="radio" name="resonance" value="no" />
<span>No</span>
</label>
</div>
</div>
<div
class="lewis-analysis-field"
data-analysis-field="electronGeometry"
>
<label
class="lewis-analysis-question"
for="lewis-electron-geometry"
>
Electron geometry (central atom)
</label>
<select
id="lewis-electron-geometry"
class="lewis-analysis-select"
required
>
<option value="">Select…</option>
</select>
</div>
<div
class="lewis-analysis-field"
data-analysis-field="molecularGeometry"
>
<label
class="lewis-analysis-question"
for="lewis-molecular-geometry"
>
Molecular geometry
</label>
<select
id="lewis-molecular-geometry"
class="lewis-analysis-select"
required
>
<option value="">Select…</option>
</select>
</div>
<div
class="lewis-analysis-field"
data-analysis-field="polarity"
>
<label class="lewis-analysis-question" for="lewis-polarity"
>Polarity</label
>
<select
id="lewis-polarity"
class="lewis-analysis-select"
required
>
<option value="">Select…</option>
</select>
</div>
<div
class="lewis-analysis-field"
data-analysis-field="distortion"
>
<span class="lewis-analysis-question"
>Is the bond angle distorted from ideal?</span
>
<div
class="lewis-analysis-options"
role="group"
aria-label="Bond angle distortion"
>
<label class="lewis-analysis-option">
<input type="radio" name="distortion" value="yes" />
<span>Yes</span>
</label>
<label class="lewis-analysis-option">
<input type="radio" name="distortion" value="no" />
<span>No</span>
</label>
</div>
</div>
<div
class="lewis-analysis-field"
data-analysis-field="hybridization"
>
<label
class="lewis-analysis-question"
for="lewis-hybridization"
>
Hybridization (central atom)
</label>
<select
id="lewis-hybridization"
class="lewis-analysis-select"
required
>
<option value="">Select…</option>
</select>
</div>
<div
class="lewis-analysis-field"
data-analysis-field="bondAngle"
>
<span class="lewis-analysis-question"
>Ideal bond angle(s), not accounting for distortion
(°)</span
>
<div
class="lewis-analysis-options lewis-analysis-options--bond-angles"
role="group"
aria-label="Ideal bond angles, not accounting for distortion"
>
<label class="lewis-analysis-option">
<input type="checkbox" name="bondAngle" value="90" />
<span>90</span>
</label>
<label class="lewis-analysis-option">
<input type="checkbox" name="bondAngle" value="109.5" />
<span>109.5</span>
</label>
<label class="lewis-analysis-option">
<input type="checkbox" name="bondAngle" value="120" />
<span>120</span>
</label>
<label class="lewis-analysis-option">
<input type="checkbox" name="bondAngle" value="180" />
<span>180</span>
</label>
</div>
</div>
</form>
<div class="lewis-stage-actions">
<button
id="lewis-analysis-check-btn"
class="btn btn-small"
type="button"
>
Check
</button>
</div>
</div>
</div>
</div>
<div
id="lewis-feedback"
class="lewis-feedback"
aria-live="polite"
></div>
<div class="score">
Score:
<span id="score">0</span>
/
<span id="total">0</span>
</div>
<div class="lewis-session-actions">
<button
id="lewis-browse-structures-btn"
class="btn btn-small hidden"
type="button"
>
All structures
</button>
<button id="continue-btn" class="btn btn-small" style="display: none">
Continue
</button>
<button id="skip-btn" class="btn btn-small">Skip</button>
</div>
<div id="final-screen" style="display: none">
<h2 id="final-heading" tabindex="-1">Practice Complete!</h2>
<p id="final-tier" class="final-tier"></p>
<p id="final-score" class="final-score-display"></p>
<p id="final-detail" class="final-detail"></p>
<div class="final-actions">
<button id="retry-btn" class="btn btn-small">Try Again</button>
</div>
</div>
<footer>
<p>STEM Study Buddy © 2026</p>
</footer>
</div>
</div>
<script src="js/nav.js"></script>
<script src="js/stem-text.js"></script>
<script src="js/lewis-answers.js"></script>
<script src="js/lewis-validation.js"></script>
<script src="js/lewis.js"></script>
</body>
</html>