design: tweak mobile navbar
This commit is contained in:
6 files changed
+37
-19
No files matched your search
@@ -303,7 +303,7 @@
|
|||||||
"localView": "Local View",
|
"localView": "Local View",
|
||||||
"thread": {
|
"thread": {
|
||||||
"single": "You're viewing a single thread.",
|
"single": "You're viewing a single thread.",
|
||||||
"allComments": "All Comments",
|
"allComments": "All comments",
|
||||||
"part": "You're viewing part of a thread.",
|
"part": "You're viewing part of a thread.",
|
||||||
"context": "Show Context"
|
"context": "Show Context"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,9 +31,7 @@
|
|||||||
>
|
>
|
||||||
<Avatar url={icon} alt={title} width={detail ? 32 : 24} circle={false} />
|
<Avatar url={icon} alt={title} width={detail ? 32 : 24} circle={false} />
|
||||||
<a class="flex-1 flex flex-col group" {href}>
|
<a class="flex-1 flex flex-col group" {href}>
|
||||||
<h3
|
<h3 class="font-medium text-base overflow-hidden text-ellipsis leading-5">
|
||||||
class="font-medium text-base overflow-hidden text-ellipsis leading-5 group-hover:underline"
|
|
||||||
>
|
|
||||||
{title}
|
{title}
|
||||||
</h3>
|
</h3>
|
||||||
<p class="text-sm text-slate-600 dark:text-zinc-400">
|
<p class="text-sm text-slate-600 dark:text-zinc-400">
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
class={[
|
class={[
|
||||||
'rounded-full font-medium transition-colors duration-100 relative z-0 shrink-0 hover:text-slate-900 hover:dark:text-zinc-100',
|
'rounded-full font-medium transition-colors duration-100 relative z-0 shrink-0 hover:text-slate-900 hover:dark:text-zinc-100',
|
||||||
selected
|
selected
|
||||||
? 'text-primary-900 dark:text-primary-100'
|
? 'tab-selected text-primary-900 dark:text-primary-100'
|
||||||
: 'text-slate-500 dark:text-zinc-500',
|
: 'text-slate-500 dark:text-zinc-500',
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
@@ -90,3 +90,17 @@
|
|||||||
{/each}
|
{/each}
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.tab-selected {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-selected::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
inset: calc(var(--spacing) * -1) calc(var(--spacing) * -3);
|
||||||
|
z-index: -10;
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
:global {
|
:global {
|
||||||
.prefix {
|
.prefix {
|
||||||
@variant max-md {
|
@variant max-md {
|
||||||
height: 100%;
|
height: 90%;
|
||||||
display: grid;
|
display: grid;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
aspect-ratio: 1 / 1;
|
aspect-ratio: 1 / 1;
|
||||||
@@ -121,10 +121,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@variant max-md {
|
.nav-btn-sm-primary .prefix {
|
||||||
.nav-btn-sm-primary .prefix {
|
@variant max-md {
|
||||||
background-color: var(--color-primary-900);
|
background-color: var(--color-primary-900);
|
||||||
color: var(--color-slate-50);
|
color: var(--color-slate-50);
|
||||||
|
border-radius: var(--radius-xl);
|
||||||
|
height: 80%;
|
||||||
|
|
||||||
@variant hover {
|
@variant hover {
|
||||||
color: var(--color-slate-50);
|
color: var(--color-slate-50);
|
||||||
|
|||||||
@@ -48,10 +48,10 @@
|
|||||||
icon={Home}
|
icon={Home}
|
||||||
href="/"
|
href="/"
|
||||||
label={$t('nav.home')}
|
label={$t('nav.home')}
|
||||||
class="logo border-0 md:rounded-full! md:w-10! md:h-10 md:px-0! text-primary-900! dark:text-primary-100! -order-1"
|
class="logo border-0 md:rounded-full! md:w-10! md:h-10 md:px-0! -order-1"
|
||||||
adaptive={false}
|
adaptive={false}
|
||||||
>
|
>
|
||||||
{#snippet customIcon()}
|
{#snippet customIcon({ isSelected })}
|
||||||
{#if LINKED_INSTANCE_URL}
|
{#if LINKED_INSTANCE_URL}
|
||||||
{#if site.data}
|
{#if site.data}
|
||||||
<Avatar
|
<Avatar
|
||||||
@@ -64,7 +64,14 @@
|
|||||||
<Spinner width={32} />
|
<Spinner width={32} />
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
<Logo width={32} />
|
<div class="hidden md:block text-primary-900! dark:text-primary-100!">
|
||||||
|
<Logo width={32} />
|
||||||
|
</div>
|
||||||
|
<div class={['block md:hidden text-inherit!']}>
|
||||||
|
<div class="prefix">
|
||||||
|
<Icon src={Home} size="20" mini />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</NavButton>
|
</NavButton>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
PostMeta,
|
PostMeta,
|
||||||
type Tag,
|
type Tag,
|
||||||
} from '$lib/feature/post'
|
} from '$lib/feature/post'
|
||||||
|
import Fixate from '$lib/ui/generic/Fixate.svelte'
|
||||||
import Placeholder from '$lib/ui/info/Placeholder.svelte'
|
import Placeholder from '$lib/ui/info/Placeholder.svelte'
|
||||||
import { CommonList } from '$lib/ui/layout'
|
import { CommonList } from '$lib/ui/layout'
|
||||||
import EndPlaceholder from '$lib/ui/layout/EndPlaceholder.svelte'
|
import EndPlaceholder from '$lib/ui/layout/EndPlaceholder.svelte'
|
||||||
@@ -214,13 +215,9 @@
|
|||||||
</article>
|
</article>
|
||||||
{#await data.data.value.comments then comments}
|
{#await data.data.value.comments then comments}
|
||||||
{#if data.data.value.params.thread.showContext || data.data.value.params.thread.singleThread}
|
{#if data.data.value.params.thread.showContext || data.data.value.params.thread.singleThread}
|
||||||
<div
|
<Fixate placement="top">
|
||||||
class="sticky mx-auto z-50 max-w-md min-w-0 flex flex-col items-center overflow-auto gap-1
|
|
||||||
bg-slate-50/50 dark:bg-zinc-900/50 backdrop-blur-xl border border-slate-200/50 dark:border-zinc-800/50
|
|
||||||
p-1 rounded-full justify-between top-6 lg:top-22 my-4"
|
|
||||||
>
|
|
||||||
<Button
|
<Button
|
||||||
color="none"
|
color="primary"
|
||||||
rounding="pill"
|
rounding="pill"
|
||||||
{loading}
|
{loading}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
@@ -232,7 +229,7 @@
|
|||||||
: data.data.value.params.thread.singleThread
|
: data.data.value.params.thread.singleThread
|
||||||
? postLink(data.data.value.post.post)
|
? postLink(data.data.value.post.post)
|
||||||
: undefined}
|
: undefined}
|
||||||
class="hover:bg-white/50 dark:hover:bg-zinc-800/30"
|
class="w-max mx-auto sticky lg:top-20 z-50"
|
||||||
>
|
>
|
||||||
{data.data.value.params.thread.showContext
|
{data.data.value.params.thread.showContext
|
||||||
? $t('routes.post.thread.context')
|
? $t('routes.post.thread.context')
|
||||||
@@ -241,7 +238,7 @@
|
|||||||
<Icon src={ArrowRight} size="16" micro />
|
<Icon src={ArrowRight} size="16" micro />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</Fixate>
|
||||||
{/if}
|
{/if}
|
||||||
{/await}
|
{/await}
|
||||||
<section class="flex flex-col gap-2 w-full" id="comments">
|
<section class="flex flex-col gap-2 w-full" id="comments">
|
||||||
|
|||||||
Reference in new issue
Block a user