's'
This commit is contained in:
103
app/vip/components/landing/TopicEbookShowcase.tsx
Normal file
103
app/vip/components/landing/TopicEbookShowcase.tsx
Normal file
@@ -0,0 +1,103 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { TOPICS_DISPLAY, EBOOKS_DISPLAY, VIDEO_COURSES_DISPLAY } from "@/app/data/vip.mock";
|
||||
import styles from "../vip.module.css";
|
||||
|
||||
export function TopicEbookShowcase() {
|
||||
return (
|
||||
<section id="topics" className={styles.section}>
|
||||
{/* 模块展示 */}
|
||||
<h2 className={styles.sectionTitle}>模块</h2>
|
||||
<div
|
||||
className={`${styles.topicGrid} animate__animated animate__fadeInUp`}
|
||||
style={{ animationDelay: "0.2s", animationFillMode: "both", marginBottom: "1.5rem" }}
|
||||
>
|
||||
{TOPICS_DISPLAY.map((t) => {
|
||||
const content = (
|
||||
<>
|
||||
<span className={styles.topicIcon}>{t.icon}</span>
|
||||
<span className={styles.topicTitle}>{t.title}</span>
|
||||
<span className={styles.topicDesc}>{t.desc}</span>
|
||||
</>
|
||||
);
|
||||
if (t.href) {
|
||||
return (
|
||||
<Link
|
||||
key={t.id}
|
||||
href={t.href}
|
||||
className={styles.topicCard}
|
||||
target={t.href.startsWith("http") ? "_blank" : undefined}
|
||||
rel={t.href.startsWith("http") ? "noopener noreferrer" : undefined}
|
||||
>
|
||||
{content}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div key={t.id} className={styles.topicCard} style={{ cursor: "default", opacity: 0.7 }}>
|
||||
{content}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* 视频教程展示 - 参考 digital 资源导航,至少 4 个 */}
|
||||
<h2 className={styles.sectionTitle}>视频教程</h2>
|
||||
<div
|
||||
className={`${styles.topicGrid} animate__animated animate__fadeInUp`}
|
||||
style={{ animationDelay: "0.22s", animationFillMode: "both", marginBottom: "1.5rem" }}
|
||||
>
|
||||
{VIDEO_COURSES_DISPLAY.map((v) => (
|
||||
<Link
|
||||
key={v.id}
|
||||
href={v.href}
|
||||
className={styles.topicCard}
|
||||
target={v.href.startsWith("http") ? "_blank" : undefined}
|
||||
rel={v.href.startsWith("http") ? "noopener noreferrer" : undefined}
|
||||
>
|
||||
<span className={styles.topicIcon}>{v.icon}</span>
|
||||
<span className={styles.topicTitle}>{v.title}</span>
|
||||
<span className={styles.topicDesc}>{v.desc}</span>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* 电子书展示 */}
|
||||
<h2 className={styles.sectionTitle}>电子书</h2>
|
||||
<div
|
||||
className="animate__animated animate__fadeInUp"
|
||||
style={{
|
||||
display: "grid",
|
||||
gridTemplateColumns: "repeat(auto-fill, minmax(260px, 1fr))",
|
||||
gap: "1rem",
|
||||
animationDelay: "0.25s",
|
||||
animationFillMode: "both",
|
||||
}}
|
||||
>
|
||||
{EBOOKS_DISPLAY.map((e) => (
|
||||
<Link
|
||||
key={e.id}
|
||||
href={e.href}
|
||||
className={styles.card}
|
||||
style={{
|
||||
display: "block",
|
||||
padding: "1.25rem",
|
||||
textDecoration: "none",
|
||||
color: "inherit",
|
||||
}}
|
||||
>
|
||||
<span style={{ fontSize: "1.5rem", marginBottom: "0.5rem", display: "block" }}>📖</span>
|
||||
<div style={{ fontWeight: 600, color: "var(--foreground)", marginBottom: "0.25rem" }}>
|
||||
《{e.title}》
|
||||
</div>
|
||||
<div style={{ fontSize: "0.9rem", color: "var(--muted-foreground)" }}>{e.desc}</div>
|
||||
<div style={{ marginTop: "0.75rem", fontSize: "0.85rem", color: "var(--accent)" }}>
|
||||
阅读 →
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user