Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

Help overlay: balance the two columns by hand-placing sections

nyblnet9fd5cc9cf769
diff --git a/slides/src/editor/editor.ts b/slides/src/editor/editor.ts
index 61680dc0..0787872e 100644
--- a/slides/src/editor/editor.ts
+++ b/slides/src/editor/editor.ts
@@ -1655,11 +1655,16 @@ 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)
+ // Two explicit columns, placed by hand for balance + theme: LEFT = general
+ // shortcuts & tips, RIGHT = the line/curve/path pointer-editing features.
+ // (Auto column-count balanced poorly with these chunky, unsplittable sections.)
const cols = div('ed-help-cols')
box.appendChild(cols)
+ const colL = div('ed-help-col')
+ const colR = div('ed-help-col')
+ cols.append(colL, colR)
const mod = navigator.platform.includes('Mac') ? '⌘' : 'Ctrl'
- const section = (title: string, rows: Array<[string, string]>) => {
+ const section = (col: HTMLElement, title: string, rows: Array<[string, string]>) => {
const sec = div('ed-help-sec')
const st = document.createElement('h3'); st.textContent = title; sec.appendChild(st)
for (const [k, d] of rows) {
@@ -1669,9 +1674,9 @@ export class Editor {
r.querySelector('span')!.textContent = d
sec.appendChild(r)
}
- cols.appendChild(sec)
+ col.appendChild(sec)
}
- section(t('Editing'), [
+ section(colL, t('Editing'), [
[`${mod}S`, t('Save')],
[`${mod}Z · ${mod}⇧Z`, t('Undo · redo')],
[`${mod}C · ${mod}V`, t('Copy · paste — elements, or the whole slide when nothing is selected')],
@@ -1680,21 +1685,21 @@ export class Editor {
['C', t('Comment mode')],
['?', t('This help')],
])
- section(t('Lines & curves'), [
+ section(colR, t('Lines & curves'), [
[t('Shape ▾'), t('Draw a line, curved line or connector — then drag on the canvas')],
[t('Drag a point'), t('Move an endpoint or anchor; drag the body to move the whole line')],
[t('Click a point'), t('Reveal its bézier handles for a precise curve')],
[`${t('Alt')}-${t('drag')}`, t('Break a smooth point into a sharp corner')],
[t('Double-click'), t('Add a point on the line; double-click a point to remove it')],
])
- section(t('Motion paths'), [
+ section(colR, t('Motion paths'), [
[t('Presenting ▸ Loop'), t('Give an element a motion-path loop, then Edit path on canvas')],
[t('Drag points'), t('Shape the trajectory — the first point is the element’s rest spot')],
[t('Click a point'), t('Reveal bézier handles; Alt-drag one for a sharp corner')],
[t('Double-click'), t('Add a point on the path; double-click a point to remove it')],
[t('Scroll a point'), t('Set how fast the element moves through that point')],
])
- section(t('Presenting'), [
+ section(colL, t('Presenting'), [
['F5', t('Present')],
['F', t('Toggle fullscreen while presenting')],
['S', t('Speaker view — notes on a second screen if you have one')],
@@ -1710,7 +1715,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); cols.appendChild(tips)
+ tips.appendChild(ul); colL.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 348c9d4c..b6952f0e 100644
--- a/slides/src/styles.css
+++ b/slides/src/styles.css
@@ -646,11 +646,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 { 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; }
+/* two hand-placed columns so the (now longer) list stays short vertically */
+.ed-help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; align-items: start; }
+.ed-help-col { min-width: 0; }
+.ed-help-sec { margin: 0 0 14px; }
/* one column when there isn't room for two (narrow / phone) */
-@media (max-width: 560px) { .ed-help-cols { column-count: 1; } }
+@media (max-width: 560px) { .ed-help-cols { grid-template-columns: 1fr; } }
.ed-help-sec h3 {
font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
color: var(--muted, #8a94a4); margin: 0 0 6px;