Codex/design 启用新的页面风格 #10

Merged
biss merged 2 commits from codex/design into master 2026-07-19 16:10:43 +08:00
8 changed files with 1091 additions and 67 deletions
Showing only changes of commit 7d5387209d - Show all commits

No files matched your search

+32
View File
@@ -342,6 +342,38 @@
} }
} }
.hitokoto-card,
:root[data-theme='dark'] .hitokoto-card {
border: 1px solid var(--line);
border-radius: 2px;
color: var(--text);
background: var(--surface-strong);
box-shadow: 5px 5px 0 color-mix(in srgb, var(--text) 14%, transparent);
backdrop-filter: none;
-webkit-backdrop-filter: none;
}
.hitokoto-card__refresh,
.hitokoto-card__collapse,
:root[data-theme='dark'] .hitokoto-card__refresh,
:root[data-theme='dark'] .hitokoto-card__collapse {
border-color: var(--line);
border-radius: 2px;
background: transparent;
}
.hitokoto-card__refresh:hover,
.hitokoto-card__collapse:hover {
color: #fff;
background: var(--accent);
transform: none;
}
.hitokoto-card__text,
:root[data-theme='dark'] .hitokoto-card__text {
color: var(--text);
}
@media (max-width: 720px) { @media (max-width: 720px) {
.hitokoto-card { .hitokoto-card {
left: 12px; left: 12px;
+11 -25
View File
@@ -11,13 +11,18 @@ interface Props {
const { posts, tags, categories } = Astro.props; const { posts, tags, categories } = Astro.props;
const avatar = siteConfig.author.avatar; const avatar = siteConfig.author.avatar;
const recentPosts = posts.slice(0, 5);
--- ---
<aside class="home-sidebar" aria-label="首页侧边栏"> <aside class="home-sidebar" aria-label="首页侧边栏">
<section class="sidebar-card profile-card"> <section class="sidebar-card profile-card">
<img class="profile-avatar" src={avatar} alt={siteConfig.author.name} loading="lazy" /> <div class="profile-identity">
<div class="profile-name">{siteConfig.author.name}</div> <img class="profile-avatar" src={avatar} alt={siteConfig.author.name} loading="lazy" />
<div>
<span>MAINTAINER</span>
<strong class="profile-name">{siteConfig.author.name}</strong>
</div>
</div>
<p class="profile-bio">在代码、图形和自托管服务之间做长期记录。</p>
<div class="profile-stats"> <div class="profile-stats">
<a href="/archives/"> <a href="/archives/">
<span>文章</span> <span>文章</span>
@@ -33,8 +38,8 @@ const recentPosts = posts.slice(0, 5);
</a> </a>
</div> </div>
<a class="follow-button" href={siteConfig.author.github} target="_blank" rel="noreferrer"> <a class="follow-button" href={siteConfig.author.github} target="_blank" rel="noreferrer">
<span class="github-mark" aria-hidden="true">GitHub</span> <span>查看 GitHub</span>
<span>Follow Me</span> <span aria-hidden="true">↗</span>
</a> </a>
<div class="profile-links" aria-label="联系方式"> <div class="profile-links" aria-label="联系方式">
<a href={siteConfig.author.github} target="_blank" rel="noreferrer" aria-label="GitHub">GitHub</a> <a href={siteConfig.author.github} target="_blank" rel="noreferrer" aria-label="GitHub">GitHub</a>
@@ -44,7 +49,7 @@ const recentPosts = posts.slice(0, 5);
<div class="sticky-sidebar"> <div class="sticky-sidebar">
<section class="sidebar-card notice-card"> <section class="sidebar-card notice-card">
<h2><span aria-hidden="true">!</span> 公告</h2> <h2><span aria-hidden="true">●</span> 站点广播</h2>
<div id="welcome-ip-location-info"> <div id="welcome-ip-location-info">
欢迎来自 <strong>远方</strong> 的小友。<br /> 欢迎来自 <strong>远方</strong> 的小友。<br />
烧烤三件套,灵魂蘸料。<br /> 烧烤三件套,灵魂蘸料。<br />
@@ -94,25 +99,6 @@ const recentPosts = posts.slice(0, 5);
</div> </div>
</section> </section>
<section class="sidebar-card recent-card">
<h2>最新文章</h2>
<div class="sidebar-posts">
{recentPosts.map((post) => (
<a class="sidebar-post" href={post.href}>
{post.cover ? (
<img src={post.cover} alt="" loading="lazy" />
) : (
<span class="post-thumb-fallback" aria-hidden="true"></span>
)}
<span>
<strong>{post.title}</strong>
<time datetime={post.date.toISOString()}>{post.dateText}</time>
</span>
</a>
))}
</div>
</section>
<SiteInfoCard posts={posts} /> <SiteInfoCard posts={posts} />
</div> </div>
</aside> </aside>
+16 -5
View File
@@ -3,16 +3,27 @@ import { getCategoryHref, type BlogPost } from '@/lib/posts';
interface Props { interface Props {
post: BlogPost; post: BlogPost;
index?: number;
} }
const { post } = Astro.props; const { post, index } = Astro.props;
const logNumber = index === undefined
? post.date.toISOString().slice(5, 10).replace('-', '.')
: String(index + 1).padStart(2, '0');
--- ---
<article class="post-card"> <article class="post-card">
<a href={post.href}> <a class="post-card-main" href={post.href}>
<time datetime={post.date.toISOString()}>{post.dateText}</time> <span class="post-card-index" aria-hidden="true">
<h2>{post.title}</h2> <small>LOG</small>
{post.summary && <p>{post.summary}</p>} <strong>{logNumber}</strong>
</span>
<span class="post-card-copy">
<time datetime={post.date.toISOString()}>{post.dateText}</time>
<span class="post-card-title">{post.title}</span>
{post.summary && <span class="post-card-summary">{post.summary}</span>}
</span>
<span class="post-card-open" aria-hidden="true">↗</span>
</a> </a>
<div class="meta-list"> <div class="meta-list">
{post.categories.map((category) => <a href={getCategoryHref(category)}>{category}</a>)} {post.categories.map((category) => <a href={getCategoryHref(category)}>{category}</a>)}
Loaded 3 of 8 files, more files were not shown because too many files have changed in this diff. Show more