Skip to content

Commit fbdf08d

Browse files
committed
refactor: improve layout and EU-centric formatting
- Split section titles and code examples onto separate lines - Add monospace code display below each section title - Fix cons/pros markers (gray ✗ on left, blue ✓ on right) - Update currency to EUR (€) and number formatting to de-DE locale - Add section-code CSS styling
1 parent d7ef3a9 commit fbdf08d

File tree

6 files changed

+65
-39
lines changed

6 files changed

+65
-39
lines changed

.parcel-cache/data.mdb

668 KB
Binary file not shown.

.parcel-cache/lock.mdb

0 Bytes
Binary file not shown.

.pugrc

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
},
1212
"sections": {
1313
"disclosure": {
14-
"title": "Collapsible Content — <details> <summary>",
14+
"title": "Collapsible Content",
15+
"code": "<details> <summary>",
1516
"js_title": "JavaScript",
1617
"js_badge": "JS",
1718
"js_warning": "Requires: ARIA state management, keyboard events, focus handling, screen reader compatibility",
@@ -40,7 +41,8 @@
4041
]
4142
},
4243
"modals": {
43-
"title": "Modal Dialogs — <dialog>",
44+
"title": "Modal Dialogs",
45+
"code": "<dialog>",
4446
"js_title": "JavaScript",
4547
"js_badge": "JS",
4648
"js_warning": "Requires: Focus trapping, inert background, ESC key handling, backdrop clicks, ARIA modal role",
@@ -71,7 +73,8 @@
7173
]
7274
},
7375
"validation": {
74-
"title": "Form Validation — <input type=\"email\"> pattern required",
76+
"title": "Form Validation",
77+
"code": "<input type=\"email\" pattern=\"...\" required>",
7578
"js_title": "JavaScript",
7679
"js_badge": "JS",
7780
"js_warning": "Requires: Custom error messages, timing coordination, accessibility announcements",
@@ -105,7 +108,8 @@
105108
]
106109
},
107110
"progress": {
108-
"title": "Progress Bars — <progress>",
111+
"title": "Progress Bars",
112+
"code": "<progress value=\"70\" max=\"100\">",
109113
"js_title": "JavaScript",
110114
"js_badge": "JS",
111115
"js_warning": "Requires: ARIA live regions, role=progressbar, value announcements",
@@ -134,7 +138,8 @@
134138
]
135139
},
136140
"temporal": {
137-
"title": "Date/Time Inputs — <input type=\"date\"> type=\"time\" type=\"datetime-local\"",
141+
"title": "Date/Time Inputs",
142+
"code": "<input type=\"date\"> <input type=\"time\">",
138143
"js_title": "JavaScript",
139144
"js_badge": "JS",
140145
"js_warning": "Requires: Calendar widget, i18n, timezone handling, keyboard navigation, touch events",
@@ -161,7 +166,8 @@
161166
]
162167
},
163168
"fieldset": {
164-
"title": "Form Grouping — <fieldset> <legend>",
169+
"title": "Form Grouping",
170+
"code": "<fieldset> <legend>",
165171
"js_title": "JavaScript",
166172
"js_badge": "JS",
167173
"js_warning": "Requires: ARIA group role, explicit labeling, manual disabled propagation",
@@ -182,7 +188,8 @@
182188
]
183189
},
184190
"output": {
185-
"title": "Calculated Results — <output>",
191+
"title": "Calculated Results",
192+
"code": "<output for=\"a b\">",
186193
"js_title": "JavaScript",
187194
"js_badge": "JS",
188195
"js_warning": "Requires: ARIA live regions, manual form association",
@@ -204,7 +211,8 @@
204211
]
205212
},
206213
"meter": {
207-
"title": "Measurements — <meter>",
214+
"title": "Measurements",
215+
"code": "<meter value=\"0.7\" low=\"0.3\" high=\"0.8\" optimum=\"1\">",
208216
"js_title": "JavaScript",
209217
"js_badge": "JS",
210218
"js_warning": "Requires: Manual color coding, ARIA roles, no distinction from progress",
@@ -228,7 +236,8 @@
228236
]
229237
},
230238
"figure": {
231-
"title": "Figures & Captions — <figure> <figcaption>",
239+
"title": "Figures & Captions",
240+
"code": "<figure> <figcaption>",
232241
"js_title": "JavaScript",
233242
"js_badge": "JS",
234243
"js_warning": "Requires: ARIA labeling, manual content-caption association",
@@ -249,7 +258,8 @@
249258
]
250259
},
251260
"popover": {
252-
"title": "Popovers — popover popovertarget",
261+
"title": "Popovers",
262+
"code": "<div popover> <button popovertarget=\"...\">",
253263
"js_title": "JavaScript",
254264
"js_badge": "JS",
255265
"js_warning": "Requires: Positioning logic, z-index, click-outside, ESC handling",
@@ -274,7 +284,8 @@
274284
]
275285
},
276286
"color": {
277-
"title": "Color Picker — <input type=\"color\">",
287+
"title": "Color Picker",
288+
"code": "<input type=\"color\">",
278289
"js_title": "JavaScript",
279290
"js_badge": "JS",
280291
"js_warning": "Requires: Color space math, gradient UI, hue/saturation controls, format conversion",
@@ -299,7 +310,8 @@
299310
]
300311
},
301312
"range": {
302-
"title": "Range Slider — <input type=\"range\">",
313+
"title": "Range Slider",
314+
"code": "<input type=\"range\" min=\"0\" max=\"100\">",
303315
"js_title": "JavaScript",
304316
"js_badge": "JS",
305317
"js_warning": "Requires: Drag/touch handling, value interpolation, ARIA slider role",
@@ -324,7 +336,8 @@
324336
]
325337
},
326338
"autocomplete": {
327-
"title": "Autocomplete — <datalist>",
339+
"title": "Autocomplete",
340+
"code": "<input list=\"...\"> <datalist id=\"...\">",
328341
"js_title": "JavaScript",
329342
"js_badge": "JS",
330343
"js_warning": "Requires: Dropdown positioning, keyboard nav, ARIA combobox, touch handling",

index.pug

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ html(lang=lang, dir=dir)
1616
p.subtitle= t.hero.subtitle
1717

1818
//- Progressive Disclosure Section
19-
+section(t.sections.disclosure.title)
19+
+section(t.sections.disclosure.title, t.sections.disclosure.code)
2020
.comparison-grid
2121
+badColumn(t.sections.disclosure.js_title, t.sections.disclosure.js_badge, t.sections.disclosure.js_warning)
2222
+jsCollapsible("content1", "Custom Collapsible Architecture", t.sections.disclosure.js_content1)
@@ -39,7 +39,7 @@ html(lang=lang, dir=dir)
3939
+prosList(t.sections.disclosure.native_pros_title, t.sections.disclosure.native_pros)
4040

4141
//- Modal Section
42-
+section(t.sections.modals.title)
42+
+section(t.sections.modals.title, t.sections.modals.code)
4343
.comparison-grid
4444
+badColumn(t.sections.modals.js_title, t.sections.modals.js_badge, t.sections.modals.js_warning)
4545
button(onclick="openJSModal()")= t.sections.modals.js_button
@@ -67,7 +67,7 @@ html(lang=lang, dir=dir)
6767
+prosList(t.sections.modals.native_pros_title, t.sections.modals.native_pros)
6868

6969
//- Form Validation Section
70-
+section(t.sections.validation.title)
70+
+section(t.sections.validation.title, t.sections.validation.code)
7171
.comparison-grid
7272
+badColumn(t.sections.validation.js_title, t.sections.validation.js_badge, t.sections.validation.js_warning)
7373
form(onsubmit="return validateJSForm(event)")
@@ -106,7 +106,7 @@ html(lang=lang, dir=dir)
106106
+prosList(t.sections.validation.native_pros_title, t.sections.validation.native_pros)
107107

108108
//- Progress Section
109-
+section(t.sections.progress.title)
109+
+section(t.sections.progress.title, t.sections.progress.code)
110110
.comparison-grid
111111
+badColumn(t.sections.progress.js_title, t.sections.progress.js_badge, t.sections.progress.js_warning)
112112
.js-progress-container
@@ -133,7 +133,7 @@ html(lang=lang, dir=dir)
133133
+prosList(t.sections.progress.native_pros_title, t.sections.progress.native_pros)
134134

135135
//- Temporal Input Section
136-
+section(t.sections.temporal.title)
136+
+section(t.sections.temporal.title, t.sections.temporal.code)
137137
.comparison-grid
138138
+badColumn(t.sections.temporal.js_title, t.sections.temporal.js_badge, t.sections.temporal.js_warning)
139139
+formGroup(t.sections.temporal.js_label)
@@ -156,7 +156,7 @@ html(lang=lang, dir=dir)
156156
+prosList(t.sections.temporal.native_pros_title, t.sections.temporal.native_pros)
157157

158158
//- Fieldset Section
159-
+section(t.sections.fieldset.title)
159+
+section(t.sections.fieldset.title, t.sections.fieldset.code)
160160
.comparison-grid
161161
+badColumn(t.sections.fieldset.js_title, t.sections.fieldset.js_badge, t.sections.fieldset.js_warning)
162162
.js-form-section
@@ -187,35 +187,35 @@ html(lang=lang, dir=dir)
187187
+prosList(t.sections.fieldset.native_pros_title, t.sections.fieldset.native_pros)
188188

189189
//- Output Section
190-
+section(t.sections.output.title)
190+
+section(t.sections.output.title, t.sections.output.code)
191191
.comparison-grid
192192
+badColumn(t.sections.output.js_title, t.sections.output.js_badge, t.sections.output.js_warning)
193193
.js-calculator
194194
label Quantity:
195195
input#js-qty(type="number", value="1", min="1", oninput="updateJsTotal()")
196196
span ×
197-
label Price: $
198-
input#js-price(type="number", value="29.99", step="0.01", oninput="updateJsTotal()")
197+
label Price:
198+
input#js-price(type="number", value="29,99", step="0.01", oninput="updateJsTotal()")
199199
.js-result
200-
span Total: $
201-
span#js-total 29.99
200+
span Total:
201+
span#js-total 29,99
202202

203203
+consList(t.sections.output.js_cons_title, t.sections.output.js_cons)
204204

205205
+goodColumn(t.sections.output.native_title, t.sections.output.native_badge, t.sections.output.native_note)
206-
form.native-calculator(oninput="nativeTotal.value = (nativeQty.valueAsNumber * nativePrice.valueAsNumber).toFixed(2)")
206+
form.native-calculator(oninput="nativeTotal.value = (nativeQty.valueAsNumber * nativePrice.valueAsNumber).toLocaleString('de-DE', {minimumFractionDigits: 2})")
207207
+formGroup("Quantity")
208208
input#nativeQty(type="number", value="1", min="1")
209-
+formGroup("Price ($)")
209+
+formGroup("Price ()")
210210
input#nativePrice(type="number", value="29.99", step="0.01")
211211
.output-display
212-
label(for="nativeTotal") Total: $
213-
output#nativeTotal(for="nativeQty nativePrice") 29.99
212+
label(for="nativeTotal") Total:
213+
output#nativeTotal(for="nativeQty nativePrice") 29,99
214214

215215
+prosList(t.sections.output.native_pros_title, t.sections.output.native_pros)
216216

217217
//- Meter Section
218-
+section(t.sections.meter.title)
218+
+section(t.sections.meter.title, t.sections.meter.code)
219219
.comparison-grid
220220
+badColumn(t.sections.meter.js_title, t.sections.meter.js_badge, t.sections.meter.js_warning)
221221
.js-gauge-container
@@ -238,7 +238,7 @@ html(lang=lang, dir=dir)
238238
+prosList(t.sections.meter.native_pros_title, t.sections.meter.native_pros)
239239

240240
//- Figure Section
241-
+section(t.sections.figure.title)
241+
+section(t.sections.figure.title, t.sections.figure.code)
242242
.comparison-grid
243243
+badColumn(t.sections.figure.js_title, t.sections.figure.js_badge, t.sections.figure.js_warning)
244244
.js-image-container
@@ -260,7 +260,7 @@ html(lang=lang, dir=dir)
260260
+prosList(t.sections.figure.native_pros_title, t.sections.figure.native_pros)
261261

262262
//- Popover Section
263-
+section(t.sections.popover.title)
263+
+section(t.sections.popover.title, t.sections.popover.code)
264264
.comparison-grid
265265
+badColumn(t.sections.popover.js_title, t.sections.popover.js_badge, t.sections.popover.js_warning)
266266
button(onclick="toggleJsPopover()")= t.sections.popover.js_button
@@ -278,7 +278,7 @@ html(lang=lang, dir=dir)
278278
+prosList(t.sections.popover.native_pros_title, t.sections.popover.native_pros)
279279

280280
//- Color Picker Section
281-
+section(t.sections.color.title)
281+
+section(t.sections.color.title, t.sections.color.code)
282282
.comparison-grid
283283
+badColumn(t.sections.color.js_title, t.sections.color.js_badge, t.sections.color.js_warning)
284284
+formGroup(t.sections.color.js_label)
@@ -301,7 +301,7 @@ html(lang=lang, dir=dir)
301301
+prosList(t.sections.color.native_pros_title, t.sections.color.native_pros)
302302

303303
//- Range Slider Section
304-
+section(t.sections.range.title)
304+
+section(t.sections.range.title, t.sections.range.code)
305305
.comparison-grid
306306
+badColumn(t.sections.range.js_title, t.sections.range.js_badge, t.sections.range.js_warning)
307307
+formGroup(t.sections.range.js_label)
@@ -331,7 +331,7 @@ html(lang=lang, dir=dir)
331331
+prosList(t.sections.range.native_pros_title, t.sections.range.native_pros)
332332

333333
//- Autocomplete Section
334-
+section(t.sections.autocomplete.title)
334+
+section(t.sections.autocomplete.title, t.sections.autocomplete.code)
335335
.comparison-grid
336336
+badColumn(t.sections.autocomplete.js_title, t.sections.autocomplete.js_badge, t.sections.autocomplete.js_warning)
337337
+formGroup(t.sections.autocomplete.js_label)
@@ -509,5 +509,5 @@ html(lang=lang, dir=dir)
509509
function updateJsTotal() {
510510
const qty = document.getElementById('js-qty').value || 0;
511511
const price = document.getElementById('js-price').value || 0;
512-
document.getElementById('js-total').textContent = (qty * price).toFixed(2);
512+
document.getElementById('js-total').textContent = (qty * price).toLocaleString('de-DE', {minimumFractionDigits: 2});
513513
}

src/components/mixins.pug

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
mixin section(title)
1+
mixin section(title, code)
22
.section
33
h2.section-title= title
4+
if code
5+
code.section-code= code
46
block
57

68
mixin badColumn(title, badge, warning)

src/main.css

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,24 @@ body {
7272

7373
.section-title {
7474
font-size: 1.25rem;
75-
margin-bottom: 1rem;
75+
margin-bottom: 0.25rem;
7676
padding: 0;
7777
text-align: left;
7878
color: var(--color-text);
7979
font-weight: 600;
8080
}
8181

82+
.section-code {
83+
display: block;
84+
font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
85+
font-size: 0.875rem;
86+
color: var(--color-text-muted);
87+
background: var(--color-code-bg);
88+
padding: 0.5rem 0.75rem;
89+
border-radius: 6px;
90+
margin-bottom: 1rem;
91+
}
92+
8293
.column {
8394
background: var(--color-card);
8495
padding: 1.5rem;
@@ -273,15 +284,15 @@ body {
273284
position: relative;
274285
}
275286

276-
.pros li::before {
287+
.good .pros li::before {
277288
content: '✓';
278289
position: absolute;
279290
left: 0;
280291
color: var(--color-primary);
281292
font-weight: bold;
282293
}
283294

284-
.cons li::before {
295+
.bad .cons li::before {
285296
content: '✗';
286297
position: absolute;
287298
left: 0;

0 commit comments

Comments
 (0)