-
Notifications
You must be signed in to change notification settings - Fork 1
/
eo1test.html
62 lines (60 loc) · 1.8 KB
/
eo1test.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Screensaver</title>
<link rel="stylesheet" type="text/css" href="/css/basscss.min.css">
<script type="text/javascript" src="js/jquery/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="/templates/ga.js"></script>
<style type="text/css">
body {
background-color: black;
}
ul {
position: absolute;
top: 0;
left: 0;
width: 100%;
}
ul li {
color: white;
font: bold 24px/45px Helvetica, Sans-Serif;
letter-spacing: -1px;
padding: 10px;
}
</style>
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@dannypage" />
<meta name="twitter:title" content="Screensaver" />
<meta name="twitter:description" content="Displays a random photo every 10 minutes." />
<meta name="twitter:image" content="https://source.unsplash.com/200x200/?water" />
<script type="text/javascript">
var reload = 1000*15; // 30 minutes
var seconds = new Date().getTime() / 1000;
var action = function() {
var now = new Date().getTime() / 1000;
var width = $(window).width();
var height = $(window).height();
var term = "water";
var src = "https://source.unsplash.com/" + width + 'x' + height + "/" + "?" + term;
$("#image").remove();
$( "#main" ).append( "<img id='image' src=" + src + ">" );
$( "#list" ).append( "<li>" + Math.round(now - seconds) + "</li>" );
seconds = now;
}
$(document).ready(function(){
action();
window.setInterval(function(){
action();
}, reload);
});
</script>
</head>
<body>
<div id="main" class="position: relative;">
<img id="image" src="" />
<ul id="list"></ul>
</div>
</body>
</html>