-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
68 lines (64 loc) · 2.65 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>图片压缩工具</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<!-- 头部标题 -->
<header>
<h1>图片压缩工具</h1>
<p>简单、快速的在线图片压缩服务</p>
</header>
<!-- 主要内容区域 -->
<main>
<!-- 上传区域 -->
<div class="upload-area" id="uploadArea">
<input type="file" id="imageInput" accept="image/png,image/jpeg" hidden>
<div class="upload-box">
<img src="upload-icon.svg" alt="上传图标" class="upload-icon">
<p>点击或拖拽图片到这里</p>
<p class="sub-text">支持 PNG、JPG 格式</p>
</div>
</div>
<!-- 预览和控制区域 -->
<div class="preview-container" id="previewContainer" style="display: none;">
<div class="preview-box">
<div class="original-image">
<h3>原图</h3>
<div class="image-container">
<img id="originalPreview" alt="原图预览">
</div>
<div class="file-info">
<span>原始大小:</span>
<span id="originalSize">0 KB</span>
</div>
</div>
<div class="compressed-image">
<h3>压缩后</h3>
<div class="image-container">
<img id="compressedPreview" alt="压缩后预览">
</div>
<div class="file-info">
<span>压缩后大小:</span>
<span id="compressedSize">0 KB</span>
</div>
</div>
</div>
<!-- 控制面板 -->
<div class="control-panel">
<div class="quality-control">
<label for="qualitySlider">压缩质量:<span id="qualityValue">80%</span></label>
<input type="range" id="qualitySlider" min="1" max="100" value="80">
</div>
<button id="downloadBtn" class="download-btn">下载压缩后的图片</button>
</div>
</div>
</main>
</div>
<script src="script.js"></script>
</body>
</html>