| index 3ef20b9..9aca78d 100644 |
| --- a/internal/slides/templates/viewer.html |
| +++ b/internal/slides/templates/viewer.html |
| @@ -22,23 +22,75 @@ |
| {{define "page-head"}}<link rel="stylesheet" href="{{asset "static/slides.css"}}"> |
| <style> |
| /* The chrome around the slide. Everything a slide itself looks like |
| - is slides.css; these five rules only place the viewer's own parts, |
| - and each one is an app attribute (slides-*) so nothing here can |
| - collide with the rst-* vocabulary. */ |
| - [slides-stage] { |
| - margin-block: var(--rst-sp-4); |
| + is slides.css; these rules only place the viewer's own parts, each |
| + an app attribute (slides-*) so nothing here can collide with the |
| + rst-* vocabulary. The look is the editor's (I2, after Docs): the |
| + slide is paper on a desk, the deck's actions one set of pills, and |
| + the filmstrip the slides' own pictures. */ |
| + @property --slides-desk { |
| + syntax: "<color>"; |
| + inherits: true; |
| + initial-value: #ebe7e2; |
| + } |
| + :root { |
| + --slides-desk: light-dark(#ebe7e2, #0e1014); |
| + } |
| + body:has([slides-viewer]) { |
| + background: var(--slides-desk); |
| + } |
| + [slides-viewer] { |
| + margin-inline: auto; |
| + max-inline-size: 72rem; |
| + } |
| + [slides-viewer] [rst-page-header] { |
| + border: 0; |
| + margin-block-end: var(--rst-sp-3); |
| + padding: 0; |
| + } |
| + [slides-viewer] [rst-page-header] h1 { |
| + font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.4rem); |
| + letter-spacing: -0.02em; |
| } |
| [slides-tools] { |
| + align-items: center; |
| display: flex; |
| flex-wrap: wrap; |
| gap: var(--rst-sp-2); |
| } |
| + [slides-tools] form { |
| + margin: 0; |
| + } |
| + [slides-tools] [rst-btn] { |
| + border-radius: 999px; |
| + min-block-size: 36px; |
| + padding-inline: 16px; |
| + } |
| + [slides-tools] [rst-btn]:not([rst-btn="primary"]) { |
| + background: var(--rst-surface); |
| + } |
| + [slides-viewer] [slides-stage] { |
| + margin-block: var(--rst-sp-4) var(--rst-sp-3); |
| + } |
| + [slides-viewer] [slides-stage] > [slides-slide] { |
| + border-radius: 6px; |
| + box-shadow: |
| + 0 0 0 1px rgb(40 28 12 / 0.06), |
| + 0 1px 2px rgb(40 28 12 / 0.10), |
| + 0 18px 40px -18px rgb(40 28 12 / 0.40); |
| + } |
| [slides-pager] { |
| align-items: center; |
| display: flex; |
| flex-wrap: wrap; |
| gap: var(--rst-sp-3); |
| } |
| + [slides-viewer] [slides-pager] { |
| + justify-content: center; |
| + } |
| + [slides-pager] [rst-btn] { |
| + border-radius: 999px; |
| + min-block-size: 36px; |
| + } |
| /* A pager end — the previous link on slide one — is plain text, not |
| a disabled control: there is nowhere to go, so there is nothing to |
| put in the tab order. */ |
| @@ -47,25 +99,85 @@ |
| color: var(--rst-text-muted); |
| margin: 0; |
| } |
| + [slides-counter] { |
| + font-variant-numeric: tabular-nums; |
| + min-inline-size: 6em; |
| + text-align: center; |
| + } |
| + [slides-viewer] details[slides-notes] { |
| + background: var(--rst-surface); |
| + border-radius: 12px; |
| + box-shadow: 0 0 0 1px light-dark(rgb(40 28 12 / 0.07), rgb(255 255 255 / 0.07)); |
| + margin-block: var(--rst-sp-4) 0; |
| + padding: 12px 18px; |
| + } |
| + [slides-viewer] details[slides-notes] > summary { |
| + color: var(--rst-text-muted); |
| + cursor: pointer; |
| + font-size: 13px; |
| + font-weight: 600; |
| + min-block-size: 24px; |
| + } |
| + [slides-film-nav] { |
| + margin-block-start: var(--rst-sp-5); |
| + } |
| [slides-film] { |
| - display: flex; |
| - flex-wrap: wrap; |
| - gap: var(--rst-sp-2); |
| + counter-reset: slides-film; |
| + display: grid; |
| + gap: var(--rst-sp-3); |
| + grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); |
| list-style: none; |
| margin: 0; |
| padding: 0; |
| } |
| + [slides-film] > li { |
| + counter-increment: slides-film; |
| + } |
| [slides-film] a { |
| - display: inline-block; |
| - /* 24 by 24 is the floor a pointer target has to meet (WCAG 2.2 AA); |
| - the padding is what gets a one-word slide name there. */ |
| + color: var(--rst-text-muted); |
| + display: grid; |
| + font-size: 12px; |
| + font-weight: 600; |
| + gap: 6px; |
| + /* 24 by 24 is the floor a pointer target has to meet (WCAG 2.2 AA). */ |
| min-height: 24px; |
| - padding: var(--rst-sp-1) var(--rst-sp-2); |
| + text-decoration: none; |
| + } |
| + [slides-film] a > span::before { |
| + content: counter(slides-film) " "; |
| + font-weight: 500; |
| + white-space: pre; |
| + } |
| + [slides-film-thumb] { |
| + aspect-ratio: 16 / 9; |
| + background: var(--rst-surface); |
| + border-radius: 6px; |
| + box-shadow: |
| + 0 0 0 1px light-dark(rgb(40 28 12 / 0.08), rgb(255 255 255 / 0.08)), |
| + 0 4px 10px -6px rgb(40 28 12 / 0.25); |
| + block-size: auto; |
| + display: block; |
| + inline-size: 100%; |
| + object-fit: contain; |
| + transition: transform 160ms ease; |
| + } |
| + [slides-film] a:hover [slides-film-thumb] { |
| + transform: translateY(-1px); |
| } |
| + /* The current slide: ringed in the accent AND aria-current, and its |
| + name in full ink — never colour alone. */ |
| [slides-film] a[aria-current="true"] { |
| - background: var(--rst-accent-soft); |
| - border-radius: var(--rst-radius-sm); |
| - font-weight: 600; |
| + color: var(--rst-text); |
| + } |
| + [slides-film] a[aria-current="true"] [slides-film-thumb] { |
| + box-shadow: 0 0 0 2px var(--rst-accent), 0 0 0 5px var(--rst-accent-soft); |
| + } |
| + [slides-film] a:focus-visible { |
| + outline: none; |
| + } |
| + [slides-film] a:focus-visible [slides-film-thumb] { |
| + outline: 2px solid var(--rst-accent); |
| + outline-offset: 3px; |
| } |
| </style>{{end}} |
| {{define "content"}} |
| @@ -138,7 +250,7 @@ |
| <nav slides-film-nav aria-label="{{.FilmLabel}}"> |
| <ol slides-film> |
| {{range .Film}} |
| - <li><a href="{{.Href}}"{{if .Current}} aria-current="true"{{end}}>{{.Label}}</a></li> |
| + <li><a href="{{.Href}}"{{if .Current}} aria-current="true"{{end}}><img slides-film-thumb src="{{.Thumb}}" alt="" width="1920" height="1080" loading="lazy"><span>{{.Label}}</span></a></li> |
| {{end}} |
| </ol> |
| </nav> |