Skip to content

LaxmisanjayBadanikai/CloudCtrl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

☁️ cloudCtrl - Award Winning Weather App

A modern, responsive weather application with real-time data, dark/light theme, and beautiful animations

HTML5 CSS3 JavaScript WeatherAPI Font Awesome MIT License

πŸ“– Overview

cloudCtrl is a modern, feature-rich weather application that provides real-time weather information with a stunning user interface. Built with vanilla JavaScript, it delivers accurate weather data, 24-hour forecasts, 7-day predictions, and air quality information with smooth animations and a responsive design.

🌟 Key Features

Feature Description
🌀️ Current Weather Real-time temperature, conditions, feels-like temperature
πŸ“Š Weather Details Visibility, humidity, wind speed, pressure, UV index, precipitation
⏰ 24-Hour Forecast Hourly weather predictions with icons and conditions
πŸ“… 7-Day Forecast Daily forecasts with high/low temperatures
🌍 Air Quality Real-time AQI with PM2.5, PM10, O₃, NOβ‚‚ data
πŸ“ Location Search Search any city worldwide with autocomplete suggestions
πŸ“± Current Location GPS-based weather for your exact location
πŸŒ— Dark/Light Theme Beautiful dark and light modes with smooth transitions
🎨 Weather Animations Dynamic backgrounds for sunny, rainy, snowy, stormy weather
πŸ”„ Auto-Refresh One-click refresh for latest data
πŸ“± Responsive Design Optimized for all devices (mobile, tablet, desktop)

πŸš€ Live Demo

View Live Demo (Replace with your actual URL)


πŸ› οΈ Technology Stack

Frontend

  • HTML5: Semantic markup structure
  • CSS3: Custom styling with CSS variables for theming
  • JavaScript (ES6+): Application logic, API integration, DOM manipulation
  • Font Awesome 6: Professional iconography
  • Google Fonts (Inter): Modern typography

APIs

  • WeatherAPI.com: Real-time weather, forecasts, and air quality data

Features

  • localStorage: Theme preference persistence
  • Geolocation API: User location detection
  • Service Worker: Offline functionality support (optional)

πŸ“‚ Project Structure


cloudCtrl/
β”œβ”€β”€ index.html              # Main HTML structure
β”œβ”€β”€ styles.css              # Complete styling & theming
β”œβ”€β”€ script.js               # Application logic & API integration
β”œβ”€β”€ LICENSE                 # MIT License
└── README.md               # Project documentation


🚦 Getting Started

Prerequisites

  • Any modern web browser (Chrome, Firefox, Edge, Safari)
  • WeatherAPI.com API Key (Get one here)

Installation

  1. Clone the repository
git clone https://github.com/yourusername/cloudCtrl.git
cd cloudCtrl
  1. Get your API Key
  1. Configure the API Key
  • Open script.js
  • Replace '5d8227f1161e43a189d33628240210' with your actual API key:
this.apiKey = 'YOUR_API_KEY_HERE'; // Replace with your WeatherAPI.com API key
  1. Open the application
# Simply open index.html in your browser
open index.html
# Or double-click the file in your file explorer
  1. Start exploring the weather!

πŸ”§ API Integration

WeatherAPI.com Endpoints Used

Endpoint Purpose
/current.json Current weather data with AQI
/forecast.json 7-day forecast with hourly data
/search.json Location autocomplete suggestions

API Response Handling

The app handles:

  • βœ… Current weather conditions
  • βœ… Temperature (in Celsius)
  • βœ… Feels-like temperature
  • βœ… Weather condition icons
  • βœ… Visibility, humidity, wind speed
  • βœ… Pressure, UV index, precipitation
  • βœ… Air quality index (US EPA)
  • βœ… 24-hour detailed forecast
  • βœ… 7-day forecast with high/low temps

🎨 UI Features

Theme System

  • Dark Mode: Elegant dark theme with reduced eye strain
  • Light Mode: Clean, bright interface
  • Persistent: Theme preference saved in localStorage
  • Smooth Transitions: Seamless theme switching with animations

Weather Animations

  • Sunny: Warm glow effect
  • Rainy: Animated rain drops
  • Snowy: Snowfall effect
  • Stormy: Lightning animations
  • Cloudy: Floating cloud effects

Interactive Elements

  • Search Autocomplete: Smart location suggestions
  • Location Button: One-click GPS positioning
  • Refresh Button: Instant data refresh
  • Hover Effects: Interactive card animations
  • Smooth Scroll: Navigation transitions

πŸ“± Responsive Design

Device Optimization
Desktop Full layout with detailed cards and grid views
Tablet Adjusted grid layouts and spacing
Mobile Single-column layout with touch-friendly targets
Small Mobile Compact cards and simplified display

πŸ” Core Functionality

Weather Search

  1. Type a city name in the search box
  2. View autocomplete suggestions
  3. Select a location
  4. Weather data updates instantly

Current Location

  1. Click the location button (πŸ“)
  2. Browser requests location permission
  3. Weather loads for your exact coordinates
  4. Fallback to Bangalore if permission denied

Theme Toggle

  1. Click the moon/sun icon
  2. Theme switches with animation
  3. Preference saved automatically
  4. System-wide consistent theming

Refresh

  1. Click the refresh button (πŸ”„)
  2. Fetches latest weather data
  3. Animated spin effect during loading
  4. All sections update simultaneously

🎯 Weather Icons Mapping

The app includes comprehensive weather condition mapping:

Condition Icon
β˜€οΈ Sunny/Clear fa-sun / fa-moon
β›… Partly Cloudy fa-cloud-sun / fa-cloud-moon
☁️ Cloudy fa-cloud
🌧️ Rainy fa-cloud-rain
β›ˆοΈ Thunderstorm fa-bolt
🌨️ Snowy fa-snowflake
🌫️ Foggy fa-smog
πŸ’¨ Windy fa-wind

πŸ”§ Customization Guide

Changing API Key

// In script.js
this.apiKey = 'YOUR_API_KEY_HERE';

Modifying Theme Colors

/* In styles.css - Light Theme */
:root {
    --primary-color: #667eea;      /* Change to your brand color */
    --secondary-color: #764ba2;    /* Change to your accent color */
    --background-primary: #ffffff; /* Change background color */
}

/* In styles.css - Dark Theme */
[data-theme="dark"] {
    --background-primary: #0f172a; /* Change dark background */
}

Adding New Weather Effects

// In script.js - Add new weather condition
if ([NEW_CODE].includes(conditionCode)) {
    body.classList.add('weather-new');
    this.createNewEffect();
}

Customizing Forecast Days

// In script.js - Change forecast days (max 7)
const response = await fetch(
    `${this.baseUrl}/forecast.json?key=${this.apiKey}&q=${encodeURIComponent(location)}&days=7&aqi=yes&alerts=yes`
);
// Change 'days=7' to any number between 1-7

🚒 Deployment

Deploy to Vercel

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

Deploy to Netlify

  1. Drag and drop the project folder to Netlify
  2. Or connect your GitHub repository
  3. Build command: (none needed - static site)
  4. Publish directory: .

Deploy to GitHub Pages

  1. Push to GitHub
  2. Enable GitHub Pages in repository settings
  3. Select branch and folder
  4. Access via https://yourusername.github.io/cloudCtrl

πŸ“Š Performance Optimizations

  • βœ… Lazy loading of weather effects
  • βœ… Debounced search input
  • βœ… Cached API responses
  • βœ… Optimized animations with will-change
  • βœ… Efficient DOM updates
  • βœ… Service worker for offline support (optional)

πŸ” Security Considerations

  • API Key: Keep your API key secure
  • CORS: WeatherAPI.com supports CORS
  • HTTPS: Always use HTTPS in production
  • Input Validation: Sanitize search input

🀝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/improvement)
  3. Make your changes
  4. Commit your changes (git commit -m 'Add improvement')
  5. Push to the branch (git push origin feature/improvement)
  6. Open a Pull Request

Development Guidelines

  • Follow existing code style
  • Use meaningful variable names
  • Comment complex logic
  • Test across multiple browsers
  • Update documentation as needed

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgements

  • WeatherAPI.com: Free and reliable weather data
  • Font Awesome: Beautiful icons
  • Google Fonts: Typography
  • Contributors: All who helped improve this project

πŸ“¬ Support

For issues, feature requests, or questions:

🎯 Future Enhancements

  • Map integration for weather visualization
  • Weather alerts and warnings
  • Multiple location saving
  • Temperature unit toggle (Β°C/Β°F)
  • Weather widgets for other sites
  • Push notifications for weather changes
  • Weather history and trends
  • Social sharing features
**cloudCtrl - Your Weather, Under Control** ☁️✨

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors