-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
191 lines (152 loc) · 6.46 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html>
<html lang="en" manifest="offline.appcache">
<head>
<meta charset="utf-8">
<meta name="description" content="Image Editor developed with HTML5 Canvas and Javascript">
<title>Image Editor</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<nav>
<li id="edit" title="Edit">Edit</li>
<li id="draw" title="Draw">Draw</li>
<li id="save" title="Save">Save</li>
<li title="Upload File">
<div id="upload"><span>Open File</span>
<input type="file" id="upload-btn">
</div>
</li>
</nav>
<div id="edit-container">
<table>
<tr>
<td>
<button id="normal" class="edit" disabled="disabled">Normal</button>
<button id="grayscale" class="edit" disabled="disabled">Grayscale</button>
<button id="sepia" class="edit" disabled="disabled">Sepia</button>
<button id="invert" class="edit" disabled="disabled">Invert</button>
<button id="brightness" class="edit" disabled="disabled">Brightness</button>
<button id="contrast" class="edit" disabled="disabled">Contrast</button>
<button id="img-resize" class="edit" disabled="disabled">Image Resize</button>
</td>
</tr>
<tr>
<td>
<button id="flipX" class="edit" disabled="disabled"><span>↔</span>Flip Horizontal</button>
<button id="flipY" class="edit" disabled="disabled"><span>↕</span>Flip Vertical</button>
<button id="rotate90" class="edit" disabled="disabled"><span>↷</span>Rotate 90</button>
<button id="rotate180" class="edit" disabled="disabled"><span>↻</span>Rotate 180</button>
<button id="rotate270" class="edit" disabled="disabled"><span>↷</span>Rotate 270</button>
<button id="rotate360" class="edit" disabled="disabled"><span>↻</span>Rotate 360</button>
</td>
</tr>
</table>
<span title="close" id="edit-close">✖</span>
</div>
<div id="draw-container">
<div id="crayon" class="draw" title="Draw with the crayon on the canvas">
<span class="icon">✎</span>
<span>Crayon</span>
</div>
<div id="color-body" class="draw">
<input type="color" class="draw" id="color" title="Select a color and draw with it">
<label for="color" title="Select a color and draw with it">Select Color</label>
</div>
<div id="eraser" class="draw" title="Eraser what you have draw">
<span class="icon">❑</span>
<span>Eraser</span>
</div>
<div id="crayon-size" class="draw" title="Increase the crayon size">
<span class="icon">✏</span>
<span>Crayon Size</span>
</div>
<div id="fill-canvas" class="draw" title="Fill the canvas with different colors based on the one you select">
<span class="icon">∎</span>
<span id="fill-text">Fill Canvas</span>
</div>
<span title="Clear Canvas" id="draw-close">✖</span>
</div>
<canvas id="canvas" width="1296" height="980"></canvas>
<div id="resize-dialog">
<span title="close" id="resize-close">✖</span>
<h1>Resize Image</h1>
<div id="resize-body">
<table>
<tr>
<td>
<label for="resize-horizontal">Horizontal:</label>
<input type="number" value="1296" min="0" max="1296" id="resize-horizontal">
</td>
</tr>
<tr>
<td>
<label for="resize-vertical">Vertical:</label>
<input type="number" value="980" min="0" max="980" id="resize-vertical">
</td>
</tr>
<tr>
<td>
<button id="resize-ok">Ok</button>
<button id="resize-cancel">Cancel</button>
</td>
</tr>
</table>
</div>
</div>
<img src="" id="currentImage">
<div id="save-dialog">
<span title="close" id="save-close">✖</span>
<h1>Save As</h1>
<div id="save-body">
<table>
<tr>
<td>
<label for="image-name">File name:</label>
<input type="text" id="image-name">
</td>
</tr>
<tr>
<td>
<label for="image-type">Save as type: </label>
<select id="image-type">
<option Selected value="png">PNG (*.png)</option>
<option value="jpg">JPEG (*.jpg)</option>
</select>
</td>
</tr>
<tr>
<td>
<label for="image-quality">Picture Quality:</label>
<input type="number" id="image-quality" min="0" value="0" step=".1" max="1">
</td>
</tr>
</table>
<a href="#" id="save-btn">Save</a>
<button id="cancel-btn">Cancel</button>
</div>
</div>
<div id="loader">
<img src="img/loader.gif" alt="loader">
<h1>Loading</h1>
</div>
<div id="cs-dialog">
<span title="close" id="cs-close">✖</span>
<label for="c-size">Increase Crayon Size</label>
<input type="range" min="0" value="5" max="20" id="c-size">
<output id="output-size"></output>
</div>
<div id="clear-image-dialog">
<h1>Are you sure you want to delete the image</h1>
<button id="clear-image-yes">Yes</button>
<button id="clear-image-no">No</button>
</div>
<div id="clear-draw-dialog">
<h1>Are you sure you want to clear the canvas</h1>
<button id="clear-draw-yes">Yes</button>
<button id="clear-draw-no">No</button>
</div>
<div id="overlay"></div>
<p id="author">Developed with ♥ By <a href="http://ckm100.github.io" target="_blank">Mawuli Kufogbe</a></p>
<script src="js/main.js"></script>
</body>
</html>