-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.html
More file actions
167 lines (141 loc) · 3.98 KB
/
Copy pathexample.html
File metadata and controls
167 lines (141 loc) · 3.98 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
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
<!doctype html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<title>Dragging and Rotating Polygons</title>
<meta name="description" content="From Core HTML5 Canvas by David Geary">
<style>
body {
background: skyblue;
font: Arial;
}
a {
text-decoration: none;
}
input {
font: 12px Arial;
}
button {
font: 12px Arial;
}
select {
font: 12px Arial;
margin-right: 10px;
}
.paint-select {
margin-right: 12px;
font: 12px Arial;
}
a:hover {
border-bottom: 1px solid #999;
}
#wrapper {
width: 870px;
margin: 0 auto;
margin-top: 11px;
}
.shadow {
-webkit-box-shadow: 4px 4px 8px rgba(60, 60, 70, 0.7);
-moz-box-shadow: 4px 4px 8px rgba(60, 60, 70, 0.7);
box-shadow: 4px 4px 8px rgba(60, 60, 70, 0.7);
}
#polygons-div {
-webkit-transition: opacity 2s;
-moz-transition: opacity 2s;
-o-transition: opacity 2s;
transition: opacity 2s;
opacity: 0;
display: none;
}
#polygons-canvas {
position: absolute;
left: 20px;
top: 50px;
border: thin inset rgba(0,0,0,0.3);
-webkit-box-shadow: 4px 4px 8px rgba(60, 60, 70, 0.7);
-moz-box-shadow: 4px 4px 8px rgba(60, 60, 70, 0.7);
box-shadow: 4px 4px 8px rgba(60, 60, 70, 0.7);
cursor: pointer;
}
#polygons-controls {
margin-left: 20px;
margin-top: 13px;
}
#polygons-fill-style-input {
margin-right: 10px;
cursor: pointer;
}
#polygons-stroke-style-input {
margin-right: 10px;
cursor: pointer;
}
#polygons-erase-all-button {
margin-left: 20px;
background: rgba(80,140,230,0.2);
color: navy;
font-size: 0.9em;
border-radius: 10px;
-webkit-border-radius: 10px;
-o-border-radius: 10px;
-moz-border-radius: 10px;
font: 12px Arial;
-webkit-transition: opacity 2s;
-moz-transition: opacity 2s;
-o-transition: opacity 2s;
text-shadow: 1px 1px 1px rgb(255,255,255);
}
#polygons-transparency-slider {
position: absolute;
top: 10px;
left: 295px;
width: 150px;
height: 30px;
}
#polygons-sides-selections {
position: absolute;
top: 12px;
left: 455px;
width: 400px;
}
</style>
</head>
<body>
<div id='polygons-controls'>
Stroke: <input id='polygons-stroke-style-input' class='color' size='9' value='#00AAFF'/>
Fill: <input id='polygons-fill-style-input' class='color' size='9' value='#AACCFF'/>
<div id='polygons-sides-selections'>
Sides: <select id='polygons-sides-select'>
<option value=4>4</option>
<option value=5 selected>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=8>8</option>
<option value=9>9</option>
<option value=10>10</option>
<option value=12>12</option>
<option value=20>20</option>
</select>
Start angle: <select id='polygons-start-angle-select'>
<option value=0 select>0</option>
<option value=22.5>22.5</option>
<option value=45>45</option>
<option value=67.5>67.5</option>
<option value=90>90</option>
</select>
Fill <input id='polygons-fillCheckbox' type='checkbox' checked/>
<button id='polygons-erase-all-button'>Erase all</button>
</div>
<div id='polygons-transparency-slider'></div>
</div>
<canvas id='polygons-canvas' width='820' height='540'>
Canvas not supported
</canvas>
<script src="polygonExample.js"></script>
<script src="polygon.js"></script>
<script src="roundedrectangle.js"></script>
<script src="sliders.js"></script>
<script src="example.js"></script>
<script src="jscolor.js"></script>
</body>
</html>