feat: add b lurred backgrounds for images
This commit is contained in:
1 parent
9f6af2a2fb
commit
9f7b03ce97
2 files changed
+12
-5
No files matched your search
@@ -26,16 +26,23 @@
|
||||
<svelte:element
|
||||
this={$userSettings.expandImages ? 'button' : 'a'}
|
||||
href={postLink(post)}
|
||||
class="container mx-auto z-10 rounded-xl max-h-[60vh] relative overflow-hidden bg-slate-100 dark:bg-zinc-900 bg-gradient-to-br from-blue-500/5 to-pink-500/5"
|
||||
class="container mx-auto z-10 rounded-xl max-h-[60vh] relative overflow-hidden bg-slate-100 dark:bg-zinc-900
|
||||
"
|
||||
data-sveltekit-preload-data="off"
|
||||
aria-label={post.name}
|
||||
on:click={() => showImage(bestImageURL(post, false, 2048))}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<img
|
||||
src={bestImageURL(post, false, 256)}
|
||||
loading="lazy"
|
||||
class="-z-10 absolute top-0 left-0 w-full h-full object-cover blur-xl opacity-50"
|
||||
alt="the background blur"
|
||||
/>
|
||||
<picture class="max-h-[inherit]">
|
||||
<source
|
||||
srcset={bestImageURL(post, false, 512)}
|
||||
srcset={bestImageURL(post, false, 256)}
|
||||
media="(max-width: 256px)"
|
||||
/>
|
||||
<source
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</Modal>
|
||||
|
||||
<div
|
||||
class="background-gradient w-full h-64 absolute top-0 left-0 -z-10 object-cover"
|
||||
class="background-gradient w-full h-48 absolute top-0 left-0 -z-10 object-cover"
|
||||
></div>
|
||||
|
||||
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
||||
@@ -78,12 +78,12 @@
|
||||
.background-gradient {
|
||||
background-image: radial-gradient(
|
||||
circle at left,
|
||||
rgba(162, 1, 114, 0.1) 0%,
|
||||
rgba(162, 1, 114, 0.05) 0%,
|
||||
rgba(255, 0, 43, 0) 100%
|
||||
),
|
||||
radial-gradient(
|
||||
circle at 60% 80%,
|
||||
rgba(162, 33, 1, 0.2) 0%,
|
||||
rgba(162, 33, 1, 0.1) 0%,
|
||||
rgba(255, 0, 174, 0) 100%
|
||||
);
|
||||
background-repeat: no-repeat;
|
||||
|
||||
Reference in new issue
Block a user