File tree Expand file tree Collapse file tree 4 files changed +77
-1
lines changed
starter/08-Omnifood-Responsive Expand file tree Collapse file tree 4 files changed +77
-1
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,15 @@ html {
67
67
/* 10px / 16px = 0.625 = 62.5% */
68
68
/* Percentage of user's browser font-size setting */
69
69
font-size : 62.5% ;
70
+ overflow-x : hidden;
70
71
}
71
72
72
73
body {
73
74
font-family : "Rubik" , sans-serif;
74
75
line-height : 1 ;
75
76
font-weight : 400 ;
76
77
color : # 555 ;
78
+ overflow-x : hidden;
77
79
}
78
80
79
81
/**************************/
Original file line number Diff line number Diff line change 120
120
.btn--form {
121
121
margin-top : 1.2rem ;
122
122
}
123
+
124
+ /* Mobile Navigation */
125
+ .btn-mobile-nav {
126
+ display : block;
127
+ }
128
+
129
+ .main-nav {
130
+ background-color : rgba (255 , 255 , 255 , 0.97 );
131
+ position : absolute;
132
+ top : 0 ;
133
+ left : 0 ;
134
+ width : 100% ;
135
+ height : 100vh ;
136
+ transform : translateX (100% );
137
+
138
+ display : flex;
139
+ align-items : center;
140
+ justify-content : center;
141
+ transition : all 0.5s ease-in;
142
+ /* 1. Hide it visually */
143
+ opacity : 0 ;
144
+ /* 2. Make it unaccessible to mouse and keyboard */
145
+ pointer-events : none;
146
+ /* 3. Hide it from screen readers */
147
+ visibility : hidden;
148
+ }
149
+
150
+ .nav-open .main-nav {
151
+ opacity : 1 ;
152
+ pointer-events : auto;
153
+ visibility : visible;
154
+ transform : translateX (0 );
155
+ }
156
+
157
+ .nav-open .icon-mobile-nav [name = "close-outline" ] {
158
+ display : block;
159
+ }
160
+
161
+ .nav-open .icon-mobile-nav [name = "menu-outline" ] {
162
+ display : none;
163
+ }
164
+
165
+ .main-nav-list {
166
+ flex-direction : column;
167
+ gap : 4.8rem ;
168
+ }
169
+
170
+ .main-nav-link : link ,
171
+ .main-nav-link : visited {
172
+ font-size : 3rem ;
173
+ }
123
174
}
Original file line number Diff line number Diff line change 11
11
/* Because we want header to be sticky later */
12
12
height : 9.6rem ;
13
13
padding : 0 4.8rem ;
14
+ position : relative;
14
15
}
15
16
16
17
.logo {
56
57
background-color : # cf711f ;
57
58
}
58
59
60
+ /* Mobile */
61
+ .btn-mobile-nav {
62
+ border : none;
63
+ background : none;
64
+ cursor : pointer;
65
+ display : none;
66
+ }
67
+
68
+ .icon-mobile-nav {
69
+ height : 4.8rem ;
70
+ width : 4.8rem ;
71
+ color : # 333 ;
72
+ }
73
+
74
+ .icon-mobile-nav [name = "close-outline" ] {
75
+ display : none;
76
+ }
77
+
59
78
/**************************/
60
79
/* HERO SECTION */
61
80
/**************************/
Original file line number Diff line number Diff line change 27
27
< title > Omnifood</ title >
28
28
</ head >
29
29
< body >
30
- < header class ="header ">
30
+ < header class ="header nav-open ">
31
31
< a href ="# ">
32
32
< img class ="logo " alt ="Omnifood logo " src ="img/omnifood-logo.png " />
33
33
</ a >
40
40
< li > < a class ="main-nav-link nav-cta " href ="# "> Try for free</ a > </ li >
41
41
</ ul >
42
42
</ nav >
43
+ < button class ="btn-mobile-nav ">
44
+ < ion-icon class ="icon-mobile-nav " name ="menu-outline "> </ ion-icon >
45
+ < ion-icon class ="icon-mobile-nav " name ="close-outline "> </ ion-icon >
46
+ </ button >
43
47
</ header >
44
48
45
49
< main >
You can’t perform that action at this time.
0 commit comments