-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
94 lines (88 loc) · 2.64 KB
/
index.php
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
<?php
$version = "RaspberryPi Kiosk Slideshow - Version " . file_get_contents("./version");
echo "<!-- " . $version . " -->\r\n";
?>
<!DOCTYPE html>
<html>
<head>
<title>
<?php echo $version; ?>
</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<style type="text/css">
html, body {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
background-color: black;
}
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: none;
padding-top: 0;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
</style>
</head>
<body>
<iframe src="datetimenow.html" id="fristFrame" style="visibility: hidden;"></iframe>
<iframe src="datetimenow.html" id="secondFrame" style="visibility: visible;"></iframe>
<script type="text/javascript">
var urls = [];
<?php
$steuerungsinfos = file("./files/slideshow.txt");
$outputSize = 0;
$delay = 14 / 2 * 1000;
for ($i = 0; $i < count($steuerungsinfos); $i++) {
if (!(substr($steuerungsinfos[$i], 0, 1) === "#")) {
$enhancedUrl = trim($steuerungsinfos[$i]);
if (!(substr($enhancedUrl, 0, 4) === "http")) {
$enhancedUrl = "./files/" . $enhancedUrl;
}
echo "urls[" . $outputSize . "] = '" . $enhancedUrl . "';\r\n";
$outputSize++;
} else if (substr($steuerungsinfos[$i], 0, 35) === "# setting-transition-delay=") {
$delayvalue = substr($steuerungsinfos[$i], 35);
$delay = $delayvalue / 2 * 1000;
}
}
echo "var delay = " . $delay . ";\r\n";
?>
var urlaktuell = 0;
setTimeout("loadIntoFristFrame()", 1000);
function loadIntoFristFrame() {
document.getElementById('fristFrame').src = urls[urlaktuell];
urlaktuell++;
if (urlaktuell === urls.length) {
urlaktuell = 0;
}
setTimeout("switchToFirstFrame()", delay);
}
function switchToFirstFrame() {
document.getElementById('fristFrame').style.visibility = 'visible';
document.getElementById('secondFrame').style.visibility = 'hidden';
setTimeout("loadIntoSecondFrame()", delay);
}
function loadIntoSecondFrame() {
document.getElementById('secondFrame').src = urls[urlaktuell];
urlaktuell++;
if (urlaktuell === urls.length) {
urlaktuell = 0;
}
setTimeout("switchToSecondFrame()", delay);
}
function switchToSecondFrame() {
document.getElementById('fristFrame').style.visibility = 'hidden';
document.getElementById('secondFrame').style.visibility = 'visible';
setTimeout("loadIntoFristFrame()", delay);
}
</script>
</body>
</html>