forked from dmliao/Sketch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
120 lines (99 loc) · 4.24 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
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Sketch</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="icon"
type="image/ico"
href="favicon.ico">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="js/toolbars/jquery.toolbars.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<!-- Actual Drawing Surface -->
<canvas id="sketch" class="surface" style="position:absolute;"></canvas>
<canvas id="buffer" class="surface" style="position:absolute;display:none;"></canvas>
<canvas id="canvas" class="surface" style="position:absolute;"></canvas>
<!-- Toolbar -->
<div id="toolbar">
<div class="btn-group-vertical">
<button type="button" id="pen" class="btn btn-default tool-icon active" onclick="pen_tool()"><i class="fa fa-pencil"></i></button>
<button type="button" id="eraser" class="btn btn-default tool-icon" onclick="eraser_tool()"><i class="fa fa-eraser"></i></button>
</div>
</div>
<div id="filemenu">
<div id="file"><i class="fa fa-bars"></i></div>
</div>
<div id="file-toolbar" style="display:none">
<a href="#" onclick="newCanvas();"><i class="fa fa-file"></i></a>
<a href="#" onclick="loadCanvas(sketch);"><i class="fa fa-folder-open"></i></a>
<a href="#"><i class="fa fa-save" onclick="saveCanvas(sketch);"></i></a>
<a href="#" id="file-download" onclick="downloadImg(sketch, 'sketch.png');" download="sketch.png"><i class="fa fa-download"></i></a>
</div>
<!--Confirm new document-->
<div id="new-document-modal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header text-center">
<h3>Confirm New Sketch</h3>
</div>
<div class="modal-body text-center">
<p>Create a new sketch? Unsaved data will be lost.</p>
</div>
<div class="modal-footer text-right">
<button type="submit" class="btn btn-primary" id="create-new-document-button" data-dismiss="modal" aria-hidden="true">Create New Sketch</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
</div>
</div>
</div>
<!--Javascript-->
<script type="text/javascript" src="js/vendor/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jquery.bootstrap-growl.min.js"></script>
<script src="js/database/IndexedDBShim.min.js"></script>
<script src="js/database/pouchdb.js"></script>
<script src="js/Blob.js"></script>
<script src="js/filesaver.min.js"></script>
<!--Application Scripts-->
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/vendor/mousetrap.js"></script>
<script>
Mousetrap.bind('ctrl+z', function(e) {
undoStroke();
});
Mousetrap.bind('ctrl+y', function(e) {
redoStroke();
});
</script>
<script>
// with jQuery
$( "#canvas" ).mousedown(function(event){
event.preventDefault();
});
</script>
<!-- Toolbar Scripts -->
<script type="text/javascript" src="js/toolbars/jquery.toolbar.min.js"></script>
<script type="text/javascript" src="js/file.js"></script>
<script>
$('#file').toolbar({
content: '#file-toolbar',
position: 'bottom',
hideOnClick: true
});
</script>
</body>
</html>