chore: eslint fix and upgrade dependencies

This commit is contained in:
ccbikai
2024-08-31 16:29:02 +08:00
parent 549064078a
commit 58be3f399c
9 changed files with 413 additions and 540 deletions

View File

@@ -168,10 +168,7 @@
margin: auto 2px;
border-radius: var(--box-border-radius);
background: #ccc 60% 60% / 3000px 3000px;
background-image: repeating-conic-gradient(
#999 0 0.0001%,
#0000 0 0.0002%
);
background-image: repeating-conic-gradient(#999 0 0.0001%, #0000 0 0.0002%);
}
input:checked + tg-spoiler {

View File

@@ -27,9 +27,7 @@ const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
<div id="header">
<a href={SITE_URL} title={channel?.title}>
<img
src={channel?.avatar?.startsWith('http')
? staticProxy + channel?.avatar
: voidFile.src}
src={channel?.avatar?.startsWith('http') ? staticProxy + channel?.avatar : voidFile.src}
alt={channel?.title}
loading="eager"
class="header-avatar"
@@ -41,13 +39,7 @@ const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
</a>
</div>
<div class="header-icons">
<a
href={`${SITE_URL}rss.xml`}
target="_blank"
rel="alternate"
type="application/rss+xml"
title="RSS Feed"
>
<a href={`${SITE_URL}rss.xml`} target="_blank" rel="alternate" type="application/rss+xml" title="RSS Feed">
<img {...rss} alt="RSS" class="social-icon" width="1em" />
</a>
@@ -61,17 +53,8 @@ const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
{
TWITTER && TWITTER.length > 0 && (
<a
href={`https://twitter.com/${TWITTER}`}
title="Twitter"
target="_blank"
>
<img
{...twitter}
alt={`twitter.com/${TWITTER}`}
class="social-icon"
width="1em"
/>
<a href={`https://twitter.com/${TWITTER}`} title="Twitter" target="_blank">
<img {...twitter} alt={`twitter.com/${TWITTER}`} class="social-icon" width="1em" />
</a>
)
}
@@ -79,12 +62,7 @@ const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
{
GITHUB && GITHUB.length > 0 && (
<a href={`https://github.com/${GITHUB}`} title="GitHub" target="_blank">
<img
{...github}
alt={`github.com/${GITHUB}`}
class="social-icon"
width="1em"
/>
<img {...github} alt={`github.com/${GITHUB}`} class="social-icon" width="1em" />
</a>
)
}
@@ -92,12 +70,7 @@ const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
{
TELEGRAM && TELEGRAM.length > 0 && (
<a href={`https://t.me/${TELEGRAM}`} title="Telegram" target="_blank">
<img
{...telegram}
alt={`t.me/${TELEGRAM}`}
class="social-icon"
width="1em"
/>
<img {...telegram} alt={`t.me/${TELEGRAM}`} class="social-icon" width="1em" />
</a>
)
}
@@ -105,12 +78,7 @@ const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
{
DISCORD && DISCORD.length > 0 && (
<a href={DISCORD} title="Discord" target="_blank">
<img
{...discord}
alt="Discord Invite"
class="social-icon"
width="1em"
/>
<img {...discord} alt="Discord Invite" class="social-icon" width="1em" />
</a>
)
}
@@ -118,29 +86,15 @@ const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
{
MASTODON && MASTODON.length > 0 && (
<a href={`https://${MASTODON}`} title="Mastodon" target="_blank">
<img
{...mastodon}
alt={`@${MASTODON}`}
class="social-icon"
width="1em"
/>
<img {...mastodon} alt={`@${MASTODON}`} class="social-icon" width="1em" />
</a>
)
}
{
BLUESKY && BLUESKY.length > 0 && (
<a
href={`https://bsky.app/profile/${BLUESKY}`}
title="BlueSky"
target="_blank"
>
<img
{...bluesky}
alt={`@${BLUESKY}`}
class="social-icon"
width="1em"
/>
<a href={`https://bsky.app/profile/${BLUESKY}`} title="BlueSky" target="_blank">
<img {...bluesky} alt={`@${BLUESKY}`} class="social-icon" width="1em" />
</a>
)
}

View File

@@ -13,33 +13,20 @@ const { SITE_URL } = Astro.locals
const { post } = Astro.props
const datetime = dayjs(post.datetime).tz(timezone)
const timeago = datetime.isBefore(dayjs().subtract(1, 'w'))
? datetime.format('HH:mm · ll · ddd')
: datetime.fromNow()
const timeago = datetime.isBefore(dayjs().subtract(1, 'w')) ? datetime.format('HH:mm · ll · ddd') : datetime.fromNow()
---
<div class="item" style={{ 'view-transition-name': `post-${post.id}` }}>
<div class="time-box">
<div class="dot"></div>
<div class="time">
<a
href={`${SITE_URL}posts/${post.id}`}
title={post.datetime}
class="item-link">{timeago}</a
>
<a href={`${SITE_URL}posts/${post.id}`} title={post.datetime} class="item-link">{timeago}</a>
</div>
</div>
{
post.content.length > 0 && (
<div class={`text-box content`} set:html={post.content} />
)
}
{post.content.length > 0 && <div class={`text-box content`} set:html={post.content} />}
{
post.tags.length > 0 && (
<div
class="tag-box"
style={post.content.length === 0 ? 'padding-top: 30px;' : ''}
>
<div class="tag-box" style={post.content.length === 0 ? 'padding-top: 30px;' : ''}>
<div class="tag-icon" />
{post.tags.map((tag) => (
<a href={`/search/%23${tag}`} title={tag} class="tag">

View File

@@ -23,11 +23,7 @@ const afterCursor = posts[0]?.id
<div class="pages-container">
{
before && beforeCursor > 1 ? (
<a
href={`${SITE_URL}before/${beforeCursor}`}
title="Before"
class="page"
>
<a href={`${SITE_URL}before/${beforeCursor}`} title="Before" class="page">
Before
</a>
) : (

View File

@@ -27,9 +27,7 @@ export const prerender = false
<List channel={channel} before={false} after={false}>
<div slot="header" id="breadcrumb">
<img
src={channel?.avatar?.startsWith('http')
? staticProxy + channel?.avatar
: voidFile.src}
src={channel?.avatar?.startsWith('http') ? staticProxy + channel?.avatar : voidFile.src}
alt={channel?.title}
loading="eager"
class="breadcrumb-avatar"