Commit Graph

54 Commits

Author SHA1 Message Date
Matt Walsh
a41b0da196 more generalized fix for mapclick enhanced timestamps close #203
moves changes made in 0b47cf79c1 to the mapclick processing for benefit of other mapclick calls
2026-04-09 12:18:56 -05:00
Matt Walsh
5dc214c6a5 filter station list upon receipt 2026-04-08 09:57:18 -05:00
Matt Walsh
6f97e3d2b9 add volume control slider and overhaul settings close #109 2025-11-10 12:54:54 -06:00
Matt Walsh
14b1891efd direct check of regex lookbehind capability 2025-09-11 08:47:16 -05:00
Matt Walsh
517c560ef6 don't parse metar for old ios versions 2025-09-03 21:46:48 -05:00
Matt Walsh
75eb81887f Clean up build around metar parser and locale 2025-08-04 12:03:18 -05:00
Eddy G
c3d863f89f Fixup mapclick.mjs 2025-07-13 22:45:04 -04:00
Eddy G
996baa78aa Add MapClick adapter and "fallback" logic when observations are stale
- Create utils/mapclick.mjs with centralized MapClick API functionality
- Refactor modules to use the new utility:
  - Current Weather
  - Latest Observations
  - Regional Forecast
- Add staleness checking utility for use by modules
2025-07-13 22:10:41 -04:00
Eddy G
4b34ffabcb Fix retry count display in doFetch 2025-07-13 19:45:52 -04:00
Eddy G
9c5ed0dcca Improve error handling to help prevent runtime errors
Adds input validation and safe property access to utility functions
to handle edge cases and invalid arguments gracefully
2025-07-07 12:43:32 -04:00
Eddy G
771ab37eaf Improve cache error handling in various edge cases
- Add null-safe operations and fallbacks for missing properties
- Simplify retry logic and enhance error logging
- Enable default retries and improve timeout handling
2025-07-07 12:43:32 -04:00
Eddy G
10baefc901 Merge remote-tracking branch 'upstream/main' into modernization-and-refactor 2025-07-02 09:08:07 -04:00
Eddy G
67dfd7ec08 Add "Sticky Kiosk" setting that stores "Kiosk" mode when activate
- This setting is important to allow creation ofa Home Screen app on iOS/iPadOS
- If kiosk mode is accidentally made sticky, it can be cleared by adding '&kiosk=false` to the URL
- Ctrl-K will now also exit kiosk mode

This adds a `stickyRead` parameter to settings, that means "read it if it's there, but don't write it"
2025-07-02 08:11:52 -04:00
Eddy G
b49433f5ff Add responsive scaling; improve scanlines and Mobile Safari support
- Replace CSS zoom with CSS transform scaling for better mobile compatibility
- Implement wrapper-based scaling approach that includes both content and navigation bar
- Replace Almanac layout with CSS Grid for better cross-browser layout
- Greatly improve scanline algorithm to handle a wide variety of displays
- Add setting to override automatic scanlines to user-specified scale factor
- Remove scanline scaling debug functions
- Refactor settings module: initialize settings upfront and improve change handler declarations
- Enhance scanline SCSS with repeating-linear-gradient for better performance
- Add app icon for iOS/iPadOS
- Add 'fullscreen' event listener
- De-bounce 'resize' event listener
- Add 'orientationchange' event listener
- Implement three resize scaling algorithms:
  - Baseline (when no scaling is needed, like on the index page)
  - Mobile scaling (except Mobile Safari kiosk mode)
  - Mobile Safari kiosk mode (using manual offset calculations)
  - Standard fullscreen/kiosk mode (using CSS centering)
2025-07-02 00:22:06 -04:00
Matt Walsh
9f9667c895 add single text scroll option #57 2025-06-28 09:20:36 -05:00
Matt Walsh
945c12e6c6 parse rss feed #57 2025-06-28 00:29:55 -05:00
Eddy G
517cafe40a Refactor data loading: move from inline JSON to client-side fetch
- Remove large JSON data injection from EJS templates
- Add client-side data-loader utility with cache-busting support
- Create server endpoints for JSON data with long-term caching
- Add graceful failure handling if core data fails to load
- Copy JSON data files to dist/data for static hosting
- Update app initialization to load data asynchronously
- Set serverAvailable flag for static builds in gulp task

This reduces HTML payload size and enables better caching strategies
for both server and static deployment modes.
2025-06-26 20:10:15 -04:00
Eddy G
7f7cb96231 Add STATIC environment variable for browser-only deployment mode
Implement STATIC=1 environment variable to enable browser-only deployment
without proxy server infrastructure. Uses WS4KP_SERVER_AVAILABLE flag to
distinguish between server-backed and static deployments for proper URL
rewriting and User-Agent header handling.

- Add STATIC env var to skip proxy route registration at startup
- Inject WS4KP_SERVER_AVAILABLE flag via EJS template based on STATIC mode
- Update fetch.mjs to conditionally send User-Agent headers based on server availability
- Update url-rewrite.mjs to skip proxy rewriting when server is unavailable
- Use renderIndex helper for consistent template data across dev/prod modes
- Improve music playlist logging

Benefits of integrated approach:
- Single environment variable controls both server and client behavior
- Flag injection happens once at render time, not on every request
- No runtime HTML string manipulation overhead
- Clean separation between server-backed and static deployment logic
- Same codebase supports both deployment modes without duplication

Static mode (STATIC=1): Direct API calls to external services, no caching
Server mode (default): Local proxy with caching and API request observability
2025-06-26 20:10:11 -04:00
Eddy G
c0e2eaf33a Refactor timing calculations and improve scroll performance
- Replace magic numbers with seconds-based timing constants
- Switch from scrollTo() to hardware-accelerated transform
- Add scroll caching to prevent repeated  DOM queries every scroll cycle
- Fix calculations to allow an arbitrarily-sized list of travel forecast cities
- Switch to safeJson() and safePromiseAll() for centralized error handling
2025-06-24 23:39:40 -04:00
Eddy G
8f34aa5139 Improve error handling
- Use safeJson() and safePromiseAll() for centralized error handling
- Enhance logging with structured debug flags
2025-06-24 23:10:52 -04:00
Eddy G
dd680c61b0 Enhance extended forecast parsing and error handling
- Add module for expired period filtering
- Switch from json() to safeJson() for centralized error handling
- Improve nighttime period handling to focus on full days
- Fix day/night temperature pairing logic
- Add debug logging
2025-06-24 23:07:47 -04:00
Eddy G
79de691eef Augment missing weather data from METAR when possible; use centralized error handling
- Add utility function to augment missing weather observation data from METAR
- Switch from json() to safeJson() for centralized error handling
- Data quality validation and age checks
- Add null/undefined value handling for wind direction calculations
2025-06-24 23:05:51 -04:00
Eddy G
0e0ea3c378 Add debug flag management system
- Default debug flags settable by query param or env variable
- Allows comma-separated list of debug flags
- Runtime modification (enable/disable/set) via console
- Support "all" flag for enabling/disabling everything
2025-06-24 22:53:25 -04:00
Eddy G
65944dc3b5 Add comprehensive responsive scanline scaling system with anti-aliasing
- Attempt pixel-perfect scanline rendering for scaled displays and zoom scenarios
- Implement dynamic scanline thickness calculation to prevent sub-pixel rendering issues
- Add enhanced kiosk detection via isKioskLike for better fullscreen optimization
- Optimize scanlines for specific kiosk resolutions (1024x768, 1023x767)
- Add responsive SCSS media queries for different display densities
- Include extensive debugging utilities for scanline troubleshooting
- Improve noSleep error handling with proper promise rejection handling
- Update to modern fullscreen API method names
- Add async/await error handling for fullscreen requests
- Trigger resize after fullscreen engagement to apply optimal scaling
2025-06-24 22:38:25 -04:00
Eddy G
7a07c67e84 Replace CORS proxy with complete server-side cache
- Replace cors/ directory and cors.mjs utility with comprehensive
    HTTP caching proxy in proxy/ directory
- Implement RFC-compliant caching with cache-control headers,
    conditional requests, and in-flight deduplication
- Centralized error handling with "safe" fetch utilities
- Add unified proxy handlers for weather.gov, SPC, radar, and mesonet APIs
- Include cache management endpoint and extensive diagnostic logging
- Migrate client-side URL rewriting from cors.mjs to url-rewrite.mjs
2025-06-24 20:45:43 -04:00
Matt Walsh
7167bb18fb allow one missing valueon current conditoins #94 #114 2025-06-19 22:50:09 -05:00
Matt Walsh
9a55a6ec39 fix setting boolean-style query string parsing close #106 2025-06-06 16:40:08 -05:00
Matt Walsh
7efd2e8db7 add scanlines 2025-05-29 17:03:50 -05:00
Matt Walsh
32aa43c5b1 update user-agent header, now allowed in some browsers 2025-05-29 14:18:49 -05:00
Matt Walsh
a83afa71cd code cleanup 2025-05-29 08:30:01 -05:00
Matt Walsh
5567fe37a6 add instrumentation 2025-05-24 09:22:23 -05:00
Matt Walsh
5946ee495a initial data and graph 2025-05-15 16:04:57 -05:00
Matt Walsh
0a388cdb83 clean up settings constructor 2025-04-08 10:40:36 -05:00
Matt Walsh
3a304d7c08 remove debugging refresh rate #74 2025-04-06 21:32:59 -05:00
Matt Walsh
0baa31a92c local forecast silent refresh 2025-04-02 20:52:33 -05:00
Matt Walsh
dc9a08bdc5 icon toggles 2025-03-22 15:10:06 +01:00
Matt Walsh
8f9be046ac fix metric conversion on regional forecast map 2025-03-08 13:39:36 -06:00
Matt Walsh
af53cca45e add si units close #52 2025-02-23 23:35:00 -06:00
Matt Walsh
e2d7a96971 linting cleanup 2024-10-21 19:21:05 -05:00
Matt Walsh
193d742aa3 add speed setting close #49 2024-07-29 23:12:47 -05:00
Matt Walsh
7be20490e8 remove localhost-specific protocol matching 2024-05-08 16:30:11 -05:00
Matt Walsh
63703d1fff settings persist when set by querystring 2024-04-19 21:14:28 -05:00
Matt Walsh
f4f3720793 fix stickiness for settings checkboxes close #39 2024-04-19 21:10:43 -05:00
Matt Walsh
6d4ec8b958 parse settings from querystring 2024-04-19 21:05:52 -05:00
Matt Walsh
240cc416b2 complete kiosk mode and permalink close #33 2024-04-12 16:16:01 -05:00
Matt Walsh
941bcacfad generate and parse querystring 2024-04-11 23:42:51 -05:00
Matt Walsh
bf8bd2ff46 add images and widescreen cleanup close #32 2023-12-19 23:43:37 -06:00
Matt Walsh
3743c45de6 additional eslint rules 2023-01-06 14:39:39 -06:00
Matt Walsh
3078ae6ba1 remove unused code 2022-12-14 08:31:48 -06:00
Matt Walsh
e5a18ea073 index.ejs cleanup 2022-12-12 14:47:53 -06:00