Skip to content

Commit e26a6db

Browse files
committed
增强算法可视化动画效果
1. 修复语法高亮显示问题 - 重写 highlightSyntax 函数,使用 React 元素而非 dangerouslySetInnerHTML - 支持 Java、Python、Go、JavaScript 四种语言的语法高亮 - 关键字显示蓝色,数字显示橙色,字符串显示绿色 2. 细化动画步骤拆分 - 步骤数从17步增加到29步 - 初始化阶段分为:初始化慢指针、初始化快指针 - 比较阶段分为:检查元素、判断结果(零/非零) - 交换阶段分为:准备交换、执行交换、交换完成 - 每个步骤都有详细描述和操作说明 3. 增强画布标注和箭头说明 - 添加区域标注(待处理区域、已处理区域) - 添加比较气泡标注 - 添加指针移动方向箭头 - 交换箭头支持三种状态:准备(橙色)、执行(红色动画)、完成(绿色) 4. 改进元素高亮效果 - 交换中的元素显示红色虚线边框 - 比较中的元素显示橙色边框 - 已处理的元素显示绿色边框和勾号标记
1 parent 02b8a6c commit e26a6db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+6327
-703
lines changed

.github/workflows/deploy.yml

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,55 @@ on:
44
push:
55
branches:
66
- main
7-
workflow_dispatch: # 允许手动触发
7+
- master
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
817

918
jobs:
10-
build-and-deploy:
19+
build:
1120
runs-on: ubuntu-latest
12-
permissions:
13-
contents: write # 明确指定需要写入权限
14-
concurrency:
15-
group: ${{ github.workflow }}-${{ github.ref }} # 确保不会同时运行多个相同的工作流程
21+
1622
steps:
17-
- name: Checkout 🛎️
18-
uses: actions/checkout@v3
19-
with:
20-
fetch-depth: 0
23+
- name: Checkout
24+
uses: actions/checkout@v4
2125

2226
- name: Setup Node.js
23-
uses: actions/setup-node@v3
27+
uses: actions/setup-node@v4
2428
with:
25-
node-version: '20' # 使用更新的Node.js版本
29+
node-version: '18'
2630
cache: 'npm'
27-
28-
- name: Debug Environment
29-
run: |
30-
node --version
31-
npm --version
32-
ls -la
3331

3432
- name: Install dependencies
35-
run: |
36-
npm config set legacy-peer-deps true
37-
npm install --no-fund --no-audit --prefer-offline
38-
env:
39-
CI: true
33+
run: npm ci --legacy-peer-deps
34+
35+
- name: Run linter
36+
run: npm run lint --if-present
4037

4138
- name: Build
4239
run: npm run build
4340
env:
44-
CI: false # 避免将警告视为错误
41+
CI: false
4542

46-
- name: Deploy 🚀
47-
uses: JamesIves/github-pages-deploy-action@v4
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
4845
with:
49-
folder: build # React 默认的构建输出目录
50-
branch: gh-pages # 部署到的分支
51-
clean: true # 清理旧文件
52-
token: ${{ secrets.GITHUB_TOKEN }} # 使用GitHub自动生成的token
46+
path: ./build
47+
48+
deploy:
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
runs-on: ubuntu-latest
53+
needs: build
54+
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)