7
7
8
8
body {
9
9
display : flex;
10
- justify-content : center;
11
- align-items : center;
12
10
flex-direction : column;
13
- background-color : # fff ;
11
+ align-items : center;
12
+ background : linear-gradient (to bottom, # d1eef8, # e5f3f7 );
14
13
padding : 20px ;
15
- height : 100vh ;
14
+ min- height: 100vh ;
16
15
}
17
16
17
+ /* Main weather widget */
18
18
.weather-widget {
19
- background-color : # 007BFF ;
20
- border-radius : 10 px ;
21
- box-shadow : 0 0 20px rgba (0 , 0 , 0 , 0.1 );
22
- padding : 20 px ;
19
+ background : linear-gradient (to bottom , # 007BFF, # 72cee7 ) ;
20
+ border-radius : 15 px ;
21
+ box-shadow : 0 8 px 20px rgba (0 , 0 , 0 , 0.15 );
22
+ padding : 25 px ;
23
23
text-align : center;
24
- max-width : 300 px ;
24
+ max-width : 320 px ;
25
25
width : 100% ;
26
+ color : white;
26
27
margin-bottom : 40px ;
27
28
}
28
29
29
- h1 {
30
- font-size : 24 px ;
31
- color : # 333 ;
30
+ . weather-widget h1 {
31
+ font-size : 28 px ;
32
+ margin-bottom : 15 px ;
32
33
}
33
34
34
- .weather-location {
35
- margin-bottom : 20 px ;
35
+ .weather-location h2 {
36
+ font-size : 22 px ;
36
37
}
37
38
38
- h2 {
39
- font-size : 20px ;
40
- color : black;
39
+ .weather-location p {
40
+ font-size : 16px ;
41
+ opacity : 0.9 ;
42
+ margin-bottom : 15px ;
41
43
}
42
44
43
45
.weather-details h3 {
44
- font-size : 48 px ;
45
- color : white ;
46
+ font-size : 50 px ;
47
+ margin : 10 px 0 ;
46
48
}
47
49
48
50
.weather-details p {
49
51
font-size : 16px ;
50
- color : white;
51
- margin-top : 10px ;
52
+ margin : 5px 0 ;
52
53
}
53
54
55
+ /* Weekly forecast */
54
56
.weekly-forecast {
55
- background-color : # fff ;
56
- border-radius : 10 px ;
57
- box-shadow : 0 0 20px rgba (0 , 0 , 0 , 0.1 );
57
+ background-color : # ffffff ;
58
+ border-radius : 15 px ;
59
+ box-shadow : 0 8 px 20px rgba (0 , 0 , 0 , 0.1 );
58
60
padding : 20px ;
59
61
text-align : center;
60
- max-width : 600 px ;
62
+ max-width : 700 px ;
61
63
width : 100% ;
62
64
}
63
65
66
+ .weekly-forecast h2 {
67
+ font-size : 24px ;
68
+ margin-bottom : 15px ;
69
+ }
70
+
71
+ /* Forecast row */
64
72
.forecast-row {
65
73
display : flex;
74
+ flex-wrap : wrap;
66
75
justify-content : space-between;
76
+ gap : 15px ;
67
77
}
68
78
69
79
.day-forecast {
70
- background-color : # 007BFF ;
80
+ flex : 1 1 100 px ;
71
81
padding : 15px ;
72
- border-radius : 5 px ;
82
+ border-radius : 10 px ;
73
83
text-align : center;
74
- width : 100px ;
84
+ color : rgb (255 , 255 , 255 );
85
+ transition : transform 0.3s ease, box-shadow 0.3s ease;
86
+ }
87
+
88
+ /* Weather type colors */
89
+ .day-forecast .sunny {
90
+ background : linear-gradient (135deg , # f6d365, # fda085 );
91
+ }
92
+
93
+ .day-forecast .cloudy {
94
+ background : linear-gradient (135deg , # bdc3c7, # 2c3e50 );
95
+ }
96
+
97
+ .day-forecast .rainy {
98
+ background : linear-gradient (135deg , # 74ebd5, # ACB6E5 );
99
+ }
100
+
101
+ .day-forecast .partly {
102
+ background : linear-gradient (135deg , # ff7d13, # f7c4be );
103
+ }
104
+
105
+ /* Hover effect */
106
+ .day-forecast : hover {
107
+ transform : translateY (-5px ) scale (1.05 );
108
+ box-shadow : 0 10px 20px rgba (0 , 0 , 0 , 0.2 );
75
109
}
76
110
77
111
.day-forecast h3 {
78
- font-size : 24 px ;
112
+ font-size : 22 px ;
79
113
margin-bottom : 5px ;
80
114
}
81
115
82
116
.day-forecast p {
83
117
font-size : 14px ;
84
- color : whitesmoke;
85
- }
118
+ }
119
+
120
+ /* Responsive */
121
+ @media (max-width : 500px ) {
122
+ .forecast-row {
123
+ flex-direction : column;
124
+ align-items : center;
125
+ }
126
+ .day-forecast {
127
+ width : 80% ;
128
+ }
129
+ }
0 commit comments