-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpixel-art-to-svg.html
More file actions
71 lines (56 loc) · 2.29 KB
/
pixel-art-to-svg.html
File metadata and controls
71 lines (56 loc) · 2.29 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pixel Art → SVG</title>
<link rel="stylesheet" href="styles-vanilla.css" />
<style>
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
img, video, canvas, svg { max-width: 100%; height: auto; }
</style>
</head>
<body>
<div class="page-shell">
<header class="page-header">
<p class="eyebrow">Frontend Widget</p>
<h1>Pixel Art → SVG</h1>
<p class="page-description">Upload a pixel-art image and convert it into a crisp SVG made from colored rectangles.</p>
</header>
<div class="widget-shell">
<div class="widget-topbar">
<a class="back-link" href="index.html">← Back to all widgets</a>
</div>
<div class="widget-grid">
<section class="panel">
<label for="pixelFile">Upload PNG or other image</label>
<input id="pixelFile" type="file" accept="image/*" />
<div style="height: 12px;"></div>
<label for="scaleInput">SVG export scale</label>
<input id="scaleInput" type="number" min="1" max="16" value="1" />
<div class="checkbox-list">
<div class="checkbox-line"><input id="transparentBg" type="checkbox" checked /><label for="transparentBg">Keep transparent pixels transparent</label></div>
</div>
<p id="pixelStatus" class="small">Upload a small pixel-art image to begin.</p>
<div style="height: 12px;"></div>
<canvas id="previewCanvas" width="160" height="160"></canvas>
<div id="pixelStats" class="kv"></div>
</section>
<section class="panel">
<h2>SVG preview</h2>
<div id="svgPreview" class="preview-box svg-preview"><p class="small">SVG preview appears here.</p></div>
<div style="height: 16px;"></div>
<h2>SVG markup</h2>
<div class="output-box"><pre id="svgOutput"></pre></div>
<div class="actions">
<button id="copySvg">Copy SVG</button>
<button id="downloadSvg" class="secondary">Download SVG</button>
</div>
</section>
</div>
</div>
</div>
<script src="pixel-art-to-svg.js"></script>
</body>
</html>