Compare commits

...

6 Commits

Author SHA1 Message Date
Matt Walsh
f17f69f60e 6.1.9 2025-09-09 22:07:51 -05:00
Matt Walsh
fa16095355 filter for actual alerts (not test) close #141 2025-09-09 22:07:42 -05:00
Matt Walsh
cc3dbeb043 6.1.8 2025-09-09 21:35:51 -05:00
Matt Walsh
8ee1e954eb better background and wide screen for hazard displays 2025-09-09 21:35:31 -05:00
Matt Walsh
bfc4bddfef Add quick start to readme 2025-09-09 20:54:13 -05:00
Matt Walsh
567325e3c5 update dependencies 2025-09-09 20:47:40 -05:00
13 changed files with 638 additions and 609 deletions

View File

@@ -32,6 +32,18 @@ From a learning standpoint, this codebase make use of a lot of different methods
* Hand written CSS made easier to mange with SASS
* A linting library to keep code style consistent
## Quck Start
Ensure you have Node installed.
```bash
git clone https://github.com/netbymatt/ws4kp.git
cd ws4kp
npm install
npm start
```
Open your browser and navigate to https://localhost:8080
## Does WeatherStar 4000+ work outside of the USA?
This project is tightly coupled to [NOAA's Weather API](https://www.weather.gov/documentation/services-web-api), which is exclusive to the United States. Using NOAA's Weather API is a crucial requirement to provide an authentic WeatherStar 4000+ experience.
@@ -57,14 +69,7 @@ WeatherStar 4000+ supports two deployment modes:
* Browser-based caching
* Used by: static file hosting and default `Dockerfile`
## Run Your WeatherStar
Ensure you have Node installed. Clone the repository:
```bash
git clone https://github.com/netbymatt/ws4kp.git
cd ws4kp
npm install
```
## Other methods to run Ws4kp
### Development Mode (individual JS files, easier debugging)
```bash

1169
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "ws4kp",
"version": "6.1.7",
"version": "6.1.9",
"description": "Welcome to the WeatherStar 4000+ project page!",
"main": "index.mjs",
"type": "module",

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -97,6 +97,12 @@ const drawScreen = async () => {
if (elem.parentElement.id === 'progress-html') return;
thisScreen?.classes?.forEach((cls) => elem.classList.add(cls));
});
// special case for red background on hazard scroll
const mainScrollBg = document.getElementById('scroll-bg');
mainScrollBg.className = '';
if (thisScreen?.classes?.includes('hazard')) {
mainScrollBg.classList.add('hazard');
}
if (typeof thisScreen === 'string') {
// only a string

View File

@@ -71,6 +71,7 @@ class Hazards extends WeatherDisplay {
// get the forecast using centralized safe handling
const url = new URL('https://api.weather.gov/alerts/active');
url.searchParams.append('point', `${this.weatherParameters.latitude},${this.weatherParameters.longitude}`);
url.searchParams.append('status', 'actual');
const alerts = await safeJson(url, { retryCount: 3, stillWaiting: () => this.stillWaiting() });
if (!alerts) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,9 @@
@use 'shared/_colors' as c;
@use 'shared/_utils' as u;
@use 'shared/_colors'as c;
@use 'shared/_utils'as u;
#hazards-html.weather-display {
background-image: url('../images/backgrounds/7.png');
}
.weather-display .main.hazards {
&.main {
@@ -7,6 +11,7 @@
height: 480px;
background-color: rgb(112, 35, 35);
.hazard-lines {
min-height: 400px;
padding-top: 10px;
@@ -26,3 +31,7 @@
}
}
}
.wide.hazards #container {
background: url(../images/backgrounds/7-wide.png);
}

View File

@@ -1,5 +1,5 @@
@use 'shared/_utils' as u;
@use 'shared/_colors' as c;
@use 'shared/_utils'as u;
@use 'shared/_colors'as c;
@font-face {
font-family: "Star4000";
@@ -161,6 +161,7 @@ body {
#divTwcMain {
width: 640px;
height: 480px;
position: relative;
.wide & {
width: 854px;
@@ -813,4 +814,4 @@ body.kiosk #loading .instructions {
>*:not(#divTwc) {
display: none !important;
}
}
}

View File

@@ -1,5 +1,5 @@
@use 'shared/_colors' as c;
@use 'shared/_utils' as u;
@use 'shared/_colors'as c;
@use 'shared/_utils'as u;
.weather-display {
width: 640px;
@@ -116,9 +116,11 @@
.scroll {
@include u.text-shadow(3px, 1.5px);
width: 640px;
height: 70px;
height: 77px;
overflow: hidden;
margin-top: 3px;
position: relative;
z-index: 1;
&.hazard {
background-color: rgb(112, 35, 35);
@@ -159,3 +161,18 @@
}
}
#scroll-bg {
position: absolute;
bottom: 0px;
height: 77px;
width: 640px;
&.hazard {
background-color: rgb(112, 35, 35);
}
}
.wide #scroll-bg {
width: 854px;
}

View File

@@ -134,6 +134,7 @@
<%- include('partials/hazards.ejs') %>
</div>
</div>
<div id="scroll-bg"></div>
</div>
<div id="divTwcBottom">
<div id="divTwcBottomLeft">