File tree Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Original file line number Diff line number Diff line change 7
7
< meta name ="viewport " content ="width=device-width ">
8
8
< link rel ="icon " type ="image/x-icon " href ="/images/logo.png "/>
9
9
< link rel ="stylesheet " href ="/css/main.css ">
10
+ < script src ="/script/script.js " defer > </ script >
10
11
< link rel ="alternate " type ="application/rss+xml " title ="RSS " href ="/feed.xml ">
11
12
</ head >
12
13
Original file line number Diff line number Diff line change @@ -35,16 +35,33 @@ body {
35
35
-webkit-box-flex : 1 ;
36
36
-webkit-flex : 1 ;
37
37
-ms-flex : 1 ;
38
- flex : 1 ;
39
38
max-width : 700px ;
40
39
}
41
40
42
41
.navbar {
43
42
float : left;
43
+ position : -webkit-sticky;
44
+ position : sticky;
45
+ top : 0 ;
44
46
text-align : left;
47
+ height : fit-content;
45
48
width : 15em ;
46
49
padding : 2em ;
47
- padding-right : 0 ;
50
+ }
51
+
52
+ .navbar > ul {
53
+ margin : 0 ;
54
+ list-style : none;
55
+ position : relative;
56
+ line-height : 0 ;
57
+ }
58
+
59
+ .navbar > ul > li {
60
+ margin : .5rem 0 ;
61
+ }
62
+
63
+ .navbar > ul > li .active {
64
+ font-weight : bold;
48
65
}
49
66
50
67
# menuLinkBar {
64
81
display : -ms-flexbox;
65
82
display : flex;
66
83
margin : 0 auto;
84
+ width : 100% ;
67
85
justify-content : center;
68
86
}
69
87
@@ -80,13 +98,15 @@ body {
80
98
-webkit-order : 2 ;
81
99
-ms-flex-order : 2 ;
82
100
order : 2 ;
101
+ padding : 1em ;
83
102
}
84
103
.navbar {
85
104
width : auto;
86
105
-webkit-box-ordinal-group : 4 ;
87
106
-webkit-order : 3 ;
88
107
-ms-flex-order : 3 ;
89
108
order : 3 ;
109
+ padding : 1em ;
90
110
}
91
111
# menuLinkBar {
92
112
display : block;
@@ -795,10 +815,10 @@ pre {
795
815
-moz-border-radius : 3px ;
796
816
-ms-border-radius : 3px ;
797
817
-o-border-radius : 3px ;
818
+ white-space : pre-wrap;
798
819
border-radius : 3px ;
799
820
display : block;
800
821
padding : 10px 15px 13px 15px ;
801
- margin : 0 3em 1em 3em ;
802
822
background-color : # fff ;
803
823
border : solid 1px # efeee6 ;
804
824
line-height : 18px ;
@@ -2015,7 +2035,7 @@ th, td {
2015
2035
}
2016
2036
2017
2037
img {
2018
- max-width : 100 % ;
2038
+ max-width : 50 % ;
2019
2039
}
2020
2040
2021
2041
/* Table of contents */
Original file line number Diff line number Diff line change
1
+ const NAVBAR_LI_ELEMENTS = document . getElementById ( 'navbar' ) . firstElementChild . children ; // Access all the <li> in side navigation
2
+
3
+ // check for a match with the <li> element and SITE_URL, then make it active
4
+ Array . from ( NAVBAR_LI_ELEMENTS ) . forEach ( ( liElement ) => {
5
+ if ( liElement . firstElementChild . href == location . href ) {
6
+ liElement . classList . add ( 'active' ) ;
7
+ return ;
8
+ }
9
+ } )
You can’t perform that action at this time.
0 commit comments