-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
44 lines (44 loc) · 1.47 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XpmEditor</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
<script>
document.addEventListener("contextmenu", function(e) {
e.preventDefault();
return false;
}, false);
</script>
</head>
<body onload="createCanvas(true)">
<h3>Recently used colors</h3>
<ul id='recent-colors'></ul>
<h3>Current color</h3>
<input type="color" value="#000000" id="color" onchange="onColorChange()">
<h3>Editor</h3>
<h4>Controls: Left click to draw pixel, right click to delete pixel.</h4>
<div class="editor">
<div class="horizontal">
<input type="number" placeholder="Columns" id="col" value="20">
<span>x</span>
<input type="number" placeholder="Rows" id="row" value="20">
<button onclick="createCanvas(false)">Create canvas!</button>
</div>
<div>
<input oninput="onResolutionChanged()" type="range" id="scale" min="6" max="30" placeholder="Scale" value="12">
<span id="scale-text">12px</span>
</div>
<div id="pixels"></div>
<div class="toolbar">
<span id="currCol" style="display: none;"></span>
<span id="currRow" style="display: none;"></span>
<button onclick="generate()">Generate!</button>
</div>
</div>
<h3>Generated code</h3>
<textarea readonly=true id="code" cols="100" rows="50"></textarea>
</body>
</html>