design: add indicator to post link to improve mind connection
This commit is contained in:
3 files changed
+43
-27
No files matched your search
@@ -2,7 +2,7 @@
|
|||||||
import type { View } from '$lib/app/settings.svelte'
|
import type { View } from '$lib/app/settings.svelte'
|
||||||
import { parseURL } from '$lib/ui/form/Link.svelte'
|
import { parseURL } from '$lib/ui/form/Link.svelte'
|
||||||
import { Material } from 'mono-svelte'
|
import { Material } from 'mono-svelte'
|
||||||
import { Icon, Link } from 'svelte-hero-icons/dist'
|
import { ArrowTopRightOnSquare, Icon, Link } from 'svelte-hero-icons/dist'
|
||||||
import { optimizeImageURL } from './helpers'
|
import { optimizeImageURL } from './helpers'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -50,31 +50,46 @@
|
|||||||
<p class="post-link-title">{embed_title}</p>
|
<p class="post-link-title">{embed_title}</p>
|
||||||
</div>
|
</div>
|
||||||
{#if thumbnail_url}
|
{#if thumbnail_url}
|
||||||
<picture class="post-link-image">
|
<div class="post-link-image">
|
||||||
{#each ['webp'] as format}
|
<picture class="contents">
|
||||||
<source
|
{#each ['webp'] as format}
|
||||||
srcset="{optimizeImageURL(
|
<source
|
||||||
thumbnail_url,
|
srcset="{optimizeImageURL(
|
||||||
256,
|
thumbnail_url,
|
||||||
format as 'avif' | 'webp',
|
256,
|
||||||
)} 256w, {optimizeImageURL(
|
format as 'avif' | 'webp',
|
||||||
thumbnail_url,
|
)} 256w, {optimizeImageURL(
|
||||||
512,
|
thumbnail_url,
|
||||||
format as 'avif' | 'webp',
|
512,
|
||||||
)} 512w"
|
format as 'avif' | 'webp',
|
||||||
media="(min-width: 0px)"
|
)} 512w"
|
||||||
type="image/{format}"
|
media="(min-width: 0px)"
|
||||||
|
type="image/{format}"
|
||||||
|
/>
|
||||||
|
{/each}
|
||||||
|
<img
|
||||||
|
src={optimizeImageURL(thumbnail_url, -1)}
|
||||||
|
class=""
|
||||||
|
width={600}
|
||||||
|
height={400}
|
||||||
|
alt=""
|
||||||
|
class:blur-3xl={nsfw}
|
||||||
/>
|
/>
|
||||||
{/each}
|
</picture>
|
||||||
<img
|
<Material
|
||||||
src={optimizeImageURL(thumbnail_url, -1)}
|
padding="xs"
|
||||||
class=""
|
color="uniform"
|
||||||
width={600}
|
class="absolute top-0 right-0 m-2 z-50"
|
||||||
height={400}
|
role="presentation"
|
||||||
alt=""
|
>
|
||||||
class:blur-3xl={nsfw}
|
<Icon
|
||||||
/>
|
src={ArrowTopRightOnSquare}
|
||||||
</picture>
|
size="16"
|
||||||
|
micro
|
||||||
|
class="text-slate-500 dark:text-zinc-300"
|
||||||
|
/>
|
||||||
|
</Material>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</Material>
|
</Material>
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -54,8 +54,8 @@
|
|||||||
ul {
|
ul {
|
||||||
:global {
|
:global {
|
||||||
:where(& > :not(:last-child)) {
|
:where(& > :not(:last-child)) {
|
||||||
margin-block-start: calc(calc(var(--spacing) * 0.75));
|
margin-block-start: calc(calc(var(--spacing) * 1));
|
||||||
margin-block-end: calc(calc(var(--spacing) * 0.75));
|
margin-block-end: calc(calc(var(--spacing) * 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
const paddingClass = {
|
const paddingClass = {
|
||||||
none: '',
|
none: '',
|
||||||
|
xs: 'p-1.5',
|
||||||
sm: 'p-2',
|
sm: 'p-2',
|
||||||
md: 'p-4',
|
md: 'p-4',
|
||||||
lg: 'p-5',
|
lg: 'p-5',
|
||||||
|
|||||||
Reference in new issue
Block a user