Compare commits

..

10 Commits

Author SHA1 Message Date
Matt Walsh
5092076050 5.9.2 2022-12-19 15:24:12 -06:00
Matt Walsh
5d891fb38f switch to 2x image sizes 2022-12-19 15:21:38 -06:00
Matt Walsh
97e0fda709 key navigation 2022-12-19 11:48:59 -06:00
Matt Walsh
7cf9dd6466 almanac delivers data when disabled 2022-12-19 11:27:02 -06:00
Matt Walsh
a44bd866ed regional forecast icon blizzard 2022-12-19 11:17:30 -06:00
Matt Walsh
21ef7f476a auto refresh fix 2022-12-19 11:15:48 -06:00
Matt Walsh
c5b715d631 checkbox label colors 2022-12-19 10:17:12 -06:00
Matt Walsh
dfd9facc79 Merge branch 'main' of github.com:netbymatt/ws4kp 2022-12-19 10:14:37 -06:00
Matt Walsh
5b926a358e no hazards, blizzard 2022-12-19 10:14:33 -06:00
Matt Walsh
ba1fbd7088 capture dist 2022-12-14 21:49:07 -06:00
14 changed files with 459 additions and 147 deletions

2
dist/index.html vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

498
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "ws4kp", "name": "ws4kp",
"version": "5.9.1", "version": "5.9.2",
"description": "Welcome to the WeatherStar 4000+ project page!", "description": "Welcome to the WeatherStar 4000+ project page!",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@@ -187,7 +187,7 @@ const enterFullScreen = () => {
// change hover text and image // change hover text and image
const img = document.getElementById('ToggleFullScreen'); const img = document.getElementById('ToggleFullScreen');
img.src = 'images/nav/ic_fullscreen_exit_white_24dp_1x.png'; img.src = 'images/nav/ic_fullscreen_exit_white_24dp_2x.png';
img.title = 'Exit fullscreen'; img.title = 'Exit fullscreen';
}; };
@@ -211,7 +211,7 @@ const exitFullscreen = () => {
resize(); resize();
// change hover text and image // change hover text and image
const img = document.getElementById('ToggleFullScreen'); const img = document.getElementById('ToggleFullScreen');
img.src = 'images/nav/ic_fullscreen_white_24dp_1x.png'; img.src = 'images/nav/ic_fullscreen_white_24dp_2x.png';
img.title = 'Enter fullscreen'; img.title = 'Enter fullscreen';
}; };
@@ -290,37 +290,41 @@ const updateFullScreenNavigate = () => {
}; };
const documentKeydown = (e) => { const documentKeydown = (e) => {
const code = (e.keyCode || e.which); const { key } = e;
// 200ms repeat
if ((Date.now() - documentKeydown.lastButton ?? 0) < 200) return false;
documentKeydown.lastButton = Date.now();
if (document.fullscreenElement || document.activeElement === document.body) { if (document.fullscreenElement || document.activeElement === document.body) {
switch (code) { switch (key) {
case 32: // Space case ' ': // Space
// don't scroll
e.preventDefault();
btnNavigatePlayClick(); btnNavigatePlayClick();
return false; return false;
case 39: // Right Arrow case 'ArrowRight':
case 34: // Page Down case 'PageDown':
// don't scroll
e.preventDefault();
btnNavigateNextClick(); btnNavigateNextClick();
return false; return false;
case 37: // Left Arrow case 'ArrowLeft':
case 33: // Page Up case 'PageUp':
// don't scroll
e.preventDefault();
btnNavigatePreviousClick(); btnNavigatePreviousClick();
return false; return false;
case 36: // Home case 'ArrowUp': // Home
e.preventDefault();
btnNavigateMenuClick(); btnNavigateMenuClick();
return false; return false;
case 48: // Restart case '0': // "O" Restart
btnNavigateRefreshClick(); btnNavigateRefreshClick();
return false; return false;
case 70: // F case 'F':
case 'f':
btnFullScreenClick(); btnFullScreenClick();
return false; return false;
@@ -368,7 +372,6 @@ const btnGetGpsClick = async () => {
txtAddress.value = `${round2(latitude, 4)}, ${round2(longitude, 4)}`; txtAddress.value = `${round2(latitude, 4)}, ${round2(longitude, 4)}`;
doRedirectToGeometry({ y: latitude, x: longitude }, (point) => { doRedirectToGeometry({ y: latitude, x: longitude }, (point) => {
console.log(point);
const location = point.properties.relativeLocation.properties; const location = point.properties.relativeLocation.properties;
// Save the query // Save the query
const query = `${location.city}, ${location.state}`; const query = `${location.city}, ${location.state}`;

View File

@@ -22,7 +22,7 @@ class Almanac extends WeatherDisplay {
} }
async getData(_weatherParameters) { async getData(_weatherParameters) {
if (!super.getData(_weatherParameters)) return; const superResponse = super.getData(_weatherParameters);
const weatherParameters = _weatherParameters ?? this.weatherParameters; const weatherParameters = _weatherParameters ?? this.weatherParameters;
// get sun/moon data // get sun/moon data
@@ -33,11 +33,13 @@ class Almanac extends WeatherDisplay {
sun, sun,
moon, moon,
}; };
// update status
this.setStatus(STATUS.loaded);
// share data // share data
this.getDataCallback(); this.getDataCallback();
if (!superResponse) return;
// update status
this.setStatus(STATUS.loaded);
} }
calcSunMoonData(weatherParameters) { calcSunMoonData(weatherParameters) {

View File

@@ -51,7 +51,10 @@ class Hazards extends WeatherDisplay {
this.getDataCallback(); this.getDataCallback();
if (!superResult) return; if (!superResult) {
this.setStatus(STATUS.loaded);
return;
}
this.drawLongCanvas(); this.drawLongCanvas();
} }
@@ -72,6 +75,7 @@ class Hazards extends WeatherDisplay {
// no alerts, skip this display by setting timing to zero // no alerts, skip this display by setting timing to zero
if (lines.length === 0) { if (lines.length === 0) {
this.setStatus(STATUS.loaded);
this.timing.totalScreens = 0; this.timing.totalScreens = 0;
this.setStatus(STATUS.loaded); this.setStatus(STATUS.loaded);
return; return;
@@ -88,8 +92,8 @@ class Hazards extends WeatherDisplay {
for (let i = 0; i < pages; i += 1) this.timing.delay.push(timingStep); for (let i = 0; i < pages; i += 1) this.timing.delay.push(timingStep);
// add the final 3 second delay // add the final 3 second delay
this.timing.delay.push(150); this.timing.delay.push(150);
this.calcNavTiming();
this.setStatus(STATUS.loaded); this.setStatus(STATUS.loaded);
this.calcNavTiming();
} }
drawCanvas() { drawCanvas() {

View File

@@ -133,6 +133,7 @@ const getWeatherRegionalIconFromIconLink = (link, _isNightTime) => {
return addPath('Clear-Wind-1994.gif'); return addPath('Clear-Wind-1994.gif');
case 'blizzard': case 'blizzard':
case 'blizzard-n':
return addPath('Blowing Snow.gif'); return addPath('Blowing Snow.gif');
case 'cold': case 'cold':
@@ -268,6 +269,7 @@ const getWeatherIconFromIconLink = (link, _isNightTime) => {
return addPath('CC_Windy.gif'); return addPath('CC_Windy.gif');
case 'blizzard': case 'blizzard':
case 'blizzard-n':
return addPath('Blowing-Snow.gif'); return addPath('Blowing-Snow.gif');
default: default:

View File

@@ -175,6 +175,7 @@ const navTo = (direction) => {
if (!firstDisplay) return; if (!firstDisplay) return;
firstDisplay.navNext(msg.command.firstFrame); firstDisplay.navNext(msg.command.firstFrame);
firstDisplay.showCanvas();
return; return;
} }
if (direction === msg.command.nextFrame) currentDisplay().navNext(); if (direction === msg.command.nextFrame) currentDisplay().navNext();
@@ -218,11 +219,11 @@ const setPlaying = (newValue) => {
if (playing) { if (playing) {
noSleep(true); noSleep(true);
playButton.title = 'Pause'; playButton.title = 'Pause';
playButton.src = 'images/nav/ic_pause_white_24dp_1x.png'; playButton.src = 'images/nav/ic_pause_white_24dp_2x.png';
} else { } else {
noSleep(false); noSleep(false);
playButton.title = 'Play'; playButton.title = 'Play';
playButton.src = 'images/nav/ic_play_arrow_white_24dp_1x.png'; playButton.src = 'images/nav/ic_play_arrow_white_24dp_2x.png';
} }
// if we're playing and on the progress screen jump to the next screen // if we're playing and on the progress screen jump to the next screen
if (!progress) return; if (!progress) return;
@@ -377,7 +378,7 @@ const stopAutoRefreshTimer = () => {
const refreshCheck = () => { const refreshCheck = () => {
// Time has elapsed. // Time has elapsed.
if (AutoRefreshCountMs >= AUTO_REFRESH_TIME_MS) { if (AutoRefreshCountMs >= AUTO_REFRESH_TIME_MS && isPlaying()) {
loadTwcData(); loadTwcData();
return true; return true;
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -213,8 +213,7 @@ button {
text-align: right; text-align: right;
} }
#imgPause1x, #imgPause1x {
#imgPause2x {
visibility: hidden; visibility: hidden;
position: absolute; position: absolute;
} }
@@ -318,6 +317,10 @@ button {
margin-bottom: 15px; margin-bottom: 15px;
@include u.status-colors(); @include u.status-colors();
.press-here {
color: white;
}
@media (prefers-color-scheme: light) { @media (prefers-color-scheme: light) {
.loading, .loading,
@@ -326,7 +329,7 @@ button {
} }
.press-here { .press-here {
color: hsl(120, 100%, 30%); color: black;
cursor: pointer; cursor: pointer;
} }
@@ -343,10 +346,6 @@ button {
} }
} }
.press-here {
color: black;
}
label { label {
display: block; display: block;
max-width: 300px; max-width: 300px;
@@ -363,7 +362,7 @@ button {
} }
#divTwcBottom img { #divTwcBottom img {
zoom: 150%; zoom: 75%;
} }
#divTwc:fullscreen { #divTwc:fullscreen {

View File

@@ -68,11 +68,6 @@
<div id="divLat"></div> <div id="divLat"></div>
<div id="divLng"></div> <div id="divLng"></div>
</div> </div>
<br />
<img id="imgPause1x" src="images/nav/ic_pause_white_24dp_1x.png" />
<img id="imgPause2x" src="images/nav/ic_pause_white_24dp_2x.png" />
<div id="version" style="display:none"> <div id="version" style="display:none">
<%- version %> <%- version %>
</div> </div>
@@ -125,16 +120,16 @@
</div> </div>
<div id="divTwcBottom"> <div id="divTwcBottom">
<div id="divTwcBottomLeft"> <div id="divTwcBottomLeft">
<img id="NavigateMenu" class="navButton" src="images/nav/ic_menu_white_24dp_1x.png" title="Menu" /> <img id="NavigateMenu" class="navButton" src="images/nav/ic_menu_white_24dp_2x.png" title="Menu" />
<img id="NavigatePrevious" class="navButton" src="images/nav/ic_skip_previous_white_24dp_1x.png" title="Previous" /> <img id="NavigatePrevious" class="navButton" src="images/nav/ic_skip_previous_white_24dp_2x.png" title="Previous" />
<img id="NavigateNext" class="navButton" src="images/nav/ic_skip_next_white_24dp_1x.png" title="Next" /> <img id="NavigateNext" class="navButton" src="images/nav/ic_skip_next_white_24dp_2x.png" title="Next" />
<img id="NavigatePlay" class="navButton" src="images/nav/ic_play_arrow_white_24dp_1x.png" title="Play" /> <img id="NavigatePlay" class="navButton" src="images/nav/ic_play_arrow_white_24dp_2x.png" title="Play" />
</div> </div>
<div id="divTwcBottomMiddle"> <div id="divTwcBottomMiddle">
<img id="NavigateRefresh" class="navButton" src="images/nav/ic_refresh_white_24dp_1x.png" title="Refresh" /> <img id="NavigateRefresh" class="navButton" src="images/nav/ic_refresh_white_24dp_2x.png" title="Refresh" />
</div> </div>
<div id="divTwcBottomRight"> <div id="divTwcBottomRight">
<img id="ToggleFullScreen" class="navButton" src="images/nav/ic_fullscreen_white_24dp_1x.png" title="Enter Fullscreen" /> <img id="ToggleFullScreen" class="navButton" src="images/nav/ic_fullscreen_white_24dp_2x.png" title="Enter Fullscreen" />
</div> </div>
</div> </div>
</div> </div>