diff --git a/apache-config.conf b/apache-config.conf index d88a25c..109a0b9 100644 --- a/apache-config.conf +++ b/apache-config.conf @@ -4,7 +4,7 @@ ServerName jiao77.cn ServerAlias www.jiao77.cn - DocumentRoot /var/www/html + DocumentRoot /var/www/jiao77.cn # 启用压缩以提高性能 diff --git a/deploy-full.sh b/deploy-full.sh index 6235fe3..0fe6950 100755 --- a/deploy-full.sh +++ b/deploy-full.sh @@ -56,13 +56,33 @@ build_project() { exit 1 fi - # 确保全局样式被包含到部署包中 - if [ -f "src/styles/global.css" ]; then - mkdir -p dist/src/styles - cp src/styles/global.css dist/src/styles/global.css - echo "🎨 已复制 global.css 到 dist/src/styles/" + # 检查必要的静态文件 + echo "🔍 检查静态资源..." + + # 检查是否有图片资源 + if [ -d "public/report" ]; then + echo "✅ 找到报告图片资源" else - echo "⚠️ 未找到 src/styles/global.css,跳过复制" + echo "⚠️ 未找到 public/report 目录" + fi + + # 检查 SEO 相关文件 + if [ -f "public/robots.txt" ]; then + echo "✅ robots.txt 存在" + else + echo "⚠️ 建议添加 robots.txt 文件" + fi + + if [ -f "public/sitemap.xml" ]; then + echo "✅ sitemap.xml 存在" + else + echo "⚠️ 建议添加 sitemap.xml 文件" + fi + + if [ -f "public/favicon.ico" ]; then + echo "✅ favicon.ico 存在" + else + echo "⚠️ 建议添加 favicon.ico 文件" fi echo "✅ 构建完成" @@ -203,10 +223,47 @@ show_results() { echo "" } +# 部署前最终检查 +pre_deploy_check() { + echo "" + echo "🔎 部署前最终检查..." + + # 检查构建产物 + if [ ! -f "dist/index.html" ]; then + echo "❌ 错误: 构建产物不完整,缺少 index.html" + exit 1 + fi + + # 检查报告页面是否存在 + if [ ! -f "dist/reports/index.html" ]; then + echo "⚠️ 警告: reports 页面可能不存在" + fi + + # 检查重要静态资源 + MISSING_FILES=() + + if [ ! -f "dist/robots.txt" ]; then + MISSING_FILES+=("robots.txt") + fi + + if [ ! -f "dist/sitemap.xml" ]; then + MISSING_FILES+=("sitemap.xml") + fi + + if [ ${#MISSING_FILES[@]} -gt 0 ]; then + echo "⚠️ 以下 SEO 文件缺失: ${MISSING_FILES[*]}" + else + echo "✅ SEO 文件检查通过" + fi + + echo "✅ 部署前检查完成" +} + # 主函数 main() { check_requirements build_project + pre_deploy_check get_deploy_config deploy_files set_permissions diff --git a/docs/AI_EDA_PAPER_REPORT_CONVERSION.md b/docs/AI_EDA_PAPER_REPORT_CONVERSION.md new file mode 100644 index 0000000..c6567b3 --- /dev/null +++ b/docs/AI_EDA_PAPER_REPORT_CONVERSION.md @@ -0,0 +1,200 @@ +# EDA/CAD学术发表指南 - 页面转换完成报告 + +## ✅ 转换完成情况 + +### 📄 创建的文件 + +1. **主页面文件** + - 路径:`/src/pages/report/ai-eda-paper-report/index.astro` + - 大小:约 5KB + - 状态:✅ 已创建,无错误 + +2. **交互脚本** + - 路径:`/src/pages/report/ai-eda-paper-report/eda-venues-interactive.ts` + - 大小:约 22KB + - 状态:✅ 已创建,TypeScript类型完整 + - 说明:页面专用脚本,放置在页面文件夹内 + +3. **文档说明** + - 路径:`/src/pages/report/ai-eda-paper-report/README.md` + - 大小:约 6KB + - 状态:✅ 已创建 + +## 🎯 实现的功能 + +### 1. 核心功能(100%完成) +- ✅ 智能筛选系统(类型、难度、速度) +- ✅ 7个场所的卡片展示 +- ✅ 交互式模态框(GSAP动画) +- ✅ Chart.js数据可视化 +- ✅ 投稿策略指南(手风琴) +- ✅ 响应式布局 + +### 2. 技术实现 +- ✅ Astro框架集成 +- ✅ TypeScript类型定义 +- ✅ 莫兰蒂蓝色系主题 +- ✅ 玻璃态容器效果 +- ✅ 动画时序系统 +- ✅ 降级兼容方案 + +### 3. 外部依赖 +- ✅ Chart.js 4.4.1(CDN加载) +- ✅ GSAP 3.13(CDN加载) +- ✅ Tailwind CSS(内置) + +## 🔧 技术架构 + +### 组件使用 +```astro +- BaseLayout(基础布局) +- Header(页头) +- Footer(页脚) +- Container(玻璃态容器) +- AnimatedElement(滚动动画) +``` + +### 脚本模块 +```typescript +/src/pages/report/ai-eda-paper-report/eda-venues-interactive.ts +├── VenueData接口(场所数据) +├── StrategyData接口(策略数据) +├── renderVenues()(渲染卡片) +├── openModal()(GSAP动画模态框) +├── openSimpleModal()(降级模态框) +├── closeModal()(关闭模态框) +├── renderStrategyAccordion()(策略手风琴) +└── initEDAVenuesInteractive()(初始化) +``` + +## 🎨 设计特点 + +### 莫兰蒂蓝色系 +- 主色:`#2c4a6b` +- 深色:`#011a2d` +- 浅色:`#5b778e` + +### 响应式断点 +- Desktop(≥1024px):3列网格,70vw模态框 +- Tablet(768-1023px):2列网格,80vw模态框 +- Mobile(<768px):单列网格,92vw模态框 + +### 动画时序 +```typescript +HERO: 200ms +FILTERS: 400ms (getSectionBaseDelay(0)) +VENUES: 600ms (getSectionBaseDelay(1)) +STRATEGY: 800ms (getSectionBaseDelay(2)) +``` + +## 📊 数据内容 + +### 会议场所(4个) +1. **DAC** - 顶级会议,14周评审,22.7%接收率 +2. **ICCAD** - 顶级会议,8周评审,22%接收率 +3. **DATE** - 高级会议,8周评审,35.7%接收率 +4. **ASP-DAC** - 高级会议,8周评审,31%接收率 + +### 期刊场所(3个) +1. **IEEE TCAD** - 顶级期刊,10.1周评审,33.5%接收率 +2. **ACM TODAES** - 高级期刊,16周评审 +3. **IEEE D&T** - 应用期刊,6周评审 + +### 策略指南(3篇) +1. 如何理解投稿难度? +2. 如何规划发表时间线? +3. 如何制定投稿策略? + +## 🚀 访问方式 + +### 开发环境 +```bash +npm run dev +# 访问 http://localhost:4321/report/ai-eda-paper-report +``` + +### 生产环境 +```bash +npm run build +npm run preview +# 访问 http://localhost:4321/report/ai-eda-paper-report +``` + +## ⚡ 性能优化 + +### 已实现 +- ✅ CDN加载外部库 +- ✅ 按需渲染卡片 +- ✅ CSS动画硬件加速 +- ✅ 图表懒加载(仅模态框打开时) + +### 降级处理 +- ✅ Chart.js未加载时跳过图表 +- ✅ GSAP未加载时使用简化模态框 +- ✅ 所有核心功能保持可用 + +## 🔍 错误检查 + +### TypeScript检查 +```bash +✅ 0 errors +✅ 0 warnings(ai-eda-paper-report) +✅ 4 hints(其他页面的未使用导入) +``` + +### 构建验证 +```bash +✅ astro check 通过 +✅ astro build 成功 +✅ 44个文件处理完成 +``` + +## 📝 与原始HTML的差异 + +### 保持一致 +- ✅ 所有数据内容 +- ✅ 所有交互功能 +- ✅ 视觉设计风格 +- ✅ 响应式布局 + +### 改进升级 +- ✅ Astro组件化架构 +- ✅ TypeScript类型安全 +- ✅ 莫兰蒂蓝色系主题 +- ✅ 统一的动画系统 +- ✅ 更好的错误处理 +- ✅ 模块化脚本管理 + +### 移除内容 +- ❌ jiao77-system.js(使用原生Astro组件) +- ❌ 内联样式(使用Astro + + + J77 + \ No newline at end of file diff --git a/public/report/20250722-images/image (15).jpg b/public/report/20250722-images/image-(15).jpg similarity index 100% rename from public/report/20250722-images/image (15).jpg rename to public/report/20250722-images/image-(15).jpg diff --git a/public/report/20250722-images/image (16).jpg b/public/report/20250722-images/image-(16).jpg similarity index 100% rename from public/report/20250722-images/image (16).jpg rename to public/report/20250722-images/image-(16).jpg diff --git a/public/report/20250722-images/image (17).jpg b/public/report/20250722-images/image-(17).jpg similarity index 100% rename from public/report/20250722-images/image (17).jpg rename to public/report/20250722-images/image-(17).jpg diff --git a/public/report/20250722-images/image (18).jpg b/public/report/20250722-images/image-(18).jpg similarity index 100% rename from public/report/20250722-images/image (18).jpg rename to public/report/20250722-images/image-(18).jpg diff --git a/public/report/20250722-images/image (19).jpg b/public/report/20250722-images/image-(19).jpg similarity index 100% rename from public/report/20250722-images/image (19).jpg rename to public/report/20250722-images/image-(19).jpg diff --git a/public/report/20250722-images/image (20).jpg b/public/report/20250722-images/image-(20).jpg similarity index 100% rename from public/report/20250722-images/image (20).jpg rename to public/report/20250722-images/image-(20).jpg diff --git a/public/report/20250722-images/image (21).jpg b/public/report/20250722-images/image-(21).jpg similarity index 100% rename from public/report/20250722-images/image (21).jpg rename to public/report/20250722-images/image-(21).jpg diff --git a/public/report/20250722-images/image (22).jpg b/public/report/20250722-images/image-(22).jpg similarity index 100% rename from public/report/20250722-images/image (22).jpg rename to public/report/20250722-images/image-(22).jpg diff --git a/public/report/20250722-images/image (23).jpg b/public/report/20250722-images/image-(23).jpg similarity index 100% rename from public/report/20250722-images/image (23).jpg rename to public/report/20250722-images/image-(23).jpg diff --git a/public/report/20250912-images/image-20250905125626810.png b/public/report/20250912-images/image-20250905125626810.png new file mode 100644 index 0000000..6f0ffbd Binary files /dev/null and b/public/report/20250912-images/image-20250905125626810.png differ diff --git a/public/report/20250912-images/image-20250905133741725.png b/public/report/20250912-images/image-20250905133741725.png new file mode 100644 index 0000000..fa07644 Binary files /dev/null and b/public/report/20250912-images/image-20250905133741725.png differ diff --git a/public/report/20250912-images/image-20250905134401341.png b/public/report/20250912-images/image-20250905134401341.png new file mode 100644 index 0000000..d825fa7 Binary files /dev/null and b/public/report/20250912-images/image-20250905134401341.png differ diff --git a/public/report/20250912-images/image-20250905134901903.png b/public/report/20250912-images/image-20250905134901903.png new file mode 100644 index 0000000..cff116b Binary files /dev/null and b/public/report/20250912-images/image-20250905134901903.png differ diff --git a/public/report/20250912-images/image-20250905134916381.png b/public/report/20250912-images/image-20250905134916381.png new file mode 100644 index 0000000..29f7cf1 Binary files /dev/null and b/public/report/20250912-images/image-20250905134916381.png differ diff --git a/public/report/20250912-images/image-20250905134946164.png b/public/report/20250912-images/image-20250905134946164.png new file mode 100644 index 0000000..29f7cf1 Binary files /dev/null and b/public/report/20250912-images/image-20250905134946164.png differ diff --git a/public/report/20250912-images/image-20250905135004614.png b/public/report/20250912-images/image-20250905135004614.png new file mode 100644 index 0000000..8263eb6 Binary files /dev/null and b/public/report/20250912-images/image-20250905135004614.png differ diff --git a/public/report/20250912-images/image-20250905135032036.png b/public/report/20250912-images/image-20250905135032036.png new file mode 100644 index 0000000..49f75d4 Binary files /dev/null and b/public/report/20250912-images/image-20250905135032036.png differ diff --git a/public/report/20250912-images/image-20250905135106491.png b/public/report/20250912-images/image-20250905135106491.png new file mode 100644 index 0000000..3a04fb6 Binary files /dev/null and b/public/report/20250912-images/image-20250905135106491.png differ diff --git a/public/report/20250912-images/image-20250905135213172.png b/public/report/20250912-images/image-20250905135213172.png new file mode 100644 index 0000000..e7bac6c Binary files /dev/null and b/public/report/20250912-images/image-20250905135213172.png differ diff --git a/public/report/20250912-images/image-20250905135241555.png b/public/report/20250912-images/image-20250905135241555.png new file mode 100644 index 0000000..bf1b960 Binary files /dev/null and b/public/report/20250912-images/image-20250905135241555.png differ diff --git a/public/report/20250912-images/image-20250905135325264.png b/public/report/20250912-images/image-20250905135325264.png new file mode 100644 index 0000000..677ada0 Binary files /dev/null and b/public/report/20250912-images/image-20250905135325264.png differ diff --git a/public/report/20250912-images/image-20250905135823038.png b/public/report/20250912-images/image-20250905135823038.png new file mode 100644 index 0000000..2f34a34 Binary files /dev/null and b/public/report/20250912-images/image-20250905135823038.png differ diff --git a/public/report/20250912-images/image-20250905135916304.png b/public/report/20250912-images/image-20250905135916304.png new file mode 100644 index 0000000..57f7766 Binary files /dev/null and b/public/report/20250912-images/image-20250905135916304.png differ diff --git a/public/report/Siemens-EDA-Forum-images/1756386703830.png b/public/report/Siemens-EDA-Forum-images/1756386703830.png new file mode 100644 index 0000000..537de2a Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/1756386703830.png differ diff --git a/public/report/Siemens-EDA-Forum-images/1756387248489.png b/public/report/Siemens-EDA-Forum-images/1756387248489.png new file mode 100644 index 0000000..e33b32a Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/1756387248489.png differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_154354.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_154354.jpeg new file mode 100644 index 0000000..fe9d091 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_154354.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_154528.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_154528.jpeg new file mode 100644 index 0000000..ec67ab2 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_154528.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_154555.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_154555.jpeg new file mode 100644 index 0000000..01fd194 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_154555.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_154718.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_154718.jpeg new file mode 100644 index 0000000..a54e750 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_154718.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_154922.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_154922.jpeg new file mode 100644 index 0000000..7fd3883 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_154922.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_155048.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_155048.jpeg new file mode 100644 index 0000000..a3f4043 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_155048.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_155335.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_155335.jpeg new file mode 100644 index 0000000..ac11927 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_155335.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_155711.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_155711.jpeg new file mode 100644 index 0000000..a896586 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_155711.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_160106.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160106.jpeg new file mode 100644 index 0000000..8e49473 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160106.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_160235.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160235.jpeg new file mode 100644 index 0000000..3bf2bd3 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160235.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_160336.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160336.jpeg new file mode 100644 index 0000000..4f25319 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160336.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_160431.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160431.jpeg new file mode 100644 index 0000000..810138c Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160431.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_160558.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160558.jpeg new file mode 100644 index 0000000..287b3dd Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160558.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_160601.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160601.jpeg new file mode 100644 index 0000000..73636eb Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160601.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_160714.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160714.jpeg new file mode 100644 index 0000000..b9e3650 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160714.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_160845.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160845.jpeg new file mode 100644 index 0000000..ce1aa68 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160845.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_160931.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160931.jpeg new file mode 100644 index 0000000..c635120 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_160931.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_161043.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_161043.jpeg new file mode 100644 index 0000000..89f2e85 Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_161043.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_161243.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_161243.jpeg new file mode 100644 index 0000000..4d9de5c Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_161243.jpeg differ diff --git a/public/report/Siemens-EDA-Forum-images/IMG_20250828_161404.jpeg b/public/report/Siemens-EDA-Forum-images/IMG_20250828_161404.jpeg new file mode 100644 index 0000000..cd4869c Binary files /dev/null and b/public/report/Siemens-EDA-Forum-images/IMG_20250828_161404.jpeg differ diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..28bb9b2 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,24 @@ +# Jiao77.cn - 个人学术报告网站 +# 允许所有搜索引擎抓取 + +User-agent: * +Allow: / + +# 网站地图位置 +Sitemap: http://jiao77.cn/sitemap.xml + +# 不允许抓取的路径(模板和示例页面) +Disallow: /report/template/ + +# 主要搜索引擎配置 +User-agent: Googlebot +Allow: / + +User-agent: Bingbot +Allow: / + +User-agent: Baiduspider +Allow: / + +# 爬取延迟(秒)- 避免过度请求 +Crawl-delay: 1 \ No newline at end of file diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..24ba764 --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,84 @@ + + + + + http://jiao77.cn/ + 2025-10-01 + weekly + 1.0 + + + + + http://jiao77.cn/about/ + 2025-10-01 + monthly + 0.8 + + + http://jiao77.cn/reports/ + 2025-10-01 + weekly + 0.9 + + + http://jiao77.cn/report/ + 2025-10-01 + weekly + 0.9 + + + + + http://jiao77.cn/report/20250928/ + 2025-09-28 + monthly + 0.8 + + + http://jiao77.cn/report/20250912/ + 2025-09-12 + monthly + 0.7 + + + http://jiao77.cn/report/20250722/ + 2025-07-22 + monthly + 0.7 + + + http://jiao77.cn/report/20250609/ + 2025-06-09 + monthly + 0.7 + + + + + http://jiao77.cn/report/ai-eda-paper-report/ + 2025-10-01 + monthly + 0.8 + + + http://jiao77.cn/report/Siemens-EDA-Forum/ + 2025-10-01 + monthly + 0.7 + + + http://jiao77.cn/report/Geo-Layout-Transformer/ + 2025-10-01 + monthly + 0.7 + + + + + http://jiao77.cn/components-demo/ + 2025-10-01 + monthly + 0.5 + + \ No newline at end of file diff --git a/src/components/AnimatedElement.astro b/src/components/AnimatedElement.astro index f8be924..aa5d8a1 100644 --- a/src/components/AnimatedElement.astro +++ b/src/components/AnimatedElement.astro @@ -45,43 +45,42 @@ const { transition: all var(--duration) var(--easing); } - /* 动画定义 */ - .animate-wrapper[data-animation="fadeIn"] { + /* 动画定义 - 只在触发时应用动画 */ + .animate-wrapper.animate-visible[data-animation="fadeIn"] { animation-name: fadeIn; } - .animate-wrapper[data-animation="fadeInUp"] { + .animate-wrapper.animate-visible[data-animation="fadeInUp"] { animation-name: fadeInUp; } - .animate-wrapper[data-animation="fadeInDown"] { + .animate-wrapper.animate-visible[data-animation="fadeInDown"] { animation-name: fadeInDown; } - .animate-wrapper[data-animation="slideInLeft"] { + .animate-wrapper.animate-visible[data-animation="slideInLeft"] { animation-name: slideInLeft; } - .animate-wrapper[data-animation="slideInRight"] { + .animate-wrapper.animate-visible[data-animation="slideInRight"] { animation-name: slideInRight; } - .animate-wrapper[data-animation="scaleIn"] { + .animate-wrapper.animate-visible[data-animation="scaleIn"] { animation-name: scaleIn; } - .animate-wrapper[data-animation="rotateIn"] { + .animate-wrapper.animate-visible[data-animation="rotateIn"] { animation-name: rotateIn; } - .animate-wrapper[data-animation="bounceIn"] { + .animate-wrapper.animate-visible[data-animation="bounceIn"] { animation-name: bounceIn; } - /* 触发状态 */ + /* 触发状态 - 动画完成后的最终状态 */ .animate-wrapper.animate-visible { - opacity: 1; - transform: none; + animation-fill-mode: both; animation-play-state: running; } @@ -200,8 +199,21 @@ const { const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { + const element = entry.target as HTMLElement; if (entry.isIntersecting) { - entry.target.classList.add('animate-visible'); + // 确保元素在进入视口时正确触发动画 + if (!element.classList.contains('animate-visible')) { + // 重置动画状态以确保延迟正确工作 + element.style.animationName = 'none'; + element.offsetHeight; // 强制重绘 + element.style.animationName = ''; + + // 添加可见类触发动画 + element.classList.add('animate-visible'); + } + } else { + // 可选:元素离开视口时重置动画(支持重复动画) + // element.classList.remove('animate-visible'); } }); }, { @@ -230,4 +242,10 @@ const { initScrollAnimations(); initClickAnimations(); }); + + // 页面导航时重新初始化(适用于SPA或动态内容) + document.addEventListener('astro:page-load', () => { + initScrollAnimations(); + initClickAnimations(); + }); \ No newline at end of file diff --git a/src/components/Container.astro b/src/components/Container.astro index 4bddd96..7c302e4 100644 --- a/src/components/Container.astro +++ b/src/components/Container.astro @@ -138,17 +138,17 @@ const revealAttributes = reveal /* 尺寸样式 */ .container-small { - max-width: 400px; + max-width: 500px; margin: 0 auto; } .container-medium { - max-width: 600px; + max-width: 800px; margin: 0 auto; } .container-large { - max-width: 800px; + max-width: 1000px; margin: 0 auto; } diff --git a/src/components/Header.astro b/src/components/Header.astro index b02a8ee..5ff1f53 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -4,22 +4,30 @@ export interface Props { description?: string; navigationItems?: Array<{ label: string; href: string; icon?: string }>; className?: string; + pageTitle?: string; // 页面标题,优先于通用标题 + showPageTitle?: boolean; // 是否显示页面标题而不是网站标题 } import GlowButton from './common/GlowButton.astro'; const { title = 'Jiao77 - AI & Technology Explorer', + pageTitle, + showPageTitle = false, description, navigationItems, className = '' } = Astro.props; +// 决定显示的标题 +const displayTitle = showPageTitle && pageTitle ? pageTitle : title; +// 决定点击行为:如果显示页面标题则返回顶部,否则返回首页 +const titleClickAction = showPageTitle ? 'scroll-to-top' : 'home'; + const defaultNavigation = [ { label: '首页', href: '/', icon: 'fas fa-home' }, { label: '报告导航', href: '/report', icon: 'fas fa-chart-line' }, { label: '关于我', href: '/about', icon: 'fas fa-user-astronaut' }, - { label: '组件测试', href: '/components-demo', icon: 'fas fa-user-astronaut' }, ]; const links = navigationItems && navigationItems.length > 0 ? navigationItems : defaultNavigation; @@ -28,9 +36,15 @@ const links = navigationItems && navigationItems.length > 0 ? navigationItems :