Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ae48b84

Browse files
committed
corrected the code
1 parent b285877 commit ae48b84

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

Source-Code/WeatherApp/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ <h4 id="date-time" class="time">2024-02-06 3:59</h4>
2626

2727
</ul>
2828
<ul class="weather-suggestions">
29-
<form>
29+
3030
<input class="input" id="input" type="text" placeholder="Enter city name">
3131
<button class="search" id="btn"><i class="fa fa-search"></i></button>
32-
</form>
32+
3333
<ul>
3434
<li>
3535
<a class="location" id="getlocation"><i class="fa fa-location-arrow "> Get Weather of your city</i></a>

Source-Code/WeatherApp/script.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ locat.addEventListener("click", () =>
6666
navigator.geolocation.getCurrentPosition(gotlocation, failedlocation)
6767
);
6868
const citiesArray = [...cities];
69-
// citiesArray.forEach((element) => {
70-
// element.addEventListener("click", async () => {
71-
// const cityName = element.innerText; // Extract city name from the clicked element
72-
// const result = await getData(cityName); // Pass the city name to getData
73-
// updateWeatherInfo(result);
74-
// });
75-
// });
69+
citiesArray.forEach((element) => {
70+
element.addEventListener("click", async () => {
71+
const cityName = element.innerText; // Extract city name from the clicked element
72+
const result = await getData(cityName); // Pass the city name to getData
73+
updateWeatherInfo(result);
74+
});
75+
});

Source-Code/WeatherApp/style.css

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
}
3636

3737
.temp{
38-
font-size: 56px;
38+
font-size: 50px;
3939
font-weight: 700;
4040
}
4141
.city{
@@ -50,11 +50,12 @@ li{
5050
display: flex;
5151
flex-direction: row;
5252
align-items: flex-end;
53-
padding: 5% 10%;
53+
padding: 5% 5%;
5454
gap: 5%;
55-
justify-content: space-between;
56-
55+
justify-content: space-evenly;
56+
width: 50%;
5757
}
58+
5859
.column{
5960
display: flex;
6061
flex-direction: column;
@@ -80,11 +81,6 @@ li{
8081
z-index: 1;
8182
padding: 3em 2em;
8283
}
83-
form {
84-
margin-bottom: 3em;
85-
display: flex;
86-
gap: 10px;
87-
}
8884
.input{
8985
height: 40px;
9086
width: 90%;
@@ -104,6 +100,8 @@ gap: 10px;
104100
border-radius: 9px;
105101
border: inherit;
106102
background-color: rgb(129, 180, 231);
103+
margin-left: 3%;
104+
position: absolute;
107105
}
108106
.fa-search{
109107
color: #fafafa;

0 commit comments

Comments
 (0)