This commit is contained in:
eric
2026-04-02 07:15:42 -05:00
parent 644a6ac3a9
commit d401a36b71
62 changed files with 13264 additions and 78 deletions

16
lib/echarts-theme.ts Normal file
View File

@@ -0,0 +1,16 @@
export const chartTheme = {
text: "#cbd5e1",
subText: "#94a3b8",
line: "#22d3ee",
bar: "#8b5cf6",
pieA: "#22d3ee",
pieB: "#8b5cf6",
pieC: "#34d399",
pieD: "#f59e0b",
split: "rgba(148,163,184,.14)",
axis: "#94a3b8",
};
export function baseGrid() {
return { left: 20, right: 20, top: 40, bottom: 20, containLabel: true };
}

9
lib/marketing.ts Normal file
View File

@@ -0,0 +1,9 @@
export function buildChannelUrl(baseHref: string, channel: string, slug: string) {
const normalized = baseHref && baseHref !== "#" ? baseHref : `/download/${slug}`;
const url = new URL(normalized, "https://download-nova.local");
url.searchParams.set("utm_source", "download_nova");
url.searchParams.set("utm_medium", "site");
url.searchParams.set("utm_campaign", "resource_download");
url.searchParams.set("channel", channel);
return normalized.startsWith("http") ? url.toString() : `${url.pathname}${url.search}`;
}

150
lib/mock-data.ts Normal file
View File

@@ -0,0 +1,150 @@
import { AppCategory, AppResource, InsightTrendPoint } from "@/lib/types";
export const categoryLabels: Record<AppCategory, string> = {
windows: "Windows",
android: "Android",
efficiency: "效率工具",
developer: "开发工具",
ai: "AI 工具",
media: "媒体工具",
design: "设计工具",
network: "网络工具",
};
export const hotKeywords = [
"AI 绘图",
"剪辑",
"效率提升",
"开发调试",
"网盘下载",
"无广告",
];
export const appResources: AppResource[] = [
{
id: "1",
slug: "nova-ai-studio",
name: "Nova AI Studio",
subtitle: "多模型桌面生产力引擎",
description: "聚合文本、图片、代码模型的一体化桌面工具,适合创作者和开发者。",
icon: "🤖",
category: "ai",
tags: ["AI", "创作", "多模型"],
version: "3.2.1",
size: "238 MB",
updatedAt: "2026-03-28",
uploadedAt: "2026-01-09",
downloads: 238942,
featured: true,
safety: ["official", "verified", "clean"],
screenshots: ["/shots/shot-1.svg", "/shots/shot-2.svg", "/shots/shot-3.svg"],
channels: [
{ id: "c1", name: "官方下载", type: "official", href: "#" },
{ id: "c2", name: "百度网盘", type: "pan", href: "#", hint: "提取码: 9P2A" },
{ id: "c3", name: "夸克网盘", type: "pan", href: "#" },
{ id: "c4", name: "备用线路", type: "mirror", href: "#" },
],
versionHistory: [
{ version: "3.2.1", size: "238 MB", updatedAt: "2026-03-28", notes: "提升导出性能与稳定性", downloadHref: "#" },
{ version: "3.1.8", size: "233 MB", updatedAt: "2026-03-04", notes: "新增提示词工作台", downloadHref: "#" },
{ version: "3.0.6", size: "226 MB", updatedAt: "2026-02-19", notes: "支持插件市场", downloadHref: "#" },
],
changelog: [
{ date: "2026-03-28", title: "渲染管线升级", description: "图像生成耗时下降 18%GPU 占用更平滑。" },
{ date: "2026-03-18", title: "订阅入口优化", description: "新增高级模板入口,支持后续接入付费能力。" },
{ date: "2026-03-04", title: "Prompt 工作台", description: "加入可复用提示词库和团队共享预留位。" },
],
usage: ["首次启动建议开启硬件加速。", "创作前先在设置里选择模型路由。", "输出内容请注意版权合规。"],
},
{
id: "2",
slug: "pixel-flow",
name: "Pixel Flow",
subtitle: "设计稿与动效协同平台",
description: "轻量化 UI 设计工具,支持组件复用和交互动效预览。",
icon: "🎨",
category: "design",
tags: ["设计", "协同", "原型"],
version: "2.6.4",
size: "184 MB",
updatedAt: "2026-03-30",
uploadedAt: "2025-12-22",
downloads: 170554,
featured: true,
safety: ["verified", "clean"],
screenshots: ["/shots/shot-2.svg", "/shots/shot-3.svg", "/shots/shot-4.svg"],
channels: [
{ id: "d1", name: "官方下载", type: "official", href: "#" },
{ id: "d2", name: "夸克网盘", type: "pan", href: "#" },
{ id: "d3", name: "备用线路", type: "mirror", href: "#" },
],
versionHistory: [
{ version: "2.6.4", size: "184 MB", updatedAt: "2026-03-30", notes: "优化组件库检索体验", downloadHref: "#" },
{ version: "2.6.0", size: "181 MB", updatedAt: "2026-03-01", notes: "新增渐变资产面板", downloadHref: "#" },
],
changelog: [
{ date: "2026-03-30", title: "画布性能提升", description: "大型页面滚动与缩放响应更稳定。" },
{ date: "2026-03-01", title: "资产管理升级", description: "支持按项目维度批量分类。"},
],
usage: ["推荐搭配 2K 以上显示器。", "可导出组件 JSON方便后续接后台配置。"],
},
{
id: "3",
slug: "devlight-proxy",
name: "DevLight Proxy",
subtitle: "开发网络抓包与转发工具",
description: "面向前后端联调的流量分析套件,支持规则改写与日志过滤。",
icon: "🧰",
category: "developer",
tags: ["抓包", "联调", "网络"],
version: "1.9.7",
size: "91 MB",
updatedAt: "2026-03-25",
uploadedAt: "2025-10-11",
downloads: 121889,
safety: ["official", "verified"],
screenshots: ["/shots/shot-3.svg", "/shots/shot-4.svg"],
channels: [
{ id: "e1", name: "官方下载", type: "official", href: "#" },
{ id: "e2", name: "百度网盘", type: "pan", href: "#" },
],
versionHistory: [{ version: "1.9.7", size: "91 MB", updatedAt: "2026-03-25", notes: "新增 HTTPS 规则组", downloadHref: "#" }],
changelog: [{ date: "2026-03-25", title: "规则组增强", description: "新增请求体关键字匹配与命中统计。" }],
usage: ["需要管理员权限安装证书。", "请在非生产环境开启请求改写。"],
},
{
id: "4",
slug: "media-spark",
name: "Media Spark",
subtitle: "智能剪辑与压缩工具",
description: "支持批量压缩、字幕自动识别和云端模板预留入口。",
icon: "🎬",
category: "media",
tags: ["视频", "压缩", "字幕"],
version: "5.1.0",
size: "302 MB",
updatedAt: "2026-03-20",
uploadedAt: "2025-11-08",
downloads: 298123,
safety: ["verified", "clean"],
screenshots: ["/shots/shot-1.svg", "/shots/shot-4.svg"],
channels: [
{ id: "f1", name: "官方下载", type: "official", href: "#" },
{ id: "f2", name: "夸克网盘", type: "pan", href: "#" },
{ id: "f3", name: "备用线路", type: "mirror", href: "#" },
],
versionHistory: [{ version: "5.1.0", size: "302 MB", updatedAt: "2026-03-20", notes: "导出速度提升 15%", downloadHref: "#" }],
changelog: [{ date: "2026-03-20", title: "编解码更新", description: "新增 H.266 预研能力与机型兼容优化。" }],
usage: ["移动端素材建议先统一帧率。", "导出前可启用智能降噪。"],
},
];
export const insightTrend: InsightTrendPoint[] = [
{ date: "03-24", downloads: 12240 },
{ date: "03-25", downloads: 13610 },
{ date: "03-26", downloads: 14120 },
{ date: "03-27", downloads: 16890 },
{ date: "03-28", downloads: 17220 },
{ date: "03-29", downloads: 19020 },
{ date: "03-30", downloads: 21440 },
];

16
lib/tracking-events.ts Normal file
View File

@@ -0,0 +1,16 @@
export const TRACKING_EVENTS = {
pageView: "page_view",
ctaClick: "cta_click",
downloadClick: "download_click",
unlockSubmit: "unlock_submit",
unlockResult: "unlock_result",
popupExpose: "popup_expose",
popupClick: "popup_click",
popupClose: "popup_close",
galleryOpen: "gallery_open",
galleryNavigate: "gallery_navigate",
abExpose: "ab_expose",
abClick: "ab_click",
} as const;
export type TrackingEventName = (typeof TRACKING_EVENTS)[keyof typeof TRACKING_EVENTS];

67
lib/types.ts Normal file
View File

@@ -0,0 +1,67 @@
export type AppCategory =
| "windows"
| "android"
| "efficiency"
| "developer"
| "ai"
| "media"
| "design"
| "network";
export interface DownloadSource {
id: string;
name: string;
type: "official" | "pan" | "mirror" | "affiliate";
href: string;
hint?: string;
}
export interface VersionHistoryItem {
version: string;
size: string;
updatedAt: string;
notes: string;
downloadHref: string;
}
export interface ChangelogItem {
date: string;
title: string;
description: string;
}
export interface AppResource {
id: string;
slug: string;
name: string;
subtitle: string;
description: string;
icon: string;
category: AppCategory;
tags: string[];
version: string;
size: string;
updatedAt: string;
uploadedAt: string;
downloads: number;
featured?: boolean;
safety: ("official" | "verified" | "clean")[];
screenshots: string[];
channels: DownloadSource[];
versionHistory: VersionHistoryItem[];
changelog: ChangelogItem[];
usage: string[];
}
export interface InsightTrendPoint {
date: string;
downloads: number;
}
export type AccessLevel = "guest" | "unlocked" | "vip";
export interface SessionState {
isLoggedIn: boolean;
accessLevel: AccessLevel;
userName?: string;
}

6
lib/utils.ts Normal file
View File

@@ -0,0 +1,6 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}