-
Notifications
You must be signed in to change notification settings - Fork 0
/
conus.html
228 lines (176 loc) · 5.61 KB
/
conus.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<meta http-equiv="refresh" content="460" >
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Conus Weather Dashboard</title>
<style>
body {
margin: 0;
}
.img-container {
height: 100vh;
overflow: hidden;
position: relative;
width: 100vw;
}
.img-container img {
height: 100%;
left: 0;
object-fit: fill;
object-position: center;
opacity: 0;
position: absolute;
top: 0;
width: 100vw;
z-index: -1;
}
.img-container img.next {
opacity: 1;
z-index: 1;
}
.img-container img.prev {
opacity: 1;
z-index: 2;
}
.img-container img.fade-out {
opacity: 0;
transition: visibility 0s .1s, opacity .1s linear;
visibility: hidden;
}
/*.fadein {
position:absolute;
top:0px;
left:50%;
margin:auto;
}
.fadein img {
position:absolute;
left:-65px;
top:0;
-webkit-animation-name: fade;
-webkit-animation-iteration-count: infinite;
-webkit-animation-duration: 6s;
animation-name: fade;
animation-iteration-count: infinite;
animation-duration: 6s;
}
@-webkit-keyframes fade {
0% {opacity: 0;}
20% {opacity: 1;}
33% {opacity: 1;}
53% {opacity: 0;}
100% {opacity: 0;}
}
@keyframes fade {
0% {opacity: 0;}
20% {opacity: 1;}
33% {opacity: 1;}
53% {opacity: 0;}
100% {opacity: 0;}
}
#crossfade img {
position:absolute;
left:0;
opacity: 1;
-webkit-transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-o-transition: opacity 1s ease-in-out;
-ms-transition: opacity 1s ease-in-out;
transition: opacity 1s ease-in-out;
}
#f1 {
}
#f2 {
-webkit-animation-delay: -4s;
}
#f3 {
-webkit-animation-delay: -2s;
}*/
</style>
</head>
<body style="width:100%;height: 100vh;background-color:white;">
<div class="img-container" data-slideshow>
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_9.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_8.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_7.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_6.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_5.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_4.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_3.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_2.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_1.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_0.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_0.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_0.gif">
<img src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_0.gif">
</div>
<!-- <div class="fadein">
<img id="f1" src="https://radar.weather.gov/ridge/lite/CONUS_9.gif" alt="">
<img id="f2" src="https://radar.weather.gov/ridge/lite/CONUS_4.gif" alt="">
<img id="f3" src="https://radar.weather.gov/ridge/lite/CONUS_0.gif" alt="">
</div> -->
<!--
<div style="width:99%;height:99vh;">
<img style="width:99%;height:99vh;" src="https://radar.weather.gov/ridge/lite/CONUS-LARGE_loop.gif" />
<img style="width:98%;" src="http://173.13.70.121/-wvhttp-01-/GetOneShot">
</div> -->
<script language="javascript">
class Slideshow {
constructor() {
this.initSlides();
this.initSlideshow();
}
// Set a `data-slide` index on each slide for easier slide control.
initSlides() {
this.container = $('[data-slideshow]');
this.slides = this.container.find('img');
this.slides.each((idx, slide) => $(slide).attr('data-slide', idx));
}
// Pseudo-preload images so the slideshow doesn't start before all the images
// are available.
initSlideshow() {
this.imagesLoaded = 0;
this.currentIndex = 0;
this.setNextSlide();
this.slides.each((idx, slide) => {
$('<img>').on('load', $.proxy(this.loadImage, this)).attr('src', $(slide).attr('src'));
});
}
// When one image has loaded, check to see if all images have loaded, and if
// so, start the slideshow.
loadImage() {
this.imagesLoaded++;
if (this.imagesLoaded >= this.slides.length) { this.playSlideshow() }
}
// Start the slideshow.
playSlideshow() {
this.slideshow = window.setInterval(() => { this.performSlide() }, 300);
}
// 1. Previous slide is unset.
// 2. What was the next slide becomes the previous slide.
// 3. New index and appropriate next slide are set.
// 4. Fade out action.
performSlide() {
if (this.prevSlide) { this.prevSlide.removeClass('prev fade-out') }
this.nextSlide.removeClass('next');
this.prevSlide = this.nextSlide;
this.prevSlide.addClass('prev');
this.currentIndex++;
if (this.currentIndex >= this.slides.length) { this.currentIndex = 0 }
this.setNextSlide();
this.prevSlide.addClass('fade-out');
}
setNextSlide() {
this.nextSlide = this.container.find(`[data-slide="${this.currentIndex}"]`).first();
this.nextSlide.addClass('next');
}
}
$(document).ready(function() {
new Slideshow;
});
</script>
</body>
</html>