web/settings: change the layout on mobile screen
This commit is contained in:
parent
f8ade2bf08
commit
dd1f9b512f
1 changed files with 32 additions and 3 deletions
|
@ -1,4 +1,6 @@
|
||||||
<script>
|
<script lang="ts">
|
||||||
|
import { page } from "$app/stores";
|
||||||
|
|
||||||
import SettingsTab from "$components/settings/SettingsTab.svelte";
|
import SettingsTab from "$components/settings/SettingsTab.svelte";
|
||||||
import SettingsSection from "$components/settings/SettingsSection.svelte";
|
import SettingsSection from "$components/settings/SettingsSection.svelte";
|
||||||
|
|
||||||
|
@ -7,10 +9,17 @@
|
||||||
import IconMovie from "@tabler/icons-svelte/IconMovie.svelte";
|
import IconMovie from "@tabler/icons-svelte/IconMovie.svelte";
|
||||||
import IconMusic from "@tabler/icons-svelte/IconMusic.svelte";
|
import IconMusic from "@tabler/icons-svelte/IconMusic.svelte";
|
||||||
import IconFileSettings from "@tabler/icons-svelte/IconFileSettings.svelte";
|
import IconFileSettings from "@tabler/icons-svelte/IconFileSettings.svelte";
|
||||||
|
|
||||||
|
let screenWidth: number;
|
||||||
|
|
||||||
|
$: isMobile = screenWidth <= 750;
|
||||||
|
$: isHome = $page.url.pathname === `/settings`;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<svelte:window bind:innerWidth={screenWidth} />
|
||||||
|
|
||||||
<div id="settings-page">
|
<div id="settings-page">
|
||||||
<div id="settings-sidebar">
|
<div id="settings-sidebar" class:visible-mobile={isMobile && isHome}>
|
||||||
<h2 id="settings-page-title">settings</h2>
|
<h2 id="settings-page-title">settings</h2>
|
||||||
<nav id="settings-navigation">
|
<nav id="settings-navigation">
|
||||||
<SettingsSection sectionTitle="general">
|
<SettingsSection sectionTitle="general">
|
||||||
|
@ -48,7 +57,7 @@
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<main id="settings-page-content">
|
<main id="settings-page-content" class:hidden-mobile={isMobile && isHome}>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
@ -91,4 +100,24 @@
|
||||||
#settings-navigation {
|
#settings-navigation {
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hidden-mobile {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 750px) {
|
||||||
|
#settings-page {
|
||||||
|
--settings-nav-width: 100%;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
#settings-sidebar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#settings-sidebar.visible-mobile {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue