Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

Help overlay: two-column layout so the shortcut list stays short

nyblneta4c4d47ec3dc
diff --git a/slides/src/editor/editor.ts b/slides/src/editor/editor.ts
index 67455dfb..61680dc0 100644
--- a/slides/src/editor/editor.ts
+++ b/slides/src/editor/editor.ts
@@ -1655,6 +1655,9 @@ export class Editor {
const h = document.createElement('h2')
h.textContent = t('Shortcuts & tips')
box.appendChild(h)
+ // sections flow into two balanced columns (title + footer stay full-width)
+ const cols = div('ed-help-cols')
+ box.appendChild(cols)
const mod = navigator.platform.includes('Mac') ? '⌘' : 'Ctrl'
const section = (title: string, rows: Array<[string, string]>) => {
const sec = div('ed-help-sec')
@@ -1666,7 +1669,7 @@ export class Editor {
r.querySelector('span')!.textContent = d
sec.appendChild(r)
}
- box.appendChild(sec)
+ cols.appendChild(sec)
}
section(t('Editing'), [
[`${mod}S`, t('Save')],
@@ -1707,7 +1710,7 @@ export class Editor {
t('Make a chart from a table and it stays linked — edit the table, the chart updates.'),
t('Your work auto-saves; restore earlier versions from About → Version history.'),
]) { const li = document.createElement('li'); li.textContent = tip; ul.appendChild(li) }
- tips.appendChild(ul); box.appendChild(tips)
+ tips.appendChild(ul); cols.appendChild(tips)
const more = div('ed-help-more')
const link = document.createElement('a')
link.href = 'https://bento.page/help'
diff --git a/slides/src/styles.css b/slides/src/styles.css
index d70e9075..348c9d4c 100644
--- a/slides/src/styles.css
+++ b/slides/src/styles.css
@@ -645,8 +645,12 @@ option { background: #fff; color: #1e2a3a; }
/* --- help overlay + help button ------------------------------------------- */
.ed-btn-help .ed-help-q { font-size: 15px; font-weight: 800; line-height: 1; }
-.ed-help-box { max-width: 480px; }
-.ed-help-sec { margin: 10px 0; }
+.ed-help-box { width: 640px; max-width: 92vw; }
+/* two balanced columns so the (now longer) list stays short vertically */
+.ed-help-cols { column-count: 2; column-gap: 30px; }
+.ed-help-sec { margin: 0 0 14px; break-inside: avoid; }
+/* one column when there isn't room for two (narrow / phone) */
+@media (max-width: 560px) { .ed-help-cols { column-count: 1; } }
.ed-help-sec h3 {
font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
color: var(--muted, #8a94a4); margin: 0 0 6px;