oficina / slides Public

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

Plain git — no account needed to clone.

Download

Download this file

1<!DOCTYPE html>
2<html lang="en">
3<head>
4<meta charset="utf-8">
5<meta name="viewport" content="width=device-width, initial-scale=1">
6<title>Slides: the presenter window (mockup 7)</title>
7<style>
8 /* The palette and the proportions are the HalfStack deck's presenter view. */
9 :root {
10 --bg: #0b0b0f; --ink: #efefec; --ink-2: #c4c4cc; --muted: #9a9aa6; --faint: #6c6c78; --accent: #ffb454;
11 --panel: #111118; --raised: #181820; --border: #26262f; --paper: #faf6ee; --paper-ink: #1c2230;
12 --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
13 --ease: cubic-bezier(0.16, 1, 0.3, 1);
14 }
15 * { box-sizing: border-box; }
16 html, body { margin: 0; block-size: 100%; overflow: hidden; }
17 body { background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
18 ::selection { background: rgb(255 180 84 / 0.3); color: var(--ink); }
19 * { scrollbar-width: thin; scrollbar-color: #3a3a46 transparent; }
20 button, input { font: inherit; color: inherit; }
21 button { cursor: pointer; background: none; border: 0; }
22 :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
23 [hidden] { display: none !important; }
24 svg { inline-size: 20px; block-size: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
25
26 /* The window never scrolls: four rows, and the middle one takes what is left. */
27 #presenter { block-size: 100dvh; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; column-gap: 32px; padding: 16px 28px 16px; }
28
29 /* ---- header ---- */
30 #phead { grid-column: 1 / 3; grid-row: 1; margin-block-end: 20px; display: flex; align-items: center; gap: 16px; padding-block-end: 16px; border-block-end: 1px solid var(--border); position: relative; font-family: var(--mono); font-variant-numeric: tabular-nums; }
31 #ppos { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 8px; font-size: 24px; line-height: 1.2; color: var(--ink); transition: background-color 0.2s var(--ease); }
32 #ppos:hover, #ppos[aria-expanded="true"] { background: var(--raised); }
33 #ppos small { font-size: 24px; color: var(--faint); }
34 #ppos svg { color: var(--faint); }
35 #pmode { padding: 4px 12px; border-radius: 999px; background: var(--raised); color: var(--ink-2); font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; }
36 #pblack { padding: 4px 12px; border-radius: 4px; border: 1px solid var(--accent); color: var(--accent); font-size: 16px; letter-spacing: 0.14em; }
37 #pelapsed { margin-inline-start: auto; padding: 4px 14px; border-radius: 8px; font-size: 40px; line-height: 1.1; color: var(--ink); transition: background-color 0.2s var(--ease); }
38 #pelapsed:hover { background: var(--raised); }
39 #pclock { font-size: 22px; color: var(--muted); }
40 .iconbtn { inline-size: 40px; block-size: 40px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
41 .iconbtn:hover, .iconbtn[aria-expanded="true"], .iconbtn[aria-pressed="true"] { background: var(--raised); color: var(--ink); }
42 .iconbtn[aria-pressed="true"] { color: var(--accent); }
43 .pop { position: absolute; z-index: 4; inset-block-start: calc(100% + 8px); border-radius: 12px; background: var(--panel); border: 1px solid var(--border); box-shadow: 0 12px 16px rgb(0 0 0 / 0.5); font-family: system-ui, sans-serif; }
44 #pmenu { inset-inline-end: 0; min-inline-size: 280px; max-block-size: calc(100dvh - 96px); overflow-y: auto; padding: 8px; display: grid; gap: 2px; font-size: 17px; }
45 #pmenu button { padding: 10px 14px; border-radius: 8px; text-align: start; color: var(--ink-2); }
46 #pmenu button:hover { background: var(--raised); color: var(--ink); }
47 #pmenu hr { inline-size: 100%; border: 0; border-block-start: 1px solid var(--border); margin: 4px 0; }
48
49 /* ---- jump to any slide ---- */
50 #pjump { inset-inline-start: 0; inline-size: min(calc(100vw - 56px), 880px); max-block-size: calc(100dvh - 96px); padding: 16px; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
51 #jfield { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
52 #jq { flex: 1; min-inline-size: 0; background: none; border: 0; font-size: 18px; color: var(--ink); }
53 #jq::placeholder { color: var(--muted); }
54 #jq:focus { outline: none; }
55 #jfield:focus-within { border-color: var(--accent); }
56 #jcount { font: 14px/1.5 var(--mono); color: var(--muted); }
57 #jgrid { min-block-size: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px 10px; padding: 2px; }
58 .jt { display: grid; gap: 6px; inline-size: 100%; min-inline-size: 0; padding: 6px; border-radius: 8px; text-align: start; color: var(--muted); font-size: 14px; line-height: 1.35; }
59 .jt > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
60 .jt:hover { background: var(--raised); color: var(--ink); }
61 .jt b { font: 600 14px/1.35 var(--mono); color: var(--ink-2); margin-inline-end: 6px; }
62 .jt .pic { inline-size: 100%; aspect-ratio: 16 / 9; border-radius: 3px; background: var(--paper); display: grid; align-content: center; justify-items: center; gap: 3px; padding: 8px; }
63 .jt .pic i { display: block; block-size: 3px; border-radius: 2px; background: #c9c2b4; inline-size: 56%; }
64 .jt .pic i:first-child { block-size: 5px; inline-size: 68%; background: #5b5347; }
65 .jt[aria-current="true"] { background: var(--raised); color: var(--ink); }
66 .jt[aria-current="true"] .pic { outline: 2px solid var(--accent); outline-offset: 2px; }
67 .jt.full .pic { background: #d9d3c6; }
68 .jt.parked .pic { background: #2a2a33; }
69 .jt.parked .pic i { background: #4a4a57; }
70 .jt em { font-style: normal; color: var(--faint); }
71
72 /* ---- left: now and next ---- */
73 /* The two slides share the column's height: the next one is half the size of
74 the current one, and 104px is the label and the gaps. */
75 #pleft { grid-row: 3; min-inline-size: 0; min-block-size: 0; container-type: size; display: flex; flex-direction: column; gap: 14px; }
76 #pleft > * { --now: min(100cqw, calc((100cqh - 72px) / 1.5 * 16 / 9)); }
77 .pframe { aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper); color: var(--paper-ink); border-radius: 4px; box-shadow: 0 8px 16px rgb(0 0 0 / 0.45); flex: none; display: grid; align-content: center; gap: 6%; padding: 6% 8%; }
78 .pframe.blacked { background: #000; }
79 .pframe.blacked > * { visibility: hidden; }
80 .pframe h2 { margin: 0; font: 700 2.4em/1.2 Georgia, serif; text-wrap: balance; }
81 .pframe ul { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 0.5em; font-size: 1.25em; line-height: 1.4; }
82 .pframe li { transition: opacity 0.35s var(--ease); }
83 .pframe li.off { opacity: 0; }
84 #pcur { inline-size: var(--now); font-size: calc(var(--now) / 34); }
85 #pnext { inline-size: calc(var(--now) / 2); font-size: calc(var(--now) / 68); opacity: 0.92; }
86 #psteps { display: flex; align-items: center; gap: 14px; }
87 #pstepnow { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 8px; background: var(--raised); }
88 #pstepnow.moved { animation: pressed 0.5s var(--ease); }
89 @keyframes pressed { from { background: rgb(255 180 84 / 0.28); } to { background: var(--raised); } }
90 #ptrack { display: flex; gap: 5px; inline-size: 96px; }
91 #ptrack i { flex: 1; block-size: 6px; border-radius: 3px; background: #2c2c36; overflow: hidden; position: relative; }
92 #ptrack i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.45s var(--ease); }
93 #ptrack i.done::after { transform: scaleX(1); }
94 #pstepstext { font: 18px/1.3 var(--mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
95 #pstepstext b { color: var(--ink); font-weight: 600; }
96 #pnext-label { display: flex; align-items: center; gap: 8px; margin-block-start: 6px; font: 16px/1.5 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
97
98 /* ---- right: notes ---- */
99 #pright { grid-row: 3; min-inline-size: 0; min-block-size: 0; display: grid; grid-template-rows: minmax(0, 1fr); position: relative; }
100 #pnotes { min-inline-size: 0; min-block-size: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 60px 32px 28px; font-size: 32px; line-height: 1.45; color: var(--ink-2); }
101 #pnotes.scroll { overflow-y: auto; }
102 #pnotes p { margin: 0; max-inline-size: 30em; transition: color 0.3s var(--ease); }
103 #pnotes section { padding-block: 0.35em; }
104 #pnotes section + section { border-block-start: 1px solid var(--border); margin-block-start: 0.5em; padding-block-start: 0.6em; }
105 #pnotes section.past p, #pnotes section.later p { color: var(--faint); }
106 #pnotes section.now p { color: var(--ink); }
107 #ptools { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; display: flex; gap: 2px; padding: 4px; border-radius: 10px; background: rgb(24 24 32 / 0.92); border: 1px solid var(--border); opacity: 0.55; transition: opacity 0.2s var(--ease); }
108 #pright:hover #ptools, #ptools:focus-within { opacity: 1; }
109 #ptools .iconbtn { inline-size: 36px; block-size: 36px; }
110 #ptools hr { inline-size: 1px; block-size: 20px; align-self: center; border: 0; background: var(--border); margin: 0 4px; }
111
112 /* ---- arranging ---- */
113 .arranging .pframe, .arranging #pnotes { outline: 2px dashed var(--accent); outline-offset: 6px; resize: both; overflow: auto; cursor: move; }
114 #parrange { grid-column: 1 / 3; grid-row: 2; margin-block-end: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 10px; background: var(--raised); color: var(--ink-2); font-size: 17px; }
115 #parrange span { margin-inline-end: auto; }
116 #parrange button { min-block-size: 36px; padding: 6px 16px; border-radius: 8px; border: 1px solid var(--border); color: var(--ink); }
117 #parrange button:hover { background: var(--panel); }
118 #hint { grid-column: 1 / 3; grid-row: 4; margin: 12px 0 0; color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
119 @media (max-width: 820px) { #presenter { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1.2fr) minmax(0, 1fr); row-gap: 0; padding-inline: 16px; } #phead, #parrange { grid-column: 1; flex-wrap: wrap; } #pright { grid-row: 4; margin-block-start: 12px; } #hint { display: none; } #pelapsed { font-size: 32px; } #pnotes { padding: 52px 16px 12px; } }
120 @media (max-width: 480px) { #presenter { grid-template-rows: auto auto minmax(0, 0.8fr) minmax(0, 1.2fr); } }
121 @media (max-height: 560px) { #hint { display: none; } #phead { margin-block-end: 12px; } }
122 @media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
123</style>
124</head>
125<body>
126<div id="presenter">
127 <div id="phead">
128 <button type="button" id="ppos" aria-expanded="false" aria-controls="pjump" title="Go to a slide"><span id="pposn">31</span><small>/ 105</small><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></button>
129 <span id="pstepnow" role="status"><span id="ptrack" aria-hidden="true"><i></i><i></i><i></i><i></i></span><span id="pstepstext"></span></span>
130 <span id="pmode">core</span>
131 <span id="pblack" hidden>BLACK</span>
132 <button type="button" id="pelapsed" title="Click to reset">12:41</button>
133 <span id="pclock">14:32</span>
134 <button type="button" class="iconbtn" id="pmore" aria-expanded="false" aria-controls="pmenu" aria-label="More"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/></svg></button>
135
136 <div class="pop" id="pjump" hidden>
137 <label id="jfield"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>
138 <input id="jq" type="text" autocomplete="off" placeholder="A slide number, or words from its title" aria-label="Go to a slide">
139 <span id="jcount">105 slides</span></label>
140 <div id="jgrid"></div>
141 </div>
142
143 <div class="pop" id="pmenu" hidden>
144 <button type="button">Pair a phone as a remote…</button>
145 <button type="button">Open the slide window</button>
146 <button type="button">Switch to full</button>
147 <button type="button" id="marrange">Arrange this window…</button>
148 <hr>
149 <button type="button">Back to the deck</button>
150 <button type="button">End presenting</button>
151 </div>
152 </div>
153
154 <div id="parrange" hidden><span>Drag a panel to move it; drag its corner to resize it.</span><button type="button" id="areset">Reset to the default</button><button type="button" id="adone">Done</button></div>
155
156 <div id="pleft">
157 <div class="pframe" id="pcur"><h2 id="curh">Three reasons it worked</h2>
158 <ul id="curl"><li>The deck was data, so it could change overnight</li><li>Every slide was rehearsed where it was written</li><li>Nothing needed the network</li></ul></div>
159 <div id="pnext-label"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12h14"/><path d="m13 6 6 6-6 6"/></svg><span id="pnexttext">Next step</span></div>
160 <div class="pframe" id="pnext"><h2 id="nxth">Three reasons it worked</h2>
161 <ul id="nxtl"><li>The deck was data, so it could change overnight</li><li>Every slide was rehearsed where it was written</li><li>Nothing needed the network</li></ul></div>
162 </div>
163
164 <div id="pright">
165 <div id="pnotes">
166 <section><p>Three reasons. Take them slowly, one press each.</p></section>
167 <section><p>First: the deck was data. A string changed at midnight was on the slide by breakfast.</p></section>
168 <section><p>Second: every slide was rehearsed where it was written.</p></section>
169 <section><p>Third: nothing needed the network. Both windows stayed together on the laptop with the Wi-Fi off, which is the only reason the talk survived the venue.</p></section>
170 </div>
171 <div id="ptools" role="toolbar" aria-label="Notes">
172 <button type="button" class="iconbtn" id="nfit" aria-pressed="true" aria-label="Fit the notes to the panel" title="Fit the notes to the panel"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 9h5V4"/><path d="M20 9h-5V4"/><path d="M4 15h5v5"/><path d="M20 15h-5v5"/></svg></button>
173 <button type="button" class="iconbtn" id="nscroll" aria-pressed="false" aria-label="Scroll the notes" title="Scroll the notes"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 4v16"/><path d="m8 8 4-4 4 4"/><path d="m8 16 4 4 4-4"/></svg></button>
174 <hr>
175 <button type="button" class="iconbtn" id="nsmaller" aria-label="Smaller notes" title="Smaller notes"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m4 18 4.5-11L13 18"/><path d="M5.6 14h5.8"/><path d="M16 12h5"/></svg></button>
176 <button type="button" class="iconbtn" id="nlarger" aria-label="Larger notes" title="Larger notes"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m4 18 4.5-11L13 18"/><path d="M5.6 14h5.8"/><path d="M16 12h5"/><path d="M18.5 9.5v5"/></svg></button>
177 </div>
178 </div>
179
180 <p id="hint">Mockup. Arrow keys or Space step; B blacks the screen. Click 31 / 105 for the slide picker, then type "42" or "links". The four notes buttons work. Arrange is in the menu at the end of the header.</p>
181</div>
182
183<script>
184 const $ = id => document.getElementById(id);
185 let step = 1, black = false;
186 const cur = [...$('curl').children], nxt = [...$('nxtl').children], secs = [...document.querySelectorAll('#pnotes section')], track = [...$('ptrack').children];
187 function paint() {
188 cur.forEach((li, i) => li.classList.toggle('off', i >= step));
189 const last = step >= 3;
190 $('pnexttext').textContent = last ? 'Next slide' : 'Next step';
191 $('nxth').textContent = last ? 'Links' : 'Three reasons it worked';
192 $('nxtl').hidden = last;
193 nxt.forEach((li, i) => li.classList.toggle('off', i > step));
194 track.forEach((d, i) => d.classList.toggle('done', i <= step));
195 $('pstepstext').innerHTML = 'step <b>' + (step + 1) + '</b> of 4';
196 const now = $('pstepnow'); now.classList.remove('moved'); void now.offsetWidth; now.classList.add('moved');
197 secs.forEach((s, i) => { s.classList.toggle('past', i < step); s.classList.toggle('now', i === step); s.classList.toggle('later', i > step); });
198 $('pcur').classList.toggle('blacked', black);
199 $('pblack').hidden = !black;
200 fit();
201 }
202 // ---- notes: fit or scroll, and a size
203 let size = 32, mode = 'fit';
204 function fit() {
205 const n = $('pnotes'); n.classList.toggle('scroll', mode === 'scroll');
206 $('nfit').setAttribute('aria-pressed', String(mode === 'fit')); $('nscroll').setAttribute('aria-pressed', String(mode === 'scroll'));
207 let px = size; n.style.fontSize = px + 'px';
208 if (mode === 'fit') while (n.scrollHeight > n.clientHeight && px > 12) { px -= 1; n.style.fontSize = px + 'px'; }
209 if (mode === 'scroll') { const now = n.querySelector('.now'); if (now) now.scrollIntoView({ block: 'nearest' }); }
210 }
211 const stop = f => e => { e.stopPropagation(); f(); };
212 $('nfit').addEventListener('click', stop(() => { mode = 'fit'; fit(); }));
213 $('nscroll').addEventListener('click', stop(() => { mode = 'scroll'; fit(); }));
214 $('nsmaller').addEventListener('click', stop(() => { size = Math.max(16, size - 4); mode = 'scroll'; fit(); }));
215 $('nlarger').addEventListener('click', stop(() => { size = Math.min(60, size + 4); mode = 'scroll'; fit(); }));
216 // ---- jump: 105 slides, some full only, some parked
217 const words = ['Welcome', 'Who I am', 'The plan', 'Rails, once', 'Then came AI', 'A cookie wall', 'What we built', 'Eleven', 'Fast, really fast', 'Sizes compared', 'Native apps', 'The suite', 'Docs', 'Slides', 'Sheets', 'The framework', 'Rules for builders', 'Deploy flow', 'One command', 'What broke', 'What held', 'Agents at work', 'Reviews', 'The spec', 'No excuses', 'Links'];
218 const slides = Array.from({ length: 105 }, (_, i) => ({ n: i + 1, title: i === 30 ? 'Three reasons it worked' : words[i % words.length] + (i >= words.length ? ' ' + (Math.floor(i / words.length) + 1) : ''), kind: i % 17 === 9 ? 'full' : (i % 23 === 14 ? 'parked' : '') }));
219 function draw(q) {
220 const g = $('jgrid'); g.textContent = '';
221 const t = q.trim().toLowerCase();
222 const hit = slides.filter(s => !t || String(s.n).startsWith(t) || s.title.toLowerCase().includes(t));
223 $('jcount').textContent = t ? hit.length + ' of 105' : '105 slides';
224 for (const s of hit) {
225 const b = document.createElement('button'); b.type = 'button'; b.className = 'jt ' + s.kind; if (s.n === 31) b.setAttribute('aria-current', 'true');
226 b.title = s.n + ' · ' + s.title; b.innerHTML = '<span class="pic"><i></i><i></i></span><span><b>' + s.n + '</b>' + s.title + (s.kind ? ' <em>· ' + (s.kind === 'full' ? 'full only' : 'parked') + '</em>' : '') + '</span>';
227 b.addEventListener('click', e => { e.stopPropagation(); $('pposn').textContent = s.n; jump(false); });
228 g.append(b);
229 }
230 const here = g.querySelector('[aria-current]'); if (here) here.scrollIntoView({ block: 'center' });
231 }
232 function jump(on) { $('pjump').hidden = !on; $('ppos').setAttribute('aria-expanded', String(on)); if (on) { $('jq').value = ''; draw(''); $('jq').focus(); } }
233 $('ppos').addEventListener('click', stop(() => jump($('pjump').hidden)));
234 $('pjump').addEventListener('click', e => e.stopPropagation());
235 $('jq').addEventListener('input', () => draw($('jq').value));
236 $('jq').addEventListener('keydown', e => { e.stopPropagation(); if (e.key === 'Enter') { const f = $('jgrid').querySelector('.jt'); if (f) f.click(); } if (e.key === 'Escape') jump(false); });
237 // ---- menu and arranging
238 $('pmore').addEventListener('click', stop(() => { const on = $('pmenu').hidden; $('pmenu').hidden = !on; $('pmore').setAttribute('aria-expanded', String(on)); }));
239 addEventListener('click', () => { $('pmenu').hidden = true; $('pmore').setAttribute('aria-expanded', 'false'); jump(false); });
240 function arrange(on) { $('presenter').classList.toggle('arranging', on); $('parrange').hidden = !on; }
241 $('marrange').addEventListener('click', () => arrange(true));
242 $('adone').addEventListener('click', stop(() => arrange(false)));
243 $('areset').addEventListener('click', stop(() => document.querySelectorAll('.pframe, #pnotes').forEach(el => { el.style.width = ''; el.style.height = ''; })));
244 // ---- keys
245 addEventListener('keydown', e => {
246 if (e.key === 'ArrowRight' || e.key === ' ') { step = Math.min(3, step + 1); black = false; e.preventDefault(); }
247 else if (e.key === 'ArrowLeft') { step = Math.max(0, step - 1); black = false; }
248 else if (e.key === 'b' || e.key === 'B' || e.key === '.') { black = !black; }
249 else return;
250 paint();
251 });
252 $('pleft').addEventListener('click', () => { if ($('presenter').classList.contains('arranging')) return; step = Math.min(3, step + 1); black = false; paint(); });
253 addEventListener('resize', fit);
254 paint();
255 if (location.hash === '#jump') jump(true);
256</script>
257</body>
258</html>
259