hilfe-dialog: schließen-fix, zentriert, kompakter, blättern
- Fix: display:flex nur für #helpDlg[open] (vorher überschrieb es das display:none des geschlossenen <dialog> → ließ sich nicht schließen). - Dialog zentriert und schmaler, kompaktere Abstände. - Blätter-Funktion: ein Themenblock pro Seite, klickbare Titel-Chips (Ansichten, Finden, …), Zurück/Weiter, Punkt-Indikator, Pfeiltasten. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -966,9 +966,34 @@ document.getElementById('fAddTarget').onclick = () => {
|
|||||||
}
|
}
|
||||||
document.getElementById('btnSettings').onclick = () => openSettings(false)
|
document.getElementById('btnSettings').onclick = () => openSettings(false)
|
||||||
document.getElementById('btnCloseSettings').onclick = closeSettings
|
document.getElementById('btnCloseSettings').onclick = closeSettings
|
||||||
// help / overview dialog (native <dialog>: Esc closes it)
|
/* help / overview dialog – paged, one topic group per page (native <dialog>: Esc closes it) */
|
||||||
document.getElementById('btnHelp').onclick = () => document.getElementById('helpDlg').showModal()
|
const HELP_PAGES = [
|
||||||
|
{ t: 'help.g.views', rows: [['kanban', 'help.board'], ['layout-grid', 'help.gallery'], ['list', 'help.list'], ['list-checks', 'help.tasks'], ['activity', 'help.activity'], ['hard-drive', 'help.storage']] },
|
||||||
|
{ t: 'help.g.find', rows: [['sliders-horizontal', 'help.mode'], ['search', 'help.search'], ['funnel', 'help.filters']] },
|
||||||
|
{ t: 'help.g.project', rows: [['pencil', 'help.edit'], ['info', 'help.info'], ['play', 'help.actions'], ['folder-open', 'help.quick']] },
|
||||||
|
{ t: 'help.g.backup', rows: [['hard-drive-upload', 'help.backup'], ['clock-alert', 'help.due']] },
|
||||||
|
{ t: 'help.g.misc', rows: [['folders', 'help.folders'], ['languages', 'help.lang'], ['keyboard', 'help.keys']] },
|
||||||
|
]
|
||||||
|
let helpPage = 0
|
||||||
|
function renderHelp() {
|
||||||
|
helpPage = Math.max(0, Math.min(HELP_PAGES.length - 1, helpPage))
|
||||||
|
document.getElementById('helpNav').innerHTML = HELP_PAGES.map((p, i) => `<button type="button" class="hnav ${i === helpPage ? 'active' : ''}" data-hp="${i}">${t(p.t)}</button>`).join('')
|
||||||
|
document.getElementById('helpBody').innerHTML = HELP_PAGES[helpPage].rows.map(([icon, k]) => `<div class="helprow"><span class="hc">${ic(icon)}</span><div>${t(k)}</div></div>`).join('')
|
||||||
|
document.getElementById('helpDots').innerHTML = HELP_PAGES.map((_, i) => `<i class="${i === helpPage ? 'on' : ''}"></i>`).join('')
|
||||||
|
document.getElementById('helpPrev').disabled = helpPage === 0
|
||||||
|
document.getElementById('helpNext').disabled = helpPage === HELP_PAGES.length - 1
|
||||||
|
document.getElementById('helpBody').scrollTop = 0
|
||||||
|
}
|
||||||
|
const gotoHelp = (i) => { helpPage = i; renderHelp() }
|
||||||
|
document.getElementById('btnHelp').onclick = () => { helpPage = 0; renderHelp(); document.getElementById('helpDlg').showModal() }
|
||||||
document.getElementById('helpClose').onclick = () => document.getElementById('helpDlg').close()
|
document.getElementById('helpClose').onclick = () => document.getElementById('helpDlg').close()
|
||||||
|
document.getElementById('helpNav').onclick = (e) => { const b = e.target.closest('[data-hp]'); if (b) gotoHelp(+b.dataset.hp) }
|
||||||
|
document.getElementById('helpPrev').onclick = () => gotoHelp(helpPage - 1)
|
||||||
|
document.getElementById('helpNext').onclick = () => gotoHelp(helpPage + 1)
|
||||||
|
document.getElementById('helpDlg').addEventListener('keydown', (e) => {
|
||||||
|
if (e.key === 'ArrowRight' && helpPage < HELP_PAGES.length - 1) gotoHelp(helpPage + 1)
|
||||||
|
if (e.key === 'ArrowLeft' && helpPage > 0) gotoHelp(helpPage - 1)
|
||||||
|
})
|
||||||
document.getElementById('spCancel').onclick = closeSettings
|
document.getElementById('spCancel').onclick = closeSettings
|
||||||
document.getElementById('spSave').onclick = saveSettings
|
document.getElementById('spSave').onclick = saveSettings
|
||||||
|
|
||||||
@@ -3190,6 +3215,7 @@ function initLang() {
|
|||||||
if (editing) try { openEditor(editing) } catch {}
|
if (editing) try { openEditor(editing) } catch {}
|
||||||
const sp = document.getElementById('spanel')
|
const sp = document.getElementById('spanel')
|
||||||
if (sp.classList.contains('open')) { I18N.apply(sp); try { renderAutoStatus() } catch {} }
|
if (sp.classList.contains('open')) { I18N.apply(sp); try { renderAutoStatus() } catch {} }
|
||||||
|
try { if (document.getElementById('helpDlg').open) renderHelp() } catch {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -684,16 +684,25 @@
|
|||||||
.dlg.wide .ihead { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
|
.dlg.wide .ihead { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
|
||||||
.dlg.wide .ihead h3 { margin: 0; display: flex; gap: 8px; align-items: center; font-size: 16px; }
|
.dlg.wide .ihead h3 { margin: 0; display: flex; gap: 8px; align-items: center; font-size: 16px; }
|
||||||
.dlg.wide .ihead .sp { flex: 1; }
|
.dlg.wide .ihead .sp { flex: 1; }
|
||||||
#helpDlg { width: 640px; display: flex; flex-direction: column; }
|
/* only style the OPEN dialog as flex – otherwise this overrides the UA display:none and it can never close */
|
||||||
.helpbody { padding: 16px 22px 22px; overflow-y: auto; min-height: 0; }
|
#helpDlg { width: 560px; max-height: calc(100vh - 80px); margin: auto; }
|
||||||
.helpintro { margin: 0; font-size: 13.5px; color: var(--text); line-height: 1.55; }
|
#helpDlg[open] { display: flex; flex-direction: column; }
|
||||||
.helph { margin: 18px 0 4px; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
|
.helpintro { margin: 0; padding: 12px 20px 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
|
||||||
.helph::after { content: ""; flex: 1; height: 1px; background: var(--border); }
|
.helpnav { display: flex; gap: 5px; flex-wrap: wrap; padding: 12px 20px 10px; }
|
||||||
.helprow { display: flex; gap: 11px; align-items: flex-start; padding: 7px 0; font-size: 13px; line-height: 1.5; color: var(--text); }
|
.hnav { font: inherit; font-size: 12px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
|
||||||
.helprow .hc { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
|
.hnav:hover { color: var(--text); }
|
||||||
.helprow .hc .i { width: 16px; height: 16px; }
|
.hnav.active { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 600; }
|
||||||
|
.helpbody { padding: 2px 20px 6px; overflow-y: auto; min-height: 0; }
|
||||||
|
.helprow { display: flex; gap: 11px; align-items: flex-start; padding: 6px 0; font-size: 13px; line-height: 1.5; color: var(--text); }
|
||||||
|
.helprow .hc { flex: 0 0 auto; width: 27px; height: 27px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
|
||||||
|
.helprow .hc .i { width: 15px; height: 15px; }
|
||||||
.helprow > div { min-width: 0; }
|
.helprow > div { min-width: 0; }
|
||||||
.helprow b { font-weight: 650; }
|
.helprow b { font-weight: 650; }
|
||||||
|
.helpfoot { display: flex; align-items: center; gap: 10px; padding: 11px 20px; border-top: 1px solid var(--border); }
|
||||||
|
.helpfoot .btn { padding: 6px 12px; }
|
||||||
|
.helpdots { display: flex; gap: 6px; margin: 0 auto; }
|
||||||
|
.helpdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); transition: background .12s; }
|
||||||
|
.helpdots i.on { background: var(--accent); }
|
||||||
#itchBody { padding: 4px 20px 20px; }
|
#itchBody { padding: 4px 20px 20px; }
|
||||||
.isec { margin-top: 16px; }
|
.isec { margin-top: 16px; }
|
||||||
.isec h4 { margin: 0 0 8px; font-size: 13px; display: flex; align-items: center; gap: 7px; }
|
.isec h4 { margin: 0 0 8px; font-size: 13px; display: flex; align-items: center; gap: 7px; }
|
||||||
@@ -1336,36 +1345,13 @@
|
|||||||
<span class="sp"></span>
|
<span class="sp"></span>
|
||||||
<button class="iconbtn" type="button" id="helpClose" data-i18n-title="common.closeEsc" title="Close (Esc)"><svg class="i"><use href="/icons.svg#x"/></svg></button>
|
<button class="iconbtn" type="button" id="helpClose" data-i18n-title="common.closeEsc" title="Close (Esc)"><svg class="i"><use href="/icons.svg#x"/></svg></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="helpbody">
|
<p class="helpintro" data-i18n="help.intro">Project Dashboard keeps all your projects under one roof: status, size, Git/backup state and quick actions – one tile per project folder.</p>
|
||||||
<p class="helpintro" data-i18n="help.intro">Project Dashboard keeps all your projects under one roof: status, size, Git/backup state and quick actions – one tile per project folder.</p>
|
<div class="helpnav" id="helpNav"></div>
|
||||||
|
<div class="helpbody" id="helpBody"></div>
|
||||||
<div class="helph" data-i18n="help.g.views">Views</div>
|
<div class="helpfoot">
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#kanban"/></svg></span><div data-i18n-html="help.board"><b>Board</b> – Kanban by status. Drag a card to another column to change its status.</div></div>
|
<button class="btn" type="button" id="helpPrev"><svg class="i"><use href="/icons.svg#chevron-left"/></svg><span data-i18n="help.prev">Back</span></button>
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#layout-grid"/></svg></span><div data-i18n-html="help.gallery"><b>Gallery</b> – big tiles with thumbnails and the key facts.</div></div>
|
<span class="helpdots" id="helpDots"></span>
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#list"/></svg></span><div data-i18n-html="help.list"><b>List</b> – compact table with sortable columns.</div></div>
|
<button class="btn primary" type="button" id="helpNext"><span data-i18n="help.next">Next</span><svg class="i"><use href="/icons.svg#chevron-right"/></svg></button>
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#list-checks"/></svg></span><div data-i18n-html="help.tasks"><b>Tasks</b> – all open to-dos across every project.</div></div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#activity"/></svg></span><div data-i18n-html="help.activity"><b>Activity</b> – a calendar heatmap of what you worked on, and when.</div></div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#hard-drive"/></svg></span><div data-i18n-html="help.storage"><b>Storage</b> – who uses how much disk; find and delete regenerable folders (cache, builds).</div></div>
|
|
||||||
|
|
||||||
<div class="helph" data-i18n="help.g.find">Finding things</div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#sliders-horizontal"/></svg></span><div data-i18n-html="help.mode"><b>Simple / Advanced</b> – Simple shows only the essentials, Advanced every feature. Toggle at the top right.</div></div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#search"/></svg></span><div data-i18n-html="help.search"><b>Search</b> – filter by name, tags or notes.</div></div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#funnel"/></svg></span><div data-i18n-html="help.filters"><b>Quick filters</b> – the chips under the counters filter by backup due, cleanable, no icon, favorites …</div></div>
|
|
||||||
|
|
||||||
<div class="helph" data-i18n="help.g.project">A single project</div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#pencil"/></svg></span><div data-i18n-html="help.edit"><b>Edit</b> – status, priority, tags, notes, tasks, icon and a custom start command.</div></div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#info"/></svg></span><div data-i18n-html="help.info"><b>Info</b> – read-only overview: description, Git, size, tech and recent activity.</div></div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#play"/></svg></span><div data-i18n-html="help.actions"><b>Actions</b> – start the program (▶), build, Git push, create a ZIP, make an itch.io page, clean up – and delete the project folder (Danger zone).</div></div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#folder-open"/></svg></span><div data-i18n-html="help.quick"><b>Quick buttons</b> – Explorer, VS Code and ▶ start sit on every card and at the top of the panel.</div></div>
|
|
||||||
|
|
||||||
<div class="helph" data-i18n="help.g.backup">Backup & safety</div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#hard-drive-upload"/></svg></span><div data-i18n-html="help.backup"><b>Backup</b> – copies projects to an external disk or NAS. Only new and changed files; nothing is ever deleted in the backup. Targets and an automatic schedule live in Settings.</div></div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#clock-alert"/></svg></span><div data-i18n-html="help.due"><b>Backup due</b> – a project changed since its last backup is flagged and appears under the “Backup due” filter.</div></div>
|
|
||||||
|
|
||||||
<div class="helph" data-i18n="help.g.misc">Good to know</div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#folders"/></svg></span><div data-i18n-html="help.folders"><b>Project folders</b> – choose which folders hold your projects in Settings → Project folders.</div></div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#languages"/></svg></span><div data-i18n-html="help.lang"><b>Language</b> – switch English / German in Settings → General.</div></div>
|
|
||||||
<div class="helprow"><span class="hc"><svg class="i"><use href="/icons.svg#keyboard"/></svg></span><div data-i18n-html="help.keys"><b>Shortcuts</b> – Esc closes panels and dialogs; Ctrl+S saves the settings.</div></div>
|
|
||||||
</div>
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
||||||
|
|||||||
@@ -744,6 +744,8 @@ window.LANG = {
|
|||||||
'help.folders': '<b>Project folders</b> – choose which folders hold your projects in Settings → Project folders.',
|
'help.folders': '<b>Project folders</b> – choose which folders hold your projects in Settings → Project folders.',
|
||||||
'help.lang': '<b>Language</b> – switch English / German in Settings → General.',
|
'help.lang': '<b>Language</b> – switch English / German in Settings → General.',
|
||||||
'help.keys': '<b>Shortcuts</b> – Esc closes panels and dialogs; Ctrl+S saves the settings.',
|
'help.keys': '<b>Shortcuts</b> – Esc closes panels and dialogs; Ctrl+S saves the settings.',
|
||||||
|
'help.prev': 'Back',
|
||||||
|
'help.next': 'Next',
|
||||||
},
|
},
|
||||||
|
|
||||||
de: {
|
de: {
|
||||||
@@ -1486,5 +1488,7 @@ window.LANG = {
|
|||||||
'help.folders': '<b>Projektordner</b> – in Einstellungen → Projektordner festlegen, welche Ordner deine Projekte enthalten.',
|
'help.folders': '<b>Projektordner</b> – in Einstellungen → Projektordner festlegen, welche Ordner deine Projekte enthalten.',
|
||||||
'help.lang': '<b>Sprache</b> – Englisch / Deutsch umschalten in Einstellungen → Allgemein.',
|
'help.lang': '<b>Sprache</b> – Englisch / Deutsch umschalten in Einstellungen → Allgemein.',
|
||||||
'help.keys': '<b>Tastenkürzel</b> – Esc schließt Panels und Dialoge; Strg+S speichert die Einstellungen.',
|
'help.keys': '<b>Tastenkürzel</b> – Esc schließt Panels und Dialoge; Strg+S speichert die Einstellungen.',
|
||||||
|
'help.prev': 'Zurück',
|
||||||
|
'help.next': 'Weiter',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user