oficina / slides Public

Clone
git clone https://amadan.net/oficina/slides

Plain git — no account needed to clone.

Download

Download this file

1{{/* present_notes — GET /p/{session}/notes, the presenter view.
2
3 The screen somebody actually presents from: what the room is
4 looking at, what is coming next, the notes for the slide that is
5 up, a clock, and the four controls. Meant for a second window on a
6 laptop or for the presenter's own phone.
7
8 The pairing block appears exactly once — on the one request that
9 carries the remote capability, and only for the person presenting
10 (presentation.go says why). Coming back to this URL later shows
11 the talk and no secret, because there is no secret left to show:
12 only the hash was stored. */}}
13{{define "page-head"}}<link rel="stylesheet" href="{{asset "static/slides.css"}}">
14<script defer src="{{asset "static/present.js"}}"></script>
15<style>
16 /* Two slides side by side above the notes, and one column the
17 moment there is not room for two — the notes are the part being
18 read, so they get the width. */
19 [slides-preview] {
20 display: grid;
21 gap: var(--rst-sp-4);
22 grid-template-columns: 2fr 1fr;
23 }
24 @media (max-width: 60rem) {
25 [slides-preview] {
26 grid-template-columns: 1fr;
27 }
28 }
29 /* The two slides are pictures of themselves (presentation.go's
30 slideThumbImg): one <img> each of the session's SVG thumbnail,
31 rather than a live copy of the slide. A border and a background
32 under it so a picture still loading is a slide-shaped space. */
33 [slides-thumb-img] {
34 aspect-ratio: 16 / 9;
35 background: var(--rst-surface-2);
36 block-size: auto;
37 border: 1px solid var(--rst-line);
38 border-radius: var(--rst-radius);
39 display: block;
40 inline-size: 100%;
41 }
42 /* The end of the talk: no next slide, so an empty frame, dashed, as
43 the presenter window draws it. */
44 [slides-thumb-img][data-end] {
45 background: transparent;
46 border-style: dashed;
47 }
48 /* Each item as tall as its line, its words at its foot, so a line
49 that wraps on a phone sits one step under the line above, and the
50 words still share a foot line. */
51 [slides-clock] {
52 display: flex;
53 flex-wrap: wrap;
54 gap: var(--rst-sp-3);
55 }
56 [slides-clock-now] {
57 font-size: var(--rst-fs-lg);
58 font-variant-numeric: tabular-nums;
59 margin: 0;
60 }
61 [slides-clock] p {
62 align-items: flex-end;
63 color: var(--rst-text-muted);
64 display: flex;
65 margin: 0;
66 }
67 [slides-commands] {
68 display: flex;
69 flex-wrap: wrap;
70 gap: var(--rst-sp-2);
71 }
72 [slides-commands] form {
73 margin: 0;
74 }
75 [slides-commands] button {
76 min-height: 44px;
77 }
78 [slides-tools] {
79 display: flex;
80 flex-wrap: wrap;
81 gap: var(--rst-sp-2);
82 }
83</style>
84{{- if .Pair}}
85{{template "present-pairing-style" .}}
86{{- end}}{{end}}
87{{define "content"}}{{$L := localizer $}}
88{{template "page-header" dict "L" $L "Title" .Title "Sub" .DeckTitle}}
89
90<div slides-clock>
91 <p slides-clock-now data-clock>{{.Clock}}</p>
92 <p>{{.Started}}</p>
93 <p data-elapsed-since="{{.StartedAt}}" data-elapsed-template="{{.ElapsedTemplate}}">{{.Elapsed}}</p>
94 <p slides-counter>{{.Counter}}</p>
95</div>
96
97{{if .Blackout}}
98{{/* State in words, never in colour alone: the presenter's own screen
99 is the one place that has to say the room is looking at nothing. */}}
100{{template "status-pill" dict "L" $L "Tone" "neutral" "Label" .BlackoutLabel}}
101{{end}}
102
103{{if .Controls}}
104<div slides-commands rst-actions>{{template "present-controls" (withL (.Controls) $L)}}</div>
105{{end}}
106
107{{/* The script's root: the session it is watching, and — only when
108 this request carried it — the capability its keyboard sends with.
109 A presenter view opened without the token watches and cannot
110 drive, which is exactly what the buttons above do too. */}}
111<div slides-preview data-session="{{.Session}}"
112 data-slide="{{.Now}}"
113 {{- with .Mode}} data-mode="{{.}}"{{end}}
114 data-blackout="{{if .Blackout}}true{{else}}false{{end}}"
115 {{- if .Token}} data-remote-token="{{.Token}}"{{end}}
116 {{- if .Drives}} data-drives{{end}}>
117 <div rst-stack>
118 <h2>{{.CurrentLabel}}</h2>
119 {{.Current}}
120 </div>
121 <div rst-stack>
122 <h2>{{.NextLabel}}</h2>
123 {{if .HasNext}}{{.Next}}{{else}}<div slides-thumb-img data-end aria-hidden="true"></div>{{end}}
124 </div>
125</div>
126
127<div rst-box rst-stack>
128 <h2>{{.NotesLabel}}</h2>
129 {{if .Notes}}{{.Notes}}{{else}}<p>{{.NoNotes}}</p>{{end}}
130</div>
131
132{{with .Pair}}
133<div rst-box rst-stack>
134 {{template "callout" dict "L" $L "Tone" "info" "Title" .Title "Body" .Body}}
135 {{template "present-pairing" (withL (.) $L)}}
136</div>
137{{end}}
138
139<nav slides-tools aria-label="{{.ToolsLabel}}">
140 {{if .StageHref}}<a rst-btn href="{{.StageHref}}">{{.StageLabel}}</a>{{end}}
141 <a rst-btn href="{{.DeckHref}}">{{.DeckLabel}}</a>
142</nav>
143{{end}}
144