-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpineisland.html
More file actions
104 lines (93 loc) · 3.52 KB
/
pineisland.html
File metadata and controls
104 lines (93 loc) · 3.52 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Multi-Cam Display</title>
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
display: flex;
}
#grid-container {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
gap: 0;
width: 100vw;
height: 100vh;
}
.cam {
position: relative;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #000;
}
img, iframe {
width: 100%;
height: 100%;
object-fit: cover;
}
#timer {
position: absolute;
top: 10px;
right: 10px;
background-color: rgba(0, 0, 0, 0.5);
color: white;
padding: 10px;
border-radius: 8px;
font-family: Arial, sans-serif;
font-size: 1.5rem;
z-index: 10;
}
</style>
<script>
let refreshInterval = 30;
let timeLeft = refreshInterval;
function refreshImage() {
const img = document.getElementById('liveImage');
const timestamp = new Date().getTime(); // Add timestamp to avoid caching
img.src = 'https://media.raven.news/weathercams/pine-island-weeki-cam/axis-cgi/jpg/image.cgi?' + timestamp;
timeLeft = refreshInterval; // Reset the countdown
}
function updateTimer() {
const timerElement = document.getElementById('timer');
timerElement.textContent = `Refresh in: ${timeLeft}s`;
timeLeft--;
if (timeLeft < 0) {
refreshImage(); // Refresh image when the countdown hits 0
}
}
// Update the timer every second
setInterval(updateTimer, 1000);
// Refresh image every 30 seconds
setInterval(refreshImage, refreshInterval * 1000);
</script>
</head>
<body>
<div id="grid-container">
<!-- First section: Image -->
<div class="cam">
<img id="liveImage" src="https://media.raven.news/weathercams/pine-island-weeki-cam/axis-cgi/jpg/image.cgi" alt="Pine Island Weeki Cam">
<div id="timer">Refresh in: 30s</div>
</div>
<!-- Second section: New camera feed -->
<div class="cam">
<iframe src="https://v.angelcam.com/iframe?v=j3l78zxdrm&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkb21haW4iOiJoZXJuYW5kby1iZWFjaC1ndWxmLW1tNTMuY2xpY2syc3RyZWFtLmNvbSIsImNhbWVyYV9pZCI6MTA5NDY3LCJleHAiOjE3Mjc0NDIzNjd9.XCrygBrKR8FqM2eYyh_81ugu6WdpRrFX713NEj6pvFA&autoplay=1" frameborder="0" allowfullscreen></iframe>
</div>
<!-- Third and fourth sections: Placeholder for now -->
<div class="cam">
<iframe src="https://v.angelcam.com/iframe?v=17ldg43ble&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkb21haW4iOiJkb2NrY2FtMi5jbGljazJzdHJlYW0uY29tIiwiY2FtZXJhX2lkIjoxMDkxMDcsImV4cCI6MTcyNzQ0MzA0NH0.4SocNVvh0SsCYdqOhBFxn58CF8QbjrdYufw-K2HFRbQ&autoplay=1" frameborder="0" allowfullscreen></iframe>
</div>
<div class="cam">
<iframe src="https://tempestwx.com/station/154546/" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</body>
</html>