Skip to content

Commit a76fbc6

Browse files
committed
猫咪照片墙设计
1 parent 82922e9 commit a76fbc6

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

packages/pure/components/basic/Header.astro

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2+
import { Image } from 'astro:assets'
23
import config from 'virtual:config'
3-
import { Icon } from '../user'
4+
45
import type { IconName } from '../../libs/icons'
6+
import { Icon } from '../user'
57
---
68

79
<header-component
@@ -28,7 +30,7 @@ import type { IconName } from '../../libs/icons'
2830
{item.icon ? (
2931
<Icon name={item.icon as IconName} class='size-4' />
3032
) : item.iconImg ? (
31-
<img src={item.iconImg} class='size-4' alt={item.title || 'icon image'} />
33+
<Image src={item.iconImg} width={16} height={16} class='size-4' alt={item.title || 'icon image'} />
3234
) : null}
3335
{item.title}
3436
</a>
@@ -215,5 +217,4 @@ import type { IconName } from '../../libs/icons'
215217
}
216218
}
217219
}
218-
219220
</style>

src/pages/cats/index.astro

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,23 +173,25 @@ const allCats = Object.entries(info);
173173
margin-bottom: 2rem;
174174
}
175175
.roster-control-btn {
176-
background-color: #fff;
177-
border: 1px solid #e2e8f0;
178-
border-radius: 9999px;
179-
padding: 0.5rem 1rem;
180-
font-size: 0.9rem;
176+
background-color: transparent;
177+
border: none;
178+
border-radius: 0;
179+
padding: 0.5rem 0.25rem;
180+
font-size: 1rem;
181181
font-weight: 500;
182182
cursor: pointer;
183183
transition: all 0.2s ease;
184+
border-bottom: 2px solid transparent;
185+
margin: 0 0.5rem;
186+
color: #718096;
184187
}
185188
.roster-control-btn:hover {
186-
background-color: #edf2f7;
187-
border-color: #cbd5e0;
189+
color: #2d3748;
188190
}
189191
.roster-control-btn.active {
190-
background-color: #4299e1;
191-
color: white;
192-
border-color: #4299e1;
192+
font-weight: 700;
193+
color: #2d3748;
194+
border-bottom-color: #4299e1;
193195
}
194196

195197
.roster-grid {
@@ -330,19 +332,21 @@ const allCats = Object.entries(info);
330332
padding: 2rem 1rem;
331333
}
332334
.masonry-grid {
333-
display: grid;
334-
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
335+
display: flex;
336+
flex-wrap: wrap;
337+
justify-content: center;
335338
gap: 1rem;
336339
}
337340
.masonry-item {
338341
position: relative;
339342
overflow: hidden;
340343
border-radius: 8px;
341344
display: block; /* For filtering */
345+
height: 300px;
342346
}
343347
.masonry-item img {
344-
width: 100%;
345-
height: auto;
348+
height: 100%;
349+
width: auto;
346350
display: block;
347351
transition: transform 0.3s ease;
348352
}

0 commit comments

Comments
 (0)