diff options
| author | Fuwn <[email protected]> | 2023-09-20 15:44:02 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-20 15:44:02 -0700 |
| commit | cbbbf59d169b3caae2121caf9c923b445e50c568 (patch) | |
| tree | 5c397d550d4296e1316553c45936f56c8b196b82 /src | |
| parent | feat(settings): limit list height (diff) | |
| download | due.moe-cbbbf59d169b3caae2121caf9c923b445e50c568.tar.xz due.moe-cbbbf59d169b3caae2121caf9c923b445e50c568.zip | |
fix(page): fix height limit with activity warning
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/+page.svelte | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index c5109c4a..76c05f86 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -19,7 +19,7 @@ document.querySelectorAll('.list').forEach((list) => { list.style.maxHeight = `calc(100vh - ${ document.querySelector('#list-container')?.getBoundingClientRect().bottom - }px)`; + }px + 1.1rem)`; }); } @@ -32,6 +32,16 @@ currentUserIdentity.name = currentUserIdentity.name; lastActivityWasToday = (await lastActivityDate(currentUserIdentity)).toDateString() >= new Date().toDateString(); + + if (!lastActivityWasToday) { + if ($settings.limitListHeight) { + document.querySelectorAll('.list').forEach((list) => { + list.style.maxHeight = `calc((100vh - ${ + document.querySelector('#list-container')?.getBoundingClientRect().bottom + }px) - 1.9rem)`; + }); + } + } } }); @@ -60,12 +70,10 @@ </script> {#if !lastActivityWasToday} - <div id="activity-warning"> - <p> - You don't have any new activity statuses from the past day! Create one within {timeLeftToday()} - to keep your streak! - </p> - </div> + <p> + You don't have any new activity statuses from the past day! Create one within {timeLeftToday()} + to keep your streak! + </p> {/if} <div id="list-container"> |