-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.html
More file actions
242 lines (210 loc) · 8.87 KB
/
Copy pathexample.html
File metadata and controls
242 lines (210 loc) · 8.87 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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!--
- Copyright (C) 2012 David Geary. This code is from the book
- Core HTML5 Canvas, published by Prentice-Hall in 2012.
-
- License:
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- The Software may not be used to create training material of any sort,
- including courses, books, instructional videos, presentations, etc.
- without the express written consent of David Geary.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-->
<!DOCTYPE html>
<html>
<head>
<title>Magnifying Glass</title>
<meta name='viewport' content='initial-scale=yes, user-scalable=no'/>
<meta name='apple-mobile-web-app-capable' content='yes'/>
<meta name='apple-mobile-web-app-status-bar-style' content='black-translucent'/>
<!-- 320x460 for iPhone 3GS -->
<link rel='apple-touch-startup-image' media='(max-device-width: 480px) and not (-webkit-min-device-pixel-ratio: 2)' href='startup-iphone.png' />
<!-- 640x920 for retina display -->
<link rel='apple-touch-startup-image' media='(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)' href='startup-iphone4.png' />
<!-- iPad Portrait 768x1004 -->
<link rel='apple-touch-startup-image' media='(min-device-width: 768px) and (orientation: portrait)' href='startup-iPad-portrait.png' />
<!-- iPad Landscape 1024x748 -->
<link rel='apple-touch-startup-image' media='(min-device-width: 768px) and (orientation: landscape)' href='startup-iPad-landscape.png' />
<link rel='apple-touch-icon-precomposed' sizes='72x72' href='icon-ipad.png' />
<style>
body {
background: -webkit-gradient(radial, 325 50%, 10, 325 50%, 640, from(rgba(205,205,0,0.75)), to(rgba(72,92,55,0.75)));
background-image: -webkit-radial-gradient(center, circle farthest-side, rgba(205, 205, 0, 0.75), rgba(72, 92, 55, 0.75));
background-image: -moz-radial-gradient(center, circle farthest-side, rgba(205, 205, 0, 0.75), rgba(72, 92, 55, 0.75));
background-image: -o-radial-gradient(center, circle farthest-side, rgba(205, 205, 0, 0.75), rgba(72, 92, 35, 0.75));
background-image: radial-gradient(center, circle farthest-side, rgba(205, 205, 0, 0.75), rgba(72, 92, 35, 0.75));
height: 100%;
}
#backdrop {
background: blue;
}
#controls {
position: absolute;
left: 60px;
top: 0px;
}
@media all and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait) {
#canvas {
position: absolute;
left: 30px;
top: 100px;
-webkit-box-shadow: rgba(60, 60, 70, 0.7) 4px 4px 8px;
-moz-box-shadow: rgba(60, 60, 70, 0.7) 4px 4px 8px;
box-shadow: rgba(60, 60, 70, 0.7) 4px 4px 8px;
border: 1px solid rgb(52, 72, 35);
cursor: pointer;
}
#controls {
position: absolute;
left: 60px;
margin-top: 30px;
}
}
@media all and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape) {
#canvas {
position: absolute;
left: 35px;
top: 100px;
-webkit-box-shadow: rgba(60, 60, 70, 0.7) 4px 4px 8px;
-moz-box-shadow: rgba(60, 60, 70, 0.7) 4px 4px 8px;
box-shadow: rgba(60, 60, 70, 0.7) 4px 4px 8px;
border: 1px solid rgb(52, 72, 35);
cursor: pointer;
}
#controls {
position: absolute;
left: 60px;
margin-top: 30px;
}
}
@media all and (min-device-width: 1025px) {
#canvas {
position: absolute;
top: 60px;
left: 35px;
-webkit-box-shadow: rgba(60, 60, 70, 0.7) 4px 4px 8px;
-moz-box-shadow: rgba(60, 60, 70, 0.7) 4px 4px 8px;
box-shadow: rgba(60, 60, 70, 0.7) 4px 4px 8px;
border: 1px solid rgb(52, 72, 35);
cursor: pointer;
}
#controls {
margin-top: 5px;
position: absolute;
left: 60px;
}
}
#glassSizeSliderDiv {
position: absolute;
left: 290px;
top: -5px;
margin-left: 10px;
display: inline;
width: 200px;
height: 40px;
}
#magnificationSliderDiv {
position: absolute;
left: 35px;
top: -5px;
margin-left: 10px;
display: inline;
width: 200px;
height: 40px;
}
#glassSizeCanvas {
position: absolute;
left: 260px;
}
#scaleOutput {
position: absolute;
left: -20px;
vertical-align: center;
color: rgb(32, 42, 15);
font: 18px Arial;
text-shadow: 1px 1px 1px rgba(255,205,0,0.5);
}
.slider {
margin-top: 5px;
}
#instructions {
font: 16px Arial;
position: absolute;
left: 170px;
top: 150px;
background: rgba(250,250,0,0.9);
border: thin solid rgb(52,72,35);
z-index: 1;
width: 650px;
height: 250px;
padding: 20px;
color: navy;
text-shadow: 2px 2px 2px rgba(255,255,235,0.8);
-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);
}
#instructions h2 {
margin-bottom: 20px;
font: 24px arial;
text-shadow: 2px 2px 2px rgba(255,255,235,0.8);
margin-top: 5px;
}
#instructions-okay {
position: absolute;
margin-left: 150px;
margin-top: 25px;
cursor: pointer;
}
#instructions-nomore {
position: absolute;
margin-top: 25px;
margin-left: 350px;
cursor: pointer;
}
</style>
</head>
<body id='body'>
<div id='backdrop'>
<div id='instructions'>
<h2>Instructions</h2>
<p>If you run this application directly from your filesystem, as opposed to over the internet, you must circumvent JavaScript's same-domain policy to manipulate the application's image. If you see the picture underneath this message, but no magnifying glass, then you need to circumvent the same-domain policy to manipulate the image.</p>
<p>You do that differently for different browsers; for example, Chrome has a command line argument --allow-file-access-from-files, that relaxes the same-domain policy so the application can manipulate the image. See your browser's documentation for more details.</p>
<span id='instructions-okay'>Okay</span>
<span id='instructions-nomore'>Don't show this again</span>
</div>
<div id='controls'>
<span id='scaleOutput'>1.5</span>
<div id='magnificationSliderDiv' class='slider'></div>
<canvas id='glassSizeCanvas' width='40' height='40'>
Canvas not supported
</canvas>
<div id='glassSizeSliderDiv' class='slider'></div>
</div>
<canvas id='canvas' width='955' height='611'>
Canvas not supported
</canvas>
</div>
<script src='js/roundedRectangle.js'></script>
<script src='js/slider.js'></script>
<script src='example.js'></script>
</body>
</html>