This commit is contained in:
eric
2026-03-15 04:25:45 -05:00
parent df12c7af4a
commit bbaa38b3b3
32 changed files with 4312 additions and 152 deletions

View File

@@ -14,29 +14,25 @@ export function TopicCards() {
className={`${styles.topicGrid} animate__animated animate__fadeInUp`}
style={{ animationDelay: "0.2s", animationFillMode: "both" }}
>
{TOPICS.map((t: TopicItem) => {
const { id, href } = t;
{TOPICS.map((topic: TopicItem) => {
const content = (
<>
<span className={styles.topicIcon}>{t.icon}</span>
<span className={styles.topicTitle}>{t.title}</span>
<span className={styles.topicDesc}>{t.desc}</span>
<span className={styles.topicIcon}>{topic.icon}</span>
<span className={styles.topicTitle}>{topic.title}</span>
<span className={styles.topicDesc}>{topic.desc}</span>
</>
);
return href ? (
return (
<Link
key={id}
href={href}
key={topic.id}
href={topic.href}
className={styles.topicCard}
target={href.startsWith("http") ? "_blank" : undefined}
rel={href.startsWith("http") ? "noopener noreferrer" : undefined}
target={topic.href.startsWith("http") ? "_blank" : undefined}
rel={topic.href.startsWith("http") ? "noopener noreferrer" : undefined}
>
{content}
</Link>
) : (
<div key={id} className={styles.topicCard} style={{ cursor: "default", opacity: 0.7 }}>
{content}
</div>
);
})}
</div>

View File

@@ -303,11 +303,11 @@ export function WelcomeBlock({
<div className={styles.loginCardTitle}></div>
<div className={styles.loginCardRow}>
<span className={styles.loginCardLabel}></span>
<Copyable text="https://qun.hackrobot.cn">
qun.hackrobot.cn
<Copyable text="/community">
/community
</Copyable>
<a
href="https://qun.hackrobot.cn"
href="/community"
target="_blank"
rel="noopener noreferrer"
className={styles.loginCardLink}

View File

@@ -1,7 +1,7 @@
"use client";
import Link from "next/link";
import { TOPICS_DISPLAY, EBOOKS_DISPLAY, VIDEO_COURSES_DISPLAY } from "@/app/data/vip.mock";
import { EBOOKS_DISPLAY, TOPICS_DISPLAY, VIDEO_COURSES_DISPLAY } from "@/app/data/vip.mock";
import styles from "../vip.module.css";
type TopicEbookShowcaseProps = {
@@ -11,29 +11,30 @@ type TopicEbookShowcaseProps = {
export function TopicEbookShowcase({ onLockedClick }: TopicEbookShowcaseProps) {
return (
<section id="topics" className={`${styles.section} ${styles.topicsSection}`}>
{/* 模块展示 */}
<h2 className={styles.sectionTitle}></h2>
<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 { id, href } = t;
const isLocked = "locked" in t && t.locked && onLockedClick;
{TOPICS_DISPLAY.map((topic) => {
const isLocked = "locked" in topic && topic.locked && onLockedClick;
const content = (
<span className={styles.topicCardInner}>
{isLocked && (
<span className={styles.topicLock} title="会员专享">🔒</span>
)}
<span className={styles.topicIcon}>{t.icon}</span>
<span className={styles.topicTitle}>{t.title}</span>
<span className={styles.topicDesc}>{t.desc}</span>
{isLocked ? (
<span className={styles.topicLock} title="会员专享">
🔒
</span>
) : null}
<span className={styles.topicIcon}>{topic.icon}</span>
<span className={styles.topicTitle}>{topic.title}</span>
<span className={styles.topicDesc}>{topic.desc}</span>
</span>
);
if (isLocked) {
return (
<button
key={id}
key={topic.id}
type="button"
className={styles.topicCard}
onClick={onLockedClick}
@@ -43,59 +44,48 @@ export function TopicEbookShowcase({ onLockedClick }: TopicEbookShowcaseProps) {
</button>
);
}
if (href) {
if (topic.href) {
return (
<Link
key={id}
href={href}
key={topic.id}
href={topic.href}
className={styles.topicCard}
target={href.startsWith("http") ? "_blank" : undefined}
rel={href.startsWith("http") ? "noopener noreferrer" : undefined}
target={topic.href.startsWith("http") ? "_blank" : undefined}
rel={topic.href.startsWith("http") ? "noopener noreferrer" : undefined}
>
{content}
</Link>
);
}
return (
<div key={id} className={styles.topicCard} style={{ cursor: "default", opacity: 0.7 }}>
{content}
</div>
);
})}
</div>
{/* 视频教程展示 - 参考 digital 资源导航,至少 4 个 */}
<h2 id="video-courses" className={styles.sectionTitle}></h2>
<h2 id="video-courses" 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) => {
const { id, href, icon, title, desc } = v;
return href ? (
<Link
key={id}
href={href}
className={styles.topicCard}
target={href.startsWith("http") ? "_blank" : undefined}
rel={href.startsWith("http") ? "noopener noreferrer" : undefined}
>
<span className={styles.topicIcon}>{icon}</span>
<span className={styles.topicTitle}>{title}</span>
<span className={styles.topicDesc}>{desc}</span>
</Link>
) : (
<div key={id} className={styles.topicCard} style={{ cursor: "default", opacity: 0.9 }}>
<span className={styles.topicIcon}>{icon}</span>
<span className={styles.topicTitle}>{title}</span>
<span className={styles.topicDesc}>{desc}</span>
</div>
);
})}
{VIDEO_COURSES_DISPLAY.map((video) => (
<Link
key={video.id}
href={video.href}
className={styles.topicCard}
target={video.href.startsWith("http") ? "_blank" : undefined}
rel={video.href.startsWith("http") ? "noopener noreferrer" : undefined}
>
<span className={styles.topicIcon}>{video.icon}</span>
<span className={styles.topicTitle}>{video.title}</span>
<span className={styles.topicDesc}>{video.desc}</span>
</Link>
))}
</div>
{/* 电子书展示 */}
<h2 id="ebooks" className={styles.sectionTitle}></h2>
<h2 id="ebooks" className={styles.sectionTitle}>
</h2>
<div
className="animate__animated animate__fadeInUp"
style={{
@@ -106,55 +96,59 @@ export function TopicEbookShowcase({ onLockedClick }: TopicEbookShowcaseProps) {
animationFillMode: "both",
}}
>
{EBOOKS_DISPLAY.map((e) => {
const { id, href } = e;
const isFree = "free" in e && e.free;
const isLocked = "locked" in e && e.locked && onLockedClick;
{EBOOKS_DISPLAY.map((ebook) => {
const isLocked = "locked" in ebook && ebook.locked && onLockedClick;
const cardContent = (
<>
<span style={{ fontSize: "1.5rem", marginBottom: "0.5rem", display: "block" }}>📖</span>
<div style={{ fontWeight: 600, color: "var(--foreground)", marginBottom: "0.25rem", display: "flex", alignItems: "center", gap: "0.5rem", flexWrap: "wrap" }}>
{e.title}
{isFree && (
<span className={styles.freeBadge}>
</span>
)}
{isLocked && (
<span title="VIP专享" style={{ fontSize: "1rem" }}>🔒</span>
)}
<span style={{ fontSize: "1.5rem", marginBottom: "0.5rem", display: "block" }}>📙</span>
<div
style={{
display: "flex",
alignItems: "center",
gap: "0.5rem",
flexWrap: "wrap",
fontWeight: 600,
color: "var(--foreground)",
marginBottom: "0.25rem",
}}
>
{ebook.title}
{"free" in ebook && ebook.free ? <span className={styles.freeBadge}></span> : null}
{isLocked ? <span title="会员专享">🔒</span> : null}
</div>
<div style={{ fontSize: "0.9rem", color: "var(--muted-foreground)" }}>{e.desc}</div>
<div style={{ marginTop: "0.75rem", fontSize: "0.85rem", color: isLocked ? "var(--muted-foreground)" : "var(--muted-foreground)" }}>
{isLocked ? "开通VIP解锁 →" : "阅读 →"}
<div style={{ fontSize: "0.9rem", color: "var(--muted-foreground)" }}>{ebook.desc}</div>
<div style={{ marginTop: "0.75rem", fontSize: "0.85rem", color: "var(--muted-foreground)" }}>
{isLocked ? "开通会员解锁 →" : "立即阅读 →"}
</div>
</>
);
if (isLocked) {
return (
<button
key={id}
key={ebook.id}
type="button"
onClick={onLockedClick}
className={styles.card}
style={{
display: "block",
width: "100%",
padding: "1.25rem",
cursor: "pointer",
border: "none",
cursor: "pointer",
font: "inherit",
textAlign: "left",
width: "100%",
}}
>
{cardContent}
</button>
);
}
return href ? (
return (
<Link
key={id}
href={href}
key={ebook.id}
href={ebook.href}
className={styles.card}
style={{
display: "block",
@@ -165,19 +159,6 @@ export function TopicEbookShowcase({ onLockedClick }: TopicEbookShowcaseProps) {
>
{cardContent}
</Link>
) : (
<div
key={id}
className={styles.card}
style={{
display: "block",
padding: "1.25rem",
cursor: "default",
opacity: 0.9,
}}
>
{cardContent}
</div>
);
})}
</div>

View File

@@ -12,29 +12,25 @@ export function TopicEntries() {
className={`${styles.topicGrid} animate__animated animate__fadeInUp`}
style={{ animationDelay: "0.2s", animationFillMode: "both" }}
>
{TOPICS.map((t) => {
const { id, href } = t;
{TOPICS.map((topic) => {
const content = (
<>
<span className={styles.topicIcon}>{t.icon}</span>
<span className={styles.topicTitle}>{t.title}</span>
<span className={styles.topicDesc}>{t.desc}</span>
<span className={styles.topicIcon}>{topic.icon}</span>
<span className={styles.topicTitle}>{topic.title}</span>
<span className={styles.topicDesc}>{topic.desc}</span>
</>
);
return href ? (
return (
<Link
key={id}
href={href}
key={topic.id}
href={topic.href}
className={styles.topicCard}
target={href.startsWith("http") ? "_blank" : undefined}
rel={href.startsWith("http") ? "noopener noreferrer" : undefined}
target={topic.href.startsWith("http") ? "_blank" : undefined}
rel={topic.href.startsWith("http") ? "noopener noreferrer" : undefined}
>
{content}
</Link>
) : (
<div key={id} className={styles.topicCard} style={{ cursor: "default", opacity: 0.7 }}>
{content}
</div>
);
})}
</div>