-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
104 lines (91 loc) · 4.09 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
<!DOCTYPE html>
<html><!-- manifest="cache.manifest" -->
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=320, initial-scale=1.0, user-scalable=no" /> <!-- device-width -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Bombay : make it sketchable</title>
<style type="text/css">
#bombay { width:300px; height:200px; margin:10px auto; border:2px solid #eee; }
#actionController { width:300px; margin:0 auto; }
#btnClear {
width:300px; border:1px solid #eee; margin:10px auto; border-radius:5px;
font-family:Tahoma; padding:10px 0px;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f1f1f1 50%, #e1e1e1 51%, #f6f6f6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(50%,#f1f1f1), color-stop(51%,#e1e1e1), color-stop(100%,#f6f6f6)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
}
.colorTab { display:block; width:300px; height:40px; margin:0 auto; }
.btnColor { border:none; width:30px; height:30px; float:left; margin-right:5px; }
.colorTab .red { background:#E53D37; }
.colorTab .green { background:#43BB00; }
.colorTab .blue { background:#0999D6; }
.colorTab .black { background:#000; }
.colorTab .white { background:#fff; border:1px solid #eee; }
</style>
</head>
<body>
<div id="wrap">
<div class="colorTab">
<button type="button" class="btnColor red" id="btnRed"></button>
<button type="button" class="btnColor green" id="btnGreen"></button>
<button type="button" class="btnColor blue" id="btnBlue"></button>
<button type="button" class="btnColor black" id="btnBlack"></button>
<button type="button" class="btnColor white" id="btnWhite"></button>
</div>
<div id="bombay"></div>
<div id="actionController" class="controller2">
<div class="action left">
<button type="button" class="btnClear" id="btnClear">CLEAR</button>
</div>
</div>
</div>
<script type="text/javascript" src="js/bombay.Canvas.js"></script>
<script type="text/javascript" src="js/bombay.Brush.js"></script>
<script type="text/javascript" src="js/bombay.Util.js"></script>
<script type="text/javascript">
var oCanvas;
var oBrush;
window.addEventListener("load", function(){
window.scrollTo(0,1);
oCanvas = new bombay.Canvas({
"elContainer": "bombay",
"nWidth": 300,
"nHeight": 200,
"bSpeedUp": true
});
oBrush = new bombay.Brush({
"sImageURL": "brushes/brush9.png",
"fOnLoad": function(){
oCanvas.useBrush(this);
}
});
// temporary action button
var elBtnClear = document.getElementById("btnClear");
elBtnClear.addEventListener("click", function(){
oCanvas.clear();
});
document.getElementById("btnRed").addEventListener("click", function(){
oCanvas.setLineColor("#E53D37");
});
document.getElementById("btnGreen").addEventListener("click", function(){
oCanvas.setLineColor("#43BB00");
});
document.getElementById("btnBlue").addEventListener("click", function(){
oCanvas.setLineColor("#0999D6");
});
document.getElementById("btnBlack").addEventListener("click", function(){
oCanvas.setLineColor("#000000");
});
document.getElementById("btnWhite").addEventListener("click", function(){
oCanvas.setLineColor("#FFFFFF");
});
});
</script>
</body>
</html>