@allons-y/course-kit 0.0.0-stage → 0.1.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/LICENSE +373 -0
- package/README.md +90 -2
- package/assets/fonts/instrument-sans-italic-var.woff2 +0 -0
- package/assets/fonts/instrument-sans-var.woff2 +0 -0
- package/assets/fonts/pt-mono.woff2 +0 -0
- package/assets/scripts/copy.js +99 -0
- package/assets/scripts/deck.js +161 -0
- package/assets/scripts/email.js +17 -0
- package/assets/scripts/practice.js +545 -0
- package/assets/scripts/theme-panel.js +647 -0
- package/assets/scripts/theme-restore.js +17 -0
- package/assets/styles/base.css +2090 -0
- package/assets/styles/deck.css +968 -0
- package/assets/styles/font.css +36 -0
- package/assets/styles/notes.css +137 -0
- package/assets/styles/print.css +428 -0
- package/assets/styles/semantics.css +101 -0
- package/components/practice/check-controls.webc +50 -0
- package/components/practice/choice-list.webc +86 -0
- package/components/practice/cite-panel.webc +108 -0
- package/components/practice/practice-figure.webc +47 -0
- package/components/practice/practice-fill.webc +154 -0
- package/components/practice/practice-grid.webc +82 -0
- package/components/practice/practice-judge.webc +165 -0
- package/components/practice/practice-match.webc +178 -0
- package/components/practice/practice-question.webc +141 -0
- package/components/practice/practice-selfcheck.webc +40 -0
- package/components/practice/practice-terms.webc +95 -0
- package/components/practice/practice-tree.webc +91 -0
- package/components/practice/practice-worksheet.webc +369 -0
- package/components/site/copyright.webc +13 -0
- package/components/site/course-documents.webc +27 -0
- package/components/site/course-now.webc +393 -0
- package/components/site/course-summary.webc +136 -0
- package/components/site/demo-weeks.webc +91 -0
- package/components/site/glossary-entry.webc +31 -0
- package/components/site/glossary-panel.webc +1482 -0
- package/components/site/glossary.webc +45 -0
- package/components/site/grading.webc +50 -0
- package/components/site/instructor.webc +269 -0
- package/components/site/masthead.webc +147 -0
- package/components/site/nav-links.webc +174 -0
- package/components/site/policies.webc +17 -0
- package/components/site/practice-index.webc +31 -0
- package/components/site/schedule-overview.webc +145 -0
- package/components/site/schedule-weeks.webc +589 -0
- package/components/site/site-footer.webc +119 -0
- package/components/site/slide-timetable.webc +152 -0
- package/components/site/syllabus.webc +217 -0
- package/components/ui/arrow-link.webc +19 -0
- package/components/ui/assigned-list.webc +101 -0
- package/components/ui/callout.webc +11 -0
- package/components/ui/card-list.webc +124 -0
- package/components/ui/codepen-embed.webc +123 -0
- package/components/ui/download-button.webc +49 -0
- package/components/ui/eyebrow.webc +18 -0
- package/components/ui/icons/github.webc +6 -0
- package/components/ui/icons/google.webc +9 -0
- package/components/ui/link-list.webc +130 -0
- package/components/ui/link-section.webc +40 -0
- package/components/ui/meeting-card.webc +73 -0
- package/components/ui/meeting-decks.webc +38 -0
- package/components/ui/table-rubric.webc +251 -0
- package/components/ui/today-link.webc +43 -0
- package/components/ui/today-marker.webc +149 -0
- package/components/ui/week-block.webc +53 -0
- package/examples/starter/_data/course.json +20 -0
- package/examples/starter/_data/dates.json +16 -0
- package/examples/starter/_data/grading.json +6 -0
- package/examples/starter/_data/instructor.json +7 -0
- package/examples/starter/_data/policies.json +9 -0
- package/examples/starter/_data/scale.json +8 -0
- package/examples/starter/_data/schedule.json +22 -0
- package/examples/starter/_data/theme.json +17 -0
- package/examples/starter/content/index.webc +12 -0
- package/examples/starter/content/schedule.webc +12 -0
- package/examples/starter/content/slides/index.11tydata.js +5 -0
- package/examples/starter/content/slides/index.webc +12 -0
- package/examples/starter/content/slides/week-1-day-1.md +40 -0
- package/examples/starter/eleventy.config.js +8 -0
- package/glue/deck-notes.data.js +41 -0
- package/glue/deck-notes.webc +32 -0
- package/glue/lesson-day.data.js +17 -0
- package/glue/lesson-day.webc +0 -0
- package/glue/lesson-plans.data.js +13 -0
- package/glue/lesson-plans.webc +2 -0
- package/index.js +6 -0
- package/layouts/base.webc +79 -0
- package/layouts/deck.webc +46 -0
- package/layouts/demo.webc +16 -0
- package/layouts/document.webc +10 -0
- package/layouts/lesson-detail.webc +109 -0
- package/layouts/lesson.webc +71 -0
- package/layouts/notes.webc +23 -0
- package/layouts/worksheet.webc +52 -0
- package/lib/assets.js +42 -0
- package/lib/bundles.js +79 -0
- package/lib/check.js +110 -0
- package/lib/components.js +19 -0
- package/lib/copy.js +653 -0
- package/lib/data/build.js +22 -0
- package/lib/data/fonts.js +16 -0
- package/lib/data/glossary.js +304 -0
- package/lib/data/index.js +8 -0
- package/lib/data/lessons.js +173 -0
- package/lib/data/project.js +22 -0
- package/lib/data/read.js +46 -0
- package/lib/data/site.js +70 -0
- package/lib/data/term.js +80 -0
- package/lib/extensions.js +70 -0
- package/lib/files.js +14 -0
- package/lib/filters.js +584 -0
- package/lib/fit.js +106 -0
- package/lib/glue.js +26 -0
- package/lib/lesson-materials.js +66 -0
- package/lib/markdown.js +568 -0
- package/lib/minify.js +53 -0
- package/lib/paths.js +5 -0
- package/lib/pdf.js +134 -0
- package/lib/plugin.js +228 -0
- package/lib/plugins.js +34 -0
- package/lib/postcss.js +93 -0
- package/lib/theme-server.js +88 -0
- package/lib/theme.js +185 -0
- package/lib/worksheet-dialect.js +415 -0
- package/lib/worksheets.js +276 -0
- package/package.json +118 -4
- package/schemas/course.schema.json +156 -0
- package/schemas/dates.schema.json +165 -0
- package/schemas/grading.schema.json +59 -0
- package/schemas/instructor.schema.json +68 -0
- package/schemas/policies.schema.json +90 -0
- package/schemas/project.schema.json +209 -0
- package/schemas/scale.schema.json +68 -0
- package/schemas/schedule.schema.json +260 -0
- package/schemas/theme.schema.json +704 -0
- package/schemas/worksheet.schema.json +449 -0
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* The home page's opening band: the next class, what is due soon and the
|
|
4
|
+
* week-by-week progress. Hidden until its script has judged "today" in the
|
|
5
|
+
* campus zone. Wording comes from `copy.home` and `copy.schedule`.
|
|
6
|
+
* @prop {object[]} [weeks] `scheduleWeeks` output; built from the page's lessons, schedule, decks and demos when left out
|
|
7
|
+
* @prop {string} [scheduleUrl] where the schedule lives, default `/schedule/`
|
|
8
|
+
*/
|
|
9
|
+
const defaultWeeks = scheduleWeeks($data.lessons, $data.schedule?.weeks, $data.collections?.deck, $data.demos);
|
|
10
|
+
/** A meeting's first topic as plain text, for the card's title. */
|
|
11
|
+
const firstTopic = (meeting) => String(meeting?.topics?.[0] ?? "").replace(/<[^>]+>/g, "").trim();
|
|
12
|
+
/** Every meeting that holds class, flat. */
|
|
13
|
+
const flatMeetings = (weeks) =>
|
|
14
|
+
(weeks ?? []).flatMap((week) =>
|
|
15
|
+
(week.meetings ?? [])
|
|
16
|
+
.filter((meeting) => !meeting.noClass && meeting.iso)
|
|
17
|
+
.map((meeting) => ({
|
|
18
|
+
iso: meeting.iso,
|
|
19
|
+
week: week.week,
|
|
20
|
+
weekday: meeting.weekday,
|
|
21
|
+
date: meeting.date,
|
|
22
|
+
title: firstTopic(meeting),
|
|
23
|
+
slides: meeting.slides ?? "",
|
|
24
|
+
})),
|
|
25
|
+
);
|
|
26
|
+
/** The script's data: meetings and deadlines, safe inside a <script> element. */
|
|
27
|
+
const nowData = (weeks, schedule, copy) =>
|
|
28
|
+
JSON.stringify({ meetings: flatMeetings(weeks), deadlines: courseDeadlines(weeks, schedule, copy) }).replaceAll("<", "\\u003c");
|
|
29
|
+
/** Every class date in a week, for the progress track. */
|
|
30
|
+
const datesOf = (week) => (week?.meetings ?? []).map((meeting) => meeting.iso).filter(Boolean).join(" ");
|
|
31
|
+
</script>
|
|
32
|
+
<section webc:root="override" class="course-now screen-only" aria-labelledby="course-now-heading" data-course-now webc:if="(weeks ?? defaultWeeks)?.length" hidden>
|
|
33
|
+
<h2 id="course-now-heading" class="sr-only" @text="$data.copy.home.heading"></h2>
|
|
34
|
+
<div class="now-card on-accent" data-now-card hidden>
|
|
35
|
+
<p class="label" data-now-label></p>
|
|
36
|
+
<p class="when" data-now-when></p>
|
|
37
|
+
<p class="topic" data-now-title></p>
|
|
38
|
+
<p class="actions">
|
|
39
|
+
<a class="primary" data-now-slides hidden><span @text="$data.copy.home.openSlides"></span> <span aria-hidden="true">→</span></a>
|
|
40
|
+
<a class="secondary" data-now-week @text="$data.copy.home.seeWeek"></a>
|
|
41
|
+
</p>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="coming-up" data-coming-up>
|
|
44
|
+
<h2 @text="$data.copy.home.comingUp"></h2>
|
|
45
|
+
<ul role="list" data-coming-list></ul>
|
|
46
|
+
<p class="empty" data-coming-empty hidden @text="$data.copy.home.nothingDue"></p>
|
|
47
|
+
<p><a :href="scheduleUrl ?? '/schedule/'"><span @text="$data.copy.home.fullSchedule"></span> <span aria-hidden="true">→</span></a></p>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="progress" data-progress>
|
|
50
|
+
<h2 @text="$data.copy.home.progress"></h2>
|
|
51
|
+
<p class="count" data-progress-count role="status"></p>
|
|
52
|
+
<ol role="list">
|
|
53
|
+
<li webc:for="week of (weeks ?? defaultWeeks)" :data-week-dates="datesOf(week)">
|
|
54
|
+
<a :href="`/schedule/#week-${week.week}`">
|
|
55
|
+
<span class="bar" aria-hidden="true"></span>
|
|
56
|
+
<span class="name" @text="fill($data.copy.home.week, { week: week.week })"></span>
|
|
57
|
+
<span class="state" data-state></span>
|
|
58
|
+
</a>
|
|
59
|
+
</li>
|
|
60
|
+
</ol>
|
|
61
|
+
</div>
|
|
62
|
+
<script type="application/json" data-course-now-data webc:keep @raw="nowData(weeks ?? defaultWeeks, $data.schedule, $data.copy)"></script>
|
|
63
|
+
</section>
|
|
64
|
+
|
|
65
|
+
<script>
|
|
66
|
+
/**
|
|
67
|
+
* <course-now>: the home page's class card, the next due items and the
|
|
68
|
+
* week-by-week progress track. Everything comes from the schedule data
|
|
69
|
+
* already on the page; dates compare in the campus zone, as
|
|
70
|
+
* <today-marker> does. Screen only.
|
|
71
|
+
*/
|
|
72
|
+
(() => {
|
|
73
|
+
try {
|
|
74
|
+
const root = document.querySelector("[data-course-now]");
|
|
75
|
+
if (!root) return;
|
|
76
|
+
/** Today in the campus zone, as "YYYY-MM-DD". */
|
|
77
|
+
const campusToday = () => new Date().toLocaleDateString("en-CA", { timeZone: document.documentElement.dataset.timezone });
|
|
78
|
+
const { t } = window.ckCopy;
|
|
79
|
+
const today = campusToday();
|
|
80
|
+
const { meetings, deadlines } = JSON.parse(root.querySelector("[data-course-now-data]").textContent);
|
|
81
|
+
const DAY_MS = 86_400_000;
|
|
82
|
+
const day = (iso) => Date.parse(`${iso}T00:00:00Z`);
|
|
83
|
+
const inDays = (iso) => Math.round((day(iso) - day(today)) / DAY_MS);
|
|
84
|
+
|
|
85
|
+
// The class card: today's class, else the next, else (before the term) the first.
|
|
86
|
+
const next = meetings.find((meeting) => meeting.iso >= today);
|
|
87
|
+
const card = root.querySelector("[data-now-card]");
|
|
88
|
+
if (next) {
|
|
89
|
+
const label = next.iso === today ? "todayLabel" : meetings.some((meeting) => meeting.iso < today) ? "nextLabel" : "firstLabel";
|
|
90
|
+
root.querySelector("[data-now-label]").textContent = t("home", label);
|
|
91
|
+
root.querySelector("[data-now-when]").textContent = t("home", "when", { week: next.week, weekday: next.weekday, date: next.date });
|
|
92
|
+
root.querySelector("[data-now-title]").textContent = next.title;
|
|
93
|
+
root.querySelector("[data-now-week]").href = `/schedule/#week-${next.week}`;
|
|
94
|
+
const slides = root.querySelector("[data-now-slides]");
|
|
95
|
+
if (next.slides) {
|
|
96
|
+
slides.href = next.slides;
|
|
97
|
+
slides.hidden = false;
|
|
98
|
+
}
|
|
99
|
+
card.hidden = false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Coming up: a week ahead, at least three, and always the next test.
|
|
103
|
+
const up = deadlines.filter((item) => item.iso >= today);
|
|
104
|
+
let shown = up.filter((item) => inDays(item.iso) <= 7);
|
|
105
|
+
if (shown.length < 3) shown = up.slice(0, 3);
|
|
106
|
+
shown = shown.slice(0, 6);
|
|
107
|
+
if (!shown.some((item) => item.kind === "test")) {
|
|
108
|
+
const test = up.find((item) => item.kind === "test");
|
|
109
|
+
if (test) shown = [...shown.slice(0, 5), test];
|
|
110
|
+
}
|
|
111
|
+
const list = root.querySelector("[data-coming-list]");
|
|
112
|
+
for (const item of shown) {
|
|
113
|
+
const row = document.createElement("li");
|
|
114
|
+
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
|
+
const days = inDays(item.iso);
|
|
124
|
+
const relative = days <= 0 ? t("home", "dueToday") : days === 1 ? t("home", "dueTomorrow") : t("home", "dueInDays", { count: days });
|
|
125
|
+
const when = document.createElement("span");
|
|
126
|
+
when.className = "due";
|
|
127
|
+
when.textContent = `${item.label}${t("common", "sep")}${relative}`;
|
|
128
|
+
row.append(chip, " ", name, " ", when);
|
|
129
|
+
list.append(row);
|
|
130
|
+
}
|
|
131
|
+
root.querySelector("[data-coming-empty]").hidden = shown.length > 0;
|
|
132
|
+
|
|
133
|
+
// Progress: one bar per week, from each week's class dates.
|
|
134
|
+
const weeks = [...root.querySelectorAll("[data-progress] li")];
|
|
135
|
+
let done = 0;
|
|
136
|
+
for (const week of weeks) {
|
|
137
|
+
const dates = week.dataset.weekDates.split(/\s+/).filter(Boolean).sort();
|
|
138
|
+
const state = !dates.length ? "" : dates.at(-1) < today ? "done" : dates[0] <= today ? "now" : "";
|
|
139
|
+
if (state) week.dataset.state = state;
|
|
140
|
+
if (state === "done") done += 1;
|
|
141
|
+
week.querySelector("[data-state]").textContent = state === "done" ? t("home", "stateDone") : state === "now" ? t("home", "stateNow") : "";
|
|
142
|
+
if (state === "now") week.querySelector("a").setAttribute("aria-current", "step");
|
|
143
|
+
}
|
|
144
|
+
root.querySelector("[data-progress-count]").textContent = t("home", "weeksDone", { done, total: weeks.length });
|
|
145
|
+
root.hidden = false;
|
|
146
|
+
// The track scrolls sideways when the weeks don't fit: open it
|
|
147
|
+
// with the current week (or the last finished one) centered.
|
|
148
|
+
const track = root.querySelector("[data-progress] ol");
|
|
149
|
+
const active = weeks.find((week) => week.dataset.state === "now") ?? weeks.filter((week) => week.dataset.state === "done").at(-1);
|
|
150
|
+
if (active && track.scrollWidth > track.clientWidth) {
|
|
151
|
+
track.scrollLeft = active.offsetLeft - (track.clientWidth - active.offsetWidth) / 2;
|
|
152
|
+
}
|
|
153
|
+
} catch {
|
|
154
|
+
// Never let the card break the scripts bundled after this one.
|
|
155
|
+
}
|
|
156
|
+
})();
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
<style webc:scoped>
|
|
160
|
+
/* The home page's opening band: a filled card for the next class beside
|
|
161
|
+
what is due, then one bar per week. Screen only. */
|
|
162
|
+
/* `hidden` has to win outside the :host nesting too, or an empty card shows.
|
|
163
|
+
The band is for the screen; its own `display` would beat `.screen-only`, so print hides it here. */
|
|
164
|
+
:host[hidden],
|
|
165
|
+
.course-now[hidden] {
|
|
166
|
+
display: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
:host {
|
|
170
|
+
display: grid;
|
|
171
|
+
grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
|
|
172
|
+
gap: var(--content-space);
|
|
173
|
+
margin-block-end: var(--section-space);
|
|
174
|
+
|
|
175
|
+
@media (width <= 768px) {
|
|
176
|
+
grid-template-columns: minmax(0, 1fr);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
h2:not(.sr-only) {
|
|
180
|
+
margin: 0;
|
|
181
|
+
font-size: var(--font-size-4);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.now-card {
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-direction: column;
|
|
188
|
+
gap: calc(var(--gutter) * 2);
|
|
189
|
+
padding: calc(var(--content-space) * 1.75);
|
|
190
|
+
border-radius: calc(var(--standard-border-radius) * 4);
|
|
191
|
+
background-color: var(--color-accent);
|
|
192
|
+
color: var(--color-on-accent);
|
|
193
|
+
|
|
194
|
+
&[hidden] {
|
|
195
|
+
display: none;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
p {
|
|
199
|
+
margin: 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.label {
|
|
203
|
+
font-size: max(var(--base-font-size), 0.875em);
|
|
204
|
+
font-weight: var(--font-weight--medium);
|
|
205
|
+
letter-spacing: 0.08em;
|
|
206
|
+
text-transform: uppercase;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.topic {
|
|
210
|
+
color: inherit;
|
|
211
|
+
text-transform: none;
|
|
212
|
+
font-size: var(--font-size-2, 1.9em);
|
|
213
|
+
font-weight: var(--font-weight--semi-bold);
|
|
214
|
+
line-height: 1.15;
|
|
215
|
+
text-wrap: balance;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.actions {
|
|
219
|
+
display: flex;
|
|
220
|
+
flex-wrap: wrap;
|
|
221
|
+
gap: calc(var(--gutter) * 2.5);
|
|
222
|
+
/* Pinned to the card's bottom edge when the card is stretched. */
|
|
223
|
+
margin-block-start: auto;
|
|
224
|
+
padding-block-start: calc(var(--gutter) * 2);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
a {
|
|
228
|
+
display: inline-flex;
|
|
229
|
+
align-items: center;
|
|
230
|
+
gap: 0.5em;
|
|
231
|
+
min-block-size: var(--target-min);
|
|
232
|
+
min-inline-size: var(--target-min);
|
|
233
|
+
justify-content: center;
|
|
234
|
+
padding-inline: 1.25em;
|
|
235
|
+
border: var(--border-width) solid var(--color-on-accent);
|
|
236
|
+
border-radius: var(--radius-pill);
|
|
237
|
+
color: var(--color-on-accent);
|
|
238
|
+
font-weight: var(--font-weight--semi-bold);
|
|
239
|
+
text-decoration: none;
|
|
240
|
+
|
|
241
|
+
&[hidden] {
|
|
242
|
+
display: none;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
&.primary {
|
|
246
|
+
background-color: var(--color-on-accent);
|
|
247
|
+
color: var(--color-accent);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.coming-up p > a {
|
|
253
|
+
display: inline-flex;
|
|
254
|
+
align-items: center;
|
|
255
|
+
min-block-size: var(--target-min);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.coming-up {
|
|
259
|
+
display: grid;
|
|
260
|
+
gap: calc(var(--gutter) * 3);
|
|
261
|
+
align-content: start;
|
|
262
|
+
padding: calc(var(--content-space) * 1.4);
|
|
263
|
+
border: var(--thin-border-width) solid var(--color-border);
|
|
264
|
+
border-radius: calc(var(--standard-border-radius) * 4);
|
|
265
|
+
background-color: var(--color-surface);
|
|
266
|
+
|
|
267
|
+
&[hidden] {
|
|
268
|
+
display: none;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
ul {
|
|
272
|
+
display: grid;
|
|
273
|
+
gap: calc(var(--gutter) * 2);
|
|
274
|
+
margin: 0;
|
|
275
|
+
padding: 0;
|
|
276
|
+
list-style: none;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
li {
|
|
280
|
+
display: flex;
|
|
281
|
+
flex-wrap: wrap;
|
|
282
|
+
align-items: baseline;
|
|
283
|
+
gap: 0.25em 0.6em;
|
|
284
|
+
padding: 0.6em 0.8em;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.what {
|
|
288
|
+
font-weight: var(--font-weight--semi-bold);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.due {
|
|
292
|
+
flex-basis: 100%;
|
|
293
|
+
color: var(--color-text-muted);
|
|
294
|
+
font-size: max(var(--base-font-size), 0.875em);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
p {
|
|
298
|
+
margin: 0;
|
|
299
|
+
font-weight: var(--font-weight--semi-bold);
|
|
300
|
+
|
|
301
|
+
&[hidden] {
|
|
302
|
+
display: none;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.empty {
|
|
307
|
+
color: var(--color-text-muted);
|
|
308
|
+
font-weight: var(--font-weight);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.progress {
|
|
313
|
+
display: grid;
|
|
314
|
+
grid-column: 1 / -1;
|
|
315
|
+
grid-template-columns: 1fr auto;
|
|
316
|
+
gap: calc(var(--gutter) * 3) var(--content-space);
|
|
317
|
+
align-items: baseline;
|
|
318
|
+
|
|
319
|
+
.count {
|
|
320
|
+
margin: 0;
|
|
321
|
+
color: var(--color-text-muted);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/* One row that scrolls sideways when the weeks don't fit; the
|
|
325
|
+
script opens it with the current week centered. */
|
|
326
|
+
ol {
|
|
327
|
+
position: relative;
|
|
328
|
+
display: flex;
|
|
329
|
+
grid-column: 1 / -1;
|
|
330
|
+
gap: calc(var(--gutter) * 2);
|
|
331
|
+
margin: 0;
|
|
332
|
+
/* Room for the focus ring, so the scroll box never clips it. */
|
|
333
|
+
padding: calc(var(--focus-ring-width) + var(--focus-ring-offset));
|
|
334
|
+
overflow-x: auto;
|
|
335
|
+
list-style: none;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
li {
|
|
339
|
+
flex: 1 0 5.5rem;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
a {
|
|
343
|
+
display: grid;
|
|
344
|
+
gap: 0.35em;
|
|
345
|
+
padding-block: 0.25em;
|
|
346
|
+
color: var(--color-text);
|
|
347
|
+
font-size: max(var(--base-font-size), 0.875em);
|
|
348
|
+
text-decoration: none;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.bar {
|
|
352
|
+
block-size: 0.6rem;
|
|
353
|
+
border-radius: var(--radius-pill);
|
|
354
|
+
background-color: var(--color-border);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.name {
|
|
358
|
+
font-weight: var(--font-weight--semi-bold);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.state {
|
|
362
|
+
min-block-size: 1.5em;
|
|
363
|
+
color: var(--color-text-muted);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
[data-state="done"] .bar {
|
|
367
|
+
background-color: var(--color-text);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
[data-state="now"] .bar {
|
|
371
|
+
background-color: var(--color-accent-secondary);
|
|
372
|
+
outline: var(--border-width) solid var(--color-accent-secondary);
|
|
373
|
+
outline-offset: 2px;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
@media (forced-colors: active) {
|
|
378
|
+
.progress [data-state="now"] .bar {
|
|
379
|
+
background: Highlight;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.progress [data-state="done"] .bar {
|
|
383
|
+
background: CanvasText;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
@media print {
|
|
388
|
+
:host,
|
|
389
|
+
.course-now {
|
|
390
|
+
display: none;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
</style>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* The course home page's body: the description, the instructor, the syllabus
|
|
4
|
+
* and the schedule. Reads the `course`, `grading`, `schedule`, `instructor`
|
|
5
|
+
* and `term` data; it takes no props.
|
|
6
|
+
*/
|
|
7
|
+
const course = $data.course ?? {};
|
|
8
|
+
const copy = $data.copy.courseSummary;
|
|
9
|
+
const escape = (text) => String(text).replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
10
|
+
/** When the final project is due, from `project.json`: "Thursday, December 3, 2026, 11:59PM". */
|
|
11
|
+
const projectWhen = () => {
|
|
12
|
+
const project = $data.project;
|
|
13
|
+
if (!project?.due) return fill($data.copy.syllabus.atTheLastClassMeeting, { lastMeeting: lastMeeting($data.lessons) });
|
|
14
|
+
return project.dueTime ? fill($data.copy.syllabus.projectDue, { date: fullDate(project.due), time: timeOfDay(project.dueTime) }) : fullDate(project.due);
|
|
15
|
+
};
|
|
16
|
+
/** "This section's final exam is …, see the Coursework section." with the link in place. */
|
|
17
|
+
const finalExamLine = () => fill(copy.thisSectionsFinalExamIs, { slot: escape(examSlot($data.schedule.finalExam)), link: `<a href="#coursework">${escape(copy.coursework)}</a>` });
|
|
18
|
+
/** "The final project is due …; its milestones and rubric are on the project page." with the link in place. */
|
|
19
|
+
const projectDue = () => fill(copy.projectDue, { when: escape(projectWhen()), link: `<a href="${escape($data.project?.url ?? "/projects/final/")}">${escape(copy.projectPageLink)}</a>` });
|
|
20
|
+
</script>
|
|
21
|
+
<article class="content-column wide" webc:root="override" webc:if="$data.course">
|
|
22
|
+
<header class="course-header">
|
|
23
|
+
<eyebrow class="print-only" @text="$data.term.label"></eyebrow>
|
|
24
|
+
<h1 class="print-only"><span @text="course.code"></span>: <span @text="course.name"></span></h1>
|
|
25
|
+
<p class="lede" @text="course.description"></p>
|
|
26
|
+
<p webc:if="course.prerequisites?.length">
|
|
27
|
+
<strong @text="copy.prerequisites"></strong>
|
|
28
|
+
<span @text="course.prerequisites.join(', ')"></span><span webc:if="course.prerequisiteNote">, <span @text="course.prerequisiteNote"></span></span>
|
|
29
|
+
</p>
|
|
30
|
+
</header>
|
|
31
|
+
|
|
32
|
+
<section id="approach" aria-labelledby="approach-heading" webc:if="course.approach">
|
|
33
|
+
<h2 id="approach-heading" @text="copy.howThisSectionIs"></h2>
|
|
34
|
+
<p @text="course.approach"></p>
|
|
35
|
+
</section>
|
|
36
|
+
|
|
37
|
+
<instructor></instructor>
|
|
38
|
+
|
|
39
|
+
<syllabus></syllabus>
|
|
40
|
+
|
|
41
|
+
<section id="schedule" aria-labelledby="schedule-heading">
|
|
42
|
+
<h2 id="schedule-heading" @text="copy.scheduleClassResources"></h2>
|
|
43
|
+
<p>
|
|
44
|
+
<span @text="copy.thisIsAProposed"></span>
|
|
45
|
+
<span @text="copy.eachWeekListsWhatTo"></span>
|
|
46
|
+
<span webc:if="$data.grading?.homework" @text="fill(copy.allAssignmentsWillBe, { lms: $data.site.lms })"></span>
|
|
47
|
+
<span webc:if="$data.grading?.project" @raw="projectDue()"></span>
|
|
48
|
+
<span webc:if="$data.grading?.final && !$data.schedule?.finalExam" @text="fill(copy.theFinalExamFalls, { period: $data.term.finalExamsDisplay })"></span>
|
|
49
|
+
<span webc:if="$data.grading?.final && $data.schedule?.finalExam" @raw="finalExamLine()"></span>
|
|
50
|
+
</p>
|
|
51
|
+
<div class="print-only">
|
|
52
|
+
<p>
|
|
53
|
+
<span @text="fill(copy.thisDocumentOmitsTheWeekbyweek, { live: $data.site?.url ? fill(copy.theLiveScheduleIsPublished, { url: `${$data.site.url}${$data.page.url}#schedule` }) : '' })"></span>
|
|
54
|
+
<span webc:if="$data.grading?.project" @text="fill(copy.projectDueShort, { when: projectWhen() })"></span>
|
|
55
|
+
</p>
|
|
56
|
+
</div>
|
|
57
|
+
<schedule-weeks></schedule-weeks>
|
|
58
|
+
</section>
|
|
59
|
+
</article>
|
|
60
|
+
|
|
61
|
+
<style webc:scoped>
|
|
62
|
+
/* The wide column, laid out as a grid so the catalog copy and the
|
|
63
|
+
teaching approach sit beside the instructor panel; the syllabus and
|
|
64
|
+
the schedule then take the full width. Nothing is wrapped, so
|
|
65
|
+
print.css's id and class hooks are untouched; print falls back to a
|
|
66
|
+
plain block flow. */
|
|
67
|
+
:host {
|
|
68
|
+
display: grid;
|
|
69
|
+
grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
|
|
70
|
+
column-gap: calc(var(--section-space) * 1.5);
|
|
71
|
+
row-gap: var(--content-space);
|
|
72
|
+
align-items: start;
|
|
73
|
+
|
|
74
|
+
@media screen and (width <= 900px) {
|
|
75
|
+
grid-template-columns: minmax(0, 1fr);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media print {
|
|
79
|
+
display: block;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host > * {
|
|
84
|
+
min-inline-size: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:host > .course-header {
|
|
88
|
+
grid-column: 1;
|
|
89
|
+
margin-block-end: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host > #approach {
|
|
93
|
+
grid-column: 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:host > #instructor {
|
|
97
|
+
grid-column: 2;
|
|
98
|
+
grid-row: 1 / span 2;
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
padding: calc(var(--content-space) * 1.2);
|
|
101
|
+
background-color: var(--color-surface);
|
|
102
|
+
border: var(--thin-border-width) solid var(--color-border);
|
|
103
|
+
border-radius: var(--standard-border-radius);
|
|
104
|
+
|
|
105
|
+
@media screen and (width <= 900px) {
|
|
106
|
+
grid-column: 1;
|
|
107
|
+
grid-row: auto;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@media print {
|
|
111
|
+
padding: 0;
|
|
112
|
+
background: none;
|
|
113
|
+
border: none;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:host > #syllabus,
|
|
118
|
+
:host > #schedule {
|
|
119
|
+
grid-column: 1 / -1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host > #schedule {
|
|
123
|
+
margin-block-start: var(--section-space);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@media screen {
|
|
127
|
+
:host > .course-header .lede,
|
|
128
|
+
:host > #approach p {
|
|
129
|
+
max-inline-size: 70ch;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host > #schedule > p {
|
|
133
|
+
max-inline-size: 90ch;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
</style>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* The weeks that had a demo, one row per meeting: its demos, then its deck.
|
|
4
|
+
* @prop {object[]} [weeks] `demoWeeks` output; built from the page's demos,
|
|
5
|
+
* lessons and decks when left out
|
|
6
|
+
*/
|
|
7
|
+
const defaultWeeks = demoWeeks($data.demos, $data.lessons, $data.collections?.deck);
|
|
8
|
+
</script>
|
|
9
|
+
<div webc:root="override" class="demo-weeks" data-today-host="meetings" webc:if="(weeks ?? defaultWeeks)?.length">
|
|
10
|
+
<today-marker></today-marker>
|
|
11
|
+
<week-block webc:for="week of (weeks ?? defaultWeeks)" :@number="week.week" :@label="fill($data.copy.schedule.weekHeading, { week: week.week })" :@dates="week.dates" @level="2">
|
|
12
|
+
<ol class="meetings" role="list">
|
|
13
|
+
<meeting-card webc:for="meeting of week.meetings" :@meeting="meeting">
|
|
14
|
+
<a slot="when" class="lesson" webc:if="$data.audience.instructor" :href="`/lessons/week-${meeting.week}/day-${meeting.day}/`" @text="$data.copy.demoWeeks.lessonPlan"></a>
|
|
15
|
+
<ul class="demos" role="list">
|
|
16
|
+
<li class="demo" webc:for="demo of meeting.demos">
|
|
17
|
+
<p class="demo-title"><arrow-link :href="demo.url"><span @text="demo.title"></span></arrow-link></p>
|
|
18
|
+
<p class="repeat" webc:if="demo.firstShown" @text="fill($data.copy.demoWeeks.shownAgainFirstUsed, { date: demo.firstShown })"></p>
|
|
19
|
+
<template webc:nokeep webc:if="!demo.firstShown">
|
|
20
|
+
<p class="description" webc:if="demo.description" @text="demo.description"></p>
|
|
21
|
+
<p class="meta">
|
|
22
|
+
<a :href="demo.download" download @text="$data.copy.demoWeeks.downloadTheHtmlFile"></a>
|
|
23
|
+
<span webc:if="demo.alsoOn?.length" @text="fill($data.copy.demoWeeks.usedAgain, { dates: demo.alsoOn.join(', ') })"></span>
|
|
24
|
+
</p>
|
|
25
|
+
</template>
|
|
26
|
+
</li>
|
|
27
|
+
</ul>
|
|
28
|
+
<meeting-decks :@meeting="meeting" :@slides-label="$data.copy.schedule.slides" :@addendum-label="$data.copy.schedule.addendum"></meeting-decks>
|
|
29
|
+
</meeting-card>
|
|
30
|
+
</ol>
|
|
31
|
+
</week-block>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<style webc:scoped>
|
|
35
|
+
/* The schedule's shape, kept to the weeks that had a demo: one row per
|
|
36
|
+
meeting with the date down the left and that day's demos beside it, the
|
|
37
|
+
deck link last so it sits in the same place on every row. */
|
|
38
|
+
:host {
|
|
39
|
+
display: grid;
|
|
40
|
+
gap: var(--content-space);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.meetings,
|
|
44
|
+
.demos {
|
|
45
|
+
list-style: none;
|
|
46
|
+
margin: 0;
|
|
47
|
+
padding: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.lesson,
|
|
51
|
+
.description,
|
|
52
|
+
.repeat,
|
|
53
|
+
.meta {
|
|
54
|
+
color: var(--color-text-muted);
|
|
55
|
+
font-size: max(var(--base-font-size), 0.9em);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Each link is an operable target: 44px tall (WCAG 2.5.5), so the rows carry the spacing. */
|
|
59
|
+
.lesson,
|
|
60
|
+
.demo-title a,
|
|
61
|
+
.meta a {
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
min-block-size: var(--target-min);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.demo + .demo {
|
|
68
|
+
margin-block-start: 0.25em;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.demo p {
|
|
72
|
+
margin: 0;
|
|
73
|
+
max-inline-size: 70ch;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.demo-title {
|
|
77
|
+
font-size: max(var(--base-font-size), 1.05em);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.description,
|
|
81
|
+
.repeat {
|
|
82
|
+
margin-block-start: 0.15em;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.meta {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-wrap: wrap;
|
|
88
|
+
gap: 0.25em 1em;
|
|
89
|
+
margin-block-start: 0.25em;
|
|
90
|
+
}
|
|
91
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* One glossary term as a `<dt>`/`<dd>` pair: the term, its definition, an
|
|
4
|
+
* optional signature, meta line and example, its tags, and where it was
|
|
5
|
+
* taught. Styled by `<glossary-panel>`, which holds the list.
|
|
6
|
+
* @prop {object} entry a term from `buildGlossary`
|
|
7
|
+
*/
|
|
8
|
+
</script>
|
|
9
|
+
<div webc:root="override" class="entry">
|
|
10
|
+
<dt>
|
|
11
|
+
<span class="term" @raw="entry.term"></span>
|
|
12
|
+
<span class="api-group" webc:if="entry.group" @text="entry.group"></span>
|
|
13
|
+
</dt>
|
|
14
|
+
<dd>
|
|
15
|
+
<p class="sig" webc:if="entry.sig" @raw="entry.sig"></p>
|
|
16
|
+
<p class="definition" @raw="entry.definition"></p>
|
|
17
|
+
<p class="meta" webc:if="entry.meta" @raw="entry.meta"></p>
|
|
18
|
+
<p class="example" webc:if="entry.example"><span class="label" @text="$data.copy.glossary.example"></span> <span @raw="entry.example"></span></p>
|
|
19
|
+
<ul class="tags" role="list">
|
|
20
|
+
<li webc:for="tag of entry.tags.test" data-kind="test" @text="tag.label"></li>
|
|
21
|
+
<li webc:for="tag of entry.tags.chapter" data-kind="chapter" @text="tag.label"></li>
|
|
22
|
+
<li webc:for="tag of entry.tags.meeting" data-kind="meeting" @text="tag.label"></li>
|
|
23
|
+
<li webc:for="tag of entry.tags.topic" data-kind="topic" @text="tag.label"></li>
|
|
24
|
+
</ul>
|
|
25
|
+
<p class="links">
|
|
26
|
+
<span class="label" webc:if="entry.taught?.length || entry.ref" @text="$data.copy.glossary.taughtIn"></span>
|
|
27
|
+
<a webc:for="place of entry.taught" :href="place.href"><span @text="fill($data.copy.glossary.slideRef, { week: place.week, weekday: place.weekday, slide: place.slide })"></span></a>
|
|
28
|
+
<a webc:if="entry.ref" :href="entry.ref.href" @text="entry.ref.label"></a>
|
|
29
|
+
</p>
|
|
30
|
+
</dd>
|
|
31
|
+
</div>
|