fix footer obscuring bottom of content

feat/vaults
Tomáš Mládek 2021-12-27 12:33:48 +01:00
parent 0760e14002
commit b63e27006a
No known key found for this signature in database
GPG Key ID: ED21612889E75EC5
3 changed files with 21 additions and 3 deletions

View File

@ -22,9 +22,15 @@
);
const history = createHistory(createHashSource());
let footerHeight = "0";
function setBottomMargin(size: CustomEvent<ResizeObserverEntry>) {
footerHeight = `${size.detail.contentRect.height}px`;
}
</script>
<Router {history} primary={false}>
<Router {history} primary={false} --footer-height={footerHeight} >
<Header />
<Route path="/">
@ -39,7 +45,7 @@
<Search query={params.query} />
</Route>
<Footer />
<Footer on:resize={setBottomMargin} />
</Router>
<style global lang="scss">

View File

@ -1,9 +1,20 @@
<script lang="ts">
import { createEventDispatcher, onMount } from "svelte";
import Jobs from "./Jobs.svelte";
import Notifications from "./Notifications.svelte";
const dispatch = createEventDispatcher();
let root: HTMLElement;
onMount(() => {
const observer = new ResizeObserver((entries) => {
entries.forEach((entry) => dispatch("resize", entry));
});
observer.observe(root);
});
</script>
<footer id="footer">
<footer id="footer" bind:this={root}>
<Notifications />
<Jobs />
</footer>

View File

@ -64,6 +64,7 @@
// header margin magic
height: calc(100% - 3.5rem - 1rem - 1px);
margin-top: 1rem;
margin-bottom: var(--footer-height);
}
.view {