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>
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 >
Original file line number Diff line number Diff line change @@ -66,10 +66,10 @@ locat.addEventListener("click", () =>
6666 navigator . geolocation . getCurrentPosition ( gotlocation , failedlocation )
6767) ;
6868const 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 3535}
3636
3737.temp {
38- font-size : 56 px ;
38+ font-size : 50 px ;
3939 font-weight : 700 ;
4040}
4141.city {
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;
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 ;
You can’t perform that action at this time.
0 commit comments