File tree Expand file tree Collapse file tree 4 files changed +74
-1
lines changed Expand file tree Collapse file tree 4 files changed +74
-1
lines changed Original file line number Diff line number Diff line change 24
24
box-shadow : 1px 1px 3px #ccc ;
25
25
}
26
26
}
27
+
28
+ .menu-button {
29
+ display : none ;
30
+ }
31
+
32
+ @media (max-width : 768px ) {
33
+ .menu-button {
34
+ display : block ;
35
+ }
36
+ .page-header {
37
+ justify-content : space-between ;
38
+ .header-center {
39
+ order : -1 ;
40
+ max-width : 24px ;
41
+ .mobile-menu {
42
+ z-index : 50 ;
43
+ }
44
+ }
45
+ .header-center > .nav-links {
46
+ background-color : #fefefe ;
47
+ border-bottom : 1px solid #ccc ;
48
+ border-top : 1px solid #ccc ;
49
+ position : absolute ;
50
+ display : flex ;
51
+ flex-wrap : wrap ;
52
+ top : 76px ;
53
+ left : 0 ;
54
+ a {
55
+ text-align : center ;
56
+ min-width : 28% ;
57
+ }
58
+ }
59
+ }
60
+ nav .hide-on-mobile {
61
+ display : none !important ;
62
+ height : 0 ;
63
+ }
64
+ nav .show-on-mobile {
65
+ display : flex !important ;
66
+ }
67
+ }
Original file line number Diff line number Diff line change
1
+ document . addEventListener ( "DOMContentLoaded" , function ( ) {
2
+ var menuButton = document . querySelector ( ".menu-button" ) ;
3
+ var menu = document . querySelector ( ".nav-links" ) ;
4
+
5
+ function hideMenu ( ) {
6
+ menu . classList . add ( "hide-on-mobile" ) ;
7
+ menu . classList . remove ( "show-on-mobile" ) ;
8
+ }
9
+
10
+ menuButton . addEventListener ( "click" , function ( ) {
11
+ var displayStyle = getComputedStyle ( menu ) . display ;
12
+ if ( displayStyle !== "none" ) {
13
+ hideMenu ( ) ;
14
+ } else {
15
+ menu . classList . add ( "show-on-mobile" ) ;
16
+ menu . classList . remove ( "hide-on-mobile" ) ;
17
+ }
18
+ } ) ;
19
+
20
+ menu . addEventListener ( "click" , hideMenu ) ;
21
+ } ) ;
Original file line number Diff line number Diff line change 1
- < nav >
1
+ < div class ="menu-button ">
2
+ < span >
3
+ < img alt ="mobile menu " src ="{{ "img /menu.svg"|relURL}}" alt=""/>
4
+ </ span >
5
+ </ div >
6
+
7
+ < nav class ="nav-links hide-on-mobile ">
2
8
< a href ="/ "> Inicio</ a >
3
9
< a href ="/biografia "> Biografía</ a >
4
10
< a href ="/proyectos "> Proyectos</ a >
5
11
< a href ="/posts "> Posts</ a >
6
12
< a href ="/colaboradores "> Colaboradores</ a >
7
13
< a href ="/contacto "> Contacto</ a >
8
14
</ nav >
15
+
16
+
17
+ {{ $mobileHeader := resources.Get "js/header-mobile.js" }}
18
+ < script src ="{{ $mobileHeader.Permalink }} " defer > </ script >
You can’t perform that action at this time.
0 commit comments