File tree Expand file tree Collapse file tree 4 files changed +74
-1
lines changed
css-gradient-based-app-step-1 Expand file tree Collapse file tree 4 files changed +74
-1
lines changed Original file line number Diff line number Diff line change 9
9
"build" : " parcel build src/index.html" ,
10
10
"postbuild:not-fully-working" : " parcel build 'public/**/*'" ,
11
11
"postbuild" : " ncp ./public ./dist --filter '**/*.*'" ,
12
- "dev" : " parcel src/index.html" ,
12
+ "dev" : " parcel src/index.html --no-cache " ,
13
13
"start" : " pm2 start 'npm run dev' --name app" ,
14
14
"restart" : " pm2 restart app" ,
15
15
"stop" : " pm2 kill" ,
Original file line number Diff line number Diff line change @@ -53,3 +53,43 @@ figcaption {
53
53
font-size : 1.3em ;
54
54
font-weight : bolder;
55
55
}
56
+
57
+ /* menu */
58
+
59
+ nav {
60
+ background : # fff ;
61
+ }
62
+
63
+ ul {
64
+ display : none;
65
+ }
66
+
67
+ ul .active {
68
+ display : block;
69
+ position : absolute;
70
+ background : # fff ;
71
+ height : 100% ;
72
+ width : 50% ;
73
+ left : 0 ;
74
+ top : 0 ;
75
+ }
76
+
77
+ ul {
78
+ margin-top : 0 ;
79
+ padding-left : 0 ;
80
+ list-style-type : none;
81
+ }
82
+
83
+ ul li a {
84
+ color : # 000 ;
85
+ text-decoration : none;
86
+ text-transform : uppercase;
87
+ font-size : .8em ;
88
+ display : block;
89
+ padding : 1.5em 3em ;
90
+ background-color : rgba (255 , 255 , 255 , .35 );
91
+ }
92
+
93
+ ul li a : hover {
94
+ background-color : rgba (232 , 232 , 232 , 0.35 );
95
+ }
Original file line number Diff line number Diff line change 17
17
< figcaption > Max Simko</ figcaption >
18
18
</ figure >
19
19
< img src ="../public/images/menu.svg " alt ="image ">
20
+ < nav >
21
+ < ul >
22
+ < li > < a href ="# "> Home</ a > </ li >
23
+ < li > < a href ="# "> About me</ a > </ li >
24
+ < li > < a href ="# "> Portfolio</ a > </ li >
25
+ < li > < a href ="# "> Contacts</ a > </ li >
26
+ </ ul >
27
+ </ nav >
20
28
</ aside >
21
29
< main >
22
30
<!-- main site content -->
Original file line number Diff line number Diff line change @@ -9,3 +9,28 @@ WebFont.load({
9
9
] ,
10
10
} ,
11
11
} ) ;
12
+
13
+ function $ ( selector ) {
14
+ return document . querySelector ( selector ) ;
15
+ }
16
+
17
+ function findMenu ( ) {
18
+ return $ ( 'aside nav ul' ) ;
19
+ }
20
+
21
+ function findImg ( ) {
22
+ return $ ( 'img' ) ;
23
+ }
24
+
25
+ function toggleMenu ( e ) {
26
+ const menu = findMenu ( ) ;
27
+ // menu.display = !menu || !menu.display || menu.display !== 'block' ? 'block' : 'none';
28
+ menu . classList . toggle ( 'active' ) ;
29
+ e . preventDefault ( ) ;
30
+ }
31
+
32
+ function onDomContentLoaded ( ) {
33
+ findImg ( ) . addEventListener ( 'click' , toggleMenu , false ) ;
34
+ }
35
+
36
+ document . addEventListener ( 'DOMContentLoaded' , onDomContentLoaded , false ) ;
You can’t perform that action at this time.
0 commit comments