style: 优化移动端ui
This commit is contained in:
@@ -3,6 +3,7 @@ import {siteConfig} from "@/consts.ts";
|
||||
import PostList from "@/components/Post/List.astro";
|
||||
import Pagination from "@/components/Post/Pagination.astro";
|
||||
import type {Post} from "@/types";
|
||||
import PageHeader from "@/components/PageHeader.astro";
|
||||
|
||||
const {siteTitle} = siteConfig;
|
||||
|
||||
@@ -16,22 +17,12 @@ const {posts, page, totalPage} = Astro.props
|
||||
---
|
||||
|
||||
<div class="page-content">
|
||||
<header>
|
||||
<div class="top">
|
||||
<h1>{siteTitle}</h1>
|
||||
<!--<nav>-->
|
||||
<!-- <span>归档</span>-->
|
||||
<!-- <span>/</span>-->
|
||||
<!-- <span>标签</span>-->
|
||||
<!-- <span>/</span>-->
|
||||
<!-- <span>关于</span>-->
|
||||
<!--</nav>-->
|
||||
</div>
|
||||
<div class="intro">
|
||||
<p>did you stand too close to the fire?<br>
|
||||
like a liar looking for forgiveness from a stone.</p>
|
||||
</div>
|
||||
</header>
|
||||
<PageHeader/>
|
||||
|
||||
<div class="intro">
|
||||
<p>did you stand too close to the fire?<br>
|
||||
like a liar looking for forgiveness from a stone.</p>
|
||||
</div>
|
||||
|
||||
<main>
|
||||
<PostList posts={posts}/>
|
||||
@@ -53,24 +44,6 @@ const {posts, page, totalPage} = Astro.props
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
header {
|
||||
margin-bottom: 24px;
|
||||
margin-top: 48px;
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: var(--border-primary);
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
@@ -79,11 +52,12 @@ const {posts, page, totalPage} = Astro.props
|
||||
}
|
||||
|
||||
.intro {
|
||||
padding: 28px 0;
|
||||
border-bottom: var(--border-secondary);
|
||||
line-height: 2;
|
||||
font-size: 15px;
|
||||
color: var(--text-secondary);
|
||||
padding-bottom: 32px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
main {
|
||||
@@ -104,4 +78,15 @@ const {posts, page, totalPage} = Astro.props
|
||||
gap: 12px;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.page-content {
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
footer {
|
||||
height: 64px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
38
src/components/PageHeader.astro
Normal file
38
src/components/PageHeader.astro
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
import {siteConfig} from "@/consts.ts";
|
||||
const {siteTitle} = siteConfig;
|
||||
---
|
||||
|
||||
<header>
|
||||
<a href="/"><h1>{siteTitle}</h1></a>
|
||||
<!--<nav>-->
|
||||
<!-- <span>归档</span>-->
|
||||
<!-- <span>/</span>-->
|
||||
<!-- <span>标签</span>-->
|
||||
<!-- <span>/</span>-->
|
||||
<!-- <span>关于</span>-->
|
||||
<!--</nav>-->
|
||||
</header>
|
||||
|
||||
<style>
|
||||
header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: var(--border-primary);
|
||||
margin-top: 32px;
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
header {
|
||||
margin-top: 24px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -39,7 +39,7 @@ const {posts} = Astro.props
|
||||
}
|
||||
|
||||
.post h2 {
|
||||
font-size: 17px;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
|
||||
Reference in New Issue
Block a user