Style more compacted
This commit is contained in:
parent
57463e3865
commit
c48c26290e
3 changed files with 52 additions and 9 deletions
23
app.js
23
app.js
|
|
@ -28,12 +28,14 @@ init().catch((error) => toast(error.message || String(error)));
|
|||
|
||||
async function init() {
|
||||
bindEvents();
|
||||
initHeaderEntriesToggle();
|
||||
await loadState();
|
||||
}
|
||||
|
||||
function bindEvents() {
|
||||
$('addEntryBtn').addEventListener('click', () => openEntryDialog());
|
||||
$('settingsBtn').addEventListener('click', openSettingsDialog);
|
||||
$('toggleEntriesBtn').addEventListener('click', toggleHeaderEntries);
|
||||
$('closeEntryDialogBtn').addEventListener('click', closeEntryDialog);
|
||||
$('closeSettingsDialogBtn').addEventListener('click', closeSettingsDialog);
|
||||
$('entryDialog').addEventListener('click', closeDialogOnBackdrop);
|
||||
|
|
@ -63,6 +65,27 @@ function normalizeSettings(settings) {
|
|||
return normalized;
|
||||
}
|
||||
|
||||
function initHeaderEntriesToggle() {
|
||||
const collapsed = localStorage.getItem('go.headerEntriesCollapsed') === '1';
|
||||
setHeaderEntriesCollapsed(collapsed);
|
||||
}
|
||||
|
||||
function toggleHeaderEntries() {
|
||||
const entries = document.querySelector('.header-entries');
|
||||
const collapsed = !entries?.classList.contains('is-collapsed');
|
||||
setHeaderEntriesCollapsed(collapsed);
|
||||
localStorage.setItem('go.headerEntriesCollapsed', collapsed ? '1' : '0');
|
||||
}
|
||||
|
||||
function setHeaderEntriesCollapsed(collapsed) {
|
||||
const entries = document.querySelector('.header-entries');
|
||||
const button = $('toggleEntriesBtn');
|
||||
if (!entries || !button) return;
|
||||
entries.classList.toggle('is-collapsed', collapsed);
|
||||
button.setAttribute('aria-expanded', collapsed ? 'false' : 'true');
|
||||
button.textContent = collapsed ? 'Show entries' : 'Hide entries';
|
||||
}
|
||||
|
||||
function renderAll() {
|
||||
fillSettingsForm();
|
||||
renderDashboard();
|
||||
|
|
|
|||
|
|
@ -30,8 +30,9 @@
|
|||
<div class="header-warning-row" aria-live="polite">
|
||||
<span id="headerWarnings" class="header-warning-list"></span>
|
||||
<span class="header-action-list">
|
||||
<button id="addEntryBtn" class="header-action-button">Add entry</button>
|
||||
<button id="settingsBtn" class="header-action-button">Settings</button>
|
||||
<button id="toggleEntriesBtn" class="header-action-button" type="button" aria-expanded="true">Entries</button>
|
||||
<button id="addEntryBtn" class="header-action-button" type="button">Add entry</button>
|
||||
<button id="settingsBtn" class="header-action-button" type="button">Settings</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="planner-column-header table-wrap" aria-label="Monthly planner column names">
|
||||
|
|
|
|||
33
style.css
33
style.css
|
|
@ -78,6 +78,7 @@ h2 { margin-bottom: 0; font-size: 1.1rem; }
|
|||
border-radius: 10px;
|
||||
background: rgba(24,18,15,.72);
|
||||
}
|
||||
.header-entries.is-collapsed { display: none; }
|
||||
.header-entries .table-wrap { overflow-x: auto; overflow-y: visible; }
|
||||
.compact-entries-table { font-size: .74rem; }
|
||||
.compact-entries-table th,
|
||||
|
|
@ -118,12 +119,16 @@ h2 { margin-bottom: 0; font-size: 1.1rem; }
|
|||
}
|
||||
.header-action-button:hover { background: var(--accent); color: #18120F; border-color: var(--accent); transform: none; }
|
||||
.planner-column-header {
|
||||
margin-top: .25rem;
|
||||
margin-top: .15rem;
|
||||
border-top: 1px solid rgba(163,138,99,.24);
|
||||
padding-top: .2rem;
|
||||
padding-top: .1rem;
|
||||
}
|
||||
.planner-header-table th {
|
||||
border-bottom: 0;
|
||||
padding: .18rem .45rem;
|
||||
line-height: 1;
|
||||
font-size: .68rem;
|
||||
}
|
||||
.planner-header-table th { border-bottom: 0; }
|
||||
.planner-header-table th,
|
||||
.planner-body-table td { padding: .55rem .45rem; }
|
||||
.panel.planner-panel {
|
||||
padding: 0;
|
||||
|
|
@ -154,6 +159,18 @@ main {
|
|||
.card .label { color: var(--muted); font-size: .64rem; line-height: 1.05; }
|
||||
.card .value { font-size: 1rem; font-weight: 800; margin-top: .02rem; }
|
||||
.card .hint { color: var(--muted); font-size: .6rem; margin-top: .02rem; line-height: 1.05; }
|
||||
.header-cards .card {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: center;
|
||||
gap: .28rem;
|
||||
padding: .18rem .32rem;
|
||||
border-radius: 8px;
|
||||
box-shadow: none;
|
||||
}
|
||||
.header-cards .card .label { font-size: .58rem; white-space: nowrap; }
|
||||
.header-cards .card .value { font-size: .86rem; margin: 0; }
|
||||
.header-cards .card .hint { display: none; }
|
||||
.card.bad .value { color: var(--bad); }
|
||||
.card.warn .value { color: var(--warn); }
|
||||
.card.good .value { color: var(--good); }
|
||||
|
|
@ -362,6 +379,9 @@ tbody tr:hover { background: rgba(255,255,255,.04); }
|
|||
.card .label { font-size: .52rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.card .value { font-size: .82rem; line-height: 1.05; }
|
||||
.card .hint { display: none; }
|
||||
.header-cards .card { padding: .14rem .2rem; gap: .18rem; }
|
||||
.header-cards .card .label { font-size: .48rem; }
|
||||
.header-cards .card .value { font-size: .72rem; }
|
||||
|
||||
.header-entries { padding: .16rem .22rem; margin: .16rem 0; }
|
||||
.header-entries .table-wrap { overflow-x: visible; overflow-y: visible; }
|
||||
|
|
@ -402,10 +422,9 @@ tbody tr:hover { background: rgba(255,255,255,.04); }
|
|||
.header-warning, .header-action-button { min-height: 1.2rem; font-size: .62rem; padding: .14rem .3rem; }
|
||||
|
||||
main { padding: 0 .3rem 3rem; }
|
||||
.planner-column-header { margin-top: .14rem; padding-top: .12rem; }
|
||||
.planner-header-table th,
|
||||
.planner-column-header { margin-top: .1rem; padding-top: .08rem; }
|
||||
.planner-header-table th { padding: .14rem .24rem; font-size: .54rem; letter-spacing: .01em; line-height: 1; }
|
||||
.planner-body-table td { padding: .32rem .24rem; }
|
||||
.planner-header-table th { font-size: .58rem; letter-spacing: .02em; }
|
||||
.month-table { min-width: 600px; }
|
||||
.month-table th:nth-child(1), .month-table td:nth-child(1) { width: 6.8rem; }
|
||||
.month-table th:nth-child(3), .month-table td:nth-child(3),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue