Skip to content

Commit 7cac416

Browse files
committed
重构照片墙
1 parent 53a99a0 commit 7cac416

6 files changed

Lines changed: 532 additions & 177 deletions

File tree

packages/pure/libs/icons.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ export const BuiltInIcons = {
173173
`,
174174
deep_seek: `
175175
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>DeepSeek</title><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path></svg>
176+
`,
177+
cake: `
178+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M12 6a2 2 0 0 0 2-2c0-.38-.1-.73-.29-1.03L12 0l-1.71 2.97c-.19.3-.29.65-.29 1.03a2 2 0 0 0 2 2m4.6 10l-1.07-1.08L14.45 16c-1.3 1.29-3.58 1.3-4.89 0L8.5 14.92L7.4 16a3.47 3.47 0 0 1-4.4.39V21a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-4.61a3.47 3.47 0 0 1-4.4-.39M18 9h-5V7h-2v2H6a3 3 0 0 0-3 3v1.54c0 1.08.88 1.96 1.96 1.96c.54 0 1.04-.2 1.38-.57L8.5 12.8l2.11 2.13c.74.74 2.03.74 2.77 0l2.12-2.13l2.15 2.13c.35.37.85.57 1.38.57c1.08 0 1.97-.88 1.97-1.96V12a3 3 0 0 0-3-3"/></svg>
179+
`,
180+
sleep: `
181+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M13.378 3.026A9.004 9.004 0 1 1 5.475 17.13a.675.675 0 0 1 .329-1.019c3.391-1.214 5.208-2.62 6.262-4.633c1.11-2.118 1.396-4.438.62-7.619a.675.675 0 0 1 .692-.834m1.011 1.637l.065.39c.417 2.705.065 4.976-1.06 7.122c-1.141 2.18-3 3.704-6.015 4.94a7.504 7.504 0 1 0 7.677-12.283l-.332-.092zm-3.395-1.01L11 3.75V9a2 2 0 1 1-1.499-1.937l-.001-2.3L6 5.829V10a2 2 0 1 1-1.499-1.937L4.5 5.273a.75.75 0 0 1 .43-.679l.102-.039l5-1.521a.75.75 0 0 1 .943.525z"/></svg>
176182
`
177183
}
178184

src/assets/cats/config/data.ts

Lines changed: 144 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,168 +1,221 @@
1-
import type { CatPhoto } from './types'
2-
31
// Import all cat images
4-
import _1h1 from '@/assets/cats/1-h-1.jpg'
5-
import _1h2 from '@/assets/cats/1-h-2.jpg'
6-
import _1h3 from '@/assets/cats/1-h-3.jpg'
7-
import _1h from '@/assets/cats/1-h.jpg'
8-
import _1m1 from '@/assets/cats/1-m-1.jpg'
9-
import _1m2 from '@/assets/cats/1-m-2.png'
10-
import _1m from '@/assets/cats/1-m.jpg'
11-
import _2111 from '@/assets/cats/2-1-1-1.jpg'
12-
import _2112 from '@/assets/cats/2-1-1-2.jpg'
13-
import _211 from '@/assets/cats/2-1-1.jpg'
14-
import _221 from '@/assets/cats/2-2-1.png'
15-
import _2231 from '@/assets/cats/2-2-3-1.jpg'
16-
import _223 from '@/assets/cats/2-2-3.jpg'
17-
import _2241 from '@/assets/cats/2-2-4-1.jpg'
18-
import _2242 from '@/assets/cats/2-2-4-2.jpg'
19-
import _2243 from '@/assets/cats/2-2-4-3.jpg'
20-
import _224 from '@/assets/cats/2-2-4.png'
21-
import _2261 from '@/assets/cats/2-2-6-1.jpg'
22-
import _226 from '@/assets/cats/2-2-6.jpg'
23-
import _31 from '@/assets/cats/3-1.png'
24-
import _u1 from '@/assets/cats/u-1.jpg'
25-
import _u2 from '@/assets/cats/u-2.jpg'
26-
import _u3 from '@/assets/cats/u-3.jpg'
27-
import _u4 from '@/assets/cats/u-4.jpg'
2+
import _1h1 from '@/assets/cats/1-h-1.jpg';
3+
import _1h2 from '@/assets/cats/1-h-2.jpg';
4+
import _1h3 from '@/assets/cats/1-h-3.jpg';
5+
import _1h from '@/assets/cats/1-h.jpg';
6+
import _1m1 from '@/assets/cats/1-m-1.jpg';
7+
import _1m2 from '@/assets/cats/1-m-2.png';
8+
import _1m from '@/assets/cats/1-m.jpg';
9+
import _2111 from '@/assets/cats/2-1-1-1.jpg';
10+
import _2112 from '@/assets/cats/2-1-1-2.jpg';
11+
import _211 from '@/assets/cats/2-1-1.jpg';
12+
import _221 from '@/assets/cats/2-2-1.png';
13+
import _2231 from '@/assets/cats/2-2-3-1.jpg';
14+
import _223 from '@/assets/cats/2-2-3.jpg';
15+
import _2241 from '@/assets/cats/2-2-4-1.jpg';
16+
import _2242 from '@/assets/cats/2-2-4-2.jpg';
17+
import _2243 from '@/assets/cats/2-2-4-3.jpg';
18+
import _224 from '@/assets/cats/2-2-4.png';
19+
import _2261 from '@/assets/cats/2-2-6-1.jpg';
20+
import _226 from '@/assets/cats/2-2-6.jpg';
21+
import _31 from '@/assets/cats/3-1.png';
22+
import _u1 from '@/assets/cats/u-1.jpg';
23+
import _u2 from '@/assets/cats/u-2.jpg';
24+
import _u3 from '@/assets/cats/u-3.jpg';
25+
import _u4 from '@/assets/cats/u-4.jpg';
26+
27+
import type { CatInfo, Photo } from './types';
28+
29+
export const info: Record<string, CatInfo> = {
30+
小花: {
31+
id: 'xiaohua',
32+
gender: '女',
33+
birthday: '2016-10-19',
34+
deathday: '2024-10-29',
35+
tags: ['三花', '田园猫', '可爱', 'Queen']
36+
},
37+
月亮: {
38+
id: 'yueliang',
39+
gender: '男',
40+
birthday: '2017-05-06',
41+
tags: ['金吉拉', '可爱', '傻萌', '馋', '长毛'],
42+
desc: '拉💩后爱跑酷的笨蛋粘人大脸猫'
43+
},
44+
大姐: {
45+
id: 'dajie',
46+
gender: '女',
47+
birthday: '2018-03-11',
48+
tags: ['三花', '田园猫', '可爱', '胖墩'],
49+
desc: '小花的大女儿, 真的该减肥了'
50+
},
51+
大头: {
52+
id: 'datou',
53+
gender: '男',
54+
birthday: '2018-08-11',
55+
tags: ['黑白', '田园猫', '头大', '呆呆的'],
56+
desc: '大块头有小胆子'
57+
},
58+
老三: {
59+
id: 'laosan',
60+
gender: '女',
61+
birthday: '2018-08-11',
62+
tags: ['黑白', '田园猫', '萌萌', '被老四欺负'],
63+
desc: '住单间的爱我的小可爱'
64+
},
65+
老四: {
66+
id: 'laosi',
67+
gender: '男',
68+
birthday: '2018-08-11',
69+
tags: ['橘白', '田园猫', '调皮', '撒娇', '可爱'],
70+
desc: '爱说话的颜值高的大橘'
71+
},
72+
老六: {
73+
id: 'laoliu',
74+
gender: '女',
75+
birthday: '2018-08-11',
76+
tags: ['黑白', '田园猫', '胆小', '妈宝'],
77+
desc: '小花最小的女儿, 胆子小还怕人'
78+
},
79+
小六: {
80+
id: 'xiaoliu',
81+
gender: '男',
82+
birthday: '2019-07-05',
83+
deathday: '2025-10-10',
84+
tags: ['黑白', '田园猫', '胆小', '害怕', '可怜'],
85+
desc: '大头和老六的大儿子, 胆子更小, 见人就跑'
86+
}
87+
}
2888

2989
/**
3090
* Cat photo data collection
3191
*/
32-
export const cats: CatPhoto[] = [
92+
export const photos: Photo[] = [
3393
{
34-
name: '小花_1',
94+
subjects: ['小花'],
3595
image: _1h1,
36-
date: '2025-04-03',
37-
tag: ['花猫']
96+
tags: ['三花', '田园猫', '可爱', 'Queen'],
3897
},
3998
{
40-
name: '小花_2',
99+
subjects: ['小花'],
41100
image: _1h2,
42-
date: '2025-04-03',
43-
tag: ['花猫', '玩耳']
101+
capturedAt: '2025-04-03',
102+
tags: ['三花', '田园猫', '可爱', 'Queen'],
44103
},
45104
{
46-
name: '小花_3',
105+
subjects: ['小花'],
47106
image: _1h3,
48-
date: '2025-04-03',
49-
desc: '小花的第三张照片'
107+
capturedAt: '2025-04-03',
108+
caption: '小花的第三张照片'
50109
},
51110
{
52-
name: '小花',
111+
subjects: ['小花'],
53112
image: _1h,
54-
date: '2025-04-03',
55-
tag: ['花猫', '主图'],
56-
desc: '小花的主要照片'
113+
capturedAt: '2025-04-03',
114+
tags: ['花猫'],
57115
},
58116
{
59-
name: '月亮_1',
117+
subjects: ['月亮'],
60118
image: _1m1,
61-
date: '2025-04-03',
62-
tag: ['月亮猫']
119+
capturedAt: '2025-04-03',
120+
tags: ['金吉拉','可爱']
63121
},
64122
{
65-
name: '月亮_2',
123+
subjects: ['月亮'],
66124
image: _1m2,
67-
date: '2025-04-03'
125+
capturedAt: '2025-04-03'
68126
},
69127
{
70-
name: '月亮',
128+
subjects: ['月亮'],
71129
image: _1m,
72-
date: '2025-04-03',
73-
desc: '月亮的主要照片'
74130
},
75131
{
76-
name: '大姐_1',
132+
subjects: ['大姐'],
77133
image: _2111,
78-
date: '2025-04-03'
134+
capturedAt: '2025-04-03'
79135
},
80136
{
81-
name: '大姐_2',
137+
subjects: ['大姐'],
82138
image: _2112,
83-
date: '2025-04-03'
139+
capturedAt: '2025-04-03'
84140
},
85141
{
86-
name: '大姐',
142+
subjects: ['大姐'],
87143
image: _211,
88-
date: '2025-04-03',
89-
tag: ['大姐猫']
144+
capturedAt: '2025-04-03',
145+
tags: ['大姐猫']
90146
},
91147
{
92-
name: '大头',
148+
subjects: ['大头'],
93149
image: _221,
94-
date: '2025-04-03',
95-
desc: '大头猫的照片'
150+
capturedAt: '2025-04-03',
151+
caption: '大头猫的照片'
96152
},
97153
{
98-
name: '老三_1',
154+
subjects: ['老三'],
99155
image: _2231,
100-
date: '2025-04-03'
156+
capturedAt: '2025-04-03'
101157
},
102158
{
103-
name: '老三',
159+
subjects: ['老三'],
104160
image: _223,
105-
date: '2025-04-03',
106-
tag: ['老三猫']
161+
capturedAt: '2025-04-03',
162+
tags: ['老三猫']
107163
},
108164
{
109-
name: '老四_1',
165+
subjects: ['老四'],
110166
image: _2241,
111-
date: '2025-04-03'
167+
capturedAt: '2025-04-03'
112168
},
113169
{
114-
name: '老四_2',
170+
subjects: ['老四'],
115171
image: _2242,
116-
date: '2025-04-03',
117-
desc: '老四的第二张照片'
172+
capturedAt: '2025-04-03',
173+
caption: '老四的第二张照片'
118174
},
119175
{
120-
name: '老四_3',
176+
subjects: ['老四'],
121177
image: _2243,
122-
date: '2025-04-03'
178+
capturedAt: '2025-04-03'
123179
},
124180
{
125-
name: '老四',
181+
subjects: ['老四'],
126182
image: _224,
127-
date: '2025-04-03',
128-
tag: ['老四猫', '主图']
183+
capturedAt: '2025-04-03',
184+
tags: ['老四猫', '主图']
129185
},
130186
{
131-
name: '老六_1',
187+
subjects: ['老六'],
132188
image: _2261,
133-
date: '2025-04-03',
134-
tag: ['老六猫', '建筑']
189+
capturedAt: '2025-04-03',
190+
tags: ['老六猫', '建筑']
135191
},
136192
{
137-
name: '老六',
193+
subjects: ['老六'],
138194
image: _226,
139-
date: '2025-04-03',
140-
desc: '老六的主要照片'
195+
capturedAt: '2025-04-03',
196+
caption: '老六的主要照片'
141197
},
142198
{
143-
name: '小孙子',
199+
subjects: ['小六'],
144200
image: _31,
145-
date: '2025-04-03',
146-
tag: ['小孙子猫']
201+
capturedAt: '2025-04-03',
147202
},
148203
{
149204
image: _u1,
150-
date: '2025-04-03',
151-
desc: '未命名的猫咪照片'
205+
capturedAt: '2025-04-03',
206+
caption: '全家福'
152207
},
153208
{
154209
image: _u2,
155-
date: '2025-04-03',
156-
tag: ['未命名']
210+
capturedAt: '2025-04-03',
211+
caption: '排排坐'
157212
},
158213
{
159214
image: _u3,
160-
date: '2025-04-03'
215+
capturedAt: '2025-04-03'
161216
},
162217
{
163218
image: _u4,
164-
date: '2025-04-03',
165-
tag: ['未命名'],
166-
desc: '最后一张未命名的照片'
219+
capturedAt: '2025-04-03',
167220
}
168-
]
221+
]

src/assets/cats/config/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from './types'
2-
export * from './data'
3-
export * from './utils'
2+
export * from './data'

src/assets/cats/config/types.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
import type { ImageMetadata } from 'astro'
1+
import type { ImageMetadata } from 'astro';
22

3-
/**
4-
* Interface for cat photo data
5-
*/
6-
export interface CatPhoto {
7-
name?: string
8-
image: ImageMetadata
9-
date: string
10-
tag?: string[]
11-
desc?: string
12-
// Other optional properties can be added in the future
13-
[key: string]: any
3+
// 猫咪的基础信息 (您现有的 info 结构)
4+
export interface CatInfo {
5+
id: string;
6+
gender: '男' | '女';
7+
birthday: string;
8+
deathday?: string;
9+
tags: string[];
10+
desc?: string;
1411
}
1512

16-
/**
17-
* Type for cat photos grouped by year
18-
*/
19-
export type CatPhotosByYear = Record<number, CatPhoto[]>
13+
// 单张照片的信息
14+
export interface Photo {
15+
image: ImageMetadata; // Astro 优化的图片类型
16+
subjects?: string[]; // 照片中的主角们, 对应 info 的 key
17+
capturedAt?: string; // 拍摄日期
18+
caption?: string; // 照片的一句话描述
19+
tags?: string[]; // 照片本身的标签, 比如 "户外", "搞怪"
20+
}

src/assets/cats/config/utils.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)