-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmaps.html
More file actions
75 lines (66 loc) · 1.81 KB
/
maps.html
File metadata and controls
75 lines (66 loc) · 1.81 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
<html>
<head>
<title>Map preview</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
var prefix = '';
function generateImageLink(id)
{
return prefix + id + '.png#' + Math.floor((Math.random() * 100000) + 1) + '_' + new Date().getTime();
}
function loadImages()
{
prefix = $('#prefix').val();
$('#imageBox').html('');
for (var i = 0; i < $('#count').val(); i++)
$('#imageBox').append('<image class="map thumbnail" number="' + i + '" src="' + generateImageLink(i) + '">');
setInterval(refreshImages, 1000);
}
function refreshImages()
{
$('#imageBox').children('img').each(function() {
$(this).attr('src', generateImageLink($(this).attr('number')));
});
}
</script>
<style>
body {
margin-top: 18px;
}
* {
text-align: center;
}
.map {
margin: 5px;
display: inline-block;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-primary">
<div class="panel-heading">Settings</div>
<div class="panel-body">
<p style="width: 350px; margin-left: auto; margin-right: auto;">
Script that automatically refreshes images with maps every 1 second. Useful for testing generator presets.
</p>
<input placeholder="Name prefix" type="text" id="prefix">
<input placeholder="Count of files" type="text" id="count">
<button onclick="loadImages()">Load</button>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Generated maps</div>
<div class="panel-body" id="imageBox">
</div>
</div>
</div>
</div>
</div>
</body>
</html>