Skip to content

Commit e4a9259

Browse files
committed
docs: refactor showcase page
1 parent bc66743 commit e4a9259

File tree

5 files changed

+60
-48
lines changed

5 files changed

+60
-48
lines changed

doc-site/docs/showcase/ShowcaseCards.tsx

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,46 @@ interface CardProps {
77

88
const Card: React.FC<CardProps> = ({ name, cover, description, link }) => {
99
return (
10-
<a href={link} target="_blank" rel="noopener noreferrer">
11-
<div className="w-72 rounded-lg shadow-md bg-white dark:bg-slate-700 hover:scale-105 transition-transform duration-300">
12-
<img src={cover} className="w-full h-42 object-cover" />
13-
<div className="h-32 p-4 flex flex-col">
14-
<p className="text-xl font-semibold text-blue-600 dark:text-blue-200">
15-
{name}
16-
</p>
17-
<p className="mt-1 text-gray-600 dark:text-white line-clamp-3">
18-
{description}
19-
</p>
20-
</div>
10+
<div className="w-72 rounded-lg shadow-md bg-white dark:bg-slate-700 hover:scale-105 transition-transform duration-300">
11+
<a href={link} target="_blank" rel="noopener noreferrer">
12+
<img src={cover} className="w-full h-44 object-cover" />
13+
</a>
14+
<div className="h-32 p-4 flex flex-col">
15+
<p className="text-xl font-semibold dark:text-blue-200">{name}</p>
16+
<p className="mt-1 text-gray-600 dark:text-white line-clamp-3">
17+
{description}
18+
</p>
2119
</div>
22-
</a>
20+
</div>
2321
);
2422
};
2523

2624
interface ShowcaseCardsProps {
27-
cases: CardProps[];
25+
data: {
26+
tips: string;
27+
list: CardProps[];
28+
};
2829
}
2930

30-
const ShowcaseCards: React.FC<ShowcaseCardsProps> = ({ cases }) => {
31+
const ShowcaseCards: React.FC<ShowcaseCardsProps> = ({
32+
data: { list, tips },
33+
}) => {
3134
return (
32-
<div className="flex flex-wrap">
33-
{cases?.map((item, index) => (
34-
<div key={index} className="mx-8 my-6">
35-
<Card
36-
name={item.name}
37-
cover={item.cover}
38-
description={item.description}
39-
link={item.link}
40-
/>
41-
</div>
42-
))}
43-
</div>
35+
<>
36+
<div className="text-center italic">{tips}</div>
37+
<div className="flex flex-wrap">
38+
{list?.map((item, index) => (
39+
<div key={index} className="mx-8 my-6">
40+
<Card
41+
name={item.name}
42+
cover={item.cover}
43+
description={item.description}
44+
link={item.link}
45+
/>
46+
</div>
47+
))}
48+
</div>
49+
</>
4450
);
4551
};
4652

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
export default [
2-
{
3-
name: 'Melody Canvas',
4-
cover:
5-
'https://raw.githubusercontent.com/RylanBot/melody-canvas/refs/heads/main/public/image/preview.png',
6-
description:
7-
'An audio visualization editor that supports customizable effects and uses WebAV for video export.',
8-
link: 'https://github.com/RylanBot/melody-canvas',
9-
},
10-
];
1+
export default {
2+
tips: 'Projects utilizing WebAV can submit their work via issues for recommendation—open-source projects are free; commercial products should contact the author to discuss sponsorship fees.',
3+
list: [
4+
{
5+
name: 'Melody Canvas',
6+
cover:
7+
'https://raw.githubusercontent.com/RylanBot/melody-canvas/refs/heads/main/public/image/preview.png',
8+
description:
9+
'An audio visualization editor that supports customizable effects and uses WebAV for video export.',
10+
link: 'https://github.com/RylanBot/melody-canvas',
11+
},
12+
],
13+
};

doc-site/docs/showcase/data.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
export default [
2-
{
3-
name: 'Melody Canvas',
4-
cover:
5-
'https://raw.githubusercontent.com/RylanBot/melody-canvas/refs/heads/main/public/image/preview.png',
6-
description:
7-
'音频可视化编辑器,支持自定义多种属性,采用 WebAV 导出视频效果。',
8-
link: 'https://github.com/RylanBot/melody-canvas',
9-
},
10-
];
1+
export default {
2+
tips: '使用了 WebAV 的项目可创建 Issue 投稿推荐自己的作品,开源项目免费,商业产品请联系作者详聊赞助费。',
3+
list: [
4+
{
5+
name: 'Melody Canvas',
6+
cover:
7+
'https://raw.githubusercontent.com/RylanBot/melody-canvas/refs/heads/main/public/image/preview.png',
8+
description:
9+
'音频可视化编辑器,支持自定义多种属性,采用 WebAV 导出视频效果。',
10+
link: 'https://github.com/RylanBot/melody-canvas',
11+
},
12+
],
13+
};

doc-site/docs/showcase/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ sidebar: false
1212
import ShowcaseCards from './ShowcaseCards.tsx';
1313
import data from './data.en-US.ts';
1414

15-
export default () => <ShowcaseCards cases={data} />;
15+
export default () => <ShowcaseCards data={data} />;
1616
```

doc-site/docs/showcase/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ sidebar: false
1212
import ShowcaseCards from './ShowcaseCards.tsx';
1313
import data from './data.ts';
1414

15-
export default () => <ShowcaseCards cases={data} />;
15+
export default () => <ShowcaseCards data={data} />;
1616
```

0 commit comments

Comments
 (0)