Skip to content

Commit f3f30da

Browse files
✨ Add new photos to gallery and update layout settings
- Introduced eight new photos with titles and descriptions to the gallery. - Changed the default layout setting from "rows" to "columns" for better visual presentation. - Minor code formatting improvements for better readability.
1 parent 03774fb commit f3f30da

File tree

9 files changed

+64
-8
lines changed

9 files changed

+64
-8
lines changed

src/pages/gallery.js

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,62 @@ const unsplashLink = (id, width, height) =>
3131
`/pages/gallery/${id}-${width}-${height}.webp`;
3232
//定义相册图片
3333
const unsplashPhotos = [
34+
{
35+
id: 202412151,
36+
width: 4624,
37+
height: 2080,
38+
title: "广东",
39+
description: "仙湖植物园的绿地"
40+
},
41+
{
42+
id: 202412152,
43+
width: 2160,
44+
height: 5044,
45+
title: "上海",
46+
description: "古猗园的莲花"
47+
},
48+
{
49+
id: 202412153,
50+
width: 2160,
51+
height: 5044,
52+
title: "浙江",
53+
description: "端午节的天一阁"
54+
},
55+
{
56+
id: 202412154,
57+
width: 2160,
58+
height: 8102,
59+
title: "浙江",
60+
description: "温州江心屿与特色小吃"
61+
},
62+
{
63+
id: 202412155,
64+
width: 1706,
65+
height: 1279,
66+
title: "山东",
67+
description: "趵突泉的正面"
68+
},
69+
{
70+
id: 202412156,
71+
width: 2160,
72+
height: 6019,
73+
title: "浙江",
74+
description: "乌镇的食住行"
75+
},
76+
{
77+
id: 202412157,
78+
width: 2160,
79+
height: 5070,
80+
title: "上海",
81+
description: "青浦区的道路"
82+
},
83+
{
84+
id: 202412158,
85+
width: 2080,
86+
height: 2080,
87+
title: "广东",
88+
description: "仙湖植物园的大树"
89+
},
3490
{
3591
id: "Newyear",
3692
width: 4624,
@@ -493,7 +549,7 @@ export function useSettings() {
493549
}
494550

495551
function Settings({ children }) {
496-
const [layout, setLayout] = useState("rows");
552+
const [layout, setLayout] = useState("columns");
497553
const [count, setCount] = useState(photos.length);
498554
const [targetRowHeight, setTargetRowHeight] = useState(200);
499555
const [columns, setColumns] = useState(5);
@@ -519,13 +575,13 @@ function Settings({ children }) {
519575
photos:
520576
tag === "其他"
521577
? photos
522-
.filter(
523-
(photo) => photo.title === undefined || photo.title === null
524-
)
525-
.slice(0, count)
578+
.filter(
579+
(photo) => photo.title === undefined || photo.title === null
580+
)
581+
.slice(0, count)
526582
: tag === "全选"
527-
? photos.slice(0, count)
528-
: photos.filter((photo) => photo.title === tag).slice(0, count),
583+
? photos.slice(0, count)
584+
: photos.filter((photo) => photo.title === tag).slice(0, count),
529585
layout,
530586
targetRowHeight,
531587
columns,
@@ -571,7 +627,7 @@ function Settings({ children }) {
571627
))}
572628
</TextField>
573629
</Filter>
574-
{/*
630+
{/*
575631
<Filter>
576632
<SliderControl
577633
name="Photos"
7.99 MB
Loading
6.94 MB
Loading
9.2 MB
Loading
6.23 MB
Loading
2.48 MB
Loading
10.2 MB
Loading
7.39 MB
Loading
4.09 MB
Loading

0 commit comments

Comments
 (0)