File tree Expand file tree Collapse file tree 4 files changed +87
-1
lines changed Expand file tree Collapse file tree 4 files changed +87
-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
+ nav .show-on-mobile.nav-links > a {
37
+ padding-left : 0 ;
38
+ padding-right : 0 ;
39
+ }
40
+ .menu-button :hover {
41
+ cursor : pointer ;
42
+ }
43
+
44
+ .page-header {
45
+ justify-content : space-between ;
46
+ .header-center {
47
+ order : -1 ;
48
+ max-width : 24px ;
49
+ .mobile-menu {
50
+ z-index : 50 ;
51
+ }
52
+ }
53
+ .header-center > .nav-links {
54
+ background-color : #fefefe ;
55
+ border-bottom : 1px solid #ccc ;
56
+ border-top : 1px solid #ccc ;
57
+ position : absolute ;
58
+ display : flex ;
59
+ width : 100% ;
60
+ flex-wrap : wrap ;
61
+ top : 76px ;
62
+ left : 0 ;
63
+ a {
64
+ text-align : center ;
65
+ min-width : 33% ;
66
+ }
67
+ }
68
+ }
69
+ nav .hide-on-mobile {
70
+ max-height : 0 ;
71
+ opacity : 0 ;
72
+ overflow : hidden ;
73
+ transition : opacity 0.5s ;
74
+ }
75
+ nav .show-on-mobile {
76
+ opacity : 1 ;
77
+ max-height : 348px ;
78
+ transition : opacity 0.5s ease ;
79
+ }
80
+ }
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
+ let menuClass = menu . classList ;
12
+ if ( menuClass . contains ( "show-on-mobile" ) ) {
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