@wakeful-cloud/slidev-theme-illinois 0.0.0-stage → 0.1.1
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 +45 -0
- package/README.md +592 -2
- package/assets/logos/block-i-blue.svg +54 -0
- package/assets/logos/block-i-full.svg +54 -0
- package/assets/logos/block-i-orange.svg +54 -0
- package/assets/logos/wordmark-blue.svg +94 -0
- package/assets/logos/wordmark-formal-blue.svg +234 -0
- package/assets/logos/wordmark-formal-full.svg +234 -0
- package/assets/logos/wordmark-formal-orange.svg +234 -0
- package/assets/logos/wordmark-full.svg +94 -0
- package/assets/logos/wordmark-orange.svg +94 -0
- package/assets/logos/wordmark-vertical-blue.svg +94 -0
- package/assets/logos/wordmark-vertical-full.svg +94 -0
- package/assets/logos/wordmark-vertical-orange.svg +94 -0
- package/citations/engine.ts +738 -0
- package/citations/errors.ts +79 -0
- package/citations/plugin.ts +137 -0
- package/citations/styles.ts +300 -0
- package/citations/syntax.ts +357 -0
- package/components/bibliography.vue +185 -0
- package/components/callout.vue +42 -0
- package/components/card.vue +37 -0
- package/components/cite.vue +62 -0
- package/components/frame.vue +71 -0
- package/components/illinois-logo.vue +45 -0
- package/components/math-morph.vue +252 -0
- package/components/qr-code.vue +51 -0
- package/components/stat.vue +43 -0
- package/components/steps.vue +77 -0
- package/global.d.ts +14 -0
- package/internal/brand-logo.vue +48 -0
- package/internal/citations.ts +206 -0
- package/internal/kicker.vue +13 -0
- package/internal/layout-root.vue +42 -0
- package/internal/pattern.vue +20 -0
- package/internal/split.vue +147 -0
- package/internal/theme.ts +878 -0
- package/layouts/agenda.vue +82 -0
- package/layouts/appendix-right.vue +15 -0
- package/layouts/appendix.vue +25 -0
- package/layouts/canvas.vue +21 -0
- package/layouts/center.vue +17 -0
- package/layouts/compare.vue +48 -0
- package/layouts/cover-right.vue +15 -0
- package/layouts/cover.vue +170 -0
- package/layouts/default.vue +15 -0
- package/layouts/end-right.vue +15 -0
- package/layouts/end.vue +89 -0
- package/layouts/fact-right.vue +15 -0
- package/layouts/fact.vue +25 -0
- package/layouts/figure.vue +43 -0
- package/layouts/grid.vue +33 -0
- package/layouts/iframe-left.vue +16 -0
- package/layouts/iframe-right.vue +16 -0
- package/layouts/image-left.vue +16 -0
- package/layouts/image-right.vue +16 -0
- package/layouts/image.vue +40 -0
- package/layouts/media-left.vue +17 -0
- package/layouts/media-right.vue +17 -0
- package/layouts/people.vue +98 -0
- package/layouts/quote-right.vue +15 -0
- package/layouts/quote.vue +41 -0
- package/layouts/references.vue +36 -0
- package/layouts/section-right.vue +15 -0
- package/layouts/section.vue +53 -0
- package/layouts/statement-right.vue +15 -0
- package/layouts/statement.vue +30 -0
- package/layouts/two-cols-header.vue +32 -0
- package/layouts/two-cols.vue +31 -0
- package/package.json +114 -4
- package/setup/mermaid.ts +73 -0
- package/setup/shiki.ts +147 -0
- package/setup/transformers.ts +21 -0
- package/setup/unocss.ts +34 -0
- package/setup/vite-plugins.ts +8 -0
- package/slide-top.vue +149 -0
- package/styles/base.css +309 -0
- package/styles/components.css +336 -0
- package/styles/index.ts +19 -0
- package/styles/layouts.css +1242 -0
- package/styles/looks.css +307 -0
- package/styles/tokens.css +324 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Framed image. `corner`: `all` (default, every corner rounded) | `none` | `bl` | `br` | `tl` | `tr`
|
|
3
|
+
(one large rounded corner, like the Illinois "Block I" photo frame); `fit`: `contain` | `cover` (default);
|
|
4
|
+
`aspect` (e.g. `4/3`), `height`, `caption`.
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import {resolveAssetUrl} from "@slidev/client";
|
|
9
|
+
import {computed} from "vue";
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
alt = "",
|
|
13
|
+
aspect,
|
|
14
|
+
caption,
|
|
15
|
+
corner = "all",
|
|
16
|
+
fit = "cover",
|
|
17
|
+
height,
|
|
18
|
+
src,
|
|
19
|
+
} = defineProps<{
|
|
20
|
+
/**
|
|
21
|
+
* Alternative text
|
|
22
|
+
*/
|
|
23
|
+
alt?: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Aspect ratio, e.g. `4/3`
|
|
27
|
+
*/
|
|
28
|
+
aspect?: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Caption below the image
|
|
32
|
+
*/
|
|
33
|
+
caption?: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Rounded corner(s): `all`, `none` or a single corner
|
|
37
|
+
*/
|
|
38
|
+
corner?: "all" | "bl" | "br" | "none" | "tl" | "tr";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* How the image fills the frame
|
|
42
|
+
*/
|
|
43
|
+
fit?: "contain" | "cover";
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Frame height (CSS length)
|
|
47
|
+
*/
|
|
48
|
+
height?: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Image URL (paths starting with `/` are served from `public/`)
|
|
52
|
+
*/
|
|
53
|
+
src: string;
|
|
54
|
+
}>();
|
|
55
|
+
|
|
56
|
+
const style = computed(() => ({
|
|
57
|
+
...(aspect ? {aspectRatio: aspect} : {}),
|
|
58
|
+
...(height ? {height} : {}),
|
|
59
|
+
}));
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<template>
|
|
63
|
+
<figure class="il-frame-figure">
|
|
64
|
+
<div class="il-frame" :class="`il-frame-${corner}`" :style="style">
|
|
65
|
+
<img :alt="alt" :class="`il-fit-${fit}`" :src="resolveAssetUrl(src)" />
|
|
66
|
+
</div>
|
|
67
|
+
<figcaption v-if="caption || $slots['default']">
|
|
68
|
+
<slot>{{ caption }}</slot>
|
|
69
|
+
</figcaption>
|
|
70
|
+
</figure>
|
|
71
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Official Illinois mark. `kind`: `block-i` (default) | `formal` | `vertical` | `wordmark`.
|
|
3
|
+
`variant`: `auto` (picks the right version for the slide background) | `blue` | `full` |
|
|
4
|
+
`orange`. Size it with `height` (CSS length) or a class.
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import {computed} from "vue";
|
|
9
|
+
import {type MarkKind, markUrl, type MarkVariant, useIllinois} from "#internal/theme.ts";
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
height,
|
|
13
|
+
kind = "block-i",
|
|
14
|
+
variant = "auto",
|
|
15
|
+
} = defineProps<{
|
|
16
|
+
/**
|
|
17
|
+
* Rendered height (CSS length)
|
|
18
|
+
*/
|
|
19
|
+
height?: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Which mark to show
|
|
23
|
+
*/
|
|
24
|
+
kind?: MarkKind;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Color variant (`auto` matches the slide background)
|
|
28
|
+
*/
|
|
29
|
+
variant?: "auto" | MarkVariant;
|
|
30
|
+
}>();
|
|
31
|
+
|
|
32
|
+
const {markVariant} = useIllinois();
|
|
33
|
+
|
|
34
|
+
const src = computed(() => markUrl(kind, variant === "auto" ? markVariant.value : variant));
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<img
|
|
39
|
+
alt="University of Illinois Urbana-Champaign"
|
|
40
|
+
class="il-logo"
|
|
41
|
+
:class="`il-mark-${kind}`"
|
|
42
|
+
:src="src"
|
|
43
|
+
:style="height ? {height} : undefined"
|
|
44
|
+
/>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Animated LaTeX, like Magic Move for code: each click morphs the equation into the next step.
|
|
3
|
+
Symbols shared by both steps glide to their new positions; the others fade out or in.
|
|
4
|
+
|
|
5
|
+
`<MathMorph :steps="['(a + b)^2', 'a^2 + 2ab + b^2']" />`
|
|
6
|
+
Props: `steps` (LaTeX strings), `at` (click of the first morph, default `+1`), `display` (display
|
|
7
|
+
math, default `true`), `duration` (milliseconds, default 700).
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
import {useSlideContext} from "@slidev/client";
|
|
12
|
+
import katex from "katex";
|
|
13
|
+
// Slidev only loads KaTeX's stylesheet when the slides contain `$` math
|
|
14
|
+
import "katex/dist/katex.min.css";
|
|
15
|
+
import {computed, nextTick, onMounted, onUnmounted, ref, watch} from "vue";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A symbol of the rendered equation and where it is
|
|
19
|
+
*/
|
|
20
|
+
interface Glyph {
|
|
21
|
+
/**
|
|
22
|
+
* Rendered element
|
|
23
|
+
*/
|
|
24
|
+
el: HTMLElement;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Matching key: the symbol's text, or its kind for rules and SVG parts
|
|
28
|
+
*/
|
|
29
|
+
key: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Position on screen
|
|
33
|
+
*/
|
|
34
|
+
rect: DOMRect;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const {
|
|
38
|
+
at = "+1",
|
|
39
|
+
display = true,
|
|
40
|
+
duration = 700,
|
|
41
|
+
steps,
|
|
42
|
+
} = defineProps<{
|
|
43
|
+
/**
|
|
44
|
+
* Click of the first morph (Slidev click syntax, e.g. `+1` or `3`)
|
|
45
|
+
*/
|
|
46
|
+
at?: number | string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Render as display math (centered, larger)
|
|
50
|
+
*/
|
|
51
|
+
display?: boolean;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Animation duration (ms)
|
|
55
|
+
*/
|
|
56
|
+
duration?: number;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* LaTeX of each step
|
|
60
|
+
*/
|
|
61
|
+
steps: string[];
|
|
62
|
+
}>();
|
|
63
|
+
|
|
64
|
+
const {$clicksContext: clicks} = useSlideContext();
|
|
65
|
+
|
|
66
|
+
// Unique click-registration ID
|
|
67
|
+
const id = `il-math-morph-${Math.random().toString(36).slice(2)}`;
|
|
68
|
+
|
|
69
|
+
const container = ref<HTMLElement>();
|
|
70
|
+
const current = ref(0);
|
|
71
|
+
|
|
72
|
+
const html = computed(() =>
|
|
73
|
+
steps.map(tex => katex.renderToString(tex, {displayMode: display, throwOnError: false})),
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Symbols of the rendered equation (text leaves, fraction bars and SVG parts such as radicals)
|
|
78
|
+
* @returns Glyphs in document order
|
|
79
|
+
*/
|
|
80
|
+
const glyphs = (): Glyph[] => {
|
|
81
|
+
const root = container.value?.querySelector(".katex-html");
|
|
82
|
+
if (!root) {
|
|
83
|
+
return [];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const result: Glyph[] = [];
|
|
87
|
+
for (const el of root.querySelectorAll<HTMLElement>("span, svg")) {
|
|
88
|
+
const text = el.children.length === 0 ? (el.textContent ?? "").trim() : "";
|
|
89
|
+
let key = "";
|
|
90
|
+
if (text) {
|
|
91
|
+
key = `t:${text}`;
|
|
92
|
+
} else if (el.classList.contains("frac-line")) {
|
|
93
|
+
key = "frac-line";
|
|
94
|
+
} else if (el.tagName.toLowerCase() === "svg") {
|
|
95
|
+
key = "svg";
|
|
96
|
+
}
|
|
97
|
+
if (key) {
|
|
98
|
+
result.push({el, key, rect: el.getBoundingClientRect()});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Pair glyphs of two steps with the longest common subsequence of their keys (keeps order)
|
|
106
|
+
* @param before Glyphs of the previous step
|
|
107
|
+
* @param after Glyphs of the next step
|
|
108
|
+
* @returns Pairs of indices `[before, after]`
|
|
109
|
+
*/
|
|
110
|
+
const match = (before: Glyph[], after: Glyph[]): [number, number][] => {
|
|
111
|
+
const rows = before.length + 1;
|
|
112
|
+
const cols = after.length + 1;
|
|
113
|
+
const table = Array.from({length: rows}, () => Array.from<number>({length: cols}).fill(0));
|
|
114
|
+
|
|
115
|
+
for (let i = before.length - 1; i >= 0; i--) {
|
|
116
|
+
for (let j = after.length - 1; j >= 0; j--) {
|
|
117
|
+
table[i]![j] =
|
|
118
|
+
before[i]!.key === after[j]!.key
|
|
119
|
+
? table[i + 1]![j + 1]! + 1
|
|
120
|
+
: Math.max(table[i + 1]![j]!, table[i]![j + 1]!);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const pairs: [number, number][] = [];
|
|
125
|
+
let i = 0;
|
|
126
|
+
let j = 0;
|
|
127
|
+
while (i < before.length && j < after.length) {
|
|
128
|
+
if (before[i]!.key === after[j]!.key) {
|
|
129
|
+
pairs.push([i, j]);
|
|
130
|
+
i++;
|
|
131
|
+
j++;
|
|
132
|
+
} else if (table[i + 1]![j]! >= table[i]![j + 1]!) {
|
|
133
|
+
i++;
|
|
134
|
+
} else {
|
|
135
|
+
j++;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return pairs;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Switch to another step, animating the change
|
|
143
|
+
* @param next Step index
|
|
144
|
+
* @param animate Whether to animate (skipped on the first render)
|
|
145
|
+
*/
|
|
146
|
+
const show = async (next: number, animate: boolean) => {
|
|
147
|
+
const root = container.value;
|
|
148
|
+
if (!root || next === current.value || !animate) {
|
|
149
|
+
current.value = next;
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Slides are scaled; convert screen distances into slide pixels
|
|
154
|
+
const scale = root.getBoundingClientRect().width / root.offsetWidth || 1;
|
|
155
|
+
|
|
156
|
+
// Ghosts are positioned relative to their own layer
|
|
157
|
+
const layer = root.querySelector<HTMLElement>(".il-math-morph-ghosts");
|
|
158
|
+
const origin = layer?.getBoundingClientRect() ?? root.getBoundingClientRect();
|
|
159
|
+
const before = glyphs();
|
|
160
|
+
|
|
161
|
+
// Snapshots of the old glyphs, faded out in place
|
|
162
|
+
const ghosts = before.map(glyph => {
|
|
163
|
+
const ghost = glyph.el.cloneNode(true) as HTMLElement;
|
|
164
|
+
const style = getComputedStyle(glyph.el);
|
|
165
|
+
// Same box as the original glyph (its line box would otherwise shift the glyph vertically)
|
|
166
|
+
const height = `${glyph.rect.height / scale}px`;
|
|
167
|
+
Object.assign(ghost.style, {
|
|
168
|
+
color: style.color,
|
|
169
|
+
font: style.font,
|
|
170
|
+
height,
|
|
171
|
+
left: `${(glyph.rect.left - origin.left) / scale}px`,
|
|
172
|
+
lineHeight: height,
|
|
173
|
+
margin: "0",
|
|
174
|
+
position: "absolute",
|
|
175
|
+
top: `${(glyph.rect.top - origin.top) / scale}px`,
|
|
176
|
+
});
|
|
177
|
+
return ghost;
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
current.value = next;
|
|
181
|
+
await nextTick();
|
|
182
|
+
|
|
183
|
+
const after = glyphs();
|
|
184
|
+
const pairs = match(before, after);
|
|
185
|
+
const matchedBefore = new Set(pairs.map(([i]) => i));
|
|
186
|
+
const matchedAfter = new Set(pairs.map(([, j]) => j));
|
|
187
|
+
const timing = {duration, easing: "cubic-bezier(0.65, 0, 0.35, 1)"};
|
|
188
|
+
|
|
189
|
+
// Shared glyphs glide from their old position
|
|
190
|
+
for (const [i, j] of pairs) {
|
|
191
|
+
const from = before[i]!.rect;
|
|
192
|
+
const to = after[j]!.rect;
|
|
193
|
+
const dx = (from.left - to.left) / scale;
|
|
194
|
+
const dy = (from.top - to.top) / scale;
|
|
195
|
+
const sx = to.width > 0 ? from.width / to.width : 1;
|
|
196
|
+
const sy = to.height > 0 ? from.height / to.height : 1;
|
|
197
|
+
after[j]!.el.animate(
|
|
198
|
+
[{transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})`}, {transform: "none"}],
|
|
199
|
+
timing,
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// New glyphs fade in
|
|
204
|
+
for (const [j, glyph] of after.entries()) {
|
|
205
|
+
if (!matchedAfter.has(j)) {
|
|
206
|
+
glyph.el.animate([{opacity: 0}, {offset: 0.4, opacity: 0}, {opacity: 1}], timing);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Removed glyphs fade out
|
|
211
|
+
for (const [i, ghost] of ghosts.entries()) {
|
|
212
|
+
if (matchedBefore.has(i) || !layer) {
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
layer.append(ghost);
|
|
216
|
+
ghost.animate([{opacity: 1}, {offset: 0.5, opacity: 0}, {opacity: 0}], timing).finished.then(
|
|
217
|
+
() => ghost.remove(),
|
|
218
|
+
() => ghost.remove(),
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
onMounted(() => {
|
|
224
|
+
// Each step after the first takes one click
|
|
225
|
+
// Slidev's API uses `null` for "no click information"
|
|
226
|
+
// oxlint-disable-next-line unicorn/no-null
|
|
227
|
+
const info = clicks?.calculateSince(at, steps.length - 1) ?? null;
|
|
228
|
+
clicks?.register(id, info);
|
|
229
|
+
|
|
230
|
+
let first = true;
|
|
231
|
+
watch(
|
|
232
|
+
() => clicks?.current,
|
|
233
|
+
() => {
|
|
234
|
+
// Without click information (e.g. when exporting), show the last step
|
|
235
|
+
const step = info ? (clicks?.current ?? 0) - info.start + 1 : steps.length - 1;
|
|
236
|
+
show(Math.min(Math.max(step, 0), steps.length - 1), !first).catch(() => undefined);
|
|
237
|
+
first = false;
|
|
238
|
+
},
|
|
239
|
+
{immediate: true},
|
|
240
|
+
);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
onUnmounted(() => clicks?.unregister(id));
|
|
244
|
+
</script>
|
|
245
|
+
|
|
246
|
+
<template>
|
|
247
|
+
<div ref="container" class="il-math-morph" :class="{'il-math-morph-display': display}">
|
|
248
|
+
<!-- oxlint-disable-next-line vue/no-v-html -- KaTeX output of the slide's own LaTeX -->
|
|
249
|
+
<div v-html="html[current]" />
|
|
250
|
+
<div aria-hidden="true" class="il-math-morph-ghosts" />
|
|
251
|
+
</div>
|
|
252
|
+
</template>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
QR code for a URL or text, always dark-on-light so phones can scan it in dark mode too.
|
|
3
|
+
`size` sets the rendered size (CSS length, default 9rem).
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import {encode} from "uqr";
|
|
8
|
+
import {computed} from "vue";
|
|
9
|
+
|
|
10
|
+
const {size = "9rem", value} = defineProps<{
|
|
11
|
+
/**
|
|
12
|
+
* Rendered size (CSS length)
|
|
13
|
+
*/
|
|
14
|
+
size?: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* URL or text to encode
|
|
18
|
+
*/
|
|
19
|
+
value: string;
|
|
20
|
+
}>();
|
|
21
|
+
|
|
22
|
+
// One SVG path with a 1x1 square per dark module
|
|
23
|
+
const qr = computed(() => {
|
|
24
|
+
const {data, size: modules} = encode(value, {border: 2, ecc: "M"});
|
|
25
|
+
|
|
26
|
+
let path = "";
|
|
27
|
+
for (const [y, row] of data.entries()) {
|
|
28
|
+
for (const [x, on] of row.entries()) {
|
|
29
|
+
if (on) {
|
|
30
|
+
path += `M${x} ${y}h1v1h-1z`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return {modules, path};
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<svg
|
|
41
|
+
:aria-label="`QR code: ${value}`"
|
|
42
|
+
class="il-qr"
|
|
43
|
+
role="img"
|
|
44
|
+
shape-rendering="crispEdges"
|
|
45
|
+
:style="{height: size, width: size}"
|
|
46
|
+
:viewBox="`0 0 ${qr.modules} ${qr.modules}`"
|
|
47
|
+
>
|
|
48
|
+
<rect fill="#fff" :height="qr.modules" :width="qr.modules" />
|
|
49
|
+
<path :d="qr.path" fill="#13294b" />
|
|
50
|
+
</svg>
|
|
51
|
+
</template>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
A key number with a label, e.g. `<Stat value="87%" label="of students passed" />`.
|
|
3
|
+
`note` adds a small source/context line; `accent: false` uses the heading color.
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
const {
|
|
8
|
+
accent = true,
|
|
9
|
+
label,
|
|
10
|
+
note,
|
|
11
|
+
value,
|
|
12
|
+
} = defineProps<{
|
|
13
|
+
/**
|
|
14
|
+
* Use the accent color for the value
|
|
15
|
+
*/
|
|
16
|
+
accent?: boolean;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Label below the value (or use the default slot)
|
|
20
|
+
*/
|
|
21
|
+
label?: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Small source or context line
|
|
25
|
+
*/
|
|
26
|
+
note?: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The number (or short text) to highlight
|
|
30
|
+
*/
|
|
31
|
+
value: number | string;
|
|
32
|
+
}>();
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<div class="il-stat" :class="{'il-stat-accent': accent}">
|
|
37
|
+
<span class="il-stat-value">{{ value }}</span>
|
|
38
|
+
<span v-if="label || $slots['default']" class="il-stat-label">
|
|
39
|
+
<slot>{{ label }}</slot>
|
|
40
|
+
</span>
|
|
41
|
+
<span v-if="note" class="il-stat-note">{{ note }}</span>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Numbered process / timeline. `items`: strings or `{title, text}`; `current` (1-based)
|
|
3
|
+
highlights one step and dims later ones; `vertical` stacks steps.
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import {computed} from "vue";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A single step
|
|
11
|
+
*/
|
|
12
|
+
interface Step {
|
|
13
|
+
/**
|
|
14
|
+
* Description below the title
|
|
15
|
+
*/
|
|
16
|
+
text?: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Step title
|
|
20
|
+
*/
|
|
21
|
+
title: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
current,
|
|
26
|
+
items,
|
|
27
|
+
vertical = false,
|
|
28
|
+
} = defineProps<{
|
|
29
|
+
/**
|
|
30
|
+
* Highlighted step (1-based); later steps are dimmed
|
|
31
|
+
*/
|
|
32
|
+
current?: number;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Steps, as titles or `{text, title}` objects
|
|
36
|
+
*/
|
|
37
|
+
items: (Step | string)[];
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Stack the steps vertically
|
|
41
|
+
*/
|
|
42
|
+
vertical?: boolean;
|
|
43
|
+
}>();
|
|
44
|
+
|
|
45
|
+
const steps = computed<Step[]>(() =>
|
|
46
|
+
items.map(item => (typeof item === "string" ? {title: item} : item)),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* State class of a step relative to `current`
|
|
51
|
+
* @param index 0-based step index
|
|
52
|
+
* @returns Class name
|
|
53
|
+
*/
|
|
54
|
+
const state = (index: number) => {
|
|
55
|
+
if (current === undefined) {
|
|
56
|
+
return "";
|
|
57
|
+
}
|
|
58
|
+
if (index + 1 === current) {
|
|
59
|
+
return "il-current";
|
|
60
|
+
}
|
|
61
|
+
return index + 1 < current ? "il-done" : "il-todo";
|
|
62
|
+
};
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
<ol
|
|
67
|
+
class="il-steps"
|
|
68
|
+
:class="{'il-steps-vertical': vertical}"
|
|
69
|
+
:style="{'--il-steps': steps.length}"
|
|
70
|
+
>
|
|
71
|
+
<li v-for="(step, index) in steps" :key="index" class="il-step" :class="state(index)">
|
|
72
|
+
<span class="il-step-number">{{ String(index + 1).padStart(2, "0") }}</span>
|
|
73
|
+
<span class="il-step-title">{{ step.title }}</span>
|
|
74
|
+
<span v-if="step.text" class="il-step-text">{{ step.text }}</span>
|
|
75
|
+
</li>
|
|
76
|
+
</ol>
|
|
77
|
+
</template>
|
package/global.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Ambient module declaration for the citations virtual module (SVG imports are typed by
|
|
3
|
+
* `vite/client`).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
declare module "virtual:illinois-citations" {
|
|
7
|
+
import type {CitationData} from "#citations/engine.ts";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Formatted citations for the current deck
|
|
11
|
+
*/
|
|
12
|
+
const data: CitationData;
|
|
13
|
+
export default data;
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
A user-supplied logo (unit, affiliation, sponsor). Uses `logoDark` on dark backgrounds when
|
|
3
|
+
provided; otherwise places the logo on a light plate so light-background artwork stays legible.
|
|
4
|
+
Falls back to the name as text when there is no logo.
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import {resolveAssetUrl} from "@slidev/client";
|
|
9
|
+
import {computed} from "vue";
|
|
10
|
+
import {type BrandRef, safeUrl} from "./theme.ts";
|
|
11
|
+
|
|
12
|
+
const {brand, dark} = defineProps<{
|
|
13
|
+
/**
|
|
14
|
+
* Logo to show
|
|
15
|
+
*/
|
|
16
|
+
brand: BrandRef;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Whether the slide background is dark
|
|
20
|
+
*/
|
|
21
|
+
dark: boolean;
|
|
22
|
+
}>();
|
|
23
|
+
|
|
24
|
+
// Logo URL for the current background
|
|
25
|
+
const src = computed(() => {
|
|
26
|
+
const url = dark ? (brand.logoDark ?? brand.logo) : brand.logo;
|
|
27
|
+
return url === undefined ? undefined : resolveAssetUrl(url);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const href = computed(() => safeUrl(brand.url));
|
|
31
|
+
|
|
32
|
+
// Light-background artwork on a dark slide gets a white plate
|
|
33
|
+
const plated = computed(() => dark && brand.logoDark === undefined && brand.logo !== undefined);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<component
|
|
38
|
+
:is="href ? 'a' : 'span'"
|
|
39
|
+
class="il-brand"
|
|
40
|
+
:class="{'il-brand-plate': plated, 'il-brand-text': !src}"
|
|
41
|
+
:href="href"
|
|
42
|
+
:rel="href ? 'noopener' : undefined"
|
|
43
|
+
:target="href ? '_blank' : undefined"
|
|
44
|
+
>
|
|
45
|
+
<img v-if="src" :alt="brand.name ?? ''" :src="src" />
|
|
46
|
+
<span v-else>{{ brand.name }}</span>
|
|
47
|
+
</component>
|
|
48
|
+
</template>
|