show menu on right side when on admin page
This commit is contained in:
parent
0ab03dd9dc
commit
4d42a5d440
@ -4,6 +4,7 @@
|
|||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import Settings from './Settings.svelte';
|
import Settings from './Settings.svelte';
|
||||||
import { playAudio } from '$lib/stores';
|
import { playAudio } from '$lib/stores';
|
||||||
|
import { page } from '$app/stores';
|
||||||
|
|
||||||
let navPaths = [
|
let navPaths = [
|
||||||
{
|
{
|
||||||
@ -56,6 +57,11 @@
|
|||||||
navPaths[menuButtonScrollIndex].active = true;
|
navPaths[menuButtonScrollIndex].active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let isAdmin = false;
|
||||||
|
$: isAdmin =
|
||||||
|
$page.url.pathname.startsWith(`${env.PUBLIC_BASE_PATH}/admin`) &&
|
||||||
|
$page.url.pathname !== `${env.PUBLIC_BASE_PATH}/admin/login`;
|
||||||
|
|
||||||
let isTouch = false;
|
let isTouch = false;
|
||||||
let nav: HTMLDivElement;
|
let nav: HTMLDivElement;
|
||||||
let settings: HTMLDialogElement;
|
let settings: HTMLDialogElement;
|
||||||
@ -86,7 +92,8 @@
|
|||||||
</main>
|
</main>
|
||||||
<nav>
|
<nav>
|
||||||
<div
|
<div
|
||||||
class="fixed bottom-4 right-4 sm:right-[initial] sm:left-4 group/menu-bar flex flex-col-reverse justify-center items-center"
|
class="fixed bottom-4 right-4 group/menu-bar flex flex-col-reverse justify-center items-center"
|
||||||
|
class:sm:left-4,sm:right-[initial]={!isAdmin}
|
||||||
bind:this={nav}
|
bind:this={nav}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
@ -137,7 +144,8 @@
|
|||||||
<ul class="flex flex-col bg-base-200 rounded">
|
<ul class="flex flex-col bg-base-200 rounded">
|
||||||
{#each navPaths as navPath, i}
|
{#each navPaths as navPath, i}
|
||||||
<li
|
<li
|
||||||
class="flex justify-center tooltip tooltip-left sm:tooltip-right"
|
class="flex justify-center tooltip tooltip-left"
|
||||||
|
class:sm:tooltip-right={!isAdmin}
|
||||||
data-tip={navPath.name}
|
data-tip={navPath.name}
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user