diff --git a/Deliverable-1/ProjectPlan.md b/Deliverable-1/ProjectPlan.md deleted file mode 100644 index 2276273..0000000 --- a/Deliverable-1/ProjectPlan.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Project Plan - -## Describe the Project - -**Project Title**: Weather Website - -**Overview**: This project is a simple, interactive weather website that allows users to check current weather conditions and basic forecasts for different cities. Users will enter a location, and the site will retrieve weather data, displaying temperature, conditions (e.g., sunny, rainy), and additional details. It will also provide a map view of the selected location. - -**Goals**: -- Create a functional, user-friendly weather lookup tool. -- Practice skills in HTML, CSS, JavaScript, and working with web APIs. - -**Features**: -- Location search with input validation -- Embedded map for visual location display -- Dynamic weather data loading with Ajax -- User-friendly components, such as a date picker for future forecasts -- Data persistence with local storage (recently searched locations) - -## Implementation Tasks - -1. **Setup Basic Page Structure** - - Create HTML for both pages: the main search page and the results page. - - Add basic styling with CSS for layout and appearance. - -2. **JavaScript and Input Validation** - - Add JavaScript to handle the search form, ensuring the user enters a valid location. - - Implement functions to handle validation errors (e.g., alerts for incorrect input). - -3. **Weather Data Fetching (Ajax and JSON)** - - Connect to a weather API (e.g., OpenWeatherMap) to retrieve JSON data. - - Write JavaScript to parse and display the data on the results page. - -4. **DOM Manipulation for Dynamic Content** - - Use JavaScript and the DOM API to create and display elements like temperature, weather icon, humidity, and wind speed dynamically. - -5. **Embedded Map and Video** - - Embed an iframe displaying a Google Map or OpenStreetMap focused on the searched location. - -6. **jQuery UI Component** - - Integrate a jQuery date picker component to allow users to select a date for a weather forecast. - -7. **Local Storage Setup** - - Use local storage to save the user’s last searched location and retrieve it when they return to the site. - -8. **Testing and Debugging** - - Test each component to ensure it works as expected. - - Validate functionality across different browsers and devices. \ No newline at end of file diff --git a/Deliverable-1/Weather Web Design _ App UI (Community).pdf b/Deliverable-1/Weather Web Design _ App UI (Community).pdf deleted file mode 100644 index dc39267..0000000 Binary files a/Deliverable-1/Weather Web Design _ App UI (Community).pdf and /dev/null differ diff --git a/Deliverable-2/fetchWeather.js b/Deliverable-2/fetchWeather.js deleted file mode 100644 index bb56737..0000000 --- a/Deliverable-2/fetchWeather.js +++ /dev/null @@ -1,116 +0,0 @@ -let map, marker; - -function initMap() { - // Initialize the map centered on a default location - map = new google.maps.Map(document.getElementById("map"), { - zoom: 8, - center: { lat: 40.7128, lng: -74.0060 }, // Default center (e.g., New York City) - }); - - // Create an AdvancedMarkerElement for placing the marker - marker = new google.maps.marker.AdvancedMarkerElement({ - map: map, - position: { lat: 40.7128, lng: -74.0060 }, // Default marker position - }); -} - -document.getElementById('city-form').addEventListener('submit', function (e) { - e.preventDefault(); - const city = document.getElementById('city-input').value; - fetchWeather(city); -}); - -async function fetchWeather(city) { - const apiKey = "YOUR_OPENWEATHERMAP_API_KEY"; // Replace with your actual OpenWeatherMap API key - const apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`; - - try { - const response = await fetch(apiUrl); - const data = await response.json(); - - if (data.cod === 200) { - displayWeather(data); - updateMap(data.coord.lat, data.coord.lon); - } else { - alert("City not found"); - } - } catch (error) { - console.error("Error fetching data:", error); - } -} - -function displayWeather(data) { - const temperature = data.main.temp; - const city = data.name; - const description = data.weather[0].description; - const windSpeed = data.wind.speed; - const feelsLike = data.main.feels_like; - - document.getElementById("temperature").textContent = `${temperature}°C`; - document.getElementById("location").textContent = city; - document.getElementById("conditions").innerHTML = ` -
Description: ${description}
-Wind Speed: ${windSpeed} km/hr
-Real Feel: ${feelsLike}°C
- `; -} - -function updateMap(lat, lon) { - // Set the map's center to the new location - const location = { lat, lng: lon }; - map.setCenter(location); - - // Update the AdvancedMarkerElement position - marker.position = location; -} - - -document.getElementById('city-form').addEventListener('submit', function (e) { - e.preventDefault(); - const city = document.getElementById('city-input').value; - fetchWeather(city); -}); - -async function fetchWeather(city) { - const apiKey = "17ada1ec5cb68dd36cf8b0e44589a2b8"; // Replace with your actual OpenWeatherMap API key - const apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`; - - try { - const response = await fetch(apiUrl); - const data = await response.json(); - - if (data.cod === 200) { - displayWeather(data); - updateMap(data.coord.lat, data.coord.lon); - } else { - alert("City not found"); - } - } catch (error) { - console.error("Error fetching data:", error); - } -} - -function displayWeather(data) { - const temperature = data.main.temp; - const city = data.name; - const description = data.weather[0].description; - const windSpeed = data.wind.speed; - const feelsLike = data.main.feels_like; - - document.getElementById("temperature").textContent = `${temperature}°C`; - document.getElementById("location").textContent = city; - document.getElementById("conditions").innerHTML = ` -Description: ${description}
-Wind Speed: ${windSpeed} km/hr
-Real Feel: ${feelsLike}°C
- `; -} - -function updateMap(lat, lon) { - // Set the map's center to the new location - const location = { lat, lng: lon }; - map.setCenter(location); - - // Move the marker to the new location - marker.setPosition(location); -} \ No newline at end of file diff --git a/Deliverable-2/index.html b/Deliverable-2/index.html deleted file mode 100644 index 1ac057e..0000000 --- a/Deliverable-2/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - -City Name
-Date
-UV Index: --
-Chance of Rain: --
-Wind: --
-Real Feel: --°
-Location: New York
-Temperature: 20°C
-Condition: Sunny
-Humidity: 60%
-Wind Speed: 10 km/h
-- Project Plan
- Describe the project
- List the implementation tasks
- wireframes
- A black and white mockup drawing of the web pages showing what components will be on a page and their positions
| -| :- | :- | -|Deliverable-2|HTML templates
- HTML web pages with CSS before JavaScript
| -|Deliverable-3|Final complete code| -|Deliverable-4|Project Report| - - -## Grading Criteria - -||**Weight (out of 30)**| -| :- | :-: | -|Deliverable-1|| -|- Clear and well written project description with enough details|1| -|- Detailed implementation tasks|1| -|- Wireframes|1| -|Deliverable-2|| -|- Look and feel
- Homogeneous colors chosen out of a color palette
- Images go well with the colors and layout
- Layout and text is clear
- User controls are accessible and easy to use
|2| -|- Layout implemented without flows and is responsive|4| -|Deliverable-3|| -|- Uses cookies, and/or local storage, and/or session storage|3| -|- Using DOM for HTML creation and manipulation|3| -|- Handles user input validation|3| -|- Uses Ajax|3| -|- Uses a jQuery or a third party user interface component|3| -|- Reads and process JSON data|2| -|- Uses an iframe and an embed code|2| -|Deliverable-4|| -|- Well written and formatted report with screenshots of the implemented website and a short description of each technology used and its usage.|2| - diff --git a/README.md b/README.md deleted file mode 100644 index 2ed9f7d..0000000 --- a/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Internet-Programming-Project - -**Project Title**: Weather Website - -**Overview**: This project is a simple, interactive weather website that allows users to check current weather conditions and basic forecasts for different cities. Users will enter a location, and the site will retrieve weather data, displaying temperature, conditions (e.g., sunny, rainy), and additional details. It will also provide a map view of the selected location. - -**Goals**: -- Create a functional, user-friendly weather lookup tool. -- Practice skills in HTML, CSS, JavaScript, and working with web APIs. - -**Features**: -- Location search with input validation -- Embedded map for visual location display -- Dynamic weather data loading with Ajax -- User-friendly components, such as a date picker for future forecasts -- Data persistence with local storage (recently searched locations) - -## Implementation Tasks - -1. **Setup Basic Page Structure** - - Create HTML for both pages: the main search page and the results page. - - Add basic styling with CSS for layout and appearance. - -2. **JavaScript and Input Validation** - - Add JavaScript to handle the search form, ensuring the user enters a valid location. - - Implement functions to handle validation errors (e.g., alerts for incorrect input). - -3. **Weather Data Fetching (Ajax and JSON)** - - Connect to a weather API (e.g., OpenWeatherMap) to retrieve JSON data. - - Write JavaScript to parse and display the data on the results page. - -4. **DOM Manipulation for Dynamic Content** - - Use JavaScript and the DOM API to create and display elements like temperature, weather icon, humidity, and wind speed dynamically. - -5. **Embedded Map and Video** - - Embed an iframe displaying a Google Map or OpenStreetMap focused on the searched location. - -6. **jQuery UI Component** - - Integrate a jQuery date picker component to allow users to select a date for a weather forecast. - -7. **Local Storage Setup** - - Use local storage to save the user’s last searched location and retrieve it when they return to the site. - -8. **Testing and Debugging** - - Test each component to ensure it works as expected. - - Validate functionality across different browsers and devices. diff --git a/index.html b/index.html new file mode 100644 index 0000000..61633d1 --- /dev/null +++ b/index.html @@ -0,0 +1,44 @@ + + + + + +Description: --
+Humidity: --%
+Wind Speed: -- km/h
+Weather App - Powered by OpenWeatherMap API
+