feat: add Today quick-navigate button to nutrition and period tracker
CI / update (push) Successful in 3m36s
CI / update (push) Successful in 3m36s
Shows a Today button when not viewing current date/month. Nutrition page button appears right-aligned in the date nav. Period tracker button appears top-right of the calendar header with centered month title and chevrons.
This commit is contained in:
@@ -662,6 +662,9 @@
|
||||
<button class="cal-nav" onclick={() => calendarOffset++} disabled={calendarOffset >= 12}>
|
||||
<ChevronRight size={16} />
|
||||
</button>
|
||||
{#if calendarOffset !== 0}
|
||||
<button class="go-today-btn" onclick={() => calendarOffset = 0}>{lang === 'de' ? 'Heute' : 'Today'}</button>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="cal-weekdays">
|
||||
{#each weekDays as wd}
|
||||
@@ -1064,9 +1067,28 @@
|
||||
}
|
||||
.cal-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
margin-bottom: 0.5rem;
|
||||
position: relative;
|
||||
}
|
||||
.go-today-btn {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
font-size: 0.65rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-primary);
|
||||
background: color-mix(in srgb, var(--color-primary) 10%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
|
||||
padding: 0.15rem 0.5rem;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.go-today-btn:hover {
|
||||
background: color-mix(in srgb, var(--color-primary) 20%, transparent);
|
||||
}
|
||||
.cal-title {
|
||||
font-size: 0.85rem;
|
||||
|
||||
@@ -930,6 +930,9 @@
|
||||
<button class="date-btn" onclick={() => navigateDate(1)} aria-label="Next day">
|
||||
<ChevronRight size={20} />
|
||||
</button>
|
||||
{#if !isToday}
|
||||
<button class="go-today-btn" onclick={goToday}>{t('today', lang)}</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="sidebar-col">
|
||||
@@ -1677,7 +1680,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.25rem;
|
||||
|
||||
position: relative;
|
||||
}
|
||||
.date-btn {
|
||||
background: none;
|
||||
@@ -1722,6 +1725,23 @@
|
||||
padding: 0.15rem 0.4rem;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.go-today-btn {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-primary);
|
||||
background: color-mix(in srgb, var(--color-primary) 10%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
|
||||
padding: 0.25rem 0.6rem;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.go-today-btn:hover {
|
||||
background: color-mix(in srgb, var(--color-primary) 20%, transparent);
|
||||
}
|
||||
|
||||
/* ── Daily Summary Card ── */
|
||||
.daily-summary {
|
||||
|
||||
Reference in New Issue
Block a user