design: improve cozy design
This commit is contained in:
3 files changed
+14
-15
No files matched your search
@@ -81,7 +81,7 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
@component
|
||||
This is the sole component for displaying posts.
|
||||
It adapts to all kinds of form factors for different contexts, such as feeds, full post view, and crosspost list.
|
||||
@@ -90,7 +90,7 @@
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<div
|
||||
class={[
|
||||
'post relative max-w-full min-w-0 w-full cursor-pointer outline-hidden group',
|
||||
'post relative max-w-full min-w-0 w-full cursor-pointer outline-hidden group/post',
|
||||
settings.leftAlign && 'left-align',
|
||||
view == 'compact' && 'py-3 list-type compact',
|
||||
view == 'cozy' && 'py-5 flex flex-col gap-2',
|
||||
@@ -164,8 +164,7 @@
|
||||
class="absolute overflow-hidden inset-0
|
||||
sm:rounded-xl bg-slate-50 dark:bg-zinc-900
|
||||
opacity-0 transition-all -z-50 no-list-margin
|
||||
group-hover:inset-y-0.5 group-hover:-inset-x-3 sm:group-hover:-inset-x-5 group-hover:opacity-100
|
||||
group-focus:inset-y-0.5 group-focus:-inset-x-3 sm:group-focus:-inset-x-5 group-focus:opacity-100
|
||||
group-hover/post:inset-y-0.5 group-hover/post:-inset-x-3 sm:group-hover/post:-inset-x-5 group-hover/post:opacity-100
|
||||
duration-150"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
@@ -39,16 +39,17 @@
|
||||
]}
|
||||
rounding="2xl"
|
||||
element="article"
|
||||
padding="sm"
|
||||
>
|
||||
{#if thumbnail_url}
|
||||
<img
|
||||
src={optimizeImageURL(thumbnail_url, 64)}
|
||||
src={optimizeImageURL(thumbnail_url, 32)}
|
||||
alt=""
|
||||
class="-z-10 absolute w-full object-cover h-full opacity-5 brightness-150
|
||||
dark:brightness-70 dark:opacity-20 blur-2xl -inset-px"
|
||||
dark:brightness-70 dark:opacity-10 blur-2xl -inset-px"
|
||||
/>
|
||||
{/if}
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class="flex flex-col gap-1 p-3 -mt-2 sm:mt-0">
|
||||
{#if richURL}
|
||||
<div
|
||||
class="text-slate-600 dark:text-zinc-400 inline-flex items-center gap-1 text-xs font-medium"
|
||||
@@ -59,9 +60,7 @@
|
||||
<p class="font-medium text-base">{embed_title}</p>
|
||||
</div>
|
||||
{#if thumbnail_url}
|
||||
<picture
|
||||
class="-m-4 mb-auto sm:-mb-4 sm:ml-auto shrink-0 sm:w-1/3 sm:max-w-60"
|
||||
>
|
||||
<picture class="mb-auto sm:ml-auto shrink-0 sm:w-1/3 sm:max-w-60">
|
||||
{#each ['webp'] as format}
|
||||
<source
|
||||
srcset="{optimizeImageURL(
|
||||
@@ -79,7 +78,7 @@
|
||||
{/each}
|
||||
<img
|
||||
src={optimizeImageURL(thumbnail_url, -1)}
|
||||
class="object-cover w-full sm:max-w-96 h-32 sm:min-h-16 bg-slate-200 dark:bg-zinc-800"
|
||||
class="object-cover w-full sm:max-w-96 h-32 sm:min-h-16 bg-slate-200 dark:bg-zinc-800 rounded-xl"
|
||||
width={600}
|
||||
height={400}
|
||||
alt=""
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
href={postLink(post)}
|
||||
class={[
|
||||
'container/a z-10 rounded-2xl cursor-pointer relative overflow-hidden',
|
||||
'bg-slate-100 dark:bg-zinc-900 transition-colors p-2',
|
||||
'border border-slate-200 dark:border-zinc-800 hover:border-slate-300 hover:dark:border-zinc-700',
|
||||
'bg-slate-100 dark:bg-zinc-900 transition-colors',
|
||||
'border border-slate-200 dark:border-zinc-800 group',
|
||||
]}
|
||||
data-sveltekit-preload-data="off"
|
||||
aria-label={post.name}
|
||||
@@ -36,7 +36,7 @@
|
||||
tabindex="0"
|
||||
>
|
||||
<!-- svelte-ignore a11y_missing_attribute -->
|
||||
<div class="inset-2 absolute -z-10 rounded-xl overflow-hidden">
|
||||
<div class="inset-0 absolute -z-10 rounded-xl overflow-hidden">
|
||||
<img
|
||||
loading="lazy"
|
||||
fetchpriority="auto"
|
||||
@@ -71,7 +71,8 @@
|
||||
src={bestImageURL(post, false, -1, null)}
|
||||
loading="lazy"
|
||||
class={[
|
||||
'max-w-full rounded-xl z-30 transition-opacity max-h-[60vh] duration-500 object-contain mx-auto',
|
||||
'max-w-full rounded-xl z-30 transition-all max-h-[60vh] duration-500 object-contain mx-auto group-hover:scale-98 group-active:scale-95',
|
||||
'duration-200 ease-cubic',
|
||||
imageLoaded === false ? 'opacity-0' : 'opacity-100',
|
||||
blur && 'blur-3xl',
|
||||
]}
|
||||
|
||||
Reference in new issue
Block a user