Skip to content

Commit 270dae1

Browse files
convert tabs/panels to details for better UX
1 parent 68f28d6 commit 270dae1

File tree

2 files changed

+82
-23
lines changed

2 files changed

+82
-23
lines changed

src/index.html

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
</head>
1616

17-
<body>
17+
<body class="chooser-page">
1818
<a class="skip-to-content" href="#main-content-marker">Skip to content</a>
1919

2020
<header>
@@ -327,7 +327,7 @@ <h1>Choose a License for Your Work</h1>
327327

328328
<aside>
329329
<div id="tool-recommendation">
330-
<h2>Recommended</h2>
330+
<h2>Recommended Choice</h2>
331331

332332
<article class="tool">
333333

@@ -364,17 +364,16 @@ <h2>Mark Your Work</h2>
364364
<p>Choose the kind of work to get appropriate license code or public domain marking.</p>
365365
</header>
366366

367-
<section>
367+
<details class="medium">
368368

369-
<h3><button class="expandPanel">Website</button></h3>
369+
<summary>Website</summary>
370370

371-
<div class="panel">
372371
<p>If you are licensing or marking one work, paste the code next to it. If you are licensing or marking the whole page or blog, you can paste the code at the bottom of the page.</p>
373372

374373
<article>
375-
<h4><button class="expandPanel">Rich Text</button></h4>
374+
<details class="format">
375+
<summary>Rich Text</summary>
376376

377-
<div class="panel">
378377
<p class="rich-text mark">[contextually formatted mark here]</p>
379378

380379
<footer>
@@ -384,13 +383,13 @@ <h4><button class="expandPanel">Rich Text</button></h4>
384383
</div>
385384
<button id="copy-rich-text-mark">Copy</button>
386385
</footer>
387-
</div>
386+
</details>
388387
</article>
389388

390389
<article>
391-
<h4><button class="expandPanel">HTML</button></h4>
390+
<details class="format">
391+
<summary>HTML</summary>
392392

393-
<div class="panel">
394393
<p class="html mark">[contextually formatted mark here]</p>
395394

396395
<footer>
@@ -400,26 +399,23 @@ <h4><button class="expandPanel">HTML</button></h4>
400399
</div>
401400
<button id="copy-html-mark">Copy</button>
402401
</footer>
403-
</div>
402+
</details>
404403
</article>
405404

406405
<!-- <h4>XMP</h4>
407406
<p>[contextually formatted mark here]</p> -->
408-
</div>
409407

410-
</section>
408+
</details>
411409

412-
<section>
413-
414-
<h3><button class="expandPanel">Print Work or Media</button></h3>
410+
<details class="medium">
411+
<summary>Print Work or Media</summary>
415412

416-
<div class="panel">
417413
<p>Copy the text below and paste it on the title and/or copyright page of your print work or presentation, or in the credits of your media.</p>
418414

419415
<article>
420-
<h4><button class="expandPanel">Plain Text</button></h4>
416+
<details class="format">
417+
<summary>Plain Text</summary>
421418

422-
<div class="panel">
423419
<p class="plain-text mark">[contextually formatted mark here]</p>
424420

425421
<footer>
@@ -429,10 +425,9 @@ <h4><button class="expandPanel">Plain Text</button></h4>
429425
</div>
430426
<button id="copy-plain-text-mark">Copy</button>
431427
</footer>
432-
</div>
428+
</details>
433429
</article>
434-
</div>
435-
</section>
430+
</details>
436431

437432
</div>
438433

src/style.css

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ ol li:has(.disable) {
110110
.content {
111111
display: grid;
112112
gap: 2em;
113-
grid-template-columns: 1fr 1fr;
113+
grid-template-columns: 1fr 2fr;
114114
}
115115

116116
.mark svg {
@@ -128,6 +128,70 @@ ol li:has(.disable) {
128128
color: lightgray;
129129
}
130130

131+
#tool-recommendation p {
132+
font-size: 1.4em;
133+
}
134+
135+
#mark-your-work p {
136+
font-size: 1.4em;
137+
}
138+
139+
details {
140+
font-family: 'Source Sans Pro';
141+
142+
border: 2px solid var(--vocabulary-neutral-color-lighter-gray);
143+
border-radius: 5px;
144+
}
145+
146+
details details {
147+
margin: 1em;
148+
}
149+
150+
details.medium {
151+
margin-bottom: 1em;
152+
}
153+
154+
details.medium:open > summary {
155+
/* margin-bottom: 1em; */
156+
}
157+
158+
details summary {
159+
padding: .2em .5em;
160+
161+
background: var(--vocabulary-neutral-color-lighter-gray);
162+
font-size: 1.6em;
163+
}
164+
165+
details.format summary {
166+
font-size: 1.3em;
167+
}
168+
169+
170+
summary:hover {
171+
cursor: pointer;
172+
}
173+
174+
summary::marker {
175+
font-size: .8em;
176+
}
177+
178+
details p {
179+
padding: 0 1em;
180+
181+
font-size: 1em;
182+
}
183+
184+
body.chooser-page .content {
185+
grid-column: 3 / 10;
186+
187+
}
188+
189+
@media (max-width: 705px) {
190+
.content {
191+
display: block;
192+
}
193+
}
194+
131195

132196
/* debug styles */
133197
.help {

0 commit comments

Comments
 (0)