-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
99 lines (96 loc) · 4.41 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base target="_blank">
<title>像素图片转换器 | 图片转像素 | 像素图生成器 | 纯 CSS 像素图 | 马赛克图片 | 像素图动画</title>
<meta name="description"
content="上传图片即可一键将图片转换为像素风格,支持多种自定义方式,可生成方块像素、点状像素和文字像素图等等。支持导出纯 CSS 像素图,并支持生成 CSS 像素图动画。" />
</head>
<body>
<div id="main">
<div id="initial">
<p>点击这里选择图片开始</p>
<div class="bg"></div>
</div>
<div id="app" style="display: none">
<div class="card-info">
<h2 class="title">图片像素转换器</h2>
<div class="remark"><span class="symbol-wrap"><span class="symbol">✌️</span></span> 将你的图片转成像素风 <span
class="symbol">✌️</span></div>
<hr>
<div class="form">
<div class="item">
<label>精度<input type="range" id="precision" min="2" max="100"></label>
</div>
<div class="item">
<label>shadow 间隙<input type="range" id="shadow-gap" min="0" max="10"></label>
</div>
<div class="item">
<label>shadow 圆角<input type="range" id="shadow-radius" min="0" max="50"></label>
</div>
<div class="item">
<label>去除 shadow 中的透明块<input type="checkbox" id="drop-transparent"></label>
</div>
<div class="item">
<label>去除 shadow 中的白色<input type="checkbox" id="drop-white"></label>
</div>
<div class="item">
<label>去除 shadow 中的 alpha 通道<input type="checkbox" id="drop-alpha"></label>
</div>
<div class="item">
<label>使用 text-shadow<input type="checkbox" id="text-shadow"></label>
</div>
<div class="item">
<label>自定义 text-shadow 文字<input type="text" id="shadow-text"></label>
</div>
<div class="item">
<label>text-shadow 文字比例<input type="range" id="shadow-text-size" min="1" max="31"></label>
</div>
<div class="item">
<label>开启动画模式<input type="checkbox" id="anime-mode"></label>
</div>
</div>
<div class="btn-group">
<button id="import">更换图片</button>
<button id="export">复制 shadow 样式</button>
</div>
</div>
<div class="card-shadow">
<h2>像素 shadow</h2>
<div class="size-wrap">
<div class="pixel-wrap">
<div class="pixel"></div>
</div>
</div>
</div>
<div class="card-canvas">
<h2>像素图</h2>
<div class="size-wrap">
<canvas id="canvas" width="200" height="200"></canvas>
</div>
</div>
<div class="card-image">
<h2>原图</h2>
<div class="image-wrap">
<img id="image" src="" alt="">
</div>
<div class="tip">
点击更换图片
</div>
</div>
</div>
</div>
<footer id="footer">
<p class="copyright">© 2022-present <a href="https://github.com/ZxBing0066">ZxBing0066</a>. All Rights Reserved.
</p>
<a href="https://github.com/ZxBing0066/pixel-converter" class="github"><img src="/GitHub.png" alt=""></a>
</footer>
<style id="pixel-style"></style>
<input type="file" id="file" accept="image/*" hidden>
<canvas id="offscreen" width="20" height="20" hidden></canvas>
<script type="module" src="/src/main.ts"></script>
<link rel="stylesheet" href="./src/bg.css">
</body>
</html>