Merge pull request #409 from Xyphyn/profile-blur

design: blur the profile picture and use in background for nav
This commit is contained in:
Xylight authored and GitHub committed 2024-08-18 21:39:34 -07:00
commit a1d9c4eccc
1 file changed
+20 -8
+20 -8
View File
@@ -35,6 +35,7 @@
import { LINKED_INSTANCE_URL } from '$lib/instance' import { LINKED_INSTANCE_URL } from '$lib/instance'
import { t } from '$lib/translations' import { t } from '$lib/translations'
import CommandsWrapper from './commands/CommandsWrapper.svelte' import CommandsWrapper from './commands/CommandsWrapper.svelte'
import { optimizeImageURL } from '$lib/components/lemmy/post/helpers'
let searching = false let searching = false
let promptOpen: boolean = false let promptOpen: boolean = false
@@ -109,7 +110,8 @@
</div> </div>
{/if} {/if}
<div <div
class="flex flex-row gap-2 py-2 px-2 items-center w-full rounded-full overflow-auto" class="flex flex-row gap-2 py-2 px-2 items-center w-full overflow-auto"
style="border-radius: inherit;"
> >
<div class="ml-auto" /> <div class="ml-auto" />
{#if $profile?.user && isAdmin($profile.user)} {#if $profile?.user && isAdmin($profile.user)}
@@ -181,12 +183,22 @@
</span> </span>
{/if} {/if}
</Menu> </Menu>
<Profile {#if $profile?.user?.local_user_view.person.avatar}
placement="top" <div
itemsClass="h-8 md:h-8 z-10" class="absolute right-0 -z-10 h-full
targetClass="z-10 h-10" overflow-hidden w-full ml-auto"
containerClass="!max-h-[28rem] z-10" style="border-radius: inherit;"
buttonClass="" >
/> <img
src={optimizeImageURL(
$profile?.user?.local_user_view.person.avatar ?? '',
32
)}
class="blur-2xl -z-10 object-cover w-48 h-48 opacity-20 dark:opacity-50 ml-auto"
alt=""
/>
</div>
{/if}
<Profile placement="top" />
</div> </div>
</nav> </nav>