-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (43 loc) · 1.76 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="StyleSheet.css">
<script src="jquery.min.js"></script>
<script src="HTML5cross.js"></script>
<script>
$(document).ready(function ()
{
$("#content").css("width", $(window).width());
$("#content").css("height", $(window).height());
$canvas = $("canvas");
$canvas.on("contextmenu", function(event)
{
event.preventDefault();
});
context = $canvas[0].getContext("2d");
image = $("#puzzle_image")[0];
$("#image_select").change(function ()
{
image.onload = function()
{
context.drawImage(image, 0, 0);
GeneratePuzzle();
Render();
SetUpEvents();
};
image.src = this.value;
});
});
</script>
</head>
<body>
<img id="puzzle_image" class="hidden"></img>
<div id="content">
<div class="centered">
<canvas id="canvas" width="150" height="150"></canvas>
<input id="image_select" type="file" accept="image/png">
</div>
</div>
</body>
</html>