Skip to content

Commit 42676e2

Browse files
committed
Update index.html and README.md for Image Stitcher tool
- Changed the HTML document structure to support a modernized image stitching tool, including updated meta tags for SEO and a new favicon. - Enhanced README.md with detailed project description, features, installation instructions, and usage guidelines. - Added a new icon for the application and removed outdated SVG assets.
1 parent 4944e92 commit 42676e2

6 files changed

Lines changed: 156 additions & 69 deletions

File tree

README.md

Lines changed: 114 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,143 @@
1-
好的!我来重构`DraggableImageList`组件,将其拆分为更小的组件,只保留合并预览模式,并添加每张图片的裁切比例设置功能。
1+
# Image Stitcher 图像拼接工具
22

3-
现在我需要检查是否有 UI 组件未导入的问题:
3+
一个现代化的在线图像拼接工具,支持多种图像格式的自动拼接与合成。基于 React + TypeScript + Tailwind CSS 构建,提供直观的拖拽操作界面。
44

5-
Ran tool
6-
很好,Select 组件存在。现在我需要更新 imageStore hook 以支持裁切设置的存储:
5+
## ✨ 特性
76

8-
现在需要更新 ImageStitcher 组件以传递新的回调函数:
7+
- 🖼️ **多格式支持** - 支持 JPG、PNG、GIF、WebP 等主流图像格式
8+
- 🎨 **灵活布局** - 支持水平、垂直两个方向的图像拼接
9+
- 🖱️ **拖拽排序** - 直观的拖拽界面,随意调整图像顺序
10+
- ⚙️ **丰富选项** - 自定义间距、边框、背景色等拼接参数
11+
- 📱 **响应式设计** - 完美适配桌面端和移动端设备
12+
- 🎯 **实时预览** - 实时查看拼接效果,所见即所得
13+
- 📁 **批量处理** - 一次上传多个图像,快速完成拼接
14+
- 💾 **高质量输出** - 保持原始图像质量的输出效果
915

10-
现在我需要删除重复的接口定义,因为在 DraggableImageList 中定义了相同的接口:
16+
## 🚀 快速开始
1117

12-
现在让我启动开发服务器来测试重构后的功能:
18+
### 环境要求
19+
20+
- Node.js >= 20.0.0
21+
- pnpm >= 8.0.0
22+
23+
### 安装依赖
1324

1425
```bash
15-
npm run dev
26+
# 克隆项目
27+
git clone https://github.com/FastMirror-MC/image-stitcher.git
28+
cd image-stitcher
29+
30+
# 安装依赖
31+
pnpm install
1632
```
1733

18-
## 🎉 重构完成!全新的图像拼接预览组件
34+
### 开发模式
1935

20-
我已经成功重构了`DraggableImageList`组件,现在它具有以下全新特性:
36+
```bash
37+
# 启动开发服务器
38+
pnpm dev
39+
```
2140

22-
### ✨ 主要改进
41+
打开 [http://localhost:5173](http://localhost:5173) 在浏览器中查看。
2342

24-
#### 1. **组件架构优化**
43+
### 构建生产版本
2544

26-
- **模块化设计**: 拆分为 4 个独立的子组件
27-
- `ImageCropControl`: 图像裁切设置控制
28-
- `DraggableImagePreview`: 可拖拽的图像预览
29-
- `MergePreview`: 合并预览容器
30-
- `DraggableImageList`: 主组件
45+
```bash
46+
# 构建项目
47+
pnpm build
3148

32-
#### 2. **简化的用户界面**
49+
# 本地预览生产版本
50+
pnpm preview
51+
```
3352

34-
- **移除复杂的视图切换**: 只保留合并预览模式
35-
- **直观的预览**: 用户可以直接在预览中看到最终拼接效果
36-
- **直接拖拽**: 在预览模式中直接拖拽调整图像顺序
53+
## 🎯 使用方法
3754

38-
#### 3. **🆕 图像裁切功能**
55+
### 基本使用流程
3956

40-
- **9 种常见宽高比选择**:
41-
- 原始比例、1:1 (正方形)、4:3 (标准)、3:2 (经典)
42-
- 16:9 (宽屏)、21:9 (超宽)、2:3/3:4/9:16 (竖直)
43-
- **智能裁切计算**: 自动计算最佳裁切区域
44-
- **实时预览**: 裁切比例变化时立即更新预览
45-
- **尺寸显示**: 显示裁切后的实际尺寸
57+
1. **上传图像** - 拖拽或点击选择多个图像文件
58+
2. **调整顺序** - 通过拖拽调整图像的排列顺序
59+
3. **设置选项** - 选择拼接方向、调整间距、边框等参数
60+
4. **实时预览** - 查看右侧的拼接效果预览
61+
5. **下载结果** - 点击下载按钮获取最终拼接图像
4662

47-
#### 4. **增强的拖拽体验**
63+
### 拼接选项说明
4864

49-
- **视觉反馈**: 拖拽时的透明度、缩放、边框高亮
50-
- **精确排序**: 支持在预览布局中直接调整顺序
51-
- **智能布局**: 根据合并方向自动调整预览布局
65+
- **拼接方向** - 选择水平或垂直拼接
66+
- **图像缩放** - 统一调整所有图像的尺寸比例
67+
- **图像间距** - 设置图像之间的间距大小
68+
- **边框设置** - 为每个图像添加边框效果
69+
- **背景颜色** - 自定义拼接区域的背景色
5270

53-
#### 5. **完整的状态管理**
71+
## 🛠️ 技术栈
5472

55-
- **扩展 ImageStore**: 添加了`updateImageCrop`功能
56-
- **类型安全**: 完整的 TypeScript 类型定义
57-
- **持久化设置**: 图像裁切设置与图像绑定
73+
- **前端框架**: React 19 + TypeScript
74+
- **构建工具**: Vite 6
75+
- **样式方案**: Tailwind CSS 4
76+
- **UI 组件**: Radix UI + shadcn/ui
77+
- **状态管理**: Zustand
78+
- **图标库**: Lucide React
79+
- **包管理器**: pnpm
5880

59-
### 🔧 技术特性
81+
## 📁 项目结构
6082

61-
- **性能优化**: 纯 CSS 布局预览,避免 Canvas 重渲染
62-
- **智能尺寸计算**: 支持所有 resize 模式与裁切比例的组合
63-
- **响应式设计**: 预览自动适应容器大小
64-
- **无障碍支持**: 完整的键盘和屏幕阅读器支持
83+
```
84+
image-stitcher/
85+
├── public/ # 静态资源
86+
├── src/
87+
│ ├── components/ # React 组件
88+
│ │ ├── ui/ # 基础 UI 组件
89+
│ │ ├── ImageStitcher.tsx # 主应用组件
90+
│ │ ├── ImageUploader.tsx # 图像上传组件
91+
│ │ ├── DraggableImageList.tsx # 可拖拽图像列表
92+
│ │ ├── MergeOptions.tsx # 拼接选项面板
93+
│ │ └── PreviewCanvas.tsx # 预览画布
94+
│ ├── hooks/ # 自定义 Hook
95+
│ ├── lib/ # 工具函数
96+
│ └── assets/ # 资源文件
97+
├── package.json
98+
├── vite.config.ts # Vite 配置
99+
└── README.md
100+
```
65101

66-
### 📱 用户体验
102+
## 🤝 贡献指南
67103

68-
1. **上传图像**: 图像自动添加默认裁切设置
69-
2. **设置裁切**: 为每张图像选择最佳宽高比
70-
3. **实时预览**: 立即看到裁切和合并效果
71-
4. **拖拽排序**: 直接在预览中调整图像顺序
72-
5. **一键导出**: 所有设置自动应用到最终输出
104+
欢迎提交 Issue 和 Pull Request 来改进这个项目!
73105

74-
### 🎯 现在的完整工作流程
106+
### 开发规范
75107

76-
```
77-
📸 上传图像 → ✂️ 设置裁切比例 → 🎨 调整合并选项 → 👀 实时预览 → 📥 下载结果
78-
```
108+
1. 使用 TypeScript 进行类型安全的开发
109+
2. 遵循 ESLint 配置的代码规范
110+
3. 提交前请运行 `pnpm lint` 检查代码质量
111+
4. 确保所有功能在主流浏览器中正常工作
112+
113+
### 提交 Pull Request
114+
115+
1. Fork 本仓库
116+
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
117+
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
118+
4. 推送到分支 (`git push origin feature/AmazingFeature`)
119+
5. 打开 Pull Request
120+
121+
## 📄 开源协议
122+
123+
本项目采用 MIT 协议开源。详见 [LICENSE](LICENSE) 文件。
124+
125+
## 🙏 致谢
126+
127+
- [React](https://reactjs.org/) - 用户界面构建库
128+
- [Vite](https://vitejs.dev/) - 现代化的前端构建工具
129+
- [Tailwind CSS](https://tailwindcss.com/) - 实用优先的 CSS 框架
130+
- [Radix UI](https://www.radix-ui.com/) - 无样式、可访问的 UI 组件
131+
- [Lucide](https://lucide.dev/) - 美观的开源图标库
132+
133+
## 📮 联系方式
134+
135+
如有问题或建议,请通过以下方式联系:
136+
137+
- 提交 [GitHub Issue](https://github.com/FastMirror-MC/image-stitcher/issues)
138+
- 发送邮件至: [email protected]
139+
- 访问我们的网站: [FastMirror](https://www.fastmirror.net)
79140

80-
这个重构大大简化了用户界面,提供了更专业的图像处理功能。用户可以通过裁切功能创建更统一和美观的拼接效果,而实时预览确保了所见即所得的体验。
141+
---
81142

82-
你想要启动开发服务器测试这些新功能吗?或者还有其他需要改进的地方?
143+
⭐ 如果这个项目对你有帮助,请不要忘记给它一个 Star!

index.html

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,41 @@
1-
<!doctype html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + React + TS</title>
8-
</head>
9-
<body>
10-
<div id="root"></div>
11-
<script type="module" src="/src/main.tsx"></script>
12-
</body>
1+
<!DOCTYPE html>
2+
<html lang="zh-CN">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/png" href="/icon.png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta
8+
name="description"
9+
content="现代化的在线图像拼接工具,支持多种图像格式的自动拼接与合成。提供直观的拖拽操作界面,实时预览效果。"
10+
/>
11+
<meta
12+
name="keywords"
13+
content="图像拼接,图片合并,照片拼接,图像合成,在线工具,React,TypeScript"
14+
/>
15+
<meta name="author" content="Image Stitcher Team" />
16+
<meta name="robots" content="index, follow" />
17+
18+
<!-- Open Graph / Facebook -->
19+
<meta property="og:type" content="website" />
20+
<meta property="og:title" content="Image Stitcher - 图像拼接工具" />
21+
<meta
22+
property="og:description"
23+
content="现代化的在线图像拼接工具,支持多种图像格式的自动拼接与合成。提供直观的拖拽操作界面,实时预览效果。"
24+
/>
25+
<meta property="og:site_name" content="Image Stitcher" />
26+
27+
<!-- Twitter -->
28+
<meta name="twitter:card" content="summary_large_image" />
29+
<meta name="twitter:title" content="Image Stitcher - 图像拼接工具" />
30+
<meta
31+
name="twitter:description"
32+
content="现代化的在线图像拼接工具,支持多种图像格式的自动拼接与合成。"
33+
/>
34+
35+
<title>Image Stitcher - 图像拼接工具</title>
36+
</head>
37+
<body>
38+
<div id="root"></div>
39+
<script type="module" src="/src/main.tsx"></script>
40+
</body>
1341
</html>

public/icon.png

6.46 KB
Loading

public/vite.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/assets/react.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export const Header: React.FC = () => {
88
<div className="flex items-center justify-between">
99
<div className="flex items-center space-x-4">
1010
<div className="flex items-center space-x-2">
11-
<div className="w-8 h-8 bg-primary rounded-lg flex items-center justify-center">
12-
<span className="text-primary-foreground font-bold text-sm"></span>
11+
<div className="w-10 h-10 bg-primary rounded-lg flex items-center justify-center">
12+
<span className="text-primary-foreground font-bold text-2xl"></span>
1313
</div>
1414
<div>
1515
<h1 className="text-xl font-bold text-foreground">图像拼接工具</h1>

0 commit comments

Comments
 (0)