Skip to content

Commit ced069f

Browse files
committed
Turn homepage plugin list into horizontal banner
1 parent dff4adb commit ced069f

2 files changed

Lines changed: 45 additions & 4 deletions

File tree

src/pages/index.module.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,39 @@
179179
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
180180
}
181181

182+
.bannerNote {
183+
max-width: 1200px;
184+
margin: 0 auto 0.75rem;
185+
color: var(--site-text-muted);
186+
font-size: 0.92rem;
187+
}
188+
189+
.pluginBanner {
190+
max-width: 1200px;
191+
margin: 0 auto;
192+
padding: 0.2rem 0 0.85rem;
193+
overflow-x: auto;
194+
overflow-y: visible;
195+
scroll-snap-type: x proximity;
196+
scrollbar-width: thin;
197+
}
198+
199+
.pluginBanner::-webkit-scrollbar {
200+
height: 10px;
201+
}
202+
203+
.pluginBanner::-webkit-scrollbar-thumb {
204+
border-radius: 999px;
205+
background: rgba(33, 121, 255, 0.22);
206+
}
207+
208+
.pluginStrip {
209+
display: flex;
210+
gap: 1rem;
211+
min-width: max-content;
212+
padding-right: 1rem;
213+
}
214+
182215
.quickCard,
183216
.pluginCard,
184217
.flowCard,
@@ -189,6 +222,11 @@
189222
border-radius: 24px;
190223
}
191224

225+
.pluginCardBanner {
226+
width: min(320px, 82vw);
227+
scroll-snap-align: start;
228+
}
229+
192230
.quickTitle,
193231
.pluginHeader h3,
194232
.flowCard h3 {

src/pages/index.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,11 @@ export default function Home(): ReactNode {
247247
<h2>插件列表</h2>
248248
<p className={styles.sectionLead}>首页现已补全 Matrix 系列全部插件入口,并覆盖文档、发布与开发者 API。</p>
249249
</div>
250-
<div className={styles.pluginGrid}>
251-
{pluginDocs.map((plugin) => (
252-
<article key={plugin.title} className={styles.pluginCard}>
250+
<p className={styles.bannerNote}>左右滑动可浏览全部插件入口。</p>
251+
<div className={styles.pluginBanner}>
252+
<div className={styles.pluginStrip}>
253+
{pluginDocs.map((plugin) => (
254+
<article key={plugin.title} className={`${styles.pluginCard} ${styles.pluginCardBanner}`}>
253255
<div className={styles.pluginHeader}>
254256
<div>
255257
<h3>{plugin.title}</h3>
@@ -267,7 +269,8 @@ export default function Home(): ReactNode {
267269
进入文档
268270
</Link>
269271
</article>
270-
))}
272+
))}
273+
</div>
271274
</div>
272275
</section>
273276

0 commit comments

Comments
 (0)