-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
245 lines (232 loc) · 6.99 KB
/
index.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Random Webcam</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/css/ol.css" type="text/css">
<style>
@font-face {
font-family: SPINNAKER;
src: url(Spinnaker-Regular.ttf);
}
@font-face {
font-family: TWITMOJI;
src: url(TwitterColorEmoji-SVGinOT.ttf);
}
body {
margin: 0;
padding: 0;
background-color:#000;
color:#fff;
font-family:SPINNAKER,TWITMOJI;
overflow: hidden;
}
#siteContainer {
width:800px;
height:480px;
background-color:#000;
margin:0;
padding:0;
position:absolute;
top:0;
left:0;
overflow:hidden;
}
#webcamContainer {
position: absolute;
top:0px;
left:0px;
max-width:800px;
height:480px;
z-index:1000;
}
#desc {
position:absolute;
bottom:0;
left:0;
z-index:1500;
}
#desc a {
color:#fff;
text-decoration:underline
}
#map {
height:150px;
width: 150px;
position:absolute;
bottom:0;
right:0;
z-index:4000
}
#settingsTrigger{
position:absolute;
top:0;
right:0;
width:50px;
height:50px;
background-image: url("iconfinder_settings_1054981.png");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
cursor:pointer;
z-index:9000
}
#reject, #fav {
position:absolute;
cursor:pointer;
right:5px;
width:40px;
border-radius:20px;
background-color:#73c3ab;
color:#000;
height:40px;
font-weight:bold;
text-align:center;
font-size:25px;
line-height:40px;
z-index:4000;
font-family:TWITMOJI
}
#reject {
top:120px;
}
#fav {
top:70px;
}
#settings {
padding: 0 5% 0 5%;
display:none;
width:90%;
height:100%;
background-color:#fff;
position:absolute;
top:0;
right:0;
z-index:5000;
color:#000;
font-size:90%
}
#tardis{
display:none;
width:50px;
height:100px;
position:absolute;
top:180px;
left:375px;
z-index:3000;
background-image: url("tardis.gif");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
input[type=range] {
width:400px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/build/ol.js"></script>
<script src="ol-ext.js"></script>
<script src="scrypt.js"></script>
<script src="lists.js"></script>
<script src="favorite.js"></script>
<script src="rejected.js"></script>
<script src="cached.js"></script>
</head>
<body>
<div id="siteContainer">
<img src="" id="webcamContainer" />
<div id="tardis"></div>
<div id="desc">
<div id="webcamLocation"></div>
<div id="roe-two">
<span id="webcamcoord"></span>
<span id="methodResult"></span>
</div>
</div>
<div id="settingsTrigger"></div>
<div id="fav">👍</div>
<div id="reject">👎</div>
<div id="settings">
<p>
<b>Search Radius</b>: <em>How far (km) can the webcam be from the selected point? Further, you spend less time calling the API but will get less relevant results</em><br />
<input type="range" id="searchRadius" name="searchRadius" min="1" max="1000" value="150" onchange="updateTextInput(this.value,'#radiusIndicator')">
<span id='radiusIndicator'>150</span>
</p>
<p>
<b>Refresh Frequency</b>: <em>How often the page automatically gets a new webcam, in minutes</em><br />
<input type="range" id="refreshFrequency" name="refreshFrequency" min="1" max="30" value="9" onchange="updateTextInput(this.value,'#frequencyIndicator')">
<span id='frequencyIndicator'>9</span>
</p>
<p>
<b>Preferred Mode</b>: <em>How does it find new webcams?</em><br />
<select name="mode" id="mode">
<option value="8" selected>Sunrise - the webcam is currently experiencing sunrise (default)</option>
<option value="7">Sunset</option>
<option value="6">Terminator - on the edge of day and night</option>
<option value="5">High noon</option>
<option value="4">Random camera in cache</option>
<option value="3">True Random Coordinates (with filters) in daylight</option>
<option value="2">Just Europe, NA, East Asia, ANZ, in daylight</option>
<option value="1">Favorites (from your saved list)</option>
<option value="0">Iconic views</option>
</select>
</p>
<p>
<b>Auto Degrade Rate</b>: <em>After this many random calls to the API, it will degrade the search to the next lowest level listed above (first not sunrises, but first all terminator points, then totally random, then iconic views, as there is not always a sunrise where there is a webcam!). Has no effect when you have selected a curated list.</em><br />
<input type="range" id="autoDegradeRate" name="autoDegradeRate" min="1" max="200" value="50" onchange="updateTextInput(this.value,'#degradeIndicator')">
<span id='degradeIndicator'>50</span>
</p>
<p>
<b>Points to remember</b>: <em>Will not repeat a webcam if it has shown in the last X webcams</em><br />
<input type="range" id="pointsToRemember" name="pointsToRemember" min="1" max="50" value="10" onchange="updateTextInput(this.value,'#rememberIndicator')">
<span id='rememberIndicator'>10</span>
</p>
<p>
<b>Terminator distance</b>: <em>How far is the Earth's terminator from the subsolar point in meters (actually 10018750 m, but different numbers will give different level of sunrise/darkness) </em><br />
<input type="range" id="terminatorDistance" name="terminatorDistance" min="1" max="20000000" value="10018750" onchange="updateTextInput(this.value,'#terminatorIndicator')">
<span id='terminatorIndicator'>10218750</span>
</p>
</div>
<div id="map" class="map"></div>
<script>
// the map must be initialized from within the body.
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
controls:[],
view: new ol.View({
center: [0, 0],
zoom: 2
})
});
var pin = new ol.layer.Vector({
source: new ol.source.Vector({
features: [
new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([0, 0]))
})
]
})
});
map.addLayer(pin);
// night/day layer
var dayNightVector = new ol.source.DayNight({ });
var dayNightLayer = new ol.layer.Vector({
source: dayNightVector,
opacity: .5,
style: new ol.style.Style({
fill: new ol.style.Fill({
color: [0,0,0]
})
})
})
map.addLayer(dayNightLayer);
getWebcam()
getNewWebcamTimeout()
</script>
</div>
</body>
</html>