-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
88 lines (81 loc) · 2.09 KB
/
index.html
File metadata and controls
88 lines (81 loc) · 2.09 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html>
<head>
<title>TileMapEditor</title>
<style>
canvas{
border:1px solid black;
cursor:pointer;
}
#selectionCanvas{
border:1px solid black;
cursor:pointer;
}
.selected{
border: 2px solid red;
}
strong{
align-items: center;
font-size: 50px;
text-align: center;
margin-left: 20vw;
}
.dialog {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #fff;
padding: 20px;
z-index: 100;
display: none;
}
.dialog-content {
text-align: center;
}
#overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 99;
display: none;
}
</style>
</head>
<body>
<button id="open-dialog-button">New</button>
<!-- The dialog box -->
<div id="dialog" class="dialog">
<div class="dialog-content">
<h2>Enter Tilemap Size</h2>
<label for="dialog-width-input">Width:</label>
<input type="number" id="dialog-width-input" min="1" value="40">
<label for="dialog-height-input">Height:</label>
<input type="number" id="dialog-height-input" min="1" value="40">
<button id="dialog-apply-button">Apply</button>
</div>
</div>
<!-- Overlay for the dialog -->
<div id="overlay"></div>
<strong>TileMapEditor</strong>
<br>
<canvas id="canvas" width="640" height="480" ></canvas>
<br>
<button id="exportBtn">Export</button>
<button id="loadButton">Load</button>
<br>
<div id="exportOptions" style="display: none;">
<button id="exportJsonBtn">Export as JSON</button>
<button id="exportImageBtn">Export as Image</button>
</div>
<br>
<canvas id="selectionCanvas" width="640" height="100"></canvas>
<br>
<input type="file" id="spritesheetInput">
<script src="setup.js"></script>
<script src="export.js"></script>
</body>
</html>