File tree Expand file tree Collapse file tree 3 files changed +16
-18
lines changed Expand file tree Collapse file tree 3 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ <h4 id="date-time" class="time">2024-02-06 3:59</h4>
26
26
27
27
</ ul >
28
28
< ul class ="weather-suggestions ">
29
- < form >
29
+
30
30
< input class ="input " id ="input " type ="text " placeholder ="Enter city name ">
31
31
< button class ="search " id ="btn "> < i class ="fa fa-search "> </ i > </ button >
32
- </ form >
32
+
33
33
< ul >
34
34
< li >
35
35
< a class ="location " id ="getlocation "> < i class ="fa fa-location-arrow "> Get Weather of your city</ i > </ a >
Original file line number Diff line number Diff line change @@ -66,10 +66,10 @@ locat.addEventListener("click", () =>
66
66
navigator . geolocation . getCurrentPosition ( gotlocation , failedlocation )
67
67
) ;
68
68
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
+ } ) ;
Original file line number Diff line number Diff line change 35
35
}
36
36
37
37
.temp {
38
- font-size : 56 px ;
38
+ font-size : 50 px ;
39
39
font-weight : 700 ;
40
40
}
41
41
.city {
50
50
display : flex;
51
51
flex-direction : row;
52
52
align-items : flex-end;
53
- padding : 5% 10 % ;
53
+ padding : 5% 5 % ;
54
54
gap : 5% ;
55
- justify-content : space-between ;
56
-
55
+ justify-content : space-evenly ;
56
+ width : 50 % ;
57
57
}
58
+
58
59
.column {
59
60
display : flex;
60
61
flex-direction : column;
80
81
z-index : 1 ;
81
82
padding : 3em 2em ;
82
83
}
83
- form {
84
- margin-bottom : 3em ;
85
- display : flex;
86
- gap : 10px ;
87
- }
88
84
.input {
89
85
height : 40px ;
90
86
width : 90% ;
@@ -104,6 +100,8 @@ gap: 10px;
104
100
border-radius : 9px ;
105
101
border : inherit;
106
102
background-color : rgb (129 , 180 , 231 );
103
+ margin-left : 3% ;
104
+ position : absolute;
107
105
}
108
106
.fa-search {
109
107
color : # fafafa ;
You can’t perform that action at this time.
0 commit comments