Skip to content

Commit cc8b5e7

Browse files
committed
feat: 实现 LeetCode 141 环形链表算法可视化
- 添加代码面板,支持语法高亮和调试效果(行高亮、变量值显示) - 添加链表可视化,使用 SVG 绘制节点和快慢指针 - 添加控制面板,支持键盘快捷键(←/→/Space) - 添加悬浮球,展示微信群二维码 - 配置 GitHub Actions 自动部署到 GitHub Pages - 添加属性测试和单元测试(38 个测试用例)
1 parent a5fc5b5 commit cc8b5e7

27 files changed

+12408
-0
lines changed

.eslintrc.cjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
jest: true
6+
},
7+
extends: 'eslint:recommended',
8+
parserOptions: {
9+
ecmaVersion: 'latest',
10+
sourceType: 'module'
11+
},
12+
rules: {
13+
'no-unused-vars': 'warn',
14+
'no-console': 'off',
15+
'semi': ['error', 'always'],
16+
'quotes': ['error', 'single']
17+
},
18+
ignorePatterns: ['dist/', 'node_modules/', '*.config.js', '*.config.cjs']
19+
};

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: 'pages'
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build-and-deploy:
19+
runs-on: ubuntu-latest
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '20'
31+
cache: 'npm'
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Run linter
37+
run: npm run lint
38+
39+
- name: Run tests
40+
run: npm run test -- --passWithNoTests
41+
42+
- name: Build
43+
run: npm run build
44+
45+
- name: Setup Pages
46+
uses: actions/configure-pages@v4
47+
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v3
50+
with:
51+
path: './dist'
52+
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
dist/
6+
7+
# IDE
8+
.idea/
9+
.vscode/
10+
*.swp
11+
*.swo
12+
13+
# OS
14+
.DS_Store
15+
Thumbs.db
16+
17+
# Logs
18+
*.log
19+
npm-debug.log*
20+
21+
# Coverage
22+
coverage/
23+
24+
# Environment
25+
.env
26+
.env.local

0 commit comments

Comments
 (0)