File tree Expand file tree Collapse file tree 2 files changed +94
-5
lines changed Expand file tree Collapse file tree 2 files changed +94
-5
lines changed Original file line number Diff line number Diff line change 1
1
2
- < nav class ="navbar navbar-expand-lg navbar- dark ">
3
- < div class ="d-flex d-none d-sm-block d-md-block d-lg-none ">
2
+ < nav class ="navbar navbar-dark ">
3
+ < div class ="d-flex d-none d-sm-block d-md-block mx-auto ">
4
4
< div class ="navbar-header ">
5
5
< a class ="navbar-brand " href ="/ "> < img src ="/assets/img/logo/logo.png " style ="height: 70px; width: 70px; background-color: white; " class ="mr-3 "> Py Contributors</ a >
6
6
</ div >
7
7
</ div >
8
8
< button class ="navbar-toggler " type ="button " data-toggle ="collapse " data-target ="#navbarColor03 " aria-controls ="navbarColor03 " aria-expanded ="false " aria-label ="Toggle navigation ">
9
- < span class ="navbar-toggler-icon "> </ span >
9
+ < div class ="hamburger ">
10
+ < div class ="line1 "> </ div >
11
+ < div class ="line2 "> </ div >
12
+ < div class ="line3 "> </ div >
13
+ </ div >
10
14
</ button >
11
15
12
16
< div class ="collapse navbar-collapse " id ="navbarColor03 ">
46
50
</ ul >
47
51
</ div >
48
52
</ div >
49
- </ nav >
53
+ </ nav >
54
+
55
+ < script >
56
+ const menu = document . querySelector ( '.hamburger' ) ;
57
+ const list = document . querySelectorAll ( 'li' ) ;
58
+
59
+ menu . addEventListener ( 'click' , ( ) => {
60
+ list . forEach ( item => {
61
+ item . classList . toggle ( 'active' ) ;
62
+ } )
63
+ menu . classList . toggle ( 'cross' ) ;
64
+ } )
65
+ </ script >
Original file line number Diff line number Diff line change @@ -158,4 +158,77 @@ background-attachment: fixed !important;
158
158
{
159
159
margin-left : 50% ;
160
160
}
161
- }
161
+ }
162
+ /* Hamburger */
163
+
164
+ .hamburger {
165
+ z-index : 1 ;
166
+ display : inline-block;
167
+ cursor : pointer;
168
+ position : absolute;
169
+ right : 10px ;
170
+ top : 10px ;
171
+ }
172
+
173
+ .line1 , .line2 , .line3 {
174
+ width : 35px ;
175
+ height : 5px ;
176
+ background-color : white;
177
+ margin : 6px 0 ;
178
+ transition : 0.4s ;
179
+ }
180
+
181
+ .cross .line1 {
182
+ transform : rotate (-45deg ) translate (-9px , 6px );
183
+ }
184
+
185
+ .cross .line2 {
186
+ opacity : 0 ;
187
+ background-color : white;
188
+ }
189
+
190
+ .cross .line3 {
191
+ transform : rotate (45deg ) translate (-8px , -8px );
192
+ background-color : white;
193
+ }
194
+ ul {
195
+ height : 100% ;
196
+ }
197
+
198
+ ul li {
199
+ display : flex;
200
+ align-items : center;
201
+ justify-content : center;
202
+ height : 20% ;
203
+ color : white;
204
+ background-color : black;
205
+ text-transform : uppercase;
206
+ letter-spacing : 2px ;
207
+ transition : all 0.4s ease-out;
208
+ transform : translateX (-100% );
209
+ }
210
+
211
+ ul li .active {
212
+ transform : translateX (0 );
213
+ }
214
+
215
+ ul li : nth-child (1 ) {
216
+ background-color : # 355070 ;
217
+ transition-delay : 0.08s ;
218
+ }
219
+ ul li : nth-child (2 ) {
220
+ background-color : # 6D597A ;
221
+ transition-delay : 0.16s ;
222
+ }
223
+ ul li : nth-child (3 ) {
224
+ background-color : # B56576 ;
225
+ transition-delay : 0.24s ;
226
+ }
227
+ ul li : nth-child (4 ) {
228
+ background-color : # E56B6F ;
229
+ transition-delay : 0.32s ;
230
+ }
231
+ ul li : nth-child (5 ) {
232
+ background-color : # EAAC8B ;
233
+ transition-delay : 0.40s ;
234
+ }
You can’t perform that action at this time.
0 commit comments