mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
chore: npm run format
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
</script>
|
||||
|
||||
<div class="top-0 left-0 z-100 h-15 w-full bg-neutral-900">
|
||||
<div class="mx-auto md:flex h-15 hidden w-[95%] max-w-7xl items-center py-2">
|
||||
<div class="mx-auto hidden h-15 w-[95%] max-w-7xl items-center py-2 md:flex">
|
||||
<div>
|
||||
<a href={resolve('/')} class="text-xl font-bold text-white hover:text-neutral-300">Sharpbin</a
|
||||
>
|
||||
@@ -74,7 +74,7 @@
|
||||
<img src={logo} alt="Sharpbin Logo" class="h-8 w-8 group-hover:opacity-80" />
|
||||
</a>
|
||||
<button
|
||||
class="ml-auto p-2 flex items-center justify-center h-10 w-10 bg-neutral-800 rounded border border-neutral-700 hover:bg-neutral-700 focus:outline-none"
|
||||
class="ml-auto flex h-10 w-10 items-center justify-center rounded border border-neutral-700 bg-neutral-800 p-2 hover:bg-neutral-700 focus:outline-none"
|
||||
on:click={() => (menuOpen = !menuOpen)}
|
||||
aria-label="Toggle Menu"
|
||||
aria-expanded={menuOpen}
|
||||
@@ -88,48 +88,52 @@
|
||||
</div>
|
||||
{#if menuOpen}
|
||||
<div
|
||||
class="mx-auto mb-2 w-full px-2 py-3 md:hidden bg-neutral-900 border-b border-neutral-800 rounded-b"
|
||||
class="mx-auto mb-2 w-full rounded-b border-b border-neutral-800 bg-neutral-900 px-2 py-3 md:hidden"
|
||||
in:slide={{ duration: 180 }}
|
||||
out:slide={{ duration: 180 }}
|
||||
style="z-index:1000;position:relative;"
|
||||
>
|
||||
<a
|
||||
href={resolve('/recent')}
|
||||
class="block w-full rounded px-3 py-2 text-neutral-100 bg-neutral-800 hover:bg-neutral-700 transition-colors text-center"
|
||||
on:click={() => (menuOpen = false)}
|
||||
>Recent Pastes</a>
|
||||
class="block w-full rounded bg-neutral-800 px-3 py-2 text-center text-neutral-100 transition-colors hover:bg-neutral-700"
|
||||
on:click={() => (menuOpen = false)}>Recent Pastes</a
|
||||
>
|
||||
{#if $user}
|
||||
{#if $user.roles.includes(1) || $user.roles.includes(255)}
|
||||
<a
|
||||
href={resolve('/reports')}
|
||||
class="mt-1 block w-full rounded px-3 py-2 text-neutral-100 bg-neutral-800 hover:bg-neutral-700 transition-colors text-center"
|
||||
on:click={() => (menuOpen = false)}
|
||||
>Reports</a>
|
||||
class="mt-1 block w-full rounded bg-neutral-800 px-3 py-2 text-center text-neutral-100 transition-colors hover:bg-neutral-700"
|
||||
on:click={() => (menuOpen = false)}>Reports</a
|
||||
>
|
||||
{/if}
|
||||
<a
|
||||
href={resolve(`/user/${$user.username}`)}
|
||||
class="mt-1 block w-full rounded px-3 py-2 text-neutral-100 bg-neutral-800 hover:bg-neutral-700 transition-colors text-center"
|
||||
on:click={() => (menuOpen = false)}
|
||||
>Profile</a>
|
||||
class="mt-1 block w-full rounded bg-neutral-800 px-3 py-2 text-center text-neutral-100 transition-colors hover:bg-neutral-700"
|
||||
on:click={() => (menuOpen = false)}>Profile</a
|
||||
>
|
||||
<button
|
||||
on:click={() => {
|
||||
logout();
|
||||
menuOpen = false;
|
||||
}}
|
||||
class="mt-1 w-full rounded bg-neutral-800 px-3 py-2 text-neutral-100 hover:bg-neutral-700 transition-colors text-center"
|
||||
>Logout</button>
|
||||
class="mt-1 w-full rounded bg-neutral-800 px-3 py-2 text-center text-neutral-100 transition-colors hover:bg-neutral-700"
|
||||
>Logout</button
|
||||
>
|
||||
{:else}
|
||||
<a
|
||||
href={resolve(`/login${returnParam}`)}
|
||||
class="mt-1 block w-full rounded px-3 py-2 text-neutral-100 bg-neutral-800 hover:bg-neutral-700 transition-colors"
|
||||
on:click={() => (menuOpen = false)}
|
||||
>Login</a>
|
||||
class="mt-1 block w-full rounded bg-neutral-800 px-3 py-2 text-neutral-100 transition-colors hover:bg-neutral-700"
|
||||
on:click={() => (menuOpen = false)}>Login</a
|
||||
>
|
||||
<!-- eslint-disable svelte/no-navigation-without-resolve -->
|
||||
<a
|
||||
href={data.options?.registration_enabled ? resolve(`/register${returnParam}`) : '#'}
|
||||
class="mt-1 block w-full rounded px-3 py-2 text-neutral-100 hover:bg-neutral-700 transition-colors {data.options?.registration_enabled ? '' : 'cursor-not-allowed bg-neutral-900 text-neutral-500'}"
|
||||
on:click={() => (menuOpen = false)}
|
||||
>Register</a>
|
||||
class="mt-1 block w-full rounded px-3 py-2 text-neutral-100 transition-colors hover:bg-neutral-700 {data
|
||||
.options?.registration_enabled
|
||||
? ''
|
||||
: 'cursor-not-allowed bg-neutral-900 text-neutral-500'}"
|
||||
on:click={() => (menuOpen = false)}>Register</a
|
||||
>
|
||||
<!-- eslint-enable svelte/no-navigation-without-resolve -->
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user