-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex-old.html
279 lines (234 loc) · 8.74 KB
/
index-old.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
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ZoomMarker_Demo</title>
<link rel="stylesheet" href="css/zoom-marker.css">
<link rel="stylesheet" href="css/easy-loading.css">
<style>
.zoom-marker-navigator{
width: 100%;
margin: 10px;
text-align: center;
}
body {
margin: 0;
}
div#zoom-marker-div {
width: 100%;
height: 100vh;
}
/* The side navigation menu */
.sidenav {
height: 100%; /* 100% Full-height */
width: 0; /* 0 width - change this with JavaScript */
position: fixed; /* Stay in place */
z-index: 1; /* Stay on top */
top: 0; /* Stay at the top */
left: 0;
background-color: #fff; /* Black*/
overflow-x: hidden; /* Disable horizontal scroll */
padding-top: 60px; /* Place content 60px from the top */
transition: 0.5s; /* 0.5 second transition effect to slide in the sidenav */
}
/* The navigation menu links */
.sidenav a {
padding: 8px 8px 8px 32px;
text-decoration: none;
color: #818181;
display: block;
transition: 0.3s;
font-family: "Open Sans";
font-size: 13px;
}
/* When you mouse over the navigation links, change their color */
.sidenav a:hover {
color: #f1f1f1;
}
/* Position and style the close button (top right corner) */
.sidenav .closebtn {
position: absolute;
top: 0;
right: 25px;
font-size: 36px;
margin-left: 50px;
}
/* Style page content - use this if you want to push the page content to the right when you open the side navigation */
#main {
transition: margin-left .5s;
padding: 20px;
}
div#main {
padding: 0px;
}
span.openNav {
position: fixed;
z-index: 9999;
color: white;
font-family: "Open Sans";
padding: 14px;
font-weight: bold;
text-shadow: 1px 1px black;
}
/* On smaller screens, where height is less than 450px, change the style of the sidenav (less padding and a smaller font size) */
@media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}
</style>
</head>
<body>
<!-- <div class="zoom-marker-navigator">
<button id="zoom-marker-btn-switch">switch picture</button>
<button id="zoom-marker-btn-clean">clean marker</button>
<button id="zoom-marker-btn-loading">show loader</button>
<button id="zoom-marker-btn-enable-drag">disable drag</button>
</div> -->
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="#">Places</a>
<a href="#">Encounters / Ambushes</a>
<a href="#">Points of interest</a>
<a href="#">People</a>
<a href="#">Plot hooks</a>
<a href="#">Add new layer...</a>
</div>
<!-- Use any element to open the sidenav -->
<span class="openNav" onclick="openNav()">view layers</span>
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main">
<div id="zoom-marker-div" class="zoom-marker-div">
<img class="zoom-marker-img" id="zoom-marker-img" alt="zoom-marker-img" name="zoom-marker-img" draggable="false"/>
</div>
</div>
</body>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/jquery.mousewheel.min.js"></script>
<script src="js/hammer.min.js"></script>
<script src="js/zoom-marker.js"></script>
<script src="js/easy-loading.js"></script>
<script>
/* Set the width of the side navigation to 250px and the left margin of the page content to 250px and add a black background color to body */
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
document.body.style.backgroundColor = "rgba(0,0,0,0.4)";
}
/* Set the width of the side navigation to 0 and the left margin of the page content to 0, and the background color of body to white */
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft = "0";
document.body.style.backgroundColor = "white";
}
/******************* init navigator button, no need for users' initialization *********************/
var picTag = 0;
var tagNumber = 1;
$('#zoom-marker-btn-switch').click(function(e){
$('#zoom-marker-img').zoomMarker_CleanMarker();
if(picTag===0){
$('#zoom-marker-img').zoomMarker_LoadImage("img/rail.jpg");
}
else if(picTag===1){
$('#zoom-marker-img').zoomMarker_LoadImage("img/mountain.jpg");
}
picTag = 1-picTag;
});
$('#zoom-marker-btn-clean').click(function(e){
$('#zoom-marker-img').zoomMarker_CleanMarker();
});
// this array stores the styles for EASY-LOADING
var styleList = [
"BALL_PULSE",
"BALL_CLIP_ROTATE", "BALL_CLIP_ROTATE_PULSE", "SQURE_SPIN", "BALL_CLIP_ROTATE_MULTIPLE",
"BALL_PULSE_RISE", "BALL_ROTATE", "CUBE_TRANSITION", "BALL_ZIP_ZAG", "BALL_ZIP_ZAG_DEFLECT",
"BALL_TRIANGLE_PATH", "BALL_SCALE", "LINE_SCALE", "LINE_SCALE_PARTY", "BALL_SCALE_MULTIPLE",
"BALL_PULSE_SYNC", "BALL_BEAT", "LINE_SCALE_PULSE_OUT", "LINE_SCALE_PULSE_OUT_RAPID",
"BALL_SCALE_RIPPLE", "BALL_SCALE_RIPPLE_MULTIPLE", "BALL_SPIN_FADE_LOADER", "LINK_SPIN_FADE_LOADER",
"TRIANGLE_SKEW_SPIN", "PACMAN", "SEMI_CIRCLE_SPIN"
];
var stylePosition = 0;
$('#zoom-marker-btn-loading').click(function(e){
EasyLoading.show({
text: $("<span>"+styleList[stylePosition]+"</span>"),
button:$("<span>dismiss</span>"),
type: EasyLoading.TYPE[styleList[stylePosition]],
//timeout: EasyLoading.TIMEOUT.FAST,
callback: function(event, data){
switch(event){
case 'on_btn_click' : console.log(data); break;
case 'on_loaded' : console.log("callback with options:"+JSON.stringify(data)); break;
}
}
});
if(++stylePosition>=styleList.length)
stylePosition = 0;
});
var isEnableDrag = true;
$('#zoom-marker-btn-enable-drag').click(function(e) {
isEnableDrag = !isEnableDrag;
$('#zoom-marker-img').zoomMarker_EnableDrag(isEnableDrag);
if(isEnableDrag) {
$('#zoom-marker-btn-enable-drag').text('disable drag');
} else {
$('#zoom-marker-btn-enable-drag').text('enable drag');
}
});
// init item
var initImg = function(item) {
// handle "TAP" event and add marker to image
item.on("zoom_marker_mouse_click", function(event, position){
console.log("Mouse click on: "+JSON.stringify(position));
item.zoomMarker_AddMarker({
src:"img/marker.svg",
x:position.x,
y:position.y,
size:40,
dialog:{
value: "<h4>content for dialog_"+tagNumber+"</h4>",
offsetX: 20,
style: {
"border-color": "#86df5f"
}
},
hint:{value:tagNumber, style:{color:"#ffffff", left:"10px"}}
});
++tagNumber
});
// listen to marker click event, print to console and delete the marker
item.on("zoom_marker_click", function(event, marker){
console.log(JSON.stringify(marker));
$('#zoom-marker-img').zoomMarker_RemoveMarker(marker.id);
});
// message for the beginning of image loading process
item.on("zoom_marker_img_load", function(event, src){
console.log("loading started for image : "+src);
EasyLoading.show({
text: $("<span>loading image</span>"),
button:$("<span>dismiss</span>"),
type: EasyLoading.TYPE.PACMAN
});
});
// message for image loaded
item.on("zoom_marker_img_loaded", function(event, size){
console.log("image has been loaded with size: "+JSON.stringify(size));
// we have to set a timer in order to watching the loader in local environment, cause the loading speed is too fast
setTimeout(function(){
EasyLoading.hide();
}, 3000);
});
}
initImg($('#zoom-marker-img'));
initImg($('#zoom-marker-img-alt'));
/******************** INIT ZoomMarker here *****************************/
$(document).ready(function () {
$('#zoom-marker-img').zoomMarker({
src: "img/worldmap-b.png",
rate: 0.1,
width: 600,
max: 100000,
markers:[]
});
})
/******************** INIT ZoomMarker here *****************************/
</script>
</html>