Commit Graph

390 Commits

Author SHA1 Message Date
Matt Walsh
190e50e2f3 add debugging information to forecast info box 2025-08-11 22:15:16 -05:00
Matt Walsh
2ab737d5a5 update dependencies 2025-08-10 20:56:40 -05:00
Matt Walsh
c8a25e5d9a Integrate no-data icon close #94 #128 2025-08-10 20:05:07 -05:00
Matt Walsh
4bf725413b fix star4000 large font 2025-08-05 22:50:40 -05:00
Matt Walsh
75eb81887f Clean up build around metar parser and locale 2025-08-04 12:03:18 -05:00
Matt Walsh
8a22e23d5a Merge remote-tracking branch 'eddyg/station-name-improvements' into code-refactor 2025-08-03 22:10:17 -05:00
Matt Walsh
d85a5ed3b1 add strings to permalink structure close #129 2025-07-30 22:29:20 -05:00
Jacob Roeland
73cbc0aa81 Add "No Data" icon
Supports #94
2025-07-25 21:23:23 -04:00
Matt Walsh
7d50ce28bd Allow for station data overrides #125 2025-07-15 22:00:33 -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
e81c957416 Remove legacy mapclick icon references
- https://api.weather.gov/icons should be the only icons used by api.weather.gov
2025-07-13 19:45:52 -04:00
Eddy G
4b34ffabcb Fix retry count display in doFetch 2025-07-13 19:45:52 -04:00
Matt Walsh
5c7a6ab1a4 fix for rss feed encoding types close #124 2025-07-11 22:36:47 -05:00
Eddy G
804d9e9e33 Centralize icon URL parsing; improve icon error handling
- Move common icon parsing logic into module
- Return a "real" icon value during error handling to avoid downstream
  consumers from trying to use an icon named "false"
- Use named regex to parse icon URLs based on API specification
2025-07-07 12:43:32 -04:00
Eddy G
3e8135a36a Improve settings initialization timing with deferred DOM updates
Defer DOM updates to ensure settings are properly applied
even when read from localStorage before the DOM is available.
2025-07-07 12:43:32 -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
2a975d4d6d Fix auto-play logic for sticky kiosk mode
The previous logic only checked URL parameters for kiosk mode,
but sticky kiosk can enable kiosk mode from localStorage without
URL parameters. Now checks actual kiosk setting value.

Fix typo in scan line settings name.
2025-07-04 14:55:57 -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
2761f76117 Build CSS changes 2025-07-02 08:11:52 -04:00
Eddy G
13621b6f46 Stop Mobile Safari from trying to auto-fill the location box
This change prevents the "No items to show" popup that obscures the first
couple suggested matches.
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
Eddy G
cc9e613ba7 Merge remote-tracking branch 'upstream/main' into modernization-and-refactor 2025-06-29 22:42:03 -04:00
Matt Walsh
9f9667c895 add single text scroll option #57 2025-06-28 09:20:36 -05:00
Matt Walsh
fda44e95fc rss feeds scroll, needs additional testing #57 2025-06-28 00:59:40 -05:00
Matt Walsh
945c12e6c6 parse rss feed #57 2025-06-28 00:29:55 -05:00
Matt Walsh
0fde88cd8f restructure current weather scroll to allow add/remove of rss feed #57 2025-06-28 00:29:47 -05:00
Matt Walsh
11eba84cdb fix for calm/0mph wind close #121 2025-06-27 22:29:56 -05:00
Matt Walsh
3d0178faa1 radar scrolling fix for ios 2025-06-27 22:16:51 -05:00
Eddy G
b1c4e6d850 Merge remote-tracking branch 'upstream/main' into modernization-and-refactor 2025-06-27 18:21:32 -04:00
Matt Walsh
8a2907e02c fix display of null wind speed 2025-06-27 15:35:15 -05:00
Matt Walsh
b870ce1c01 store already processed radar images for reuse on silent reload 2025-06-27 15:29:20 -05:00
Eddy G
90c1ab92b4 Merge upstream/main: integrate radar worker removal and improvements
- Remove radar-worker.mjs and integrate functionality into radar-processor.mjs
- Update package.json and gulpfile.mjs with upstream changes
2025-06-27 11:05:32 -04:00
Matt Walsh
6d090cb1c7 streamline radar tile layout calculation #74 2025-06-26 21:23:44 -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
c8b520b752 Build CSS changes 2025-06-24 23:54:23 -04:00
Eddy G
ebface1749 Add comment about not needing to use safeJson()
- Fix indentation in media.mjs
2025-06-24 23:53:44 -04:00
Eddy G
137c2f6d08 Don't set to failed if not enabled
- Allow any falsey value to indicate failure
2025-06-24 23:42:22 -04:00
Eddy G
bec80a1ebe Refactor alert/hazard system with timing and display improvements
- 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
- Switch to safeJson() for centralized error handling across alert modules
- Horizontal alert scroll now goes edge-to-edge
- Integrate global speed settings into horizontal scroll timing
- Improve error handling flow with better fallback behavior for missing data
- Remvoe unused getCurrentData() function in hazards.mjs
- Move background color from scrolling element to container to avoid
    showing the underlying content when scrolling with trasnform
2025-06-24 23:41:44 -04:00
Eddy G
e34137e430 Refactor timing calculations and improve scroll performance
- Replace magic numbers with seconds-based timing constants
- Switch from scrollTo() to hardware-accelerated transform for smooth scrolling
- Add scroll caching to prevent repeated DOM queries every scroll cycle
- Fix calculations to support flexible hourly forecast lengths
    (i.e. in the future, could offer every other hour)
- Switch to safeJson() for centralized error handling
2025-06-24 23:40:07 -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
975bccdac5 Switch from json() to safeJson() for centralized error handling
- Prevent infinitie recursion by ensuring the same display is not
    selected in loadDisplay()
2025-06-24 23:37:47 -04:00
Eddy G
8ead95c041 Improve error handling and API efficiency
- Switch to safe*() methods for centralized error handling
- Add error handling and validation
- Optimize radar API usage by only fetching yesterday's data when needed
- Use centralized URL rewriting for caching proxy support
- Add debug logging throughout radar processing pipeline
- Improve canvas context validation and error recovery
- Handle worker errors gracefully by setting totalScreens = 0 to skip in animation
- Remove unused OVERRIDES parameter passing to workers
2025-06-24 23:35:41 -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
e472b99b44 Improve SPC Outlook data fetching and error handling
- Switch to safeJson() and safePromiseAll() for centralized error handling
- Only set failed state if enabled
2025-06-24 23:09:18 -04:00
Eddy G
09a21e6f5a Add content-aware transition timing; remove expired forecasts
- DOM-based measurement system for accurate forecast lines
- Replace fixed-timing with dynamic timing based on actual forecast lines
- Filter out expired forecasts
- Improve error handling and only set failed state if enabled
- Debug logging for timing calculations and content measurement
- Switch from json() to safeJson() for centralized error handling
2025-06-24 23:08:25 -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