Browse Source

Display height was off, innerHeight overestimates the viewport

master
Nuša Pukšič 11 months ago
parent
commit
3605eb295b
  1. 8
      src/routes/+layout.svelte

8
src/routes/+layout.svelte

@ -6,9 +6,6 @@ @@ -6,9 +6,6 @@
import { Alert } from "flowbite-svelte";
import { HammerSolid } from "flowbite-svelte-icons";
// Compute viewport height.
$: displayHeight = window.innerHeight;
// Get standard metadata for OpenGraph tags
let title = 'Library of Alexandria';
let currentUrl = $page.url.href;
@ -18,7 +15,8 @@ @@ -18,7 +15,8 @@
let summary = 'Alexandria is a digital library, utilizing Nostr events for curated publications and wiki pages.';
onMount(() => {
document.body.style.height = `${displayHeight}px`;
const rect = document.body.getBoundingClientRect();
document.body.style.height = `${rect.height}px`;
});
</script>
@ -44,7 +42,7 @@ @@ -44,7 +42,7 @@
<div class={'leather min-h-full w-full flex flex-col items-center'}>
<Navigation class='sticky top-0' />
<Alert rounded={false} class='border-t-4 border-primary-500 text-gray-900 dark:text-gray-100 dark:border-primary-500 flex justify-left'>
<Alert rounded={false} class='!hidden border-t-4 border-primary-500 text-gray-900 dark:text-gray-100 dark:border-primary-500 flex justify-left mb-2'>
<HammerSolid class='mr-2 h-5 w-5 text-primary-500 dark:text-primary-500' />
<span class='font-medium'>
Pardon our dust! The publication view is currently using an experimental loader, and may be unstable.

Loading…
Cancel
Save