Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C22 - Sarah K Charday N #16

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

chardayneal
Copy link

No description provided.

skoch-neat and others added 21 commits December 2, 2024 13:36
…mperature increment and decrement logic into a single updateTemp function. Added functionality to handle invalid temperature parsing using NaN. Centralized temperature color and landscape updates into dedicated functions, updateTempColor and updateLandscape. Cleaned up event listener setup for temperature controls and ensured proper initialization on DOM load. Refined temperature thresholds and landscape text for more dynamic updates. Changed cold temp color from blue to teal to match Ada solution.
…in the corresponding input box.

Co-authored-by: Charday Neal <[email protected]>
…ging, and landscape updates. Renamed temperature-related constants for clarity regarding unit of measurement. Created logError function for improved error handling for invalid temperature values. Updated updateTemp function to handle NaN values for invalid temperatures. Fixed registerHandlers to ensure city name input validation before fetching weather. Minor code formatting cleanup for consistency.
… and updateSky function to dynamically display sky conditions. Refactored temperature category mapping with getTemperatureCategory to improve readability and maintainability. Improved error handling by introducing logError and displayErrorMessage functions for better user feedback and debugging. Modified updateTemp to ensure default handling of invalid temperature values. Introduced registerHandlers for cleaner event listener registration. Replaced repetitive DOM queries with getElement utility and centralized elements mapping. Enhanced initial state setup for default city and weather display on page load.
…me, simplifying the displayWeatherForCity function and the currentTempButton event handler.
…h CDN link found in README based on instructor feedback.
…ult value for sky visual, added functionality to updateSky for UI reset. Combined updateTempColor and updateLandscape to single function, updateUI. Renamed functions for added clarity. Removed duplicated logError calls.

Co-authored-by: Charday Neal [email protected]
…ns for better readability. Merged related constants into grouped objects DEFAULTS for default values and WEATHER_CONFIG for temperature schemes and sky views. Simplified temperature categories and their corresponding colors and landscapes. Updated functions to use the new constants.

Co-authored-by: Charday Neal [email protected]
Removed duplicate call to updateSky on page load. Reorganized functio…
…y introducing a state object. Updated functions to modify the state directly, such as updateState, which now handles changes to the city, sky, temperature, and landscape. Simplified the logic for updating the UI based on the state and applied weather data. Removed redundant logic and ensured the app is easier to maintain and extend.

Co-authored-by: Charday Neal [email protected]
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