rshow 0.0.0-stage → 0.0.2
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 +21 -0
- package/README.md +50 -2
- package/dist/main.js +8500 -0
- package/package.json +48 -4
- package/skills/rshow/SKILL.md +144 -0
- package/skills/rshow/reference/cli.md +263 -0
- package/skills/rshow/reference/dashboard.md +122 -0
- package/skills/rshow/reference/mockups.md +113 -0
- package/skills/rshow/reference/page-contract.md +83 -0
- package/skills/rshow/reference/pages.md +174 -0
- package/skills/rshow/reference/poster.md +137 -0
- package/skills/rshow/reference/project-page.md +132 -0
- package/skills/rshow/reference/reports.md +158 -0
- package/skills/rshow/reference/sketch.md +78 -0
- package/skills/rshow/reference/terminal.md +148 -0
- package/skills/rshow/reference/themes.md +139 -0
- package/skills/rshow-implement/SKILL.md +112 -0
- package/skills/rshow-implement/reference/compare.md +156 -0
- package/skills/rshow-implement/reference/handoff.md +125 -0
- package/skills/rshow-implement/reference/map.md +151 -0
- package/skills/rshow-slides/SKILL.md +136 -0
- package/skills/rshow-slides/reference/layouts.md +251 -0
- package/themes/default/dashboard.css +521 -0
- package/themes/default/dashboard.js +1390 -0
- package/themes/default/deck.css +586 -0
- package/themes/default/deck.js +741 -0
- package/themes/default/example/capture.ans +1 -0
- package/themes/default/example/dashboard.html +106 -0
- package/themes/default/example/demo.cast +14 -0
- package/themes/default/example/drawing.excalidraw +377 -0
- package/themes/default/example/index.html +311 -0
- package/themes/default/example/mockup-desktop.html +331 -0
- package/themes/default/example/mockup-platforms.html +742 -0
- package/themes/default/example/mockup.html +416 -0
- package/themes/default/example/page.html +153 -0
- package/themes/default/example/poster-figure.svg +58 -0
- package/themes/default/example/poster.html +181 -0
- package/themes/default/example/project.html +229 -0
- package/themes/default/example/report.html +404 -0
- package/themes/default/example/results.csv +61 -0
- package/themes/default/example/sketch.html +178 -0
- package/themes/default/example/teaser.svg +66 -0
- package/themes/default/example/terminal.html +231 -0
- package/themes/default/example/tui.html +223 -0
- package/themes/default/fonts/IBMPlexMono-Regular-Latin1.woff2 +0 -0
- package/themes/default/fonts/IBMPlexSans-Light-Latin1.woff2 +0 -0
- package/themes/default/fonts/IBMPlexSans-Regular-Latin1.woff2 +0 -0
- package/themes/default/fonts/IBMPlexSans-SemiBold-Latin1.woff2 +0 -0
- package/themes/default/fonts/OFL.txt +93 -0
- package/themes/default/fonts.css +63 -0
- package/themes/default/index.html +573 -0
- package/themes/default/mockup.css +1078 -0
- package/themes/default/mockup.js +1433 -0
- package/themes/default/mode.js +242 -0
- package/themes/default/page.css +320 -0
- package/themes/default/poster.css +480 -0
- package/themes/default/poster.js +223 -0
- package/themes/default/project.css +482 -0
- package/themes/default/project.js +116 -0
- package/themes/default/report.css +776 -0
- package/themes/default/report.js +427 -0
- package/themes/default/sketch.css +166 -0
- package/themes/default/sketch.js +681 -0
- package/themes/default/skins/adwaita.css +669 -0
- package/themes/default/skins/custom.css +596 -0
- package/themes/default/skins/egui.css +639 -0
- package/themes/default/skins/fluent.css +1093 -0
- package/themes/default/skins/fluent.js +458 -0
- package/themes/default/skins/mac.css +647 -0
- package/themes/default/skins/material.css +692 -0
- package/themes/default/skins/sketch.css +436 -0
- package/themes/default/skins/sketch.js +494 -0
- package/themes/default/skins/wire.css +561 -0
- package/themes/default/terminal.css +292 -0
- package/themes/default/terminal.js +433 -0
- package/themes/default/theme.json +149 -0
- package/themes/default/tokens.css +255 -0
- package/themes/default/tui.css +703 -0
- package/themes/default/tui.js +472 -0
- package/worker/index.js +6918 -0
- package/worker/migrations/0001_init.sql +52 -0
- package/worker/migrations/0002_blobs.sql +5 -0
- package/worker/migrations/0003_projects.sql +31 -0
- package/worker/migrations/0004_page_data_blob.sql +19 -0
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* rshow theme "default": poster layout
|
|
3
|
+
*
|
|
4
|
+
* A conference poster that prints from the browser. Link order: fonts.css,
|
|
5
|
+
* tokens.css, poster.css, then mode.js in <head>, then the qrcode-generator
|
|
6
|
+
* script and poster.js (both deferred, in that order).
|
|
7
|
+
*
|
|
8
|
+
* <div class="poster-toolbar"> size buttons, print, mode toggle </div>
|
|
9
|
+
* <div class="poster-stage">
|
|
10
|
+
* <div class="poster" data-size="a0">
|
|
11
|
+
* <header class="poster-head"> title, authors, logos, QR </header>
|
|
12
|
+
* <main class="poster-cols"> one <section> per block </main>
|
|
13
|
+
* <footer class="poster-foot"> references </footer>
|
|
14
|
+
* </div>
|
|
15
|
+
* </div>
|
|
16
|
+
*
|
|
17
|
+
* A size is an attribute on the poster, not a second stylesheet. data-size="a0"
|
|
18
|
+
* (841x1189mm, three columns) is the default and needs no attribute; "a1" is
|
|
19
|
+
* 594x841mm, three columns; "36x48" is the 3x4ft sheet shown landscape (48in
|
|
20
|
+
* wide, 36in tall, four columns) and "48x36" is the same sheet stood portrait
|
|
21
|
+
* (36in wide, 48in tall, three columns). The status line beside the buttons
|
|
22
|
+
* always names the width and the height, so the sheet a print will use is never
|
|
23
|
+
* a guess. Each size sets --poster-w and --poster-h, and poster.js copies those two
|
|
24
|
+
* values into one @page rule so a print is exactly one page of that size with no
|
|
25
|
+
* margin. The @page rule at the bottom of this file is the a0 default, for a
|
|
26
|
+
* document that never runs the script.
|
|
27
|
+
*
|
|
28
|
+
* On screen the poster keeps its real width in mm and poster.js scales the whole
|
|
29
|
+
* block down to the width of the window, so a preview is a preview and not a
|
|
30
|
+
* second, responsive layout. The type is in pt for the same reason: 110pt here
|
|
31
|
+
* is 110pt on paper. --poster-type carries one multiplier per sheet, because a
|
|
32
|
+
* 110pt title that fills an A0 line would overflow an A1.
|
|
33
|
+
*
|
|
34
|
+
* Same system as the deck, the page and the report: Carbon tokens, Plex Sans,
|
|
35
|
+
* square corners, no shadow, no card, no eyebrow, no numbered tile, sentence
|
|
36
|
+
* case. Print is always light; the tokens do that.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
:root {
|
|
40
|
+
/* Air around the poster on screen. poster.js reads the same number so the
|
|
41
|
+
scaled width and the stage agree. */
|
|
42
|
+
--poster-edge: 24px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
*,
|
|
46
|
+
*::before,
|
|
47
|
+
*::after {
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
html {
|
|
52
|
+
color-scheme: var(--color-scheme);
|
|
53
|
+
-webkit-text-size-adjust: 100%;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
body {
|
|
57
|
+
margin: 0;
|
|
58
|
+
background: var(--bg-shell);
|
|
59
|
+
color: var(--fg);
|
|
60
|
+
font-family: var(--font-sans);
|
|
61
|
+
font-size: var(--text-sm);
|
|
62
|
+
line-height: 1.45;
|
|
63
|
+
-webkit-font-smoothing: antialiased;
|
|
64
|
+
text-rendering: optimizeLegibility;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:focus-visible {
|
|
68
|
+
outline: 2px solid var(--accent);
|
|
69
|
+
outline-offset: 2px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* --------------------------------------------------------------- toolbar -- */
|
|
73
|
+
|
|
74
|
+
.poster-toolbar {
|
|
75
|
+
position: sticky;
|
|
76
|
+
top: 0;
|
|
77
|
+
z-index: 10;
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-wrap: wrap;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: var(--space-03);
|
|
82
|
+
padding: var(--space-03) var(--space-05);
|
|
83
|
+
background: var(--bg-shell);
|
|
84
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.poster-sizes {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-wrap: wrap;
|
|
90
|
+
gap: var(--space-02);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.poster-toolbar button {
|
|
94
|
+
min-height: 44px;
|
|
95
|
+
padding: 0 var(--space-05);
|
|
96
|
+
font: inherit;
|
|
97
|
+
font-size: var(--text-2xs);
|
|
98
|
+
line-height: 1;
|
|
99
|
+
color: var(--muted);
|
|
100
|
+
background: transparent;
|
|
101
|
+
border: 1px solid var(--border-subtle);
|
|
102
|
+
border-radius: var(--radius);
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
-webkit-appearance: none;
|
|
105
|
+
appearance: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.poster-toolbar button:hover {
|
|
109
|
+
color: var(--fg);
|
|
110
|
+
background: var(--bg);
|
|
111
|
+
border-color: var(--border-strong);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.poster-toolbar button[aria-pressed="true"] {
|
|
115
|
+
color: var(--fg);
|
|
116
|
+
background: var(--bg);
|
|
117
|
+
border-color: var(--border-strong);
|
|
118
|
+
font-weight: 600;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.poster-toolbar [data-rshow-mode-toggle] {
|
|
122
|
+
margin-left: auto;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.poster-status {
|
|
126
|
+
font-size: var(--text-2xs);
|
|
127
|
+
color: var(--muted);
|
|
128
|
+
font-variant-numeric: tabular-nums;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@media (max-width: 671px) {
|
|
132
|
+
/* Four buttons on a phone would be four rows of chrome above a poster that is
|
|
133
|
+
already small. The sheet a size means is in the status line once it is
|
|
134
|
+
pressed, so the orientation word leaves the face of the button. */
|
|
135
|
+
.poster-size-face {
|
|
136
|
+
display: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.poster-toolbar {
|
|
140
|
+
gap: var(--space-02);
|
|
141
|
+
padding: var(--space-02) var(--space-04);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.poster-toolbar button {
|
|
145
|
+
padding: 0 var(--space-04);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.poster-toolbar [data-rshow-mode-toggle] {
|
|
149
|
+
margin-left: 0;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* ---------------------------------------------------------------- stage -- */
|
|
154
|
+
|
|
155
|
+
/* The stage is the scaled canvas: poster.js gives it the width and height the
|
|
156
|
+
transformed poster actually paints, so the page scrolls to the right place
|
|
157
|
+
and the air around the poster is not 3000px wide. */
|
|
158
|
+
.poster-stage {
|
|
159
|
+
position: relative;
|
|
160
|
+
margin: var(--poster-edge) auto;
|
|
161
|
+
overflow: hidden;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* --------------------------------------------------------------- poster -- */
|
|
165
|
+
|
|
166
|
+
.poster {
|
|
167
|
+
--poster-type: 1.19;
|
|
168
|
+
--poster-w: 841mm;
|
|
169
|
+
--poster-h: 1189mm;
|
|
170
|
+
|
|
171
|
+
--poster-pad: calc(34mm * var(--poster-type));
|
|
172
|
+
--poster-gap: calc(15mm * var(--poster-type));
|
|
173
|
+
--poster-title: calc(110pt * var(--poster-type));
|
|
174
|
+
--poster-heading: calc(48pt * var(--poster-type));
|
|
175
|
+
--poster-subhead: calc(28pt * var(--poster-type));
|
|
176
|
+
--poster-lead: calc(34pt * var(--poster-type));
|
|
177
|
+
--poster-body: calc(30pt * var(--poster-type));
|
|
178
|
+
--poster-small: calc(22pt * var(--poster-type));
|
|
179
|
+
--poster-refs: calc(20pt * var(--poster-type));
|
|
180
|
+
|
|
181
|
+
display: grid;
|
|
182
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
183
|
+
gap: var(--poster-gap);
|
|
184
|
+
width: var(--poster-w);
|
|
185
|
+
height: var(--poster-h);
|
|
186
|
+
padding: var(--poster-pad);
|
|
187
|
+
overflow: hidden;
|
|
188
|
+
background: var(--bg);
|
|
189
|
+
color: var(--fg);
|
|
190
|
+
font-size: var(--poster-body);
|
|
191
|
+
line-height: 1.4;
|
|
192
|
+
transform-origin: 0 0;
|
|
193
|
+
-webkit-print-color-adjust: exact;
|
|
194
|
+
print-color-adjust: exact;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.poster[data-size="a1"] {
|
|
198
|
+
--poster-w: 594mm;
|
|
199
|
+
--poster-h: 841mm;
|
|
200
|
+
--poster-type: 0.845;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* Landscape: 48in wide by 36in tall, four columns. */
|
|
204
|
+
.poster[data-size="36x48"] {
|
|
205
|
+
--poster-w: 48in;
|
|
206
|
+
--poster-h: 36in;
|
|
207
|
+
--poster-type: 1.1;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Portrait: 36in wide by 48in tall, three columns. */
|
|
211
|
+
.poster[data-size="48x36"] {
|
|
212
|
+
--poster-w: 36in;
|
|
213
|
+
--poster-h: 48in;
|
|
214
|
+
--poster-type: 1.21;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* ----------------------------------------------------------- title band -- */
|
|
218
|
+
|
|
219
|
+
.poster-head {
|
|
220
|
+
display: grid;
|
|
221
|
+
gap: calc(9mm * var(--poster-type));
|
|
222
|
+
min-width: 0;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.poster-title {
|
|
226
|
+
margin: 0;
|
|
227
|
+
font-size: var(--poster-title);
|
|
228
|
+
font-weight: 300;
|
|
229
|
+
line-height: 1.05;
|
|
230
|
+
letter-spacing: var(--tracking-display);
|
|
231
|
+
text-wrap: balance;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.poster-byline {
|
|
235
|
+
display: grid;
|
|
236
|
+
grid-template-columns: minmax(0, 1fr) auto auto;
|
|
237
|
+
align-items: end;
|
|
238
|
+
gap: var(--poster-gap);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.poster-who {
|
|
242
|
+
min-width: 0;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.poster-authors {
|
|
246
|
+
margin: 0;
|
|
247
|
+
font-size: var(--poster-lead);
|
|
248
|
+
line-height: 1.3;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.poster-affil {
|
|
252
|
+
margin: calc(2mm * var(--poster-type)) 0 0;
|
|
253
|
+
font-size: var(--poster-small);
|
|
254
|
+
line-height: 1.4;
|
|
255
|
+
color: var(--muted);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.poster-venue {
|
|
259
|
+
margin: calc(3mm * var(--poster-type)) 0 0;
|
|
260
|
+
font-size: var(--poster-small);
|
|
261
|
+
line-height: 1.4;
|
|
262
|
+
color: var(--muted);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.poster-logos {
|
|
266
|
+
margin: 0;
|
|
267
|
+
font-size: var(--poster-small);
|
|
268
|
+
line-height: 1.5;
|
|
269
|
+
color: var(--muted);
|
|
270
|
+
text-align: right;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.poster-qr {
|
|
274
|
+
display: grid;
|
|
275
|
+
gap: calc(3mm * var(--poster-type));
|
|
276
|
+
width: calc(56mm * var(--poster-type));
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* The generated QR carries white ground and black modules of its own, so it
|
|
280
|
+
scans on either mode and on paper. */
|
|
281
|
+
.poster-qr svg {
|
|
282
|
+
display: block;
|
|
283
|
+
width: 100%;
|
|
284
|
+
height: auto;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.poster-qr-url {
|
|
288
|
+
margin: 0;
|
|
289
|
+
font-size: var(--poster-small);
|
|
290
|
+
line-height: 1.3;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.poster-qr-url a {
|
|
294
|
+
color: var(--accent);
|
|
295
|
+
text-decoration: none;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.poster-qr--text .poster-qr-url {
|
|
299
|
+
font-size: var(--poster-lead);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.poster sup {
|
|
303
|
+
font-size: 0.62em;
|
|
304
|
+
line-height: 0;
|
|
305
|
+
vertical-align: super;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/* ------------------------------------------------------------- columns -- */
|
|
309
|
+
|
|
310
|
+
.poster-cols {
|
|
311
|
+
display: grid;
|
|
312
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
313
|
+
gap: var(--poster-gap);
|
|
314
|
+
align-content: start;
|
|
315
|
+
min-height: 0;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.poster[data-size="36x48"] .poster-cols {
|
|
319
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* The last two sections take the whole second row of a four-column sheet, and
|
|
323
|
+
each one splits its own text in two, so a line never runs the width of three
|
|
324
|
+
columns and the foot of the sheet is not left with two empty cells. */
|
|
325
|
+
.poster[data-size="36x48"] .poster-cols > section:nth-last-child(-n + 2) {
|
|
326
|
+
grid-column: span 2;
|
|
327
|
+
column-count: 2;
|
|
328
|
+
column-gap: var(--poster-gap);
|
|
329
|
+
column-fill: balance;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.poster-cols > section {
|
|
333
|
+
min-width: 0;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/* ---------------------------------------------------------------- prose -- */
|
|
337
|
+
|
|
338
|
+
.poster h2 {
|
|
339
|
+
margin: 0 0 calc(6mm * var(--poster-type));
|
|
340
|
+
font-size: var(--poster-heading);
|
|
341
|
+
font-weight: 600;
|
|
342
|
+
line-height: 1.1;
|
|
343
|
+
letter-spacing: 0;
|
|
344
|
+
text-wrap: balance;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.poster p {
|
|
348
|
+
margin: 0 0 calc(5mm * var(--poster-type));
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.poster p:last-child,
|
|
352
|
+
.poster section > :last-child,
|
|
353
|
+
.poster figure + p {
|
|
354
|
+
margin-bottom: 0;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.poster ul,
|
|
358
|
+
.poster ol {
|
|
359
|
+
margin: 0 0 calc(5mm * var(--poster-type));
|
|
360
|
+
padding-left: calc(9mm * var(--poster-type));
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.poster li {
|
|
364
|
+
margin: 0 0 calc(3mm * var(--poster-type));
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.poster li:last-child {
|
|
368
|
+
margin-bottom: 0;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.poster li::marker {
|
|
372
|
+
color: var(--muted);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.poster strong {
|
|
376
|
+
font-weight: 600;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.poster a {
|
|
380
|
+
color: var(--accent);
|
|
381
|
+
text-decoration: underline;
|
|
382
|
+
text-decoration-thickness: 1px;
|
|
383
|
+
text-underline-offset: 0.12em;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.poster code {
|
|
387
|
+
padding: 0.1em 0.32em;
|
|
388
|
+
font-family: var(--font-mono);
|
|
389
|
+
font-size: 0.88em;
|
|
390
|
+
background: var(--layer-01);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* -------------------------------------------------------------- figures -- */
|
|
394
|
+
|
|
395
|
+
.poster figure {
|
|
396
|
+
margin: 0;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.poster figure img {
|
|
400
|
+
display: block;
|
|
401
|
+
width: 100%;
|
|
402
|
+
height: auto;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.poster figcaption {
|
|
406
|
+
margin-top: calc(5mm * var(--poster-type));
|
|
407
|
+
font-size: var(--poster-small);
|
|
408
|
+
line-height: 1.4;
|
|
409
|
+
color: var(--muted);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/* ------------------------------------------------------------ references -- */
|
|
413
|
+
|
|
414
|
+
.poster-foot {
|
|
415
|
+
min-width: 0;
|
|
416
|
+
font-size: var(--poster-refs);
|
|
417
|
+
line-height: 1.35;
|
|
418
|
+
color: var(--muted);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.poster-refs-title {
|
|
422
|
+
margin: 0 0 calc(4mm * var(--poster-type));
|
|
423
|
+
font-size: var(--poster-subhead);
|
|
424
|
+
font-weight: 600;
|
|
425
|
+
line-height: 1.2;
|
|
426
|
+
color: var(--fg);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.poster-refs {
|
|
430
|
+
display: grid;
|
|
431
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
432
|
+
gap: calc(4mm * var(--poster-type)) var(--poster-gap);
|
|
433
|
+
margin: 0;
|
|
434
|
+
padding-left: calc(7mm * var(--poster-type));
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.poster-refs li {
|
|
438
|
+
margin: 0;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/* --------------------------------------------------------------- paper --- */
|
|
442
|
+
|
|
443
|
+
@page {
|
|
444
|
+
size: 841mm 1189mm;
|
|
445
|
+
margin: 0;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
@media print {
|
|
449
|
+
html,
|
|
450
|
+
body {
|
|
451
|
+
margin: 0;
|
|
452
|
+
padding: 0;
|
|
453
|
+
background: var(--bg);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.poster-toolbar,
|
|
457
|
+
.poster-status,
|
|
458
|
+
.rshow-mode-toggle,
|
|
459
|
+
.rshow-mode-toggle--fixed {
|
|
460
|
+
display: none;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.poster-stage {
|
|
464
|
+
width: auto !important;
|
|
465
|
+
height: auto !important;
|
|
466
|
+
margin: 0;
|
|
467
|
+
overflow: visible;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.poster {
|
|
471
|
+
transform: none !important;
|
|
472
|
+
width: var(--poster-w);
|
|
473
|
+
height: var(--poster-h);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.poster-cols > section,
|
|
477
|
+
.poster figure {
|
|
478
|
+
break-inside: avoid;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* rshow theme "default": poster runtime. One optional dependency:
|
|
3
|
+
* qrcode-generator, loaded before this file.
|
|
4
|
+
*
|
|
5
|
+
* Markup: <div class="poster-stage"><div class="poster" data-size="a0">...</div></div>
|
|
6
|
+
* with a toolbar of [data-poster-size] buttons and one [data-poster-print].
|
|
7
|
+
*
|
|
8
|
+
* .poster[data-size] a0, a1, 36x48 or 48x36, read back as --poster-w and
|
|
9
|
+
* --poster-h, which this file writes into one @page rule
|
|
10
|
+
* so print is exactly one page of that size.
|
|
11
|
+
* [data-qr] an element that should carry a QR code for its URL.
|
|
12
|
+
* The code is an inline SVG from qrcode-generator; when
|
|
13
|
+
* the library is missing the element keeps the plain
|
|
14
|
+
* address it already holds and gets .poster-qr--text.
|
|
15
|
+
* [data-poster-status] one line of words naming the current sheet.
|
|
16
|
+
*
|
|
17
|
+
* On screen the poster is scaled to the width of the window and scaled again on
|
|
18
|
+
* every resize, so a reader sees the whole poster and never a reflowed one.
|
|
19
|
+
*
|
|
20
|
+
* A size can also be named in the address, ?size=a1, which is how an automated
|
|
21
|
+
* print picks a sheet without clicking; changing the size from the toolbar
|
|
22
|
+
* writes the same parameter back with replaceState, so a reload prints the sheet
|
|
23
|
+
* on screen. */
|
|
24
|
+
(function () {
|
|
25
|
+
'use strict';
|
|
26
|
+
|
|
27
|
+
var EDGE = 24;
|
|
28
|
+
var WORDS = {
|
|
29
|
+
a0: 'A0, 841 mm wide x 1189 mm tall, three columns',
|
|
30
|
+
a1: 'A1, 594 mm wide x 841 mm tall, three columns',
|
|
31
|
+
'36x48': '36x48 sheet, landscape: 48 in wide x 36 in tall, four columns',
|
|
32
|
+
'48x36': '48x36 sheet, portrait: 36 in wide x 48 in tall, three columns'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var poster = document.querySelector('.poster');
|
|
36
|
+
if (!poster) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
var stage = poster.parentNode;
|
|
40
|
+
var status = document.querySelector('[data-poster-status]');
|
|
41
|
+
var frame = 0;
|
|
42
|
+
|
|
43
|
+
// ------------------------------------------------------------- QR code --
|
|
44
|
+
|
|
45
|
+
function noCode(host) {
|
|
46
|
+
host.classList.add('poster-qr--text');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function renderQr(host) {
|
|
50
|
+
var url = (host.getAttribute('data-qr') || '').replace(/^\s+|\s+$/g, '');
|
|
51
|
+
if (url === '') {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (typeof window.qrcode !== 'function') {
|
|
55
|
+
noCode(host);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
var svg;
|
|
59
|
+
try {
|
|
60
|
+
var code = window.qrcode(0, 'M');
|
|
61
|
+
code.addData(url);
|
|
62
|
+
code.make();
|
|
63
|
+
var box = document.createElement('div');
|
|
64
|
+
box.innerHTML = code.createSvgTag({
|
|
65
|
+
cellSize: 8,
|
|
66
|
+
margin: 32,
|
|
67
|
+
scalable: true,
|
|
68
|
+
alt: 'QR code for ' + url
|
|
69
|
+
});
|
|
70
|
+
svg = box.firstChild;
|
|
71
|
+
} catch (err) {
|
|
72
|
+
noCode(host);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (!svg || svg.nodeType !== 1) {
|
|
76
|
+
noCode(host);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
host.insertBefore(svg, host.firstChild);
|
|
80
|
+
host.classList.remove('poster-qr--text');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// ------------------------------------------------------------ page size --
|
|
84
|
+
|
|
85
|
+
// CSS holds the sheet and its columns; the two values travel to @page so the
|
|
86
|
+
// numbers live in one place. A stylesheet rule beats the a0 default in
|
|
87
|
+
// poster.css because this element is appended last.
|
|
88
|
+
function pageSize() {
|
|
89
|
+
var rule = document.getElementById('poster-page-size');
|
|
90
|
+
if (!rule) {
|
|
91
|
+
rule = document.createElement('style');
|
|
92
|
+
rule.id = 'poster-page-size';
|
|
93
|
+
(document.head || document.documentElement).appendChild(rule);
|
|
94
|
+
}
|
|
95
|
+
var computed = window.getComputedStyle(poster);
|
|
96
|
+
var width = (computed.getPropertyValue('--poster-w') || '').replace(/^\s+|\s+$/g, '');
|
|
97
|
+
var height = (computed.getPropertyValue('--poster-h') || '').replace(/^\s+|\s+$/g, '');
|
|
98
|
+
rule.textContent = width !== '' && height !== ''
|
|
99
|
+
? '@page{size:' + width + ' ' + height + ';margin:0}'
|
|
100
|
+
: '';
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// --------------------------------------------------------------- scale --
|
|
104
|
+
|
|
105
|
+
function fit() {
|
|
106
|
+
var width = poster.offsetWidth;
|
|
107
|
+
var height = poster.offsetHeight;
|
|
108
|
+
if (width === 0 || height === 0) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
var view = document.documentElement.clientWidth || window.innerWidth || width;
|
|
112
|
+
var scale = Math.min(1, (view - EDGE * 2) / width);
|
|
113
|
+
if (!(scale > 0)) {
|
|
114
|
+
scale = 1;
|
|
115
|
+
}
|
|
116
|
+
// offsetWidth is the layout width, so a scaled poster still reports the
|
|
117
|
+
// sheet and not the frame it is drawn in.
|
|
118
|
+
poster.style.transform = 'scale(' + scale + ')';
|
|
119
|
+
if (stage) {
|
|
120
|
+
stage.style.width = Math.round(width * scale) + 'px';
|
|
121
|
+
stage.style.height = Math.round(height * scale) + 'px';
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function queueFit() {
|
|
126
|
+
if (frame !== 0) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
frame = window.requestAnimationFrame(function () {
|
|
130
|
+
frame = 0;
|
|
131
|
+
fit();
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// --------------------------------------------------------------- sizes --
|
|
136
|
+
|
|
137
|
+
function known(size) {
|
|
138
|
+
return Object.prototype.hasOwnProperty.call(WORDS, size) ? size : '';
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// ?size=a1 picks the sheet before the first paint, so a print command on a
|
|
142
|
+
// headless browser does not have to click a button first.
|
|
143
|
+
function asked() {
|
|
144
|
+
var match = /[?&]size=([a-z0-9]+)/i.exec(window.location.search || '');
|
|
145
|
+
return match ? known(match[1].toLowerCase()) : '';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// The address keeps the sheet, so a reload and a print of the window agree.
|
|
149
|
+
function remember(size) {
|
|
150
|
+
if (typeof window.history.replaceState !== 'function') {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
try {
|
|
154
|
+
var query = (window.location.search || '').replace(/[?&]size=[a-z0-9]+/i, '');
|
|
155
|
+
var keep = query.replace(/^&/, '?');
|
|
156
|
+
var next = keep + (keep === '' ? '?' : '&') + 'size=' + size;
|
|
157
|
+
window.history.replaceState(null, '', next + (window.location.hash || ''));
|
|
158
|
+
} catch (err) {
|
|
159
|
+
// A file:// page or a sandboxed frame may refuse; the sheet still changes.
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function setSize(size, silent) {
|
|
164
|
+
var next = known(size) || known(poster.getAttribute('data-size')) || 'a0';
|
|
165
|
+
if (poster.getAttribute('data-size') !== next) {
|
|
166
|
+
poster.setAttribute('data-size', next);
|
|
167
|
+
}
|
|
168
|
+
var buttons = document.querySelectorAll('[data-poster-size]');
|
|
169
|
+
for (var i = 0; i < buttons.length; i += 1) {
|
|
170
|
+
buttons[i].setAttribute(
|
|
171
|
+
'aria-pressed',
|
|
172
|
+
buttons[i].getAttribute('data-poster-size') === next ? 'true' : 'false'
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
if (status) {
|
|
176
|
+
status.textContent = WORDS[next] || next;
|
|
177
|
+
}
|
|
178
|
+
pageSize();
|
|
179
|
+
fit();
|
|
180
|
+
if (!silent) {
|
|
181
|
+
remember(next);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function onSize(event) {
|
|
186
|
+
setSize(event.currentTarget.getAttribute('data-poster-size'));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
var sizes = document.querySelectorAll('[data-poster-size]');
|
|
190
|
+
for (var s = 0; s < sizes.length; s += 1) {
|
|
191
|
+
sizes[s].addEventListener('click', onSize);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
var printButton = document.querySelector('[data-poster-print]');
|
|
195
|
+
if (printButton) {
|
|
196
|
+
printButton.addEventListener('click', function () {
|
|
197
|
+
window.print();
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
var hosts = document.querySelectorAll('[data-qr]');
|
|
202
|
+
for (var q = 0; q < hosts.length; q += 1) {
|
|
203
|
+
renderQr(hosts[q]);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Boot is silent: the first paint must not rewrite the address it was opened at.
|
|
207
|
+
setSize(asked() || poster.getAttribute('data-size'), true);
|
|
208
|
+
|
|
209
|
+
window.addEventListener('resize', queueFit);
|
|
210
|
+
window.addEventListener('orientationchange', queueFit);
|
|
211
|
+
|
|
212
|
+
if (document.fonts && document.fonts.ready) {
|
|
213
|
+
document.fonts.ready.then(function () {
|
|
214
|
+
fit();
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (typeof window.ResizeObserver === 'function') {
|
|
219
|
+
new window.ResizeObserver(queueFit).observe(poster);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
queueFit();
|
|
223
|
+
}());
|