summaryrefslogtreecommitdiff
path: root/docs/site/site.typ
diff options
context:
space:
mode:
Diffstat (limited to 'docs/site/site.typ')
-rw-r--r--docs/site/site.typ27
1 files changed, 15 insertions, 12 deletions
diff --git a/docs/site/site.typ b/docs/site/site.typ
index 03d9a15d..068b5b9c 100644
--- a/docs/site/site.typ
+++ b/docs/site/site.typ
@@ -70,7 +70,7 @@
#el("footer", (class: "colophon"))[
pardes ·
#if project.source != none [#el("a", (href: project.source))[source] · ]
- #if project.license != none [#project.license · ]
+ #if project.license != none [#project.license license · ]
built from `docs/typ` with Typst ·
#el("a", (href: "fonts/LICENSE-DepartureMono.txt"))[fonts] (OFL)
]
@@ -94,7 +94,13 @@
#doc-links.update(true)
-#let ready = clips.filter(c => c.ready)
+// The first ready clip plays at the top; the grid shows the rest.
+#let hero = clips.find(c => c.ready)
+#let video(c, extra) = el("video", (poster: "media/" + c.name + ".png", muted: "", loop: "", playsinline: "",
+ controls: "") + extra)[
+ #el("source", (src: "media/" + c.name + ".webm", type: "video/webm"))[]
+ #el("source", (src: "media/" + c.name + ".mp4", type: "video/mp4"))[]
+]
#let start = (
(id: "guide", label: [Start: the guide], note: [about 15 min]),
(id: "tutor", label: [Hands on: the tutor], note: none),
@@ -108,8 +114,11 @@
#el("p", (class: "pitch"))[#tagline.]
#el("p", (class: "runs"))[It runs in a terminal or in its own window (SDL), on Linux;
macOS and browser builds are in the tree.]
- #if ready.len() > 0 {
- el("img", (class: "hero", src: "media/" + ready.first().name + ".png", alt: ready.first().caption))[]
+ #if hero != none {
+ el("figure", (class: "clip hero"))[
+ #video(hero, (autoplay: ""))
+ #el("figcaption")[#hero.caption]
+ ]
}
#el("div", (class: "start"))[
#for s in start {
@@ -122,15 +131,9 @@
}
]
#el("div", (class: "clips"))[
- #for c in clips {
+ #for c in clips.filter(c => c != hero) {
el("figure", (class: "clip"))[
- #if c.ready {
- el("video", (poster: "media/" + c.name + ".png", muted: "", loop: "", playsinline: "",
- controls: "", preload: "none"))[
- #el("source", (src: "media/" + c.name + ".webm", type: "video/webm"))[]
- #el("source", (src: "media/" + c.name + ".mp4", type: "video/mp4"))[]
- ]
- } else {
+ #if c.ready { video(c, (preload: "none")) } else {
el("img", (src: "media/placeholder.svg", alt: "", width: "640", height: "400"))[]
}
#el("figcaption")[#c.caption]