@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,45 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* The course glossary page: every `vocab` and `api` slide as one tagged
|
|
4
|
+
* term, listed A to Z and enhanced into
|
|
5
|
+
* Review and Flashcards by `<glossary-panel>`.
|
|
6
|
+
* Reads the `glossary` global.
|
|
7
|
+
*/
|
|
8
|
+
</script>
|
|
9
|
+
<article class="content-column glossary" id="glossary" webc:if="$data.glossary?.terms?.length">
|
|
10
|
+
<header>
|
|
11
|
+
<eyebrow class="separators">
|
|
12
|
+
<span @text="$data.term.label"></span>
|
|
13
|
+
<span @text="$data.course.code"></span>
|
|
14
|
+
<span @text="$data.copy.glossary.glossary"></span>
|
|
15
|
+
</eyebrow>
|
|
16
|
+
<h1 @text="$data.copy.glossary.courseGlossary"></h1>
|
|
17
|
+
<p class="intro">
|
|
18
|
+
<strong @text="$data.glossary.terms.length"></strong>
|
|
19
|
+
<span @text="fill($data.copy.glossary.termsFromClassEach, { reading: $data.glossary.readingLabel.toLowerCase() })"></span>
|
|
20
|
+
</p>
|
|
21
|
+
</header>
|
|
22
|
+
|
|
23
|
+
<glossary-panel :@json="$data.glossary.json">
|
|
24
|
+
<div data-static>
|
|
25
|
+
<section class="group" webc:for="group of $data.glossary.az" :id="`g-az-${group.key}`" :aria-labelledby="`g-az-${group.key}-h`">
|
|
26
|
+
<h2 class="heading" :id="`g-az-${group.key}-h`">
|
|
27
|
+
<span class="name" @text="group.label"></span>
|
|
28
|
+
<span class="aside">
|
|
29
|
+
<span class="count" @text="fill(plural($data.copy.glossary, 'terms', group.terms.length, $data.site.language), { count: group.terms.length })"></span>
|
|
30
|
+
</span>
|
|
31
|
+
</h2>
|
|
32
|
+
<dl>
|
|
33
|
+
<glossary-entry webc:for="item of group.terms" :@entry="item"></glossary-entry>
|
|
34
|
+
</dl>
|
|
35
|
+
</section>
|
|
36
|
+
</div>
|
|
37
|
+
</glossary-panel>
|
|
38
|
+
</article>
|
|
39
|
+
|
|
40
|
+
<style webc:scoped>
|
|
41
|
+
.intro {
|
|
42
|
+
color: var(--color-text-muted);
|
|
43
|
+
margin-block: 0;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* The grade-weighting table and the grading scale. Reads the `grading` and
|
|
4
|
+
* `scale` data; it takes no props and renders nothing without `grading`.
|
|
5
|
+
*/
|
|
6
|
+
</script>
|
|
7
|
+
<div webc:root="override" webc:if="$data.grading">
|
|
8
|
+
<table>
|
|
9
|
+
<caption @text="$data.copy.grading.gradeWeighting"></caption>
|
|
10
|
+
<thead>
|
|
11
|
+
<tr><th scope="col" @text="$data.copy.grading.category"></th><th scope="col" @text="$data.copy.grading.weight"></th></tr>
|
|
12
|
+
</thead>
|
|
13
|
+
<tbody>
|
|
14
|
+
<tr webc:for="entry of Object.entries($data.grading).filter(([key]) => key !== '$schema')">
|
|
15
|
+
<td @text="entry[1].title"></td>
|
|
16
|
+
<td @text="entry[1].weight"></td>
|
|
17
|
+
</tr>
|
|
18
|
+
</tbody>
|
|
19
|
+
</table>
|
|
20
|
+
<table>
|
|
21
|
+
<caption @text="$data.copy.grading.gradingScale"></caption>
|
|
22
|
+
<thead>
|
|
23
|
+
<tr><th scope="col" @text="$data.copy.grading.grade"></th><th scope="col" @text="$data.copy.grading.weightedAverage"></th></tr>
|
|
24
|
+
</thead>
|
|
25
|
+
<tbody>
|
|
26
|
+
<tr webc:for="band of Object.entries($data.scale ?? {}).filter(([key]) => key !== '$schema')">
|
|
27
|
+
<td @text="band[0]"></td>
|
|
28
|
+
<td>
|
|
29
|
+
<span webc:if="band[1].min != null" @text="fill($data.copy.grading.andAbove, { min: band[1].min })"></span>
|
|
30
|
+
<span webc:else @text="fill($data.copy.grading.below, { max: band[1].max })"></span>
|
|
31
|
+
</td>
|
|
32
|
+
</tr>
|
|
33
|
+
</tbody>
|
|
34
|
+
</table>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<style webc:scoped>
|
|
38
|
+
:host {
|
|
39
|
+
display: grid;
|
|
40
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 18em), 1fr));
|
|
41
|
+
gap: calc(var(--content-space, 1rem) * 2);
|
|
42
|
+
align-items: start;
|
|
43
|
+
|
|
44
|
+
caption {
|
|
45
|
+
text-align: start;
|
|
46
|
+
font-weight: var(--font-weight--semi-bold);
|
|
47
|
+
padding-block-end: calc(var(--content-space, 1rem) / 2);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* The instructor's details: photo, office, contact and hours. Reads `instructor`.
|
|
4
|
+
* @prop {'card'} [variant] a compact card instead of the full section
|
|
5
|
+
*/
|
|
6
|
+
</script>
|
|
7
|
+
<section id="instructor" aria-labelledby="instructor-heading" webc:root="override" webc:if="$data.instructor">
|
|
8
|
+
<template webc:nokeep webc:if="variant !== 'card'">
|
|
9
|
+
<div class="who">
|
|
10
|
+
<img class="photo screen-only" webc:if="$data.instructor.photo" :src="$data.instructor.photo" :alt="$data.instructor.name" width="160" height="160">
|
|
11
|
+
<div class="facts-column">
|
|
12
|
+
<h2 id="instructor-heading" @text="$data.copy.instructor.yourInstructor"></h2>
|
|
13
|
+
<dl class="facts">
|
|
14
|
+
<div class="name">
|
|
15
|
+
<dt class="sr-only" @text="$data.copy.instructor.name"></dt>
|
|
16
|
+
<dd><strong><span webc:if="!$data.instructor.profile" @text="$data.instructor.name"></span><a
|
|
17
|
+
webc:if="$data.instructor.profile" :href="$data.instructor.profile" @text="$data.instructor.name"></a></strong></dd>
|
|
18
|
+
</div>
|
|
19
|
+
<div webc:if="$data.instructor.office">
|
|
20
|
+
<dt @text="$data.copy.instructor.office"></dt>
|
|
21
|
+
<dd @text="$data.instructor.office"></dd>
|
|
22
|
+
</div>
|
|
23
|
+
<div webc:if="$data.instructor.hours?.length">
|
|
24
|
+
<dt @text="$data.copy.instructor.officeHours"></dt>
|
|
25
|
+
<dd>
|
|
26
|
+
<ul role="list">
|
|
27
|
+
<li webc:for="block of $data.instructor.hours" @text="block"></li>
|
|
28
|
+
</ul>
|
|
29
|
+
</dd>
|
|
30
|
+
</div>
|
|
31
|
+
<div webc:if="$data.instructor.email" :class="$data.instructor.contact ? 'print-only' : ''">
|
|
32
|
+
<dt @text="$data.copy.instructor.email"></dt>
|
|
33
|
+
<dd><a :data-email="encodeEmail($data.instructor.email)"></a></dd>
|
|
34
|
+
</div>
|
|
35
|
+
<div webc:if="$data.instructor.contact" :class="$data.instructor.email ? 'screen-only' : ''">
|
|
36
|
+
<dt @text="$data.copy.instructor.message"></dt>
|
|
37
|
+
<dd><a :href="$data.instructor.contact" @text="$data.copy.instructor.sendMeAMessage"></a></dd>
|
|
38
|
+
</div>
|
|
39
|
+
<div webc:if="$data.instructor.blog">
|
|
40
|
+
<dt @text="$data.copy.instructor.blog"></dt>
|
|
41
|
+
<dd><a :href="$data.instructor.blog" @text="$data.instructor.blog.replace(/^https?:\/\//, '').replace(/\/$/, '')"></a></dd>
|
|
42
|
+
</div>
|
|
43
|
+
</dl>
|
|
44
|
+
<p class="muted note" webc:if="$data.instructor.note" @text="$data.instructor.note"></p>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<template webc:nokeep webc:if="variant === 'card'">
|
|
50
|
+
<div class="instructor-card">
|
|
51
|
+
<img class="photo" webc:if="$data.instructor.photo" :src="$data.instructor.photo" :alt="$data.instructor.name" width="160" height="160">
|
|
52
|
+
<p class="monogram" aria-hidden="true" webc:if="!$data.instructor.photo" @text="$data.instructor.name.split(' ').filter(Boolean).map((part) => part[0]).join('')"></p>
|
|
53
|
+
<div>
|
|
54
|
+
<h2 id="instructor-heading" class="instructor-name"><span
|
|
55
|
+
webc:if="!$data.instructor.profile" @text="$data.instructor.name"></span><a
|
|
56
|
+
webc:if="$data.instructor.profile" :href="$data.instructor.profile" @text="$data.instructor.name"></a></h2>
|
|
57
|
+
<p class="instructor-meta separators">
|
|
58
|
+
<span @text="$data.copy.instructor.instructor"></span>
|
|
59
|
+
<span webc:if="$data.instructor.office" @text="$data.instructor.office"></span>
|
|
60
|
+
<span webc:if="$data.instructor.hours?.length" @text="$data.instructor.hours.join('; ')"></span>
|
|
61
|
+
</p>
|
|
62
|
+
<p class="instructor-contact" webc:if="$data.instructor.contact || $data.instructor.email || $data.instructor.blog">
|
|
63
|
+
<a webc:if="$data.instructor.contact" :href="$data.instructor.contact" :class="$data.instructor.email ? 'cta screen-only' : 'cta'" @text="$data.copy.instructor.sendMeAMessage"></a>
|
|
64
|
+
<a webc:if="$data.instructor.email" :data-email="encodeEmail($data.instructor.email)" :class="$data.instructor.contact ? 'print-only' : ''"></a>
|
|
65
|
+
<a webc:if="$data.instructor.blog" class="cta" :href="$data.instructor.blog" @text="$data.instructor.blog.replace(/^https?:\/\//, '').replace(/\/$/, '')"></a>
|
|
66
|
+
</p>
|
|
67
|
+
<p class="muted note" @text="$data.instructor.note" webc:if="$data.instructor.note"></p>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</template>
|
|
71
|
+
</section>
|
|
72
|
+
|
|
73
|
+
<style webc:scoped>
|
|
74
|
+
/* Default variant: the headshot beside a small labelled fact list — name,
|
|
75
|
+
office, hours, email, blog, rather than a sentence, so each fact has a
|
|
76
|
+
place a student can scan to. print.css collapses the same dl to one
|
|
77
|
+
run-in line (its `#instructor dl` rules), so the markup serves both. */
|
|
78
|
+
:host .who {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: flex-start;
|
|
81
|
+
gap: calc(var(--content-space) * 1.1);
|
|
82
|
+
|
|
83
|
+
@media print {
|
|
84
|
+
display: block;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host .facts-column {
|
|
89
|
+
min-inline-size: 0;
|
|
90
|
+
flex: 1 1 auto;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:host .facts-column h2 {
|
|
94
|
+
margin-block: 0 0.35em;
|
|
95
|
+
font-size: var(--font-size-6);
|
|
96
|
+
font-weight: var(--font-weight--semi-bold);
|
|
97
|
+
letter-spacing: 0.08em;
|
|
98
|
+
text-transform: uppercase;
|
|
99
|
+
color: var(--color-text-muted);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:host .facts {
|
|
103
|
+
display: grid;
|
|
104
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
105
|
+
column-gap: var(--content-space);
|
|
106
|
+
row-gap: 0.3em;
|
|
107
|
+
margin: 0;
|
|
108
|
+
|
|
109
|
+
> div {
|
|
110
|
+
display: contents;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* `display: contents` outranks the utility classes, so restate them
|
|
114
|
+
for rows that appear on one medium only. */
|
|
115
|
+
> div.print-only {
|
|
116
|
+
display: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
dt {
|
|
120
|
+
color: var(--color-text-muted);
|
|
121
|
+
font-size: var(--font-size-6);
|
|
122
|
+
letter-spacing: 0.05em;
|
|
123
|
+
text-transform: uppercase;
|
|
124
|
+
line-height: var(--font-height);
|
|
125
|
+
padding-block-start: 0.15em;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
dd {
|
|
129
|
+
margin: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
ul {
|
|
133
|
+
list-style: none;
|
|
134
|
+
margin: 0;
|
|
135
|
+
padding: 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.name dd {
|
|
139
|
+
grid-column: 1 / -1;
|
|
140
|
+
font-size: var(--font-size-4);
|
|
141
|
+
line-height: var(--font-height--dense);
|
|
142
|
+
margin-block-end: 0.35em;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@media print {
|
|
146
|
+
display: inline;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
:host .note {
|
|
151
|
+
margin-block: 0.75em 0;
|
|
152
|
+
font-size: max(var(--base-font-size), 0.9em);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:host .photo {
|
|
156
|
+
flex: none;
|
|
157
|
+
inline-size: 5.5em;
|
|
158
|
+
block-size: 5.5em;
|
|
159
|
+
border-radius: var(--circle-border-radius);
|
|
160
|
+
object-fit: cover;
|
|
161
|
+
border: var(--thin-border-width) solid var(--color-border);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host .instructor-contact {
|
|
165
|
+
margin-block: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:host .instructor-card {
|
|
169
|
+
display: flex;
|
|
170
|
+
align-items: flex-start;
|
|
171
|
+
gap: var(--content-space);
|
|
172
|
+
max-inline-size: min(60ch, 100%);
|
|
173
|
+
margin-inline: auto;
|
|
174
|
+
padding: calc(var(--content-space) * 1.2);
|
|
175
|
+
|
|
176
|
+
background-color: var(--color-surface);
|
|
177
|
+
border: var(--thin-border-width) solid var(--color-border);
|
|
178
|
+
border-radius: var(--standard-border-radius);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:host .instructor-card .photo {
|
|
182
|
+
inline-size: 4em;
|
|
183
|
+
block-size: 4em;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Initials rather than a photograph: it identifies the card at a glance
|
|
187
|
+
without another asset to keep current. Decorative — the name is right
|
|
188
|
+
beside it, so it stays out of the accessibility tree. */
|
|
189
|
+
:host .monogram {
|
|
190
|
+
flex: none;
|
|
191
|
+
display: grid;
|
|
192
|
+
place-items: center;
|
|
193
|
+
inline-size: 2.75em;
|
|
194
|
+
block-size: 2.75em;
|
|
195
|
+
margin: 0;
|
|
196
|
+
|
|
197
|
+
background-color: var(--color-surface-accent);
|
|
198
|
+
border-radius: 50%;
|
|
199
|
+
color: var(--color-accent-text);
|
|
200
|
+
font-weight: var(--font-weight--semi-bold);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
:host .instructor-name {
|
|
204
|
+
margin-block: 0 0.15em;
|
|
205
|
+
font-size: max(var(--base-font-size), 1.15em);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
:host .instructor-meta {
|
|
209
|
+
margin-block: 0 0.75em;
|
|
210
|
+
color: var(--color-text-muted);
|
|
211
|
+
font-size: max(var(--base-font-size), 0.92em);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
:host .cta {
|
|
215
|
+
color: var(--color-link);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* The address is an operable target: 44px tall (WCAG 2.5.5). */
|
|
219
|
+
:host a[data-email] {
|
|
220
|
+
display: inline-flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
min-block-size: var(--target-min);
|
|
223
|
+
/* The address breaks at its <wbr>s; this is the last resort for one unbreakable token. */
|
|
224
|
+
overflow-wrap: anywhere;
|
|
225
|
+
min-inline-size: 0;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* On a phone the card and the fact list stack, and their children may shrink below their content. */
|
|
229
|
+
:host .instructor-card > *,
|
|
230
|
+
:host .who > * {
|
|
231
|
+
min-inline-size: 0;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
@media screen and (width < 30em) {
|
|
235
|
+
:host .instructor-card,
|
|
236
|
+
:host .who {
|
|
237
|
+
flex-direction: column;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:host .facts {
|
|
241
|
+
grid-template-columns: minmax(0, 1fr);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:host .facts dt {
|
|
245
|
+
padding-block-start: 0.4em;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/* print.css collapses the facts to one inline run by id selector; match
|
|
250
|
+
its specificity to drop a screen-only row. */
|
|
251
|
+
@media print {
|
|
252
|
+
:host#instructor .facts > div.screen-only {
|
|
253
|
+
display: none;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
</style>
|
|
257
|
+
|
|
258
|
+
<script>
|
|
259
|
+
for (const link of document.querySelectorAll("a[data-email]")) {
|
|
260
|
+
const email = atob(link.dataset.email);
|
|
261
|
+
link.href = `mailto:${email}`;
|
|
262
|
+
// Break opportunities before "@" and after each ".": a narrow screen wraps the address there, not mid-word.
|
|
263
|
+
link.textContent = "";
|
|
264
|
+
email.split(/(?=@)|(?<=\.)/).forEach((part, index) => {
|
|
265
|
+
if (index) link.append(document.createElement("wbr"));
|
|
266
|
+
link.append(part);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
</script>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
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`.
|
|
5
|
+
*/
|
|
6
|
+
const navItems = (() => {
|
|
7
|
+
const items = eleventyNavigation($data.collections.all);
|
|
8
|
+
const home = items.find((item) => item.url === "/");
|
|
9
|
+
const rest = items.filter((item) => item.url !== "/");
|
|
10
|
+
return [...(home ? [home] : []), { url: "/#syllabus", title: $data.copy.nav.syllabus }, ...rest.filter((item) => item.menu !== false)];
|
|
11
|
+
})();
|
|
12
|
+
</script>
|
|
13
|
+
<header webc:root="override" id="header">
|
|
14
|
+
<div class="container">
|
|
15
|
+
<div class="identity">
|
|
16
|
+
<eyebrow class="separators">
|
|
17
|
+
<span @text="$data.site.institution"></span>
|
|
18
|
+
<span @text="$data.term.label"></span>
|
|
19
|
+
</eyebrow>
|
|
20
|
+
<h1 class="course-title" webc:if="$data.page.url === '/'">
|
|
21
|
+
<a href="/" aria-current="page"><span class="code" @text="$data.course.code"></span> <span class="name" @text="$data.course.name"></span></a>
|
|
22
|
+
</h1>
|
|
23
|
+
<p class="course-title" webc:else>
|
|
24
|
+
<a href="/"><span class="code" @text="$data.course.code"></span> <span class="name" @text="$data.course.name"></span></a>
|
|
25
|
+
</p>
|
|
26
|
+
<p class="meta separators" webc:if="$data.schedule?.meetings?.days?.length">
|
|
27
|
+
<span @text="$data.schedule.meetings.days.length > 1 ? `${$data.schedule.meetings.days.slice(0, -1).join(', ')} & ${$data.schedule.meetings.days.at(-1)}` : $data.schedule.meetings.days[0]"></span>
|
|
28
|
+
<span webc:if="$data.schedule.meetings.time" @text="$data.schedule.meetings.time"></span>
|
|
29
|
+
<span webc:if="$data.instructor?.office" @text="$data.instructor.office"></span>
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="links">
|
|
33
|
+
<nav-links column :aria-label="$data.copy.nav.site" @context="hero" :@navigation="navItems"></nav-links>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</header>
|
|
37
|
+
|
|
38
|
+
<style webc:scoped>
|
|
39
|
+
/* A hero, not a bar: the course identity at full size on the left, the
|
|
40
|
+
site's internal links stacked on the right. It scrolls away with the
|
|
41
|
+
page — nothing is sticky — so anchor targets need no offset. */
|
|
42
|
+
:host {
|
|
43
|
+
/* base.css's `body > header { grid-column: 1 / -1; }` is what keeps
|
|
44
|
+
this full-bleed; everything else about the plain banner treatment is
|
|
45
|
+
overridden here. */
|
|
46
|
+
text-align: start;
|
|
47
|
+
padding: 0;
|
|
48
|
+
|
|
49
|
+
/* A soft wash of the course accent that has faded fully into the page
|
|
50
|
+
surface by the bottom edge, so the band needs no closing rule. */
|
|
51
|
+
background: linear-gradient(
|
|
52
|
+
to bottom,
|
|
53
|
+
color-mix(in sRGB, var(--color-accent) 7%, var(--color-page)),
|
|
54
|
+
var(--color-page)
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
@media print {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
> .container {
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
/* Match the content column (`--page-column`, set on body). */
|
|
64
|
+
inline-size: var(--page-column);
|
|
65
|
+
margin-inline: auto;
|
|
66
|
+
margin-block: 0;
|
|
67
|
+
padding-inline: 0;
|
|
68
|
+
padding-block: calc(var(--section-space) * 1.25) var(--section-space);
|
|
69
|
+
|
|
70
|
+
display: grid;
|
|
71
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
72
|
+
column-gap: calc(var(--section-space) * 2);
|
|
73
|
+
row-gap: var(--content-space);
|
|
74
|
+
align-items: start;
|
|
75
|
+
|
|
76
|
+
@media screen and (width <= 768px) {
|
|
77
|
+
grid-template-columns: minmax(0, 1fr);
|
|
78
|
+
padding-block: var(--section-space) calc(var(--section-space) * 0.75);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.identity {
|
|
83
|
+
display: grid;
|
|
84
|
+
gap: calc(var(--content-space) * 0.6);
|
|
85
|
+
|
|
86
|
+
> * {
|
|
87
|
+
margin: 0;
|
|
88
|
+
max-inline-size: none;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.course-title {
|
|
93
|
+
margin: 0;
|
|
94
|
+
max-inline-size: none;
|
|
95
|
+
font-family: var(--display-font);
|
|
96
|
+
font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.75rem);
|
|
97
|
+
font-weight: var(--font-weight--semi-bold);
|
|
98
|
+
line-height: 1.1;
|
|
99
|
+
letter-spacing: -0.01em;
|
|
100
|
+
text-wrap: balance;
|
|
101
|
+
|
|
102
|
+
a {
|
|
103
|
+
color: var(--color-text);
|
|
104
|
+
text-decoration: none;
|
|
105
|
+
|
|
106
|
+
&:is(:hover, :focus-visible) .name {
|
|
107
|
+
text-decoration: underline;
|
|
108
|
+
text-decoration-thickness: 0.06em;
|
|
109
|
+
text-underline-offset: 0.12em;
|
|
110
|
+
text-decoration-color: var(--color-accent);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.code {
|
|
115
|
+
display: block;
|
|
116
|
+
font-size: 0.5em;
|
|
117
|
+
font-weight: var(--font-weight--semi-bold);
|
|
118
|
+
letter-spacing: 0.06em;
|
|
119
|
+
color: var(--color-accent-text);
|
|
120
|
+
margin-block-end: 0.2em;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.meta {
|
|
125
|
+
margin: 0;
|
|
126
|
+
color: var(--color-text-muted);
|
|
127
|
+
font-size: max(var(--base-font-size), 0.95em);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.links {
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: start;
|
|
133
|
+
gap: calc(var(--content-space) * 1.5);
|
|
134
|
+
padding-inline-start: calc(var(--section-space) * 1.25);
|
|
135
|
+
border-inline-start: var(--thin-border-width) solid var(--color-border);
|
|
136
|
+
|
|
137
|
+
@media screen and (width <= 768px) {
|
|
138
|
+
inline-size: 100%;
|
|
139
|
+
justify-content: space-between;
|
|
140
|
+
padding-inline-start: 0;
|
|
141
|
+
padding-block-start: var(--content-space);
|
|
142
|
+
border-inline-start: none;
|
|
143
|
+
border-block-start: var(--thin-border-width) solid var(--color-border);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
</style>
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
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
|
+
* 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
|
+
* @prop {{ url: string, title: string }[]} navigation pages from `eleventyNavigation`
|
|
6
|
+
* @prop {'footer' | 'hero'} [context] adds the instructor's contact link in the footer and the hero
|
|
7
|
+
*/
|
|
8
|
+
</script>
|
|
9
|
+
<nav webc:root="override" :data-context="context">
|
|
10
|
+
<ul role="list" webc:if="navigation?.length">
|
|
11
|
+
<li webc:for="item of navigation">
|
|
12
|
+
<a :href="item?.url" @attributes="({ 'aria-current': item?.url === $data?.page?.url ? 'page' : undefined })" @text="item?.title"></a>
|
|
13
|
+
</li>
|
|
14
|
+
<li webc:if="$data.instructor?.contact && (context === 'footer' || context === 'hero')"><a :href="$data.instructor.contact" @text="$data.copy.nav.contact"></a></li>
|
|
15
|
+
</ul>
|
|
16
|
+
<slot webc:if="!navigation?.length"></slot>
|
|
17
|
+
</nav>
|
|
18
|
+
<style webc:scoped>
|
|
19
|
+
:host:not(:has(li)) {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host {
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: calc(var(--container-space) * 3.5);
|
|
26
|
+
|
|
27
|
+
ul {
|
|
28
|
+
list-style: none;
|
|
29
|
+
margin: 0;
|
|
30
|
+
padding: 0;
|
|
31
|
+
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
justify-content: space-evenly;
|
|
35
|
+
inline-size: 100%;
|
|
36
|
+
gap: calc(var(--content-space) * 1.6);
|
|
37
|
+
|
|
38
|
+
@media screen and (width <= 612px) {
|
|
39
|
+
justify-content: flex-start;
|
|
40
|
+
column-gap: calc(var(--content-space) * 0.75);
|
|
41
|
+
row-gap: calc(var(--content-space) * 0.25);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
li {
|
|
46
|
+
font-size: 1em;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* `a[href]` outranks the page's underline for links in lists. A menu is
|
|
50
|
+
not a sentence: it carries no underline until you point at it, and the
|
|
51
|
+
current page keeps an accent one. */
|
|
52
|
+
a[href] {
|
|
53
|
+
/* Inline padding is left alone; the block padding lifts each link to
|
|
54
|
+
the 24px minimum target size without changing the row rhythm. */
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
min-block-size: var(--target-min);
|
|
58
|
+
min-inline-size: var(--target-min);
|
|
59
|
+
padding-block: 0.2em;
|
|
60
|
+
font-size: max(var(--base-font-size), 0.95em);
|
|
61
|
+
color: inherit;
|
|
62
|
+
text-decoration: none;
|
|
63
|
+
|
|
64
|
+
/* The current page keeps an underline here; the hero menu fills it (below). */
|
|
65
|
+
&[aria-current="page"] {
|
|
66
|
+
text-decoration: underline;
|
|
67
|
+
text-decoration-color: var(--color-accent-text);
|
|
68
|
+
text-decoration-thickness: var(--border-width);
|
|
69
|
+
text-underline-offset: 0.4ex;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&:not([aria-current="page"]):is(:hover, :focus-visible) {
|
|
73
|
+
color: var(--color-link-hover);
|
|
74
|
+
text-decoration: underline;
|
|
75
|
+
text-decoration-thickness: var(--thin-border-width);
|
|
76
|
+
text-underline-offset: 0.4ex;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@media screen and (width <= 612px) {
|
|
80
|
+
font-size: max(var(--base-font-size), 0.875em);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Stacked (the footer and the 404 page): one row while the links fit, folding
|
|
86
|
+
to as many rows as it takes when they don't. No breakpoint — the content
|
|
87
|
+
decides, so the same rule holds for three links or a dozen. */
|
|
88
|
+
:host([stacked]) ul {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-wrap: wrap;
|
|
91
|
+
justify-content: start;
|
|
92
|
+
align-items: baseline;
|
|
93
|
+
column-gap: calc(var(--content-space) * 2);
|
|
94
|
+
row-gap: calc(var(--content-space) * 0.35);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Column (the hero's link stack and the footer groups): one link per line,
|
|
98
|
+
folding back into a wrapped row on narrow screens where the column would
|
|
99
|
+
otherwise push the page content down. */
|
|
100
|
+
:host([column]) {
|
|
101
|
+
padding: 0;
|
|
102
|
+
line-height: inherit;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host([column]) ul {
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
align-items: start;
|
|
109
|
+
justify-content: start;
|
|
110
|
+
inline-size: auto;
|
|
111
|
+
gap: calc(var(--content-space) * 0.35);
|
|
112
|
+
|
|
113
|
+
@media screen and (width <= 768px) {
|
|
114
|
+
flex-direction: row;
|
|
115
|
+
flex-wrap: wrap;
|
|
116
|
+
align-items: baseline;
|
|
117
|
+
column-gap: calc(var(--content-space) * 1.25);
|
|
118
|
+
row-gap: calc(var(--content-space) * 0.25);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host([column]) li {
|
|
123
|
+
display: block;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* A stack of plain links, not pills — no border, no background. */
|
|
127
|
+
:host([column]) a,
|
|
128
|
+
:host([column]) a:visited {
|
|
129
|
+
margin: 0;
|
|
130
|
+
padding-inline: var(--link-pad, 0);
|
|
131
|
+
border: none;
|
|
132
|
+
border-radius: 0;
|
|
133
|
+
line-height: inherit;
|
|
134
|
+
font-size: max(var(--base-font-size), 1em);
|
|
135
|
+
color: inherit;
|
|
136
|
+
|
|
137
|
+
&[aria-current="page"] {
|
|
138
|
+
padding-inline: var(--link-pad, 0);
|
|
139
|
+
background: none;
|
|
140
|
+
color: var(--color-accent-text);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* The hero menu: the current page is a filled pill, so it reads as "you are
|
|
145
|
+
here" without relying on an underline. Links are 44px targets. Flat
|
|
146
|
+
selectors: webc:scoped does not rewrite a nested `&` under `:host()`. */
|
|
147
|
+
:host([data-context="hero"][column]) {
|
|
148
|
+
--link-pad: 0.85em;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:host([data-context="hero"][column]) a[href] {
|
|
152
|
+
border-radius: var(--radius-pill);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:host([data-context="hero"][column]) a[href][aria-current="page"] {
|
|
156
|
+
background-color: var(--color-accent-secondary);
|
|
157
|
+
color: var(--color-on-accent-secondary);
|
|
158
|
+
text-decoration: none;
|
|
159
|
+
font-weight: var(--font-weight--semi-bold);
|
|
160
|
+
--color-focus-ring: var(--color-on-accent-secondary);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
:host([data-context="hero"][column]) a[href]:not([aria-current="page"]):hover {
|
|
164
|
+
background-color: color-mix(in oklab, var(--color-accent-secondary) 10%, transparent);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@media (forced-colors: active) {
|
|
168
|
+
:host([data-context="hero"][column]) a[href][aria-current="page"] {
|
|
169
|
+
forced-color-adjust: none;
|
|
170
|
+
background: SelectedItem;
|
|
171
|
+
color: SelectedItemText;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
</style>
|