@allons-y/course-kit 0.4.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/scripts/deck.js +7 -5
- package/assets/styles/base.css +23 -15
- package/assets/styles/deck.css +44 -18
- package/components/site/course-now.webc +50 -48
- package/components/site/instructor.webc +1 -1
- package/components/site/masthead.webc +31 -4
- package/components/site/nav-links.webc +53 -4
- package/components/site/schedule-overview.webc +51 -15
- package/components/site/schedule-weeks.webc +80 -26
- package/components/site/site-footer.webc +1 -1
- package/components/ui/assigned-list.webc +27 -8
- package/examples/starter/content/slides/week-1-day-1.md +37 -0
- package/lib/copy.js +1 -2
- package/lib/markdown.js +1 -1
- package/package.json +3 -3
package/assets/scripts/deck.js
CHANGED
|
@@ -52,12 +52,14 @@ const setIndex = (i, scroll = true) => {
|
|
|
52
52
|
if (location.hash !== `#s${index + 1}`) history.replaceState(null, "", `#s${index + 1}`);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
/* Uncovers this slide's `::: answer` blocks
|
|
56
|
-
|
|
55
|
+
/* Uncovers this slide's `::: answer` blocks and its figures' `<g class="step">`
|
|
56
|
+
groups one at a time, in source order, before advancing; Enter reveals
|
|
57
|
+
without advancing. Going back leaves them revealed. `step` is SVG-only, so
|
|
58
|
+
a `::: step` block stays an ordinary block. */
|
|
57
59
|
const reveal = () => {
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
60
|
-
|
|
60
|
+
const hidden = slides[index].querySelector(".answer:not(.is-revealed), svg .step:not(.is-revealed)");
|
|
61
|
+
if (!hidden) return false;
|
|
62
|
+
hidden.classList.add("is-revealed");
|
|
61
63
|
return true;
|
|
62
64
|
};
|
|
63
65
|
|
package/assets/styles/base.css
CHANGED
|
@@ -285,9 +285,9 @@ main {
|
|
|
285
285
|
scroll-margin-block-start: 1.5rlh;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
+
/* A wash of the accent, strong enough to see on the page, a surface and a filled card. */
|
|
288
289
|
::selection {
|
|
289
|
-
background: color-mix(in
|
|
290
|
-
border-radius: 0.25em;
|
|
290
|
+
background: color-mix(in sRGB, var(--color-accent) 30%, var(--color-page));
|
|
291
291
|
color: var(--color-text);
|
|
292
292
|
}
|
|
293
293
|
|
|
@@ -675,14 +675,9 @@ a {
|
|
|
675
675
|
}
|
|
676
676
|
|
|
677
677
|
main {
|
|
678
|
-
/* A section opens with
|
|
679
|
-
an underlined heading reads as a link. */
|
|
678
|
+
/* A section opens with space alone: no rule and no accent bar. */
|
|
680
679
|
:where(h2:not([class])) {
|
|
681
680
|
margin-block-start: calc(var(--content-space) * 2.5);
|
|
682
|
-
padding-block-start: calc(var(--content-space) * 0.75);
|
|
683
|
-
border-block-start: var(--thin-border-width) solid var(--color-border);
|
|
684
|
-
background: linear-gradient(var(--color-accent-secondary), var(--color-accent-secondary)) top left / 2.75rem var(--border-width) no-repeat;
|
|
685
|
-
background-origin: border-box;
|
|
686
681
|
}
|
|
687
682
|
|
|
688
683
|
:where(h3:not([class])) {
|
|
@@ -1177,10 +1172,16 @@ body:has(.doc-layout[data-contents="true"], .lesson-layout) {
|
|
|
1177
1172
|
flex-wrap: wrap;
|
|
1178
1173
|
gap: calc(var(--gutter) * 2);
|
|
1179
1174
|
|
|
1175
|
+
/* A CSS dot, not a character: never an emoji, never read aloud. A border, so forced colors keeps it. */
|
|
1180
1176
|
> *:not(:last-child)::after {
|
|
1181
|
-
content: "
|
|
1182
|
-
|
|
1183
|
-
|
|
1177
|
+
content: "";
|
|
1178
|
+
display: inline-block;
|
|
1179
|
+
box-sizing: border-box;
|
|
1180
|
+
inline-size: 0.3em;
|
|
1181
|
+
block-size: 0.3em;
|
|
1182
|
+
margin-inline-start: calc(var(--gutter) * 2);
|
|
1183
|
+
border: 0.15em solid currentColor;
|
|
1184
|
+
border-radius: 50%;
|
|
1184
1185
|
vertical-align: middle;
|
|
1185
1186
|
}
|
|
1186
1187
|
}
|
|
@@ -1625,7 +1626,7 @@ blockquote {
|
|
|
1625
1626
|
selecting or copying never takes them. */
|
|
1626
1627
|
.code-block {
|
|
1627
1628
|
--code-edge: var(--color-code-edge-neutral);
|
|
1628
|
-
--code-line-height: 1;
|
|
1629
|
+
--code-line-height: 1.2;
|
|
1629
1630
|
|
|
1630
1631
|
position: relative;
|
|
1631
1632
|
margin-block: 0 1rem;
|
|
@@ -1699,12 +1700,16 @@ blockquote {
|
|
|
1699
1700
|
line-height: var(--code-line-height);
|
|
1700
1701
|
}
|
|
1701
1702
|
|
|
1703
|
+
/* The block sets its own padding and scrolling: a page whose reset clears
|
|
1704
|
+
the base `pre` rule (the kit's own landing page) still gets them. */
|
|
1702
1705
|
pre {
|
|
1703
1706
|
margin: 0;
|
|
1704
1707
|
border: 0;
|
|
1705
1708
|
border-radius: 0;
|
|
1706
1709
|
background: none;
|
|
1710
|
+
padding-block: 0.75rem;
|
|
1707
1711
|
padding-inline: 0;
|
|
1712
|
+
overflow-x: auto;
|
|
1708
1713
|
}
|
|
1709
1714
|
|
|
1710
1715
|
code {
|
|
@@ -1715,18 +1720,21 @@ blockquote {
|
|
|
1715
1720
|
|
|
1716
1721
|
br { display: none; }
|
|
1717
1722
|
|
|
1723
|
+
/* The text starts where the title bar's label does (1rem in from the border, the 3px edge counted), numbered or not. */
|
|
1718
1724
|
.highlight-line {
|
|
1719
1725
|
display: block;
|
|
1720
|
-
padding-inline:
|
|
1726
|
+
padding-inline: calc(1rem - 3px) 1rem;
|
|
1721
1727
|
border-inline-start: 3px solid transparent;
|
|
1722
1728
|
}
|
|
1723
1729
|
|
|
1730
|
+
/* The number column is as wide as the last line's number (`--line-digits`, set by lib/markdown.js), so the
|
|
1731
|
+
numbers start at the same edge as an unnumbered block's text and the gap after them is the same on every line. */
|
|
1724
1732
|
&[data-line-numbers] .highlight-line::before {
|
|
1725
1733
|
counter-increment: line;
|
|
1726
1734
|
content: counter(line);
|
|
1727
1735
|
display: inline-block;
|
|
1728
|
-
inline-size: 2
|
|
1729
|
-
margin-inline:
|
|
1736
|
+
inline-size: calc(var(--line-digits, 2) * 1ch);
|
|
1737
|
+
margin-inline: 0 1rem;
|
|
1730
1738
|
text-align: end;
|
|
1731
1739
|
color: var(--color-code-comment);
|
|
1732
1740
|
user-select: none;
|
package/assets/styles/deck.css
CHANGED
|
@@ -148,10 +148,16 @@ base.css/masthead. The class names below are the deck dialect's vocabulary
|
|
|
148
148
|
flex-wrap: wrap;
|
|
149
149
|
gap: 0.8em;
|
|
150
150
|
|
|
151
|
+
/* A CSS dot, as in base.css: never an emoji, never read aloud, visible in forced colors. */
|
|
151
152
|
> *:not(:last-child)::after {
|
|
152
|
-
content: "
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
content: "";
|
|
154
|
+
display: inline-block;
|
|
155
|
+
box-sizing: border-box;
|
|
156
|
+
inline-size: 0.3em;
|
|
157
|
+
block-size: 0.3em;
|
|
158
|
+
margin-inline-start: 0.8em;
|
|
159
|
+
border: 0.15em solid currentColor;
|
|
160
|
+
border-radius: 50%;
|
|
155
161
|
vertical-align: middle;
|
|
156
162
|
}
|
|
157
163
|
}
|
|
@@ -537,46 +543,66 @@ base.css/masthead. The class names below are the deck dialect's vocabulary
|
|
|
537
543
|
}
|
|
538
544
|
}
|
|
539
545
|
|
|
540
|
-
/* `::: answer
|
|
541
|
-
the slide. Revealed by deck.js; print shows every answer. */
|
|
546
|
+
/* `::: answer`: the box an answer sits in. */
|
|
542
547
|
.answer {
|
|
543
548
|
background: var(--color-surface-accent);
|
|
544
549
|
border-inline-start: 5px solid var(--color-accent-strong);
|
|
545
550
|
border-radius: 0 12px 12px 0;
|
|
546
551
|
padding: min(1.4cqi, 1.1rem) min(2cqi, 1.5rem);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/* Hidden but space-reserved, so revealing never reflows the slide: a
|
|
555
|
+
`::: answer` block, and each `<g class="step">` of an inline SVG figure
|
|
556
|
+
(`<g class="answer">` is the older name for a step). deck.js reveals
|
|
557
|
+
them one at a time, in source order; print shows them all. */
|
|
558
|
+
.answer, svg .step {
|
|
547
559
|
visibility: hidden;
|
|
548
560
|
opacity: 0;
|
|
549
|
-
transition: opacity 180ms ease-out;
|
|
550
561
|
|
|
551
562
|
&.is-revealed {
|
|
552
563
|
visibility: visible;
|
|
553
564
|
opacity: 1;
|
|
554
565
|
}
|
|
555
|
-
|
|
556
|
-
@media (prefers-reduced-motion: reduce) { transition: none; }
|
|
557
566
|
}
|
|
558
567
|
|
|
559
|
-
/*
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
svg .answer .pop {
|
|
568
|
+
/* Inside a revealed step, `.pop` lands with a short scale so the eye goes
|
|
569
|
+
to it, and a `.draw` stroke draws on from its start. */
|
|
570
|
+
svg :is(.answer, .step) .pop {
|
|
563
571
|
transform-box: fill-box;
|
|
564
572
|
transform-origin: center;
|
|
565
573
|
}
|
|
566
574
|
|
|
567
|
-
|
|
568
|
-
|
|
575
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
576
|
+
.answer, svg .step { transition: opacity 180ms ease-out; }
|
|
569
577
|
|
|
570
|
-
|
|
578
|
+
svg :is(.answer, .step).is-revealed .pop { animation: pop-in 380ms ease-out; }
|
|
579
|
+
|
|
580
|
+
svg :is(.answer, .step).is-revealed .draw[pathLength="1"] { animation: draw-on 600ms ease-in-out; }
|
|
571
581
|
}
|
|
572
582
|
|
|
573
583
|
@keyframes pop-in {
|
|
574
584
|
from {
|
|
575
|
-
|
|
585
|
+
scale: 1.14;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/* With `pathLength="1"` on the stroke, one dash is the whole line. The
|
|
590
|
+
dashes live only in the keyframes: with no motion the stroke is
|
|
591
|
+
untouched. An arrowhead waits for the line to arrive. */
|
|
592
|
+
@keyframes draw-on {
|
|
593
|
+
from {
|
|
594
|
+
stroke-dasharray: 1;
|
|
595
|
+
stroke-dashoffset: 1;
|
|
596
|
+
marker: none;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
99% {
|
|
600
|
+
marker: none;
|
|
576
601
|
}
|
|
577
602
|
|
|
578
603
|
to {
|
|
579
|
-
|
|
604
|
+
stroke-dasharray: 1;
|
|
605
|
+
stroke-dashoffset: 0;
|
|
580
606
|
}
|
|
581
607
|
}
|
|
582
608
|
|
|
@@ -960,7 +986,7 @@ base.css/masthead. The class names below are the deck dialect's vocabulary
|
|
|
960
986
|
|
|
961
987
|
.card, pre { break-inside: avoid; }
|
|
962
988
|
|
|
963
|
-
.answer {
|
|
989
|
+
.answer, svg .step {
|
|
964
990
|
visibility: visible;
|
|
965
991
|
opacity: 1;
|
|
966
992
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script webc:setup>
|
|
2
2
|
/**
|
|
3
|
-
* The home page's opening band: the next class
|
|
4
|
-
* week-by-week progress. Hidden until its script has judged "today" in the
|
|
3
|
+
* The home page's opening band: the next class with a link to its week, what
|
|
4
|
+
* is due soon (date first) and the week-by-week progress, side by side as space allows. Hidden until its script has judged "today" in the
|
|
5
5
|
* campus zone. Wording comes from `copy.home` and `copy.schedule`.
|
|
6
6
|
* @prop {object[]} [weeks] `scheduleWeeks` output; built from the page's lessons, schedule, decks and demos when left out
|
|
7
7
|
* @prop {string} [scheduleUrl] where the schedule lives, default `/schedule/`
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
weekday: meeting.weekday,
|
|
21
21
|
date: meeting.date,
|
|
22
22
|
title: firstTopic(meeting),
|
|
23
|
-
slides: meeting.slides ?? "",
|
|
24
23
|
})),
|
|
25
24
|
);
|
|
26
25
|
/** The script's data: meetings and deadlines, safe inside a <script> element. */
|
|
@@ -36,8 +35,7 @@
|
|
|
36
35
|
<p class="when" data-now-when></p>
|
|
37
36
|
<p class="topic" data-now-title></p>
|
|
38
37
|
<p class="actions">
|
|
39
|
-
<a class="primary" data-now-
|
|
40
|
-
<a class="secondary" data-now-week @text="$data.copy.home.seeWeek"></a>
|
|
38
|
+
<a class="primary" :href="scheduleUrl ?? '/schedule/'" data-now-week><span @text="$data.copy.home.seeWeek"></span> <span aria-hidden="true">→</span></a>
|
|
41
39
|
</p>
|
|
42
40
|
</div>
|
|
43
41
|
<div class="coming-up" data-coming-up>
|
|
@@ -54,7 +52,7 @@
|
|
|
54
52
|
<a :href="`/schedule/#week-${week.week}`">
|
|
55
53
|
<span class="bar" aria-hidden="true"></span>
|
|
56
54
|
<span class="name" @text="fill($data.copy.home.week, { week: week.week })"></span>
|
|
57
|
-
<span class="state" data-state></span>
|
|
55
|
+
<span class="state sr-only" data-state></span>
|
|
58
56
|
</a>
|
|
59
57
|
</li>
|
|
60
58
|
</ol>
|
|
@@ -90,12 +88,9 @@
|
|
|
90
88
|
root.querySelector("[data-now-label]").textContent = t("home", label);
|
|
91
89
|
root.querySelector("[data-now-when]").textContent = t("home", "when", { week: next.week, weekday: next.weekday, date: next.date });
|
|
92
90
|
root.querySelector("[data-now-title]").textContent = next.title;
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
slides.href = next.slides;
|
|
97
|
-
slides.hidden = false;
|
|
98
|
-
}
|
|
91
|
+
// The rendered href carries any path prefix; only the week's anchor is added here.
|
|
92
|
+
const week = root.querySelector("[data-now-week]");
|
|
93
|
+
week.href = `${week.getAttribute("href").split("#")[0]}#week-${next.week}`;
|
|
99
94
|
card.hidden = false;
|
|
100
95
|
}
|
|
101
96
|
|
|
@@ -110,27 +105,30 @@
|
|
|
110
105
|
}
|
|
111
106
|
const list = root.querySelector("[data-coming-list]");
|
|
112
107
|
for (const item of shown) {
|
|
108
|
+
// The date leads: it is what the card is for. The title follows, and there is no kind chip.
|
|
113
109
|
const row = document.createElement("li");
|
|
114
110
|
row.dataset.kind = item.kind;
|
|
115
|
-
const chip = document.createElement("span");
|
|
116
|
-
chip.className = "due-chip";
|
|
117
|
-
chip.dataset.kind = item.kind;
|
|
118
|
-
chip.textContent = t("schedule", `dueKind${item.kind.charAt(0).toUpperCase()}${item.kind.slice(1)}`);
|
|
119
|
-
const name = document.createElement(item.href ? "a" : "span");
|
|
120
|
-
if (item.href) name.href = item.href;
|
|
121
|
-
name.className = "what";
|
|
122
|
-
name.textContent = item.title;
|
|
123
111
|
const days = inDays(item.iso);
|
|
124
112
|
const relative = days <= 0 ? t("home", "dueToday") : days === 1 ? t("home", "dueTomorrow") : t("home", "dueInDays", { count: days });
|
|
125
113
|
const when = document.createElement("span");
|
|
126
114
|
when.className = "due";
|
|
127
|
-
|
|
128
|
-
|
|
115
|
+
const date = document.createElement("strong");
|
|
116
|
+
date.textContent = item.label;
|
|
117
|
+
const soon = document.createElement("span");
|
|
118
|
+
soon.className = "relative";
|
|
119
|
+
soon.textContent = relative;
|
|
120
|
+
when.append(date, t("common", "sep"), soon);
|
|
121
|
+
const name = document.createElement(item.href ? "a" : "span");
|
|
122
|
+
if (item.href) name.href = item.href;
|
|
123
|
+
name.className = "what";
|
|
124
|
+
name.textContent = item.title;
|
|
125
|
+
row.append(when, " ", name);
|
|
129
126
|
list.append(row);
|
|
130
127
|
}
|
|
131
128
|
root.querySelector("[data-coming-empty]").hidden = shown.length > 0;
|
|
132
129
|
|
|
133
|
-
// Progress: one bar per week, from each week's class dates.
|
|
130
|
+
// Progress: one bar per week, from each week's class dates. The state is in the bar's
|
|
131
|
+
// look, and in text for a screen reader only.
|
|
134
132
|
const weeks = [...root.querySelectorAll("[data-progress] li")];
|
|
135
133
|
let done = 0;
|
|
136
134
|
for (const week of weeks) {
|
|
@@ -166,22 +164,29 @@
|
|
|
166
164
|
display: none;
|
|
167
165
|
}
|
|
168
166
|
|
|
167
|
+
/* The next class and what is coming up share a row while they fit, and
|
|
168
|
+
wrap as the page narrows; a panel alone on a row fills it. The progress
|
|
169
|
+
track always has a row of its own. */
|
|
169
170
|
:host {
|
|
170
|
-
display:
|
|
171
|
-
|
|
171
|
+
display: flex;
|
|
172
|
+
flex-wrap: wrap;
|
|
172
173
|
gap: var(--content-space);
|
|
173
174
|
margin-block-end: var(--section-space);
|
|
174
175
|
|
|
175
|
-
@media (width <= 768px) {
|
|
176
|
-
grid-template-columns: minmax(0, 1fr);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
176
|
h2:not(.sr-only) {
|
|
180
177
|
margin: 0;
|
|
181
178
|
font-size: var(--font-size-4);
|
|
182
179
|
}
|
|
183
180
|
}
|
|
184
181
|
|
|
182
|
+
.coming-up {
|
|
183
|
+
flex: 1 1 16rem;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.now-card {
|
|
187
|
+
flex: 1.5 1 20rem;
|
|
188
|
+
}
|
|
189
|
+
|
|
185
190
|
.now-card {
|
|
186
191
|
display: flex;
|
|
187
192
|
flex-direction: column;
|
|
@@ -276,16 +281,21 @@
|
|
|
276
281
|
list-style: none;
|
|
277
282
|
}
|
|
278
283
|
|
|
284
|
+
/* The date is the line that is read first; the title sits under it. */
|
|
279
285
|
li {
|
|
280
|
-
display:
|
|
281
|
-
|
|
282
|
-
align-items: baseline;
|
|
283
|
-
gap: 0.25em 0.6em;
|
|
284
|
-
padding: 0.6em 0.8em;
|
|
286
|
+
display: grid;
|
|
287
|
+
justify-items: start;
|
|
285
288
|
}
|
|
286
289
|
|
|
287
|
-
.
|
|
288
|
-
|
|
290
|
+
.due {
|
|
291
|
+
color: var(--color-text-muted);
|
|
292
|
+
font-size: max(var(--base-font-size), 0.875em);
|
|
293
|
+
|
|
294
|
+
strong {
|
|
295
|
+
color: var(--color-text);
|
|
296
|
+
font-size: var(--font-size-4);
|
|
297
|
+
font-weight: var(--font-weight--semi-bold);
|
|
298
|
+
}
|
|
289
299
|
}
|
|
290
300
|
|
|
291
301
|
/* A link is an operable target: 44px tall (WCAG 2.5.5). */
|
|
@@ -295,12 +305,6 @@
|
|
|
295
305
|
min-block-size: var(--target-min);
|
|
296
306
|
}
|
|
297
307
|
|
|
298
|
-
.due {
|
|
299
|
-
flex-basis: 100%;
|
|
300
|
-
color: var(--color-text-muted);
|
|
301
|
-
font-size: max(var(--base-font-size), 0.875em);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
308
|
p {
|
|
305
309
|
margin: 0;
|
|
306
310
|
font-weight: var(--font-weight--semi-bold);
|
|
@@ -318,7 +322,7 @@
|
|
|
318
322
|
|
|
319
323
|
.progress {
|
|
320
324
|
display: grid;
|
|
321
|
-
|
|
325
|
+
flex: 1 1 100%;
|
|
322
326
|
grid-template-columns: 1fr auto;
|
|
323
327
|
gap: calc(var(--gutter) * 3) var(--content-space);
|
|
324
328
|
align-items: baseline;
|
|
@@ -346,9 +350,12 @@
|
|
|
346
350
|
flex: 1 0 5.5rem;
|
|
347
351
|
}
|
|
348
352
|
|
|
353
|
+
/* A 44px target (WCAG 2.5.5), now that the state is not a visible third line. */
|
|
349
354
|
a {
|
|
350
355
|
display: grid;
|
|
356
|
+
align-content: start;
|
|
351
357
|
gap: 0.35em;
|
|
358
|
+
min-block-size: var(--target-min);
|
|
352
359
|
padding-block: 0.25em;
|
|
353
360
|
color: var(--color-text);
|
|
354
361
|
font-size: max(var(--base-font-size), 0.875em);
|
|
@@ -365,11 +372,6 @@
|
|
|
365
372
|
font-weight: var(--font-weight--semi-bold);
|
|
366
373
|
}
|
|
367
374
|
|
|
368
|
-
.state {
|
|
369
|
-
min-block-size: 1.5em;
|
|
370
|
-
color: var(--color-text-muted);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
375
|
[data-state="done"] .bar {
|
|
374
376
|
background-color: var(--color-text);
|
|
375
377
|
}
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</li>
|
|
54
54
|
<li webc:if="$data.instructor.contact" :class="$data.instructor.email ? 'screen-only' : ''">
|
|
55
55
|
<a class="icon-link" :href="$data.instructor.contact" :aria-label="$data.copy.instructor.sendMeAMessage" :title="$data.copy.instructor.sendMeAMessage"><svg
|
|
56
|
-
aria-hidden="true" focusable="false" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="
|
|
56
|
+
aria-hidden="true" focusable="false" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 4h14a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-7l-5 4v-4H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z"></path></svg><span
|
|
57
57
|
class="link-text" @text="$data.copy.instructor.sendMeAMessage"></span></a>
|
|
58
58
|
</li>
|
|
59
59
|
<li webc:if="$data.instructor.blog">
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script webc:setup>
|
|
2
2
|
/**
|
|
3
3
|
* The page header: institution, term, course title and the navigation. Reads `site`, `term` and `course`.
|
|
4
|
-
* The menu is Home, Syllabus, then every page of the site menu that has not set `menu: false`.
|
|
4
|
+
* The menu is Home, Syllabus, then every page of the site menu that has not set `menu: false`. A page other pages name as their `eleventyNavigation.parent` is a group: its link, then theirs.
|
|
5
|
+
* When the instructor has a `booking` link, it is shown under the meeting line on every page, and the menu leaves Contact to the footer.
|
|
5
6
|
* @prop {'auto' | 1 | 2} [navColumns] how many columns the menu is set in: `auto` (the default) sets it in two columns when it has more than 3 links, so a long menu keeps the header short, and in one stack otherwise; `1` and `2` fix it either way. The same as `"navColumns"` in `course.json`, and wins over it
|
|
6
7
|
*/
|
|
7
8
|
/** Links shown in the hero menu before which the menu stays a single stack. */
|
|
@@ -9,15 +10,19 @@
|
|
|
9
10
|
/** The prop wins over the course's `navColumns`; `auto`, or nothing, counts the links the hero shows (the instructor's contact link is one of them). */
|
|
10
11
|
const twoColumns = (data, prop, linkCount) => {
|
|
11
12
|
const wanted = prop ?? data.course?.navColumns;
|
|
12
|
-
if (wanted === undefined || wanted === "auto") return linkCount + (data.instructor?.contact ? 1 : 0) > MAX_STACKED;
|
|
13
|
+
if (wanted === undefined || wanted === "auto") return linkCount + (data.instructor?.contact && !data.instructor?.booking?.url ? 1 : 0) > MAX_STACKED;
|
|
13
14
|
return Number(wanted) === 2;
|
|
14
15
|
};
|
|
16
|
+
/** A page's children that have not left the menu. */
|
|
17
|
+
const inMenu = (item) => ({ ...item, children: (item.children ?? []).filter((child) => child.menu !== false) });
|
|
15
18
|
const navItems = (() => {
|
|
16
19
|
const items = eleventyNavigation($data.collections.all);
|
|
17
20
|
const home = items.find((item) => item.url === "/");
|
|
18
21
|
const rest = items.filter((item) => item.url !== "/");
|
|
19
|
-
return [...(home ? [home] : []), { url: "/#syllabus", title: $data.copy.nav.syllabus }, ...rest.filter((item) => item.menu !== false)];
|
|
22
|
+
return [...(home ? [home] : []), { url: "/#syllabus", title: $data.copy.nav.syllabus }, ...rest.filter((item) => item.menu !== false).map(inMenu)];
|
|
20
23
|
})();
|
|
24
|
+
/** Every link the menu shows, a group's children included. */
|
|
25
|
+
const linkCount = navItems.reduce((count, item) => count + 1 + (item.children?.length ?? 0), 0);
|
|
21
26
|
</script>
|
|
22
27
|
<header webc:root="override" id="header">
|
|
23
28
|
<div class="container">
|
|
@@ -37,9 +42,12 @@
|
|
|
37
42
|
<span webc:if="$data.schedule.meetings.time" @text="$data.schedule.meetings.time"></span>
|
|
38
43
|
<span webc:if="$data.instructor?.office" @text="$data.instructor.office"></span>
|
|
39
44
|
</p>
|
|
45
|
+
<p class="booking" webc:if="$data.instructor?.booking?.url">
|
|
46
|
+
<a :href="$data.instructor.booking.url" @text="$data.instructor.booking.label || $data.copy.instructor.bookAnAppointment"></a>
|
|
47
|
+
</p>
|
|
40
48
|
</div>
|
|
41
49
|
<div class="links">
|
|
42
|
-
<nav-links column two-column webc:if="twoColumns($data, typeof navColumns === 'undefined' ? undefined : navColumns,
|
|
50
|
+
<nav-links column two-column webc:if="twoColumns($data, typeof navColumns === 'undefined' ? undefined : navColumns, linkCount)" :aria-label="$data.copy.nav.site" @context="hero" :@navigation="navItems"></nav-links>
|
|
43
51
|
<nav-links column webc:else :aria-label="$data.copy.nav.site" @context="hero" :@navigation="navItems"></nav-links>
|
|
44
52
|
</div>
|
|
45
53
|
</div>
|
|
@@ -137,6 +145,25 @@
|
|
|
137
145
|
font-size: max(var(--base-font-size), 0.95em);
|
|
138
146
|
}
|
|
139
147
|
|
|
148
|
+
/* The booking link: an outlined pill, a 44px target, on every page. */
|
|
149
|
+
.booking a {
|
|
150
|
+
display: inline-flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
min-block-size: var(--target-min);
|
|
153
|
+
padding-inline: 1.25em;
|
|
154
|
+
border: var(--border-width) solid var(--color-accent-text);
|
|
155
|
+
border-radius: var(--radius-pill);
|
|
156
|
+
color: var(--color-accent-text);
|
|
157
|
+
font-weight: var(--font-weight--semi-bold);
|
|
158
|
+
text-decoration: none;
|
|
159
|
+
|
|
160
|
+
&:is(:hover, :focus-visible) {
|
|
161
|
+
background-color: var(--color-accent);
|
|
162
|
+
border-color: var(--color-accent);
|
|
163
|
+
color: var(--color-on-accent);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
140
167
|
.links {
|
|
141
168
|
display: flex;
|
|
142
169
|
align-items: start;
|
|
@@ -2,16 +2,22 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* The site navigation as a list of links, marking the current page. Give it the `navigation` array, or write the links in the default slot
|
|
4
4
|
* as a `<ul>` of `<li><a>`; the array wins when it has items, and when it is missing or empty the slot is rendered instead.
|
|
5
|
-
*
|
|
6
|
-
* @prop {
|
|
5
|
+
* A page with `children` (pages whose `eleventyNavigation.parent` is its key) is a group: its own link, then its children in a nested list.
|
|
6
|
+
* @prop {{ url: string, title: string, children?: { url: string, title: string }[] }[]} navigation pages from `eleventyNavigation`
|
|
7
|
+
* @prop {'footer' | 'hero'} [context] adds the instructor's contact link in the footer, and in the hero unless the header shows the booking link
|
|
7
8
|
*/
|
|
8
9
|
</script>
|
|
9
10
|
<nav webc:root="override" :data-context="context">
|
|
10
11
|
<ul role="list" webc:if="navigation?.length">
|
|
11
|
-
<li webc:for="item of navigation">
|
|
12
|
+
<li webc:for="item of navigation" @attributes="({ class: item?.children?.length ? 'group' : undefined })">
|
|
12
13
|
<a :href="item?.url" @attributes="({ 'aria-current': item?.url === $data?.page?.url ? 'page' : undefined })" @text="item?.title"></a>
|
|
14
|
+
<ul role="list" webc:if="item?.children?.length">
|
|
15
|
+
<li webc:for="child of item.children">
|
|
16
|
+
<a :href="child?.url" @attributes="({ 'aria-current': child?.url === $data?.page?.url ? 'page' : undefined })" @text="child?.title"></a>
|
|
17
|
+
</li>
|
|
18
|
+
</ul>
|
|
13
19
|
</li>
|
|
14
|
-
<li webc:if="$data.instructor?.contact && (context === 'footer' || context === 'hero')"><a :href="$data.instructor.contact" @text="$data.copy.nav.contact"></a></li>
|
|
20
|
+
<li webc:if="$data.instructor?.contact && (context === 'footer' || (context === 'hero' && !$data.instructor?.booking?.url))"><a :href="$data.instructor.contact" @text="$data.copy.nav.contact"></a></li>
|
|
15
21
|
</ul>
|
|
16
22
|
<slot webc:if="!navigation?.length"></slot>
|
|
17
23
|
</nav>
|
|
@@ -139,6 +145,49 @@
|
|
|
139
145
|
}
|
|
140
146
|
}
|
|
141
147
|
|
|
148
|
+
/* A group: the parent page's link as a small label, its children under it.
|
|
149
|
+
In the two-column hero it takes the second column to itself. */
|
|
150
|
+
:host li.group > a[href] {
|
|
151
|
+
font-size: max(var(--base-font-size), 0.875em);
|
|
152
|
+
font-weight: var(--font-weight--semi-bold);
|
|
153
|
+
letter-spacing: 0.08em;
|
|
154
|
+
text-transform: uppercase;
|
|
155
|
+
color: var(--color-text-muted);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:host([column]) li.group > ul {
|
|
159
|
+
margin-block-start: calc(var(--content-space) * 0.35);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@media screen and (width > 768px) {
|
|
163
|
+
:host([column][two-column]) li.group {
|
|
164
|
+
break-before: column;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* The children are spaced by their own margins, as the first column's links are. */
|
|
168
|
+
:host([column][two-column]) li.group > ul {
|
|
169
|
+
display: block;
|
|
170
|
+
columns: auto;
|
|
171
|
+
margin-block-start: calc(var(--content-space) * 0.35);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* On a narrow screen the menu is a wrapped row: a group takes a row of its own, label first. */
|
|
176
|
+
@media screen and (width <= 768px) {
|
|
177
|
+
:host([column]) li.group {
|
|
178
|
+
display: flex;
|
|
179
|
+
flex-wrap: wrap;
|
|
180
|
+
flex-basis: 100%;
|
|
181
|
+
align-items: baseline;
|
|
182
|
+
column-gap: calc(var(--content-space) * 1.25);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
:host([column]) li.group > ul {
|
|
186
|
+
inline-size: auto;
|
|
187
|
+
margin-block-start: 0;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
142
191
|
/* A stack of plain links, not pills — no border, no background. */
|
|
143
192
|
:host([column]) a,
|
|
144
193
|
:host([column]) a:visited {
|
|
@@ -151,11 +151,12 @@
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
/* Space between the label and the month links, beside them or, when the row wraps, above them. */
|
|
154
155
|
.schedule-jump {
|
|
155
156
|
display: flex;
|
|
156
157
|
flex-wrap: wrap;
|
|
157
158
|
align-items: center;
|
|
158
|
-
gap: 0 var(--content-space);
|
|
159
|
+
gap: 0.5rem calc(var(--content-space) * 1.5);
|
|
159
160
|
min-inline-size: 0;
|
|
160
161
|
|
|
161
162
|
h2 {
|
|
@@ -231,23 +232,54 @@
|
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
234
|
|
|
235
|
+
/* A switch, not a button: a quiet label after a small track whose knob and fill say on or off, so it reads as a setting beside the month
|
|
236
|
+
links rather than outranking them. The state is aria-pressed; the whole row is the 44px target. The track's edge holds 3:1. */
|
|
234
237
|
.hide-past {
|
|
238
|
+
display: inline-flex;
|
|
239
|
+
align-items: center;
|
|
240
|
+
gap: 0.6em;
|
|
235
241
|
min-block-size: var(--target-min);
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
border: var(--
|
|
239
|
-
border-radius: var(--radius-pill);
|
|
242
|
+
padding-inline: 0.25em;
|
|
243
|
+
border: 0;
|
|
244
|
+
border-radius: var(--standard-border-radius);
|
|
240
245
|
background: transparent;
|
|
241
|
-
color: var(--color-text);
|
|
246
|
+
color: var(--color-text-muted);
|
|
242
247
|
font: inherit;
|
|
243
|
-
font-
|
|
248
|
+
font-size: max(var(--base-font-size), 0.95em);
|
|
244
249
|
cursor: pointer;
|
|
245
250
|
|
|
251
|
+
&::before {
|
|
252
|
+
content: "";
|
|
253
|
+
flex: none;
|
|
254
|
+
inline-size: 2.25em;
|
|
255
|
+
block-size: 1.25em;
|
|
256
|
+
box-sizing: border-box;
|
|
257
|
+
border: var(--thin-border-width) solid var(--color-border-strong);
|
|
258
|
+
border-radius: var(--radius-pill);
|
|
259
|
+
background:
|
|
260
|
+
radial-gradient(circle closest-side, var(--color-text-muted) 70%, transparent 76%) left 0.15em center / 0.95em 0.95em no-repeat,
|
|
261
|
+
var(--color-page);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&:is(:hover, :focus-visible) {
|
|
265
|
+
color: var(--color-text);
|
|
266
|
+
}
|
|
267
|
+
|
|
246
268
|
&[aria-pressed="true"] {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
269
|
+
color: var(--color-text);
|
|
270
|
+
|
|
271
|
+
&::before {
|
|
272
|
+
border-color: var(--color-accent-secondary);
|
|
273
|
+
background:
|
|
274
|
+
radial-gradient(circle closest-side, var(--color-on-accent-secondary) 70%, transparent 76%) right 0.15em center / 0.95em 0.95em no-repeat,
|
|
275
|
+
var(--color-accent-secondary);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
280
|
+
&::before {
|
|
281
|
+
transition: background-position 150ms ease-out, background-color 150ms ease-out;
|
|
282
|
+
}
|
|
251
283
|
}
|
|
252
284
|
}
|
|
253
285
|
|
|
@@ -260,11 +292,15 @@
|
|
|
260
292
|
text-decoration-color: Highlight;
|
|
261
293
|
}
|
|
262
294
|
|
|
263
|
-
.hide-past
|
|
295
|
+
.hide-past::before {
|
|
264
296
|
forced-color-adjust: none;
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
297
|
+
border-color: ButtonText;
|
|
298
|
+
background: radial-gradient(circle closest-side, ButtonText 70%, transparent 76%) left 0.15em center / 0.95em 0.95em no-repeat, Canvas;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.hide-past[aria-pressed="true"]::before {
|
|
302
|
+
border-color: Highlight;
|
|
303
|
+
background: radial-gradient(circle closest-side, HighlightText 70%, transparent 76%) right 0.15em center / 0.95em 0.95em no-repeat, Highlight;
|
|
268
304
|
}
|
|
269
305
|
}
|
|
270
306
|
|
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
<section class="this-week screen-only" data-this-week aria-labelledby="this-week-heading" hidden>
|
|
23
23
|
<header class="this-head">
|
|
24
24
|
<p class="label" data-this-label @text="copy.thisWeek"></p>
|
|
25
|
-
<
|
|
25
|
+
<div class="this-title">
|
|
26
|
+
<h3 id="this-week-heading"><a href="#" data-this-link></a></h3>
|
|
27
|
+
<p class="week-of" data-this-dates></p>
|
|
28
|
+
</div>
|
|
26
29
|
</header>
|
|
27
30
|
<ol class="this-days" role="list" data-this-days></ol>
|
|
28
31
|
<div class="this-groups" data-this-groups hidden>
|
|
@@ -67,8 +70,8 @@
|
|
|
67
70
|
<p class="label" @text="copy.readBefore"></p>
|
|
68
71
|
<ul role="list">
|
|
69
72
|
<li webc:for="reading of meeting.readings" @attributes="reading.kind ? { class: 'due-item', 'data-kind': reading.kind } : {}">
|
|
70
|
-
<span class="due-chip" webc:if="reading.kind" :data-kind="reading.kind" @text="dueKindLabel(reading.kind, $data.copy)"></span>
|
|
71
73
|
<a :href="reading.href" @text="reading.title"></a>
|
|
74
|
+
<span class="due-chip" webc:if="reading.kind" :data-kind="reading.kind" @text="dueKindLabel(reading.kind, $data.copy)"></span>
|
|
72
75
|
<span class="check" webc:if="detail(reading)" @text="detail(reading)"></span>
|
|
73
76
|
</li>
|
|
74
77
|
</ul>
|
|
@@ -77,9 +80,9 @@
|
|
|
77
80
|
<p class="label" @text="copy.due"></p>
|
|
78
81
|
<ul role="list">
|
|
79
82
|
<li webc:for="item of meeting.due" class="due-item" :data-kind="item.kind">
|
|
80
|
-
<span class="due-chip" :data-kind="item.kind" @text="dueKindLabel(item.kind, $data.copy)"></span>
|
|
81
83
|
<a webc:if="item.href" :href="item.href" @text="item.title"></a>
|
|
82
84
|
<span webc:if="!item.href" @text="item.title"></span>
|
|
85
|
+
<span class="due-chip" :data-kind="item.kind" @text="dueKindLabel(item.kind, $data.copy)"></span>
|
|
83
86
|
<span class="check" @text="item.dueLabel"></span>
|
|
84
87
|
</li>
|
|
85
88
|
</ul>
|
|
@@ -96,11 +99,11 @@
|
|
|
96
99
|
</li>
|
|
97
100
|
</ol>
|
|
98
101
|
<footer class="week-resources" webc:if="week.readings?.length || week.resources?.length">
|
|
99
|
-
<p class="label" @text="copy.
|
|
102
|
+
<p class="label" @text="copy.resources"></p>
|
|
100
103
|
<ul role="list">
|
|
101
104
|
<li data-reading webc:for="reading of (week.readings ?? [])" @attributes="reading.kind ? { class: 'due-item', 'data-kind': reading.kind } : {}">
|
|
102
|
-
<span class="due-chip" webc:if="reading.kind" :data-kind="reading.kind" @text="dueKindLabel(reading.kind, $data.copy)"></span>
|
|
103
105
|
<a :href="reading.href" @text="reading.title"></a>
|
|
106
|
+
<span class="due-chip" webc:if="reading.kind" :data-kind="reading.kind" @text="dueKindLabel(reading.kind, $data.copy)"></span>
|
|
104
107
|
<span class="check" webc:if="detail(reading)" @text="detail(reading)"></span>
|
|
105
108
|
</li>
|
|
106
109
|
<li webc:for="resource of (week.resources ?? [])">
|
|
@@ -141,9 +144,10 @@
|
|
|
141
144
|
const flag = (el, text, kind) => el.querySelector(".week-head h3")?.after(make("span", `week-flag ${kind}`, text));
|
|
142
145
|
const current = weeks.find(({ dates }) => dates.at(-1) >= today);
|
|
143
146
|
for (const week of weeks) {
|
|
147
|
+
// A past week is muted (`.week[data-past]`); "Done" is there for a screen reader only.
|
|
144
148
|
if (week.dates.at(-1) < today) {
|
|
145
149
|
week.el.dataset.past = "";
|
|
146
|
-
flag(week.el, t("schedule", "stateDone"), "done");
|
|
150
|
+
flag(week.el, t("schedule", "stateDone"), "done sr-only");
|
|
147
151
|
}
|
|
148
152
|
}
|
|
149
153
|
const started = Boolean(current && current.dates[0] <= today);
|
|
@@ -233,6 +237,8 @@
|
|
|
233
237
|
sideways. */
|
|
234
238
|
:host {
|
|
235
239
|
--week-grid: 8.5em minmax(0, 7fr) minmax(0, 5fr);
|
|
240
|
+
/* The "for this class" column's inset after its rule, shared by the column and its head (rem: the two are set in different sizes). */
|
|
241
|
+
--for-class-inset: 1.5rem;
|
|
236
242
|
display: grid;
|
|
237
243
|
gap: var(--content-space);
|
|
238
244
|
}
|
|
@@ -283,7 +289,13 @@
|
|
|
283
289
|
font-size: max(var(--base-font-size), 0.9em);
|
|
284
290
|
}
|
|
285
291
|
|
|
286
|
-
/*
|
|
292
|
+
/* In a week's header the dates sit at the end of the row, after the heading and its Now flag. */
|
|
293
|
+
.week-head .week-of {
|
|
294
|
+
margin-inline-start: auto;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/* The column heads, once per week: a booktabs header over the rows. The grid, the gap and the padding are the rows' own, at the rows'
|
|
298
|
+
font size, so each head starts where its column's content does; only the words are set small. */
|
|
287
299
|
.week-cols {
|
|
288
300
|
display: grid;
|
|
289
301
|
grid-template-columns: var(--week-grid);
|
|
@@ -291,10 +303,18 @@
|
|
|
291
303
|
padding: 0.5em 1em 0.4em;
|
|
292
304
|
border-block-end: var(--thin-border-width) solid var(--color-text);
|
|
293
305
|
color: var(--color-text-muted);
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
306
|
+
|
|
307
|
+
> span {
|
|
308
|
+
font-size: var(--font-size-6);
|
|
309
|
+
font-weight: var(--font-weight--medium);
|
|
310
|
+
letter-spacing: 0.08em;
|
|
311
|
+
text-transform: uppercase;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* The "for this class" column is inset by its rule and padding (below). */
|
|
315
|
+
> span:nth-child(3) {
|
|
316
|
+
padding-inline-start: calc(var(--for-class-inset) + var(--thin-border-width));
|
|
317
|
+
}
|
|
298
318
|
|
|
299
319
|
@media (width <= 860px) {
|
|
300
320
|
display: none;
|
|
@@ -375,7 +395,7 @@
|
|
|
375
395
|
font-size: max(var(--base-font-size), 0.94em);
|
|
376
396
|
|
|
377
397
|
@media (860px < width) {
|
|
378
|
-
padding-inline-start:
|
|
398
|
+
padding-inline-start: var(--for-class-inset);
|
|
379
399
|
border-inline-start: var(--thin-border-width) solid var(--color-border);
|
|
380
400
|
}
|
|
381
401
|
|
|
@@ -391,6 +411,31 @@
|
|
|
391
411
|
display: block;
|
|
392
412
|
}
|
|
393
413
|
|
|
414
|
+
/* An item with a kind: the title first, its badge at the end of the row, and the due line under both. The badge follows the title in the
|
|
415
|
+
source too, so a screen reader hears the title first. In the week's resources the item takes the whole row, so the badge lines up. */
|
|
416
|
+
.due-item {
|
|
417
|
+
display: grid;
|
|
418
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
419
|
+
align-items: center;
|
|
420
|
+
column-gap: 0.75em;
|
|
421
|
+
flex-basis: 100%;
|
|
422
|
+
|
|
423
|
+
> .due-chip {
|
|
424
|
+
grid-column: 2;
|
|
425
|
+
grid-row: 1;
|
|
426
|
+
justify-self: end;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
> :not(.due-chip, .check) {
|
|
430
|
+
grid-column: 1;
|
|
431
|
+
grid-row: 1;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
> .check {
|
|
435
|
+
grid-column: 1 / -1;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
394
439
|
.arrow {
|
|
395
440
|
color: var(--color-accent-text);
|
|
396
441
|
text-decoration: none;
|
|
@@ -436,17 +481,18 @@
|
|
|
436
481
|
display: none;
|
|
437
482
|
}
|
|
438
483
|
|
|
439
|
-
|
|
484
|
+
/* The week's heading, then its dates at the end of the row, as in each week's own header. */
|
|
485
|
+
.this-title {
|
|
440
486
|
display: flex;
|
|
441
487
|
flex-wrap: wrap;
|
|
442
488
|
align-items: baseline;
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
font-size: var(--font-size-3);
|
|
489
|
+
justify-content: space-between;
|
|
490
|
+
gap: 0.2em 1em;
|
|
446
491
|
}
|
|
447
492
|
|
|
448
|
-
|
|
449
|
-
|
|
493
|
+
h3 {
|
|
494
|
+
margin: 0;
|
|
495
|
+
font-size: var(--font-size-3);
|
|
450
496
|
}
|
|
451
497
|
|
|
452
498
|
/* The week's own link is an operable target: 44px tall (WCAG 2.5.5). */
|
|
@@ -495,6 +541,7 @@
|
|
|
495
541
|
}
|
|
496
542
|
|
|
497
543
|
.day-flag {
|
|
544
|
+
margin-inline-start: auto;
|
|
498
545
|
padding: 0.05em 0.65em;
|
|
499
546
|
border-radius: var(--radius-pill);
|
|
500
547
|
background-color: var(--color-accent-secondary);
|
|
@@ -532,6 +579,21 @@
|
|
|
532
579
|
box-shadow: inset var(--border-width) 0 0 var(--color-accent-secondary);
|
|
533
580
|
}
|
|
534
581
|
|
|
582
|
+
/* A past week steps back: muted text (still 7:1), no surface behind the heading and no accent rule under it. Color is not the only cue:
|
|
583
|
+
past weeks come before the one marked Now, and the hide-past toggle names them. */
|
|
584
|
+
.week[data-past] {
|
|
585
|
+
color: var(--color-text-muted);
|
|
586
|
+
|
|
587
|
+
.week-head {
|
|
588
|
+
background-color: transparent;
|
|
589
|
+
border-block-end-color: var(--color-border);
|
|
590
|
+
|
|
591
|
+
h3 {
|
|
592
|
+
color: var(--color-text-muted);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
535
597
|
.week-flag {
|
|
536
598
|
padding: 0.1em 0.65em;
|
|
537
599
|
border-radius: var(--radius-pill);
|
|
@@ -542,14 +604,6 @@
|
|
|
542
604
|
background-color: var(--color-accent-secondary);
|
|
543
605
|
color: var(--color-on-accent-secondary);
|
|
544
606
|
}
|
|
545
|
-
|
|
546
|
-
&.done {
|
|
547
|
-
color: var(--color-text-muted);
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
&.done::before {
|
|
551
|
-
content: "✓ " / "";
|
|
552
|
-
}
|
|
553
607
|
}
|
|
554
608
|
|
|
555
609
|
/* Print: the weeks as a plain list, without the card, tools or heads. */
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
<div class="group">
|
|
17
17
|
<p class="label" id="footer-pages" @text="$data.copy.siteFooter.pages"></p>
|
|
18
|
-
<nav-links column aria-labelledby="footer-pages" @context="footer" :@navigation="eleventyNavigation($data.collections.all)"></nav-links>
|
|
18
|
+
<nav-links column aria-labelledby="footer-pages" @context="footer" :@navigation="eleventyNavigation($data.collections.all).flatMap((item) => [{ ...item, children: [] }, ...(item.children ?? [])])"></nav-links>
|
|
19
19
|
</div>
|
|
20
20
|
<nav class="group" aria-labelledby="footer-policies" webc:if="$data.policies">
|
|
21
21
|
<p class="label" id="footer-policies" @text="$data.copy.siteFooter.policies"></p>
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* A labelled list of readings or deadlines. Renders nothing when empty.
|
|
4
4
|
* Give it the `items` array, or write the list as a `<dl>` in the default slot: each `<dt>` holds the title or its link (give it `data-kind` and,
|
|
5
|
-
*
|
|
5
|
+
* after the title, `<span class="due-chip" data-kind="test">Test</span>` for a chip, shown at the end of the row), each `<dd>` only the check or due detail. The array wins when
|
|
6
6
|
* it has items; when it is missing or empty the slot is rendered instead, so the list still shows if the data does not load.
|
|
7
7
|
* @prop {string} label the heading above the list
|
|
8
8
|
* @prop {{ title: string, href?: string, check?: string, dueLabel?: string, kind?: string }[]} items the readings or deadlines to list
|
|
9
9
|
* @prop {string} [dueOn] how a due date reads after the check, with `{when}`: `copy.schedule.dueOn` ("due {when}"); without it the date stands alone
|
|
10
|
-
* @prop {boolean} [chips] put a `.due-chip` for the item's `kind`
|
|
10
|
+
* @prop {boolean} [chips] put a `.due-chip` for the item's `kind` after its title, at the end of the row; a bare `@chips` turns them on
|
|
11
11
|
* @prop {Record<string, string>} [kinds] the chip words by kind, from `copy.schedule.dueKind*`; needed with `chips`
|
|
12
12
|
*/
|
|
13
13
|
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
<slot webc:if="!items?.length"></slot>
|
|
23
23
|
<ul role="list" webc:if="items?.length">
|
|
24
24
|
<li webc:for="item of items" @attributes="on(chips) && item.kind ? { class: 'due-item', 'data-kind': item.kind } : {}">
|
|
25
|
-
<span class="due-chip" webc:if="on(chips) && item.kind" :data-kind="item.kind" @text="kinds?.[item.kind]"></span>
|
|
26
25
|
<a webc:if="item.href" :href="item.href" @text="item.title"></a>
|
|
27
26
|
<span webc:if="!item.href" @text="item.title"></span>
|
|
27
|
+
<span class="due-chip" webc:if="on(chips) && item.kind" :data-kind="item.kind" @text="kinds?.[item.kind]"></span>
|
|
28
28
|
<span class="check" webc:if="detail(item, dueOn)" @text="detail(item, dueOn)"></span>
|
|
29
29
|
</li>
|
|
30
30
|
</ul>
|
|
@@ -48,13 +48,33 @@
|
|
|
48
48
|
padding: 0;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
/*
|
|
51
|
+
/*
|
|
52
|
+
* The title, then its chip at the end of the row, then the detail under both. A long title wraps beside the chip, never under it.
|
|
53
|
+
* The title row is a target tall whether or not the title is a link, so every item is spaced alike. The chip is placed by column,
|
|
54
|
+
* so a slot's `<dt>` shows it at the end in either source order.
|
|
55
|
+
*/
|
|
52
56
|
li,
|
|
53
57
|
dt {
|
|
54
|
-
display:
|
|
55
|
-
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
60
|
+
grid-template-rows: minmax(var(--target-min), auto);
|
|
56
61
|
align-items: center;
|
|
57
|
-
gap: 0
|
|
62
|
+
column-gap: 0.75em;
|
|
63
|
+
|
|
64
|
+
> .due-chip {
|
|
65
|
+
grid-column: 2;
|
|
66
|
+
grid-row: 1;
|
|
67
|
+
justify-self: end;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
> :not(.due-chip, .check) {
|
|
71
|
+
grid-column: 1;
|
|
72
|
+
grid-row: 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
> .check {
|
|
76
|
+
grid-column: 1 / -1;
|
|
77
|
+
}
|
|
58
78
|
}
|
|
59
79
|
|
|
60
80
|
/* A link is an operable target: 44px tall (WCAG 2.5.5). */
|
|
@@ -93,7 +113,6 @@
|
|
|
93
113
|
}
|
|
94
114
|
|
|
95
115
|
.check {
|
|
96
|
-
flex-basis: 100%;
|
|
97
116
|
line-height: var(--font-height);
|
|
98
117
|
color: var(--color-text-muted);
|
|
99
118
|
font-size: max(var(--base-font-size), 0.9em);
|
|
@@ -38,3 +38,40 @@ What we will do
|
|
|
38
38
|
:::
|
|
39
39
|
|
|
40
40
|
>>>
|
|
41
|
+
>>> slide
|
|
42
|
+
|
|
43
|
+
::: eyebrow
|
|
44
|
+
How the web works
|
|
45
|
+
:::
|
|
46
|
+
|
|
47
|
+
## From a file to a reader
|
|
48
|
+
|
|
49
|
+
<svg viewBox="0 0 720 190" role="img" aria-label="A page file is put on a web server, and the server sends it to a browser.">
|
|
50
|
+
<defs><marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto"><path class="accent" d="M0 0 L10 5 L0 10 z"/></marker></defs>
|
|
51
|
+
<rect class="tint" x="20" y="30" width="180" height="80" rx="12"/>
|
|
52
|
+
<text class="mono" x="110" y="78" text-anchor="middle" font-size="22">index.html</text>
|
|
53
|
+
<g class="step">
|
|
54
|
+
<path class="stroke-accent draw" pathLength="1" d="M208 70 H262" stroke-width="3" marker-end="url(#arrow)"/>
|
|
55
|
+
<g class="pop">
|
|
56
|
+
<rect class="tint" x="270" y="30" width="180" height="80" rx="12"/>
|
|
57
|
+
<text x="360" y="78" text-anchor="middle" font-size="22">Web server</text>
|
|
58
|
+
</g>
|
|
59
|
+
</g>
|
|
60
|
+
<g class="step">
|
|
61
|
+
<path class="stroke-accent draw" pathLength="1" d="M458 70 H512" stroke-width="3" marker-end="url(#arrow)"/>
|
|
62
|
+
<g class="pop">
|
|
63
|
+
<rect class="tint" x="520" y="30" width="180" height="80" rx="12"/>
|
|
64
|
+
<text x="610" y="78" text-anchor="middle" font-size="22">Browser</text>
|
|
65
|
+
</g>
|
|
66
|
+
</g>
|
|
67
|
+
<g class="step">
|
|
68
|
+
<text class="accent" x="360" y="160" text-anchor="middle" font-size="20">The address names the server and the file.</text>
|
|
69
|
+
</g>
|
|
70
|
+
</svg>
|
|
71
|
+
|
|
72
|
+
::: notes How a page travels (0:20–0:30)
|
|
73
|
+
- Press the next-slide key once for each part of the figure.
|
|
74
|
+
- Ask where the file lives at each step.
|
|
75
|
+
:::
|
|
76
|
+
|
|
77
|
+
>>>
|
package/lib/copy.js
CHANGED
|
@@ -63,7 +63,6 @@ export const COPY_DEFAULTS = {
|
|
|
63
63
|
nextLabel: "Next class",
|
|
64
64
|
firstLabel: "First class",
|
|
65
65
|
when: "Week {week} · {weekday}, {date}",
|
|
66
|
-
openSlides: "Open the slides",
|
|
67
66
|
seeWeek: "See the week",
|
|
68
67
|
comingUp: "Coming up",
|
|
69
68
|
fullSchedule: "Full schedule",
|
|
@@ -101,7 +100,7 @@ export const COPY_DEFAULTS = {
|
|
|
101
100
|
materials: "Materials",
|
|
102
101
|
slides: "Slides",
|
|
103
102
|
addendum: "Addendum",
|
|
104
|
-
|
|
103
|
+
resources: "Resources",
|
|
105
104
|
noClass: "No class — {reason}",
|
|
106
105
|
substitution: "Runs a {weekday} schedule",
|
|
107
106
|
dueKeyLabel: "Key to due items",
|
package/lib/markdown.js
CHANGED
|
@@ -550,7 +550,7 @@ const codeBlock = (tokens, idx, options, env, self) => {
|
|
|
550
550
|
const copy = resolveCopy().code;
|
|
551
551
|
const label = copy.languages[language] ?? (language ? language.toUpperCase() : copy.plain);
|
|
552
552
|
const file = title ? `<span class="code-block-file">${esc(title)}</span>` : "";
|
|
553
|
-
return `<figure class="code-block" data-edge="${edge}"${numbered ?
|
|
553
|
+
return `<figure class="code-block" data-edge="${edge}"${numbered ? ` data-line-numbers style="--line-digits: ${String(lines).length}"` : ""}>\n<figcaption class="code-block-head"><span class="code-block-lang">${esc(label)}</span>${file}</figcaption>\n${pre}</figure>\n`;
|
|
554
554
|
};
|
|
555
555
|
|
|
556
556
|
markdown.renderer.rules.fence = (tokens, idx, options, env, self) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allons-y/course-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Shared layouts, components, styles and build helpers for Eleventy course sites.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "Cassondra Roberts <castastrophe@users.noreply.github.com> (https://allons-y.studio)",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"preview:build": "node scripts/site.js build",
|
|
43
43
|
"docs:build": "node scripts/site.js build",
|
|
44
44
|
"docs:start": "node scripts/site.js start",
|
|
45
|
-
"docs:test": "
|
|
45
|
+
"docs:test": "node scripts/browser-run.js",
|
|
46
46
|
"pages:build": "node scripts/site.js build",
|
|
47
47
|
"format": "opx lint --fix",
|
|
48
48
|
"lint": "opx lint",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"ajv": "^8.20.0",
|
|
109
109
|
"ajv-formats": "^3.0.1",
|
|
110
110
|
"axe-core": "^4.14.0",
|
|
111
|
-
"cypress": "^15.21.
|
|
111
|
+
"cypress": "^15.21.2",
|
|
112
112
|
"cypress-axe": "^1.7.0"
|
|
113
113
|
},
|
|
114
114
|
"oss-docs": {
|