-
Notifications
You must be signed in to change notification settings - Fork 0
/
flits.html
88 lines (79 loc) · 2.7 KB
/
flits.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flitsmeister refresh</title>
<style>
/* Remove default margins and padding */
body, html {
margin: 0;
padding: 0;
height: 100%;
display: flex;
flex-direction: column;
}
/* Make the iframe fill the remaining space */
iframe {
flex: 1;
border: none;
}
/* Style the button container */
#controls {
padding: 10px;
background-color: #f1f1f1;
text-align: center;
}
/* Style for the buttons */
#controls button {
margin: 0 5px;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}
/* Style for the interval display */
#intervalDisplay {
font-size: 18px;
margin: 0 10px;
}
</style>
<script>
let refreshIntervalId;
let currentInterval = 10; // Default interval is 10 seconds
// Function to refresh the iframe
function refreshIframe() {
document.getElementById('teslaIframe').src += '';
}
// Function to update the refresh interval and restart the timer
function updateInterval(newInterval) {
currentInterval = newInterval;
document.getElementById('intervalDisplay').innerText = currentInterval + ' seconds';
clearInterval(refreshIntervalId);
refreshIntervalId = setInterval(refreshIframe, currentInterval * 1000);
}
// Function to increment the interval
function incrementInterval() {
updateInterval(currentInterval + 1);
}
// Function to decrement the interval
function decrementInterval() {
if (currentInterval > 1) {
updateInterval(currentInterval - 1);
}
}
// Set the initial refresh interval to 10 seconds
window.onload = function() {
document.getElementById('intervalDisplay').innerText = currentInterval + ' seconds';
refreshIntervalId = setInterval(refreshIframe, currentInterval * 1000);
}
</script>
</head>
<body>
<iframe id="teslaIframe" src="https://tesla.flitsmeister.nl"></iframe>
<div id="controls">
<button onclick="decrementInterval()">-1 Second</button>
<span id="intervalDisplay"></span>
<button onclick="incrementInterval()">+1 Second</button>
</div>
</body>
</html>