Skip to content

Conversation

@simpleC0de
Copy link

Description

This PR adds a modern, production-ready admin UI for the weather control system in esx_weather. The new interface replaces the basic text-based menu with a sleek, animated dashboard that provides real-time weather management across different zones.


Motivation

The existing weather system lacked a user-friendly interface for admins to manage weather conditions. This update provides:

  • Better UX: Visual weather cards with icons and animations
  • Zone Management: Control weather independently for different map areas
  • Modern Design: Clean, responsive interface that matches 2025 standards
  • Developer Experience: Modular codebase following DRY principles

Implementation Details

Architecture:

  • Modular JavaScript split into 8 focused modules (State, Controllers, Services, Utilities)
  • XSS protection with input sanitization and validation
  • Memory leak prevention using AbortController for event cleanup
  • Event delegation pattern for optimal performance

Key Features:

  • Real-time weather updates via NUI callbacks
  • Animated transitions using Lucide icons
  • Custom dropdown components with smooth animations
  • Responsive design for different screen sizes

Security:

  • All user inputs are validated and sanitized
  • Server-side weather type verification
  • Safe DOM manipulation (no innerHTML with user data)

Usage Example

-- Admins can open the weather panel with a command or keybind
-- The UI automatically loads current weather data from all zones

-- Apply weather changes
-- Select zone -> Pick weather type -> Click "Apply"
-- Changes sync instantly across all clients in that zone

Visual Preview:

  • Gradient weather cards based on current conditions
  • Live zone indicators showing which zone you're currently in
  • Smooth dropdown animations for weather selection

PR Checklist

  • My commit messages and PR title follow the Conventional Commits standard.
  • My changes have been tested locally and function as expected.
  • My PR does not introduce any breaking changes.
  • I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.

@Kr3mu Kr3mu merged commit cae61e5 into esx-framework:esx_weather Oct 26, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants