This commit is contained in:
Kevin
2026-05-18 13:21:13 +08:00
parent 20e2fc62ae
commit 0defc800a3
9 changed files with 1802 additions and 137 deletions

3
.gitignore vendored
View File

@@ -22,3 +22,6 @@ Thumbs.db
# Editor (optional local) # Editor (optional local)
*.swp *.swp
*.swo *.swo
# Wrangler local state
.wrangler/

BIN
dist.zip Normal file

Binary file not shown.

1835
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,8 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc -b && vite build", "build": "tsc -b && vite build",
"preview": "vite preview" "preview": "vite preview",
"deploy:pages": "bash scripts/deploy-pages.sh"
}, },
"dependencies": { "dependencies": {
"react": "^18.3.1", "react": "^18.3.1",
@@ -16,8 +17,9 @@
"devDependencies": { "devDependencies": {
"@types/react": "^18.3.12", "@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1", "@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3", "@vitejs/plugin-react": "^4.7.0",
"typescript": "^5.6.3", "typescript": "^5.6.3",
"vite": "^5.4.10" "vite": "^6.4.2",
"wrangler": "^4.92.0"
} }
} }

1
public/_redirects Normal file
View File

@@ -0,0 +1 @@
/* /index.html 200

33
scripts/deploy-pages.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
# 构建 Vite 产物并上传到 Cloudflare Pages静态资源直连部署
#
# 本机首次:
# npm install
# npx wrangler login
#
# CI / 非交互登录请设置:
# CLOUDFLARE_API_TOKEN权限需包含 Account · Cloudflare Pages · Edit
# CLOUDFLARE_ACCOUNT_ID仪表盘「账户 ID」或运行 npx wrangler whoami
#
# 可选环境变量:
# PAGES_PROJECT_NAME 覆盖 Pages 项目名(默认 heguangtongkun-landing需与 wrangler.toml / 控制台一致)
# PAGES_DEPLOY_BRANCH 部署分支名,影响生产/预览归类(默认 main
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
PAGES_PROJECT_NAME="${PAGES_PROJECT_NAME:-hgtk-landing}"
PAGES_DEPLOY_BRANCH="${PAGES_DEPLOY_BRANCH:-main}"
echo "==> npm ci & build"
npm ci
npm run build
echo "==> wrangler pages deploy -> project: ${PAGES_PROJECT_NAME}, branch: ${PAGES_DEPLOY_BRANCH}"
npx wrangler pages deploy dist \
--project-name="$PAGES_PROJECT_NAME" \
--branch="$PAGES_DEPLOY_BRANCH"
echo "==> Done."

View File

@@ -2,6 +2,9 @@ import { type CSSProperties } from "react";
import CompareSlider from "./CompareSlider"; import CompareSlider from "./CompareSlider";
import LogoMark from "./LogoMark"; import LogoMark from "./LogoMark";
/** 工信部 ICP 备案号(页脚公示,需与域名备案信息一致) */
const SITE_ICP_NUMBER = "沪ICP备2026019929号";
/* ── Feature cards ─────────────────────────────── */ /* ── Feature cards ─────────────────────────────── */
const features = [ const features = [
{ {
@@ -542,9 +545,21 @@ export default function LandingPage() {
<footer className="site-footer"> <footer className="site-footer">
<div className="wrap footer-inner"> <div className="wrap footer-inner">
<div className="footer-main">
<span>© {new Date().getFullYear()} · </span> <span>© {new Date().getFullYear()} · </span>
<span className="footer-note"> 3D App · </span> <span className="footer-note"> 3D App · </span>
</div> </div>
<div className="footer-filings">
<a
className="footer-filing-link"
href="https://beian.miit.gov.cn/"
target="_blank"
rel="noopener noreferrer"
>
{SITE_ICP_NUMBER}
</a>
</div>
</div>
</footer> </footer>
</> </>
); );

View File

@@ -1732,13 +1732,19 @@
.footer-inner { .footer-inner {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.5rem; gap: 0.75rem;
font-size: 0.92rem; font-size: 0.92rem;
color: var(--text-muted); color: var(--text-muted);
} }
.footer-main {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
@media (min-width: 640px) { @media (min-width: 640px) {
.footer-inner { .footer-main {
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@@ -1748,3 +1754,19 @@
.footer-note { .footer-note {
opacity: 0.8; opacity: 0.8;
} }
.footer-filings {
font-size: 0.85rem;
line-height: 1.4;
}
.footer-filing-link {
color: inherit;
text-decoration: none;
opacity: 0.9;
}
.footer-filing-link:hover {
text-decoration: underline;
opacity: 1;
}

14
wrangler.toml Normal file
View File

@@ -0,0 +1,14 @@
# Git 集成时的两种常见配置:
#
# 1) 仅静态 PagesBuild = npm run buildOutput = dist「Deploy command」留空
# (由 Cloudflare 直接发布 dist勿再执行 wrangler deploy
#
# 2) Workers + Vite 管道:控制台会执行 npx wrangler deploy要求 package.json 中 Vite ≥ 6
#
# 下面 name 建议与 Cloudflare 控制台里的 Worker / Pages 项目名一致(你当前日志为 hgtk-landing
name = "hgtk-landing"
compatibility_date = "2025-05-01"
pages_build_output_dir = "dist"
# 若 wrangler 提示需要账户 ID可取消下行注释并填入或与 CLOUDFLARE_ACCOUNT_ID 二选一)
# account_id = ""