design: add blur to user card

This commit is contained in:
Xylight committed 2024-08-18 14:36:39 -07:00
1 parent cedfb53ba2
commit de77be7f65
1 file changed
+18 -1
+18 -1
View File
@@ -3,6 +3,7 @@
import Avatar from './Avatar.svelte' import Avatar from './Avatar.svelte'
import PostBody from '../lemmy/post/PostBody.svelte' import PostBody from '../lemmy/post/PostBody.svelte'
import LabelStat from './LabelStat.svelte' import LabelStat from './LabelStat.svelte'
import { optimizeImageURL } from '../lemmy/post/helpers'
export let avatar: string | undefined = undefined export let avatar: string | undefined = undefined
export let name: string export let name: string
@@ -14,7 +15,13 @@
}[] = [] }[] = []
</script> </script>
<Material color="transparent" padding="none" rounding="xl" {...$$restProps}> <Material
color="transparent"
padding="none"
rounding="xl"
class="z-10 relative"
{...$$restProps}
>
{#if banner} {#if banner}
<div class="max-h-36 overflow-visible"> <div class="max-h-36 overflow-visible">
<img <img
@@ -24,6 +31,16 @@
alt="User banner" alt="User banner"
/> />
</div> </div>
<div
class="absolute top-0 left-0 -z-10 object-cover h-full w-full rounded-xl
overflow-hidden"
>
<img
src={optimizeImageURL(banner, 64)}
alt=""
class="opacity-10 blur-2xl h-full w-full saturate-200"
/>
</div>
{/if} {/if}
<div class="p-4 flex flex-col sm:flex-row gap-4"> <div class="p-4 flex flex-col sm:flex-row gap-4">
<div class="space-y-3 flex-1"> <div class="space-y-3 flex-1">