-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
79 lines (70 loc) · 1.74 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>I agree</title>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<script>
$(document).ready(function () {
var dir = "./data/";
var fileextension = ".jpg";
setInterval(function () {
$.ajax({
url: dir,
success: function (data) {
var files = $(data).find("a:contains(" + fileextension + ")");
console.log(files);
var lastFile1 = $(files[files.length - 1]).attr('href');
var lastFile2 = $(files[files.length - 2]).attr('href');
var lastFile3 = $(files[files.length - 3]).attr('href');
var lastFile4 = $(files[files.length - 4]).attr('href');
$('.container:nth-child(1)').css('background-image', 'url(' + dir + lastFile1 + ')');
$('.container:nth-child(2)').css('background-image', 'url(' + dir + lastFile2 + ')');
$('.container:nth-child(3)').css('background-image', 'url(' + dir + lastFile3 + ')');
$('.container:nth-child(4)').css('background-image', 'url(' + dir + lastFile4 + ')');
}
});
}, 500);
});
</script>
<style>
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
.container {
position: absolute;
background-position: center center;
background-size: cover;
width: 50%;
height: 50%;
}
.container:nth-child(2) {
left: 50%;
}
.container:nth-child(3) {
top: 50%;
}
.container:nth-child(4) {
top: 50%;
left: 50%;
}
img {
display: none;
}
</style>
</head>
<body>
<div class="container">
</div>
<div class="container">
</div>
<div class="container">
</div>
<div class="container">
</div>
</body>
</html>