File tree 3 files changed +43
-5
lines changed
3 files changed +43
-5
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,32 @@ 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 : sticky;
44
+ top : 0 ;
45
+ overflow-y : scroll;
44
46
text-align : left;
45
47
width : 15em ;
46
48
padding : 2em ;
47
- padding-right : 0 ;
49
+ }
50
+
51
+ .navbar > ul {
52
+ margin : 0 ;
53
+ list-style : none;
54
+ position : relative;
55
+ line-height : 0 ;
56
+ }
57
+
58
+ .navbar > ul > li {
59
+ margin : .5rem 0 ;
60
+ }
61
+
62
+ .navbar > ul > li .active {
63
+ font-weight : bold;
48
64
}
49
65
50
66
# menuLinkBar {
64
80
display : -ms-flexbox;
65
81
display : flex;
66
82
margin : 0 auto;
83
+ max-height : 100vh ;
84
+ overflow-x : hidden;
85
+ overflow-y : scroll;
67
86
justify-content : center;
68
87
}
69
88
@@ -74,19 +93,22 @@ body {
74
93
-webkit-flex-direction : column;
75
94
-ms-flex-direction : column;
76
95
flex-direction : column;
96
+ max-height : fit-content;
77
97
}
78
98
.site {
79
99
-webkit-box-ordinal-group : 3 ;
80
100
-webkit-order : 2 ;
81
101
-ms-flex-order : 2 ;
82
102
order : 2 ;
103
+ padding : 1em ;
83
104
}
84
105
.navbar {
85
- width : auto ;
106
+ width : 100 % ;
86
107
-webkit-box-ordinal-group : 4 ;
87
108
-webkit-order : 3 ;
88
109
-ms-flex-order : 3 ;
89
110
order : 3 ;
111
+ padding : 1em ;
90
112
}
91
113
# menuLinkBar {
92
114
display : block;
@@ -795,10 +817,10 @@ pre {
795
817
-moz-border-radius : 3px ;
796
818
-ms-border-radius : 3px ;
797
819
-o-border-radius : 3px ;
820
+ white-space : pre-wrap;
798
821
border-radius : 3px ;
799
822
display : block;
800
823
padding : 10px 15px 13px 15px ;
801
- margin : 0 3em 1em 3em ;
802
824
background-color : # fff ;
803
825
border : solid 1px # efeee6 ;
804
826
line-height : 18px ;
@@ -2015,7 +2037,7 @@ th, td {
2015
2037
}
2016
2038
2017
2039
img {
2018
- max-width : 100 % ;
2040
+ max-width : 50 % ;
2019
2041
}
2020
2042
2021
2043
/* 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
+ let flag = false ;
3
+
4
+
5
+ // rotate the arrow of <li> which matches the SITE_URL
6
+ Array . from ( NAVBAR_LI_ELEMENTS ) . forEach ( ( liElement ) => {
7
+ if ( liElement . firstElementChild . href == location . href ) {
8
+ liElement . classList . add ( 'active' ) ;
9
+ flag = true ;
10
+ return ;
11
+ }
12
+ } )
13
+
14
+ // if non of other is active the the Home tab is active
15
+ if ( ! flag ) NAVBAR_LI_ELEMENTS [ 0 ] . classList . add ( 'active' ) ;
You can’t perform that action at this time.
0 commit comments