mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-17 09:09:30 -07:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7505e3e6f | ||
|
|
705fa9f582 | ||
|
|
5edf5cc947 | ||
|
|
d0382e0de1 | ||
|
|
69d14236f1 | ||
|
|
64fb06d7b4 |
2
dist/index.html
vendored
2
dist/index.html
vendored
File diff suppressed because one or more lines are too long
2
dist/resources/ws.min.css
vendored
2
dist/resources/ws.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/resources/ws.min.js
vendored
2
dist/resources/ws.min.js
vendored
File diff suppressed because one or more lines are too long
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "5.3.0",
|
"version": "5.4.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "5.3.0",
|
"version": "5.4.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"eslint": "^8.21.0",
|
"eslint": "^8.21.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "5.3.0",
|
"version": "5.4.0",
|
||||||
"description": "Welcome to the WeatherStar 4000+ project page!",
|
"description": "Welcome to the WeatherStar 4000+ project page!",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
BIN
server/images/nav/ic_gps_fixed_white_18dp_1x.png
Normal file
BIN
server/images/nav/ic_gps_fixed_white_18dp_1x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
BIN
server/images/nav/ic_gps_fixed_white_18dp_2x.png
Normal file
BIN
server/images/nav/ic_gps_fixed_white_18dp_2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
BIN
server/images/nav/ic_gps_fixed_white_24dp_1x.png
Normal file
BIN
server/images/nav/ic_gps_fixed_white_24dp_1x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
BIN
server/images/nav/ic_gps_fixed_whte_24dp_2x.png
Normal file
BIN
server/images/nav/ic_gps_fixed_whte_24dp_2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
@@ -23,7 +23,7 @@ const categories = [
|
|||||||
'Airport', 'Ferry', 'Marina', 'Pier', 'Port', 'Resort', // POI/Travel
|
'Airport', 'Ferry', 'Marina', 'Pier', 'Port', 'Resort', // POI/Travel
|
||||||
'Postal', 'Populated Place',
|
'Postal', 'Populated Place',
|
||||||
];
|
];
|
||||||
const cats = categories.join(',');
|
const category = categories.join(',');
|
||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
document.getElementById('txtAddress').addEventListener('focus', (e) => {
|
document.getElementById('txtAddress').addEventListener('focus', (e) => {
|
||||||
@@ -54,7 +54,7 @@ const init = () => {
|
|||||||
params: {
|
params: {
|
||||||
f: 'json',
|
f: 'json',
|
||||||
countryCode: 'USA', // 'USA,PRI,VIR,GUM,ASM',
|
countryCode: 'USA', // 'USA,PRI,VIR,GUM,ASM',
|
||||||
category: cats,
|
category,
|
||||||
maxSuggestions: 10,
|
maxSuggestions: 10,
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
|||||||
@@ -55,7 +55,9 @@ class CurrentWeather extends WeatherDisplay {
|
|||||||
// test for data received
|
// test for data received
|
||||||
if (!observations) {
|
if (!observations) {
|
||||||
console.error('All current weather stations exhausted');
|
console.error('All current weather stations exhausted');
|
||||||
this.setStatus(STATUS.failed);
|
if (this.enabled) this.setStatus(STATUS.failed);
|
||||||
|
// send failed to subscribers
|
||||||
|
this.getDataCallback(undefined);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// preload the icon
|
// preload the icon
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ class HourlyGraph extends WeatherDisplay {
|
|||||||
if (!super.getData()) return;
|
if (!super.getData()) return;
|
||||||
|
|
||||||
const data = await getHourlyData();
|
const data = await getHourlyData();
|
||||||
|
if (data === undefined) {
|
||||||
|
this.setStatus(STATUS.failed);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// get interesting data
|
// get interesting data
|
||||||
const temperature = data.map((d) => d.temperature);
|
const temperature = data.map((d) => d.temperature);
|
||||||
@@ -42,18 +46,20 @@ class HourlyGraph extends WeatherDisplay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
drawCanvas() {
|
drawCanvas() {
|
||||||
if (!this.canvas) this.canvas = this.elem.querySelector('.chart canvas');
|
if (!this.image) this.image = this.elem.querySelector('.chart img');
|
||||||
|
|
||||||
// get available space
|
// get available space
|
||||||
const boundingRect = this.canvas.getBoundingClientRect();
|
const availableWidth = 532;
|
||||||
const availableWidth = boundingRect.width;
|
const availableHeight = 285;
|
||||||
const availableHeight = boundingRect.height;
|
|
||||||
|
|
||||||
this.canvas.width = availableWidth;
|
this.image.width = availableWidth;
|
||||||
this.canvas.height = availableHeight;
|
this.image.height = availableHeight;
|
||||||
|
|
||||||
// get context
|
// get context
|
||||||
const ctx = this.canvas.getContext('2d');
|
const canvas = document.createElement('canvas');
|
||||||
|
canvas.width = availableWidth;
|
||||||
|
canvas.height = availableHeight;
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
ctx.imageSmoothingEnabled = false;
|
ctx.imageSmoothingEnabled = false;
|
||||||
|
|
||||||
// calculate time scale
|
// calculate time scale
|
||||||
@@ -93,9 +99,14 @@ class HourlyGraph extends WeatherDisplay {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// temperature axis labels
|
// temperature axis labels
|
||||||
this.elem.querySelector('.y-axis .l-1').innerHTML = maxTemp;
|
// limited to 3 characters, sacraficing degree character
|
||||||
this.elem.querySelector('.y-axis .l-2').innerHTML = midTemp;
|
const degree = String.fromCharCode(176);
|
||||||
this.elem.querySelector('.y-axis .l-3').innerHTML = minTemp;
|
this.elem.querySelector('.y-axis .l-1').innerHTML = (maxTemp + degree).substring(0, 3);
|
||||||
|
this.elem.querySelector('.y-axis .l-2').innerHTML = (midTemp + degree).substring(0, 3);
|
||||||
|
this.elem.querySelector('.y-axis .l-3').innerHTML = (minTemp + degree).substring(0, 3);
|
||||||
|
|
||||||
|
// set the image source
|
||||||
|
this.image.src = canvas.toDataURL();
|
||||||
|
|
||||||
super.drawCanvas();
|
super.drawCanvas();
|
||||||
this.finishDraw();
|
this.finishDraw();
|
||||||
|
|||||||
@@ -37,12 +37,13 @@ class Hourly extends WeatherDisplay {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Get hourly forecast failed');
|
console.error('Get hourly forecast failed');
|
||||||
console.error(e.status, e.responseJSON);
|
console.error(e.status, e.responseJSON);
|
||||||
this.setStatus(STATUS.failed);
|
if (this.enabled) this.setStatus(STATUS.failed);
|
||||||
|
// return undefined to other subscribers
|
||||||
|
this.getDataCallback(undefined);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.data = await Hourly.parseForecast(forecast.properties);
|
this.data = await Hourly.parseForecast(forecast.properties);
|
||||||
|
|
||||||
this.getDataCallback();
|
this.getDataCallback();
|
||||||
if (!superResponse) return;
|
if (!superResponse) return;
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ let AutoRefreshCountMs = 0;
|
|||||||
const init = async () => {
|
const init = async () => {
|
||||||
// set up resize handler
|
// set up resize handler
|
||||||
window.addEventListener('resize', resize);
|
window.addEventListener('resize', resize);
|
||||||
|
resize();
|
||||||
|
|
||||||
// auto refresh
|
// auto refresh
|
||||||
const TwcAutoRefresh = localStorage.getItem('TwcAutoRefresh');
|
const TwcAutoRefresh = localStorage.getItem('TwcAutoRefresh');
|
||||||
|
|||||||
@@ -367,8 +367,6 @@ class Radar extends WeatherDisplay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RadarContext.putImageData(RadarImageData, 0, 0);
|
RadarContext.putImageData(RadarImageData, 0, 0);
|
||||||
|
|
||||||
// MapContext.drawImage(RadarContext.canvas, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static mergeDopplerRadarImage(mapContext, radarContext) {
|
static mergeDopplerRadarImage(mapContext, radarContext) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -89,7 +89,7 @@
|
|||||||
top: 0px;
|
top: 0px;
|
||||||
left: 50px;
|
left: 50px;
|
||||||
|
|
||||||
canvas {
|
img {
|
||||||
width: 532px;
|
width: 532px;
|
||||||
height: 285px;
|
height: 285px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,17 @@
|
|||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: "Star4000";
|
font-family: "Star4000";
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
background-color: #000000;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
color: lightblue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input,
|
input,
|
||||||
@@ -20,12 +31,42 @@ button {
|
|||||||
#txtAddress {
|
#txtAddress {
|
||||||
width: 490px;
|
width: 490px;
|
||||||
font-size: 16pt;
|
font-size: 16pt;
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
background-color: #000000;
|
||||||
|
color: white;
|
||||||
|
border: 1px solid darkgray;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#btnGetGps,
|
#btnGetGps,
|
||||||
#btnGetLatLng,
|
#btnGetLatLng,
|
||||||
#btnClearQuery {
|
#btnClearQuery {
|
||||||
font-size: 16pt;
|
font-size: 16pt;
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
background-color: #000000;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
border: 1px solid darkgray;
|
||||||
|
}
|
||||||
|
|
||||||
|
#btnGetGps img {
|
||||||
|
|
||||||
|
&.dark {
|
||||||
|
display: none;
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.light {
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete-suggestions {
|
.autocomplete-suggestions {
|
||||||
@@ -90,6 +131,11 @@ button {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
background-color: #000000;
|
background-color: #000000;
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
background-color: rgb(48, 48, 48);
|
||||||
|
}
|
||||||
|
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
<div id="divQuery">
|
<div id="divQuery">
|
||||||
<form id="frmGetLatLng">
|
<form id="frmGetLatLng">
|
||||||
<input id="txtAddress" type="text" value="" placeholder="Zip or City, State" /><button id="btnGetGps" type="button" title="Get GPS Location"><img id="imgGetGps" src="images/nav/ic_gps_fixed_black_18dp_1x.png" /></button>
|
<input id="txtAddress" type="text" value="" placeholder="Zip or City, State" /><button id="btnGetGps" type="button" title="Get GPS Location"><img src="images/nav/ic_gps_fixed_black_18dp_1x.png" class="light"/><img src="images/nav/ic_gps_fixed_white_18dp_1x.png" class="dark"/></button>
|
||||||
<input id="btnGetLatLng" type="submit" value="GO" />
|
<input id="btnGetLatLng" type="submit" value="GO" />
|
||||||
<input id="btnClearQuery" type="reset" value="Reset" />
|
<input id="btnClearQuery" type="reset" value="Reset" />
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<div class="label l-3">55</div>
|
<div class="label l-3">55</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="chart">
|
<div class="chart">
|
||||||
<canvas id="chart-area"></canvas>
|
<img id="chart-area"></img>
|
||||||
</div>
|
</div>
|
||||||
<div class="x-axis">
|
<div class="x-axis">
|
||||||
<div class="label l-1">12a</div>
|
<div class="label l-1">12a</div>
|
||||||
|
|||||||
@@ -1,43 +1,43 @@
|
|||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="logo"><img src="images/Logo3.png" /></div>
|
<div class="logo"><img src="images/Logo3.png" /></div>
|
||||||
<div class="title dual">
|
<div class="title dual">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
Local
|
Local
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
Radar
|
Radar
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div class="precip">
|
<div class="precip">
|
||||||
<div class="precip-header">PRECIP</div>
|
<div class="precip-header">PRECIP</div>
|
||||||
<div class="scale">
|
<div class="scale">
|
||||||
<div class="text">Light</div>
|
<div class="text">Light</div>
|
||||||
<div class="scale-table">
|
<div class="scale-table">
|
||||||
<div class="box box-1"></div>
|
<div class="box box-1"></div>
|
||||||
<div class="box box-2"></div>
|
<div class="box box-2"></div>
|
||||||
<div class="box box-3"></div>
|
<div class="box box-3"></div>
|
||||||
<div class="box box-4"></div>
|
<div class="box box-4"></div>
|
||||||
<div class="box box-5"></div>
|
<div class="box box-5"></div>
|
||||||
<div class="box box-6"></div>
|
<div class="box box-6"></div>
|
||||||
<div class="box box-7"></div>
|
<div class="box box-7"></div>
|
||||||
<div class="box box-7"></div>
|
<div class="box box-7"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text">Heavy</div>
|
<div class="text">Heavy</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="time"></div>
|
<div class="time"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main radar">
|
<div class="main radar">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="scroll-area">
|
<div class="scroll-area">
|
||||||
<div class="frame template">
|
<div class="frame template">
|
||||||
<div class="map">
|
<div class="map">
|
||||||
<img src="images/4000RadarMap2.jpg" />
|
<img src="images/4000RadarMap2.jpg" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user