style, fix: footer with notifications, styling improvements
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Tomáš Mládek 2023-08-27 09:58:56 +02:00
parent e2db937b65
commit 4b798163f9

View file

@ -1,22 +1,19 @@
<script lang="ts"> <script lang="ts">
import Icon from "../utils/Icon.svelte" import Icon from "../utils/Icon.svelte";
import Jobs from "./Jobs.svelte"; import Jobs from "./Jobs.svelte";
import Notifications from "./Notifications.svelte"; import Notifications from "./Notifications.svelte";
import { i18n } from "../../i18n"; import { i18n } from "../../i18n";
let hidden = true; let hidden = true;
let activeJobs: number; let activeJobs: number;
let infoHeight = -1;
</script> </script>
<footer <footer id="footer" class:hidden>
id="footer" <div class="notifications">
class:hidden <Notifications />
style="--info-height: -{infoHeight}px" </div>
>
<!-- svelte-ignore a11y-click-events-have-key-events --> <!-- svelte-ignore a11y-click-events-have-key-events -->
<div class="status" bind:clientHeight={infoHeight} on:click={() => hidden = !hidden}> <div class="status" on:click={() => (hidden = !hidden)}>
<div class="info"> <div class="info">
{#if activeJobs > 0} {#if activeJobs > 0}
{$i18n.t("Active jobs:")} {activeJobs} {$i18n.t("Active jobs:")} {activeJobs}
@ -25,13 +22,10 @@
{/if} {/if}
</div> </div>
<div class="icons"> <div class="icons">
<Icon <Icon name="{hidden ? 'up' : 'down'}-arrow" />
name="{hidden ? 'up' : 'down'}-arrow"
/>
</div> </div>
</div> </div>
<div class="content"> <div class="jobs">
<Notifications />
<Jobs bind:active={activeJobs} /> <Jobs bind:active={activeJobs} />
</div> </div>
</footer> </footer>
@ -41,26 +35,32 @@
position: fixed; position: fixed;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
& > * {
padding: 0 0.5rem;
}
background: var(--background); background: var(--background);
border-top: 1px solid var(--foreground-lighter); border-top: 1px solid var(--foreground-lighter);
transition: 0.7s bottom ease; transition: 0.7s bottom ease;
--height: calc(100vh / 6);
} }
footer.hidden { footer.hidden {
bottom: -20vh; bottom: calc(var(--height) * -1);
} }
.status { .status {
height: 2rem;
width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
height: 2em;
padding: 0.2em;
position: absolute;
top: 0;
width: 100%;
cursor: pointer; cursor: pointer;
@ -70,13 +70,23 @@
} }
} }
.content { .notifications,
margin-top: 2em; .jobs {
overflow-y: scroll; display: flex;
height: 20vh; flex-direction: column;
gap: 0.25rem;
} }
:global(#footer .content > *) { :global(.notifications > *:first-child) {
margin: 0.5rem; padding-top: 0.5rem;
}
.jobs {
overflow-y: scroll;
height: var(--height);
padding-top: 0.5rem;
background: var(--background-lighter);
} }
</style> </style>