diff --git a/README.md b/README.md
index 0f57702..af383c5 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,15 @@
-# HTML-CSS-JavaScript-projects-for-beginners
-
-This is the source code of the YouTube video (10 projects) https://www.youtube.com/watch?v=ePzOFu2xXUQ.
-
-Part 2 (16 projects) : https://youtu.be/EWv2jnhZErc
-
-NEW HTML CSS JavaScript Projects Interesting HTML CSS JavaScript projects Learn HTML, CSS, and JavaScript 2021 to create modern websites. Fun learning HTML, CSS, and JavaScript!
-
-I'm Sahand, a web developer in computer science. I've been doing this for over a decade. This course was created to share my knowledge and experience with you. Build simple websites using HTML, CSS, and JavaScript. Responsive web design employs HTML, CSS, and JavaScript. This is a skill you'll learn in this course. This new course teaches students how to install Visual Studio Code and its extensions. Then we start from scratch with each project. After finishing HTML, it's on to CSS and JavaScript. Building in HTML, CSS, or JavaScript is fine. This guide explains HTML, CSS, and JavaScript syntax.
-
-Every project is started from scratch and finished without using copied code. Then they are used on the project to ensure everyone understands. This program's exciting project-based curriculum includes building modern, super cool, and responsive websites! Let's get started learning HTML, CSS, and JavaScript.
-
-Contact me if you have any questions through my twitter: @codewithsahand.
+# HTML CSS JavaScript Projects
+
+This is the source code of the website: 100 HTML CSS JavaScript Projects
+
Hi there! I'm Sahand, a web developer with over a decade of experience. This course, "HTML CSS JavaScript Projects," was created to share my knowledge and experience with you. In this course, you'll learn how to build simple, responsive websites using HTML, CSS, and JavaScript.
+
In this course, you'll learn how to install Visual Studio Code and its extensions, and then we'll start from scratch with each project. After finishing HTML, we'll move on to CSS and JavaScript. Building in HTML, CSS, or JavaScript is fine, and this guide will explain HTML, CSS, and JavaScript syntax.
+
Each project in this course is started from scratch and finished without using copied code. Then, we'll go over the code together to ensure that everyone understands. This program's exciting project-based curriculum includes building modern, super cool, and responsive websites!
+
If you have any questions, please feel free to contact me through my email: codewithsahand@gmail.com
`)
+ .join("");
+ } catch (error) {
+ weatherDataEl.querySelector(".icon").innerHTML = "";
+ weatherDataEl.querySelector(".temperature").textContent = "";
+ weatherDataEl.querySelector(".description").textContent =
+ "An error happened, please try again later";
+
+ weatherDataEl.querySelector(".details").innerHTML = "";
+ }
+}
diff --git a/projects/weather-app/script.js b/projects/weather-app/script.js
deleted file mode 100644
index ada1704..0000000
--- a/projects/weather-app/script.js
+++ /dev/null
@@ -1,71 +0,0 @@
-// Set the API key to be used for making requests to the OpenWeatherMap API
-const apiKey = "ec24604fb141c0188e07713025f2b7b8";
-
-// Get the element that will display the weather data on the page
-const weatherData = document.getElementById("weather-data");
-
-// Get the input element for the city from the HTML form
-const cityInput = document.getElementById("city-input");
-
-// Get the HTML form element
-const form = document.querySelector("form");
-
-// Add a submit event listener to the form, which will get the value from the city input field and use it to get weather data
-form.addEventListener("submit", (event) => {
- event.preventDefault(); // Prevent the default form submission behavior
- const city = cityInput.value; // Get the value from the city input field
- getWeatherData(city); // Call the function to get weather data for the specified city
-});
-
-// Define an async function to get weather data for a given city
-async function getWeatherData(city) {
- try {
- // Make a request to the OpenWeatherMap API to get weather data for the specified city
- const response = await fetch(`
-https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`);
-
- // Check if the response from the API is not ok (e.g. 404 error)
- if (!response.ok) {
- throw new Error("Network response was not ok");
- }
-
- // Parse the response from the API as JSON
- const data = await response.json();
-
- // Check if the API returned an error message
- if (data.cod === "404") {
- throw new Error(data.message);
- }
-
- // Extract the temperature, description, icon, and other weather details from the API response
- const temperature = Math.round(data.main.temp);
- const description = data.weather[0].description;
- const icon = data.weather[0].icon;
- const details = [
- `Feels like: ${Math.round(data.main.feels_like)}°C`,
- `Humidity: ${data.main.humidity}%`,
- `Wind speed: ${data.wind.speed} m/s`,
- ];
-
- // Set the HTML content of the weather data display elements to the retrieved weather data
- weatherData.querySelector(
- ".icon"
- ).innerHTML = ``;
- weatherData.querySelector(".temperature").textContent = `${temperature}°C`;
- weatherData.querySelector(".description").textContent = description;
- weatherData.querySelector(".details").innerHTML = details
- .map((detail) => `
${detail}
`)
- .join("");
- } catch (error) {
- console.log(error);
-
- // If there was an error fetching weather data, clear the HTML content of the weather data display elements and display an error message
- weatherData.querySelector(".icon").innerHTML = "";
- weatherData.querySelector(".temperature").textContent = "";
- weatherData.querySelector(".description").textContent =
- "Error fetching weather data. Please try again.";
- weatherData.querySelector(".details").innerHTML = "";
- }
-}
-
-// The above code uses the Fetch API to retrieve weather data from the OpenWeatherMap API, and the async/await syntax to handle the asynchronous nature of the API call. The code also dynamically updates the HTML content of the weather data display elements with the retrieved weather data.
diff --git a/projects/weather-app/style.css b/projects/weather-app/style.css
index bed3d24..2030f24 100644
--- a/projects/weather-app/style.css
+++ b/projects/weather-app/style.css
@@ -1,117 +1,94 @@
body {
- margin: 0; /* Reset default margin */
- font-family: "Montserrat", sans-serif; /* Use Montserrat font for all text */
- background-color: #f7f7f7; /* Set light gray background color */
+ margin: 0;
+ font-family: "Montserrat", sans-serif;
+ background-color: #f7f7f7;
}
.container {
- max-width: 600px; /* Set maximum width of container */
- margin: 0 auto; /* Center container horizontally */
- padding: 20px; /* Add padding inside container */
- border-radius: 5px; /* Add rounded corners to container */
- box-shadow: 0 0 20px rgba(0, 0, 0, 0.2); /* Add shadow effect to container */
- background-color: #fff; /* Set white background color for container */
- margin-top: 50px; /* Add margin to the top of the container */
- text-align: center; /* Center align the content inside container */
+ background-color: #fff;
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
+ margin: 0 auto;
+ margin-top: 50px;
+ text-align: center;
+ max-width: 600px;
+ border-radius: 5px;
+ padding: 20px;
}
form {
- display: flex; /* Use flexbox for layout */
- justify-content: center; /* Center children horizontally */
- align-items: center; /* Center children vertically */
- margin-bottom: 20px; /* Add margin to bottom */
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-bottom: 20px;
}
form input[type="text"] {
- padding: 10px; /* Add padding to all sides */
- border: none; /* Remove border */
- border-radius: 5px; /* Add rounded corners */
- font-size: 18px; /* Set font size */
- width: 60%; /* Set width */
- outline: none; /* Remove outline */
+ padding: 10px;
+ border: none;
+ outline: none;
+ font-size: 18px;
+ width: 60%;
}
form input[type="submit"] {
- background-color: #007bff; /* set background color for the submit button */
- color: #fff; /* set text color for the submit button */
- border: none; /* remove border from the submit button */
- padding: 10px 20px; /* set padding for the submit button */
- border-radius: 5px; /* set border radius for the submit button */
- font-size: 18px; /* set font size for the submit button text */
- cursor: pointer; /* change cursor to pointer on hover */
- outline: none; /* remove outline on focus */
- transition: background-color 0.3s ease; /* add transition effect for background color change */
+ background-color: #007bff;
+ color: #fff;
+ border: none;
+ padding: 10px 20px;
+ border-radius: 5px;
+ font-size: 18px;
+ cursor: pointer;
+ outline: none;
+ transition: background-color 0.3s ease;
}
form input[type="submit"]:hover {
- background-color: #0062cc; /* set background color on hover */
+ background-color: #0062cc;
}
-.icon {
- width: 100px; /* set width of the icon */
- height: 100px; /* set height of the icon */
- margin: 0 auto; /* center the icon horizontally */
- background-size: contain; /* scale the background image to fit within the container */
- background-repeat: no-repeat; /* prevent the background image from repeating */
- background-position: center center; /* center the background image within the container */
+.icon img {
+ width: 100px;
+ height: 100px;
+ background-size: contain;
+ background-repeat: no-repeat;
+ background-position: center center;
}
.temperature {
- font-size: 48px; /* set font size for the temperature display */
- font-weight: bold; /* set font weight for the temperature display */
- margin: 20px 0; /* add margin to the top and bottom of the temperature display */
+ font-size: 48px;
+ font-weight: bold;
+ margin: 20px 0;
}
-.description {
- font-size: 24px; /* set font size for the weather description */
- margin-bottom: 20px; /* add margin to the bottom of the weather description */
+.description{
+ font-size: 24px;
+ margin-bottom: 20px;
}
-.details {
- display: flex; /* set display property to flex */
- justify-content: center; /* center the child elements horizontally */
- align-items: center; /* center the child elements vertically */
- flex-wrap: wrap; /* allow the child elements to wrap onto a new line if needed */
+.details{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-wrap: wrap;
}
-.details > div {
- flex: 1; /* Use the remaining available space for each div */
- margin: 10px; /* Add margin around each div */
- padding: 20px; /* Add padding inside each div */
- background-color: #f1f1f1; /* Set background color for each div */
- border-radius: 5px; /* Round the corners of each div */
- text-align: center; /* Center the content horizontally */
- min-height: 45px; /* Set a minimum height for each div */
- align-items: center; /* Center the content vertically */
- justify-content: center; /* Center the content horizontally */
+.details > div{
+ padding: 20px;
+ background-color: #f1f1f1;
+ margin: 10px;
+ flex: 1;
+ border-radius: 5px;
+ text-align: center;
+ min-height: 45px;
}
-.details > div > h3 {
- margin-top: 0; /* Remove the top margin of the heading */
- font-size: 18px; /* Set the font size for the heading */
- font-weight: bold; /* Set the font weight for the heading */
-}
-
-.details > div > p {
- margin-bottom: 0; /* Remove the bottom margin of the paragraph */
- font-size: 16px; /* Set the font size for the paragraph */
-}
-
-.details > div > p:first-child {
- font-weight: bold; /* Set the font weight for the first paragraph */
-}
-
-.details > div > p:last-child {
- margin-top: 10px; /* Add margin to the top of the last paragraph */
-}
-
-@media (max-width: 768px) {
- form {
- flex-direction: column; /* Change the direction of the flex items to column */
- }
+@media (max-width: 768px){
+ form {
+ flex-direction: column;
+ }
- form input[type="text"] {
- width: 100%; /* Set the width of the input field to 100% */
- margin-bottom: 10px; /* Add margin to the bottom of the input field */
- }
+ form input[type="text"]{
+ width: 100%;
+ margin-bottom: 10px;
+ }
}