Skip to content

Commit

Permalink
fix: front page
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperorb committed Mar 31, 2024
1 parent e021eb1 commit 3098112
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
23 changes: 10 additions & 13 deletions src/lib/components/ui/Main.svelte
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
<main id="main" tabindex="-1">
<script lang="ts">
export let center: boolean | undefined = undefined;
</script>

<main id="main" class:center={center} tabindex="-1">
<div class="wrapper">
<slot />
</div>
</main>

<style>
main {
flex: 1;
}
@media (min-width: 900px) {
main {
z-index: 2;
max-width: 100%;
}
.wrapper {
border-radius: 6px 0 0 6px;
}
.center {
display: flex;
justify-content: center;
align-items: center;
}
.wrapper {
border-radius: 4px;
background-color: var(--background-color);
border: 1px solid var(--border-color);
border-right: 0;
padding: var(--spacing-4);
}
</style>
6 changes: 4 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
import ProgressBar from '$lib/components/ui/ProgressBar.svelte';
import Header from '$lib/components/ui/Header.svelte';
let routeId: FormatMethodsKeys | 'Playground';
let routeId: FormatMethodsKeys | 'Playground' | "/";
$: isHomePage = false;
const getRouteId = (page: Page<Record<string, string>>): void => {
isHomePage = page.route.id === "/";
routeId = page.route.id?.replace('/', '') as FormatMethodsKeys;
if(browser) {
document.querySelector("h1")?.setAttribute("tabIndex", "-1");
Expand All @@ -38,7 +40,7 @@

<Navigation />

<Main>
<Main bind:center={isHomePage}>
{#if $navigating}
<ProgressBar />
{/if}
Expand Down

0 comments on commit 3098112

Please sign in to comment.