design: improve cozy design

This commit is contained in:
James Xylight committed 2025-08-21 17:56:40 -07:00
1 parent 6303dc224c
commit baa5a067c1
3 files changed
+14 -15

No files matched your search

+3 -4
View File
@@ -81,7 +81,7 @@
}) })
</script> </script>
<!-- <!--
@component @component
This is the sole component for displaying posts. 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. 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 --> <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
<div <div
class={[ 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', settings.leftAlign && 'left-align',
view == 'compact' && 'py-3 list-type compact', view == 'compact' && 'py-3 list-type compact',
view == 'cozy' && 'py-5 flex flex-col gap-2', view == 'cozy' && 'py-5 flex flex-col gap-2',
@@ -164,8 +164,7 @@
class="absolute overflow-hidden inset-0 class="absolute overflow-hidden inset-0
sm:rounded-xl bg-slate-50 dark:bg-zinc-900 sm:rounded-xl bg-slate-50 dark:bg-zinc-900
opacity-0 transition-all -z-50 no-list-margin 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-hover/post:inset-y-0.5 group-hover/post:-inset-x-3 sm:group-hover/post:-inset-x-5 group-hover/post:opacity-100
group-focus:inset-y-0.5 group-focus:-inset-x-3 sm:group-focus:-inset-x-5 group-focus:opacity-100
duration-150" duration-150"
></div> ></div>
</div> </div>
@@ -39,16 +39,17 @@
]} ]}
rounding="2xl" rounding="2xl"
element="article" element="article"
padding="sm"
> >
{#if thumbnail_url} {#if thumbnail_url}
<img <img
src={optimizeImageURL(thumbnail_url, 64)} src={optimizeImageURL(thumbnail_url, 32)}
alt="" alt=""
class="-z-10 absolute w-full object-cover h-full opacity-5 brightness-150 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} {/if}
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-1 p-3 -mt-2 sm:mt-0">
{#if richURL} {#if richURL}
<div <div
class="text-slate-600 dark:text-zinc-400 inline-flex items-center gap-1 text-xs font-medium" 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> <p class="font-medium text-base">{embed_title}</p>
</div> </div>
{#if thumbnail_url} {#if thumbnail_url}
<picture <picture class="mb-auto sm:ml-auto shrink-0 sm:w-1/3 sm:max-w-60">
class="-m-4 mb-auto sm:-mb-4 sm:ml-auto shrink-0 sm:w-1/3 sm:max-w-60"
>
{#each ['webp'] as format} {#each ['webp'] as format}
<source <source
srcset="{optimizeImageURL( srcset="{optimizeImageURL(
@@ -79,7 +78,7 @@
{/each} {/each}
<img <img
src={optimizeImageURL(thumbnail_url, -1)} 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} width={600}
height={400} height={400}
alt="" alt=""
@@ -26,8 +26,8 @@
href={postLink(post)} href={postLink(post)}
class={[ class={[
'container/a z-10 rounded-2xl cursor-pointer relative overflow-hidden', 'container/a z-10 rounded-2xl cursor-pointer relative overflow-hidden',
'bg-slate-100 dark:bg-zinc-900 transition-colors p-2', 'bg-slate-100 dark:bg-zinc-900 transition-colors',
'border border-slate-200 dark:border-zinc-800 hover:border-slate-300 hover:dark:border-zinc-700', 'border border-slate-200 dark:border-zinc-800 group',
]} ]}
data-sveltekit-preload-data="off" data-sveltekit-preload-data="off"
aria-label={post.name} aria-label={post.name}
@@ -36,7 +36,7 @@
tabindex="0" tabindex="0"
> >
<!-- svelte-ignore a11y_missing_attribute --> <!-- 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 <img
loading="lazy" loading="lazy"
fetchpriority="auto" fetchpriority="auto"
@@ -71,7 +71,8 @@
src={bestImageURL(post, false, -1, null)} src={bestImageURL(post, false, -1, null)}
loading="lazy" loading="lazy"
class={[ 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', imageLoaded === false ? 'opacity-0' : 'opacity-100',
blur && 'blur-3xl', blur && 'blur-3xl',
]} ]}