|
1 | 1 | --- |
2 | 2 | import { Image } from 'astro:assets' |
3 | | -import MsgboardLayout from '@/layouts/MsgboardLayout.astro' |
| 3 | +import PageLayout from '@/layouts/BaseLayout.astro' |
4 | 4 | import DanmakuComments from '@/components/waline/DanmakuComments.astro' |
5 | | -import bannerImage from '@/assets/msgboard/boat.png' |
| 5 | +import bannerImage from '@/assets/msgboard/board.png' |
6 | 6 | import { Icon } from '@/custom/components/user' |
| 7 | +import { Comment } from '@/components/waline' |
7 | 8 |
|
8 | 9 | const meta = { |
9 | 10 | title: '留言板', |
10 | 11 | description: '欢迎分享你的故事与想法, 请友善交流, 尊重彼此.' |
11 | 12 | } |
12 | 13 | --- |
13 | 14 |
|
14 | | -<MsgboardLayout info={{ slug: '/msgboard' }}> |
15 | | - <div |
16 | | - id='content-header' |
17 | | - class='animate relative w-full overflow-hidden rounded-lg shadow-lg mb-8 aspect-[3/1] md:aspect-[4/1]' |
18 | | - > |
19 | | - <!-- Optimized Image as Background --> |
20 | | - <Image |
21 | | - src={bannerImage} |
22 | | - alt='留言板横幅' |
23 | | - class='absolute inset-0 z-0 w-full h-full object-cover object-center' |
24 | | - /> |
25 | | - |
26 | | - <!-- Gradient Overlay --> |
27 | | - <div class='absolute inset-0 z-10 bg-gradient-to-r from-black/60 via-black/30 to-transparent'> |
| 15 | +<PageLayout meta={meta}> |
| 16 | + <main class='mt-6 lg:mt-10'> |
| 17 | + <div class="section-header"> |
| 18 | + <div class="section-header-text"> |
| 19 | + <div class='flex items-center gap-3'> |
| 20 | + <Icon name='msgboard' class='size-8' /> |
| 21 | + <h1 class='text-3xl font-bold'>{meta.title}</h1> |
| 22 | + </div> |
| 23 | + <p class='mt-2 text-muted-foreground'>{meta.description}</p> |
| 24 | + </div> |
| 25 | + <Image src={bannerImage} alt="留言板横幅" class="section-header-image" /> |
28 | 26 | </div> |
29 | 27 |
|
30 | | - <!-- Text Content --> |
31 | | - <div class='relative z-20 flex h-full flex-col justify-center p-6 md:p-8 md:w-3/4 lg:w-2/3'> |
32 | | - <div class='flex items-center gap-3'> |
33 | | - <Icon name='msgboard' class='size-8 text-white' /> |
34 | | - <h1 class='text-3xl font-bold text-white'>{meta.title}</h1> |
| 28 | + <div id='content' class='animate mt-8'> |
| 29 | + <DanmakuComments /> |
| 30 | + <div class="mt-8"> |
| 31 | + <Comment /> |
35 | 32 | </div> |
36 | | - <p class='mt-2 text-white/80'> |
37 | | - {meta.description} |
38 | | - </p> |
39 | 33 | </div> |
40 | | - </div> |
| 34 | + </main> |
| 35 | +</PageLayout> |
| 36 | + |
| 37 | +<style> |
| 38 | + .section-header { |
| 39 | + display: flex; |
| 40 | + align-items: stretch; |
| 41 | + margin-bottom: 1.5rem; |
| 42 | + background-color: #f7fafc; |
| 43 | + border-radius: 8px; |
| 44 | + overflow: hidden; |
| 45 | + height: 200px; |
| 46 | + } |
| 47 | + .section-header-text { |
| 48 | + padding: 2rem; |
| 49 | + display: flex; |
| 50 | + flex-direction: column; |
| 51 | + justify-content: center; |
| 52 | + flex: 1; |
| 53 | + } |
| 54 | + .section-header-image { |
| 55 | + width: 40%; |
| 56 | + object-fit: cover; |
| 57 | + } |
41 | 58 |
|
42 | | - <DanmakuComments /> |
43 | | -</MsgboardLayout> |
| 59 | + @media (max-width: 767px) { |
| 60 | + .section-header { |
| 61 | + flex-direction: column; |
| 62 | + height: auto; |
| 63 | + } |
| 64 | + .section-header-image { |
| 65 | + width: 100%; |
| 66 | + height: 150px; |
| 67 | + } |
| 68 | + .section-header-text { |
| 69 | + padding: 1.5rem; |
| 70 | + } |
| 71 | + } |
| 72 | +</style> |
0 commit comments