aboutsummaryrefslogtreecommitdiffstats
path: root/cropper/tests/staticHTMLStructure.htm
blob: ddb99278e2e0ede4ab539e9492ac69d20dd50e31 (plain) (blame)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Language" content="en-us" />
	<title></title>
</head>
<body>
	<!--
		
		This is a static test file for the HTML & CSS structure employed, tested in 
		the following browsers:
		
			PC:
				IE 6:          working
				IE 5.5:        working
				IE 5.0:        opacity issues
				FF 1.5:        working
				Opera 9:       working
			MAC:
				Camino 1.0:    working
				FF 1.5:        working
				Safari 2.0:    working
				
	-->	
	<style type="text/css">		
		.imgCrop_wrap {
			width: 500px;   /* @TODO IN JS */
			height: 333px;  /* @TODO IN JS */
			position: relative;
			cursor: crosshair;
		}
		
		/* fix for IE displaying all boxes at line-height by default */
		.imgCrop_wrap,
		.imgCrop_wrap * {
			font-size: 0;
		}
		
		.imgCrop_overlay {
			background-color: #000;
			opacity: 0.5;
			filter:alpha(opacity=50);
			position: absolute;
			width: 100%;
			height: 100%;
		}
		
		.imgCrop_selArea {
			position: absolute;
			cursor: move;
			/* @TODO: rest to be done via JS when selecting areas */
			top: 110px;
			left: 210px;
			width: 200px;
			height: 200px;
			z-index: 2;
			background: transparent url(castle.jpg) no-repeat  -210px -110px;
		}
		
		/* imgCrop_clickArea is all a fix for IE 5.5 & 6 to allow the user to click on the given area */
		.imgCrop_clickArea {
			width: 100%;
			height: 100%;
			background-color: #FFF;
			opacity: 0.01;
			filter:alpha(opacity=01);
		}
				
		.imgCrop_marqueeHoriz {
			position: absolute;
			width: 100%;
			height: 1px;
			background: transparent url(marqueeHoriz.gif) repeat-x 0 0;
		}
		
		.imgCrop_marqueeVert {
			position: absolute;
			height: 100%;
			width: 1px;
			background: transparent url(marqueeVert.gif) repeat-y 0 0;
		}
				
		.imgCrop_marqueeNorth { top: 0; left: 0; }
		.imgCrop_marqueeEast  { top: 0; right: 0; }
		.imgCrop_marqueeSouth { bottom: 0px; left: 0; }
		.imgCrop_marqueeWest  { top: 0; left: 0; }
		
		
		.imgCrop_handle {
			position: absolute;
			border: 1px solid #333;
			width: 6px;
			height: 6px;
			background: #FFF;
			opacity: 0.5;
			filter:alpha(opacity=50);
			z-index: 3;
		}
		
		.imgCrop_handleN {
			top: -3px;
			left: 0;
			margin-left: 49%;    /* @TODO : in JS */
			cursor: n-resize;
		}
		
		.imgCrop_handleNE { 
			top: -3px;
			right: -3px;
			cursor: ne-resize;
		}
		
		.imgCrop_handleE {
			top: 0;
			right: -3px;
			margin-top: 49%;    /* @TODO : in JS */
			cursor: e-resize;
		}
		
		.imgCrop_handleSE {
			right: -3px;
			bottom: -3px;
			cursor: se-resize;
		}
		
		.imgCrop_handleS {
			right: 0;
			bottom: -3px;
			margin-right: 49%; /* @TODO : in JS */
			cursor: s-resize;
		}
		
		.imgCrop_handleSW {
			left: -3px;
			bottom: -3px;
			cursor: sw-resize;
		}
		
		.imgCrop_handleW {
			top: 0;
			left: -3px;
			margin-top: 49%;  /* @TODO : in JS */
			cursor: e-resize;
		}
		
		.imgCrop_handleNW {
			top: -3px;
			left: -3px;
			cursor: nw-resize;
		}
		
		/**
		 * Create an area to click & drag around on as the default browser behaviour is to let you drag the image 
		 */
		.imgCrop_dragArea {
			width: 100%;
			height: 100%;
			z-index: 200;
			position: absolute;
			top: 0;
			left: 0;
		}
		
		
		.imgCrop_previewWrap {
			width: 200px;  /* @TODO : in JS */
			height: 200px; /* @TODO : in JS */
			overflow: hidden;
			position: relative;
		}
		
		/* @TODO : all in JS */
		.imgCrop_previewWrap img {
			position: absolute;
			width: 500px;
			height: 333px;
			left: -210px;
			top: -110px;
		}
		
		/**
		 * These are just for the static test
		 */
		.imgCrop_wrap {
			margin: 20px 0 0 50px;
			float: left;
		}
		
		#previewWrapper {
			float: left;
			margin-left: 20px;
		}
		
			
	</style>
	
	<br /><br />
	
	<!-- This is all attached to the image dynamically -->
	<div class="imgCrop_wrap">
		<img src="castle.jpg" alt="test image" id="testImage" width="500" height="333" />
		<div class="imgCrop_dragArea">
			<div class="imgCrop_overlay"></div>
			<div class="imgCrop_selArea">
				<!-- marquees -->
				<!-- the inner spans are only required for IE to stop it making the divs 1px high/wide -->
				<div class="imgCrop_marqueeHoriz imgCrop_marqueeNorth"><span></span></div>
				<div class="imgCrop_marqueeVert imgCrop_marqueeEast"><span></span></div>
				<div class="imgCrop_marqueeHoriz imgCrop_marqueeSouth"><span></span></div>
				<div class="imgCrop_marqueeVert imgCrop_marqueeWest"><span></span></div>			
				<!-- handles -->
				<div class="imgCrop_handle imgCrop_handleN"></div>
				<div class="imgCrop_handle imgCrop_handleNE"></div>
				<div class="imgCrop_handle imgCrop_handleE"></div>
				<div class="imgCrop_handle imgCrop_handleSE"></div>
				<div class="imgCrop_handle imgCrop_handleS"></div>
				<div class="imgCrop_handle imgCrop_handleSW"></div>
				<div class="imgCrop_handle imgCrop_handleW"></div>
				<div class="imgCrop_handle imgCrop_handleNW"></div>
				<div class="imgCrop_clickArea"></div>
			</div>	
			<div class="imgCrop_clickArea"></div>	
		</div>	
	</div>
	
	<div id="previewWrapper">
		<h3>Preview:</h3>
		<div class="imgCrop_previewWrap">
			<img src="castle.jpg" alt="test image" id="previewImage" />
		</div>
	</div>
</body>
</html>