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 Settings from './Settings.svelte';
|
||||
import { playAudio } from '$lib/stores';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
let navPaths = [
|
||||
{
|
||||
@ -56,6 +57,11 @@
|
||||
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 nav: HTMLDivElement;
|
||||
let settings: HTMLDialogElement;
|
||||
@ -86,7 +92,8 @@
|
||||
</main>
|
||||
<nav>
|
||||
<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}
|
||||
>
|
||||
<button
|
||||
@ -137,7 +144,8 @@
|
||||
<ul class="flex flex-col bg-base-200 rounded">
|
||||
{#each navPaths as navPath, i}
|
||||
<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}
|
||||
>
|
||||
<a
|
||||
|
Loading…
x
Reference in New Issue
Block a user