File tree Expand file tree Collapse file tree 5 files changed +45
-27
lines changed
Expand file tree Collapse file tree 5 files changed +45
-27
lines changed Original file line number Diff line number Diff line change 5555 </div >
5656 </nav >
5757 </div >
58+
59+ <script >
60+ document .addEventListener (' DOMContentLoaded' , () => {
61+ const filetreeSidebar = document .querySelector (' .filetree-sidebar' );
62+ const activeNote = filetreeSidebar ? filetreeSidebar .querySelector (' .active-note' ) : null ;
63+
64+ if (activeNote && filetreeSidebar) {
65+ // Scroll the active note into view, centered vertically
66+ activeNote .scrollIntoView ({ behavior: ' smooth' , block: ' center' });
67+ }
68+ });
69+ </script >
Original file line number Diff line number Diff line change 1+ <script >
2+ // Prevent FOUC by setting theme class before page render
3+ (function () {
4+ const storedTheme = localStorage .getItem (' site-theme' );
5+ const prefersDark = window .matchMedia && window .matchMedia (' (prefers-color-scheme: dark)' ).matches ;
6+ let theme = ' dark' ; // Default theme
7+
8+ if (storedTheme === ' dark' || (storedTheme === ' auto' && prefersDark)) {
9+ theme = ' dark' ;
10+ } else if (storedTheme === ' light' || (storedTheme === ' auto' && ! prefersDark)) {
11+ theme = ' light' ;
12+ } else if (prefersDark) {
13+ theme = ' dark' ;
14+ } else {
15+ theme = ' light' ;
16+ }
17+ document .body .classList .add (' theme-' + theme);
18+ document .body .classList .remove (' js-fouc-hidden' );
19+ })();
20+ </script >
Original file line number Diff line number Diff line change 1- <script >
2- // Prevent FOUC by setting theme class before page render
3- (function () {
4- const storedTheme = localStorage .getItem (' site-theme' );
5- const prefersDark = window .matchMedia && window .matchMedia (' (prefers-color-scheme: dark)' ).matches ;
6- let theme = ' dark' ; // Default theme
71
8- if (storedTheme === ' dark' || (storedTheme === ' auto' && prefersDark)) {
9- theme = ' dark' ;
10- } else if (storedTheme === ' light' || (storedTheme === ' auto' && ! prefersDark)) {
11- theme = ' light' ;
12- } else if (prefersDark) {
13- theme = ' dark' ;
14- } else {
15- theme = ' light' ;
16- }
17- document .body .classList .add (' theme-' + theme);
18- })();
19- </script >
202
213<script src =" /vendor/lucide.min.js" ></script >
224<meta name =" viewport" content =" width=device-width, initial-scale=1.0" >
Original file line number Diff line number Diff line change 1111 {% endfor %}
1212 <link rel =" stylesheet" href =" /styles/site-stats.css" >
1313 <link rel =" stylesheet" href =" /styles/lazy-loading.css" >
14+ <style >
15+ .js-fouc-hidden {
16+ opacity : 0 ;
17+ transition : opacity 0.3s ease-in-out ;
18+ }
19+ </style >
1420 </head >
15- <body class =" theme-{{meta.baseTheme}} markdown-preview-view markdown-rendered markdown-preview-section {{meta.bodyClasses}}" >
21+ <body class =" js-fouc-hidden theme-{{meta.baseTheme}} markdown-preview-view markdown-rendered markdown-preview-section {{meta.bodyClasses}}" >
22+ {% include " components/fouc-prevention.njk" %}
1623 <!-- Sidebar Toggle Buttons -->
1724 <button id =" toggle-left-sidebar" class =" sidebar-toggle-button" >
1825 <svg width =" 24" height =" 24" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 2" stroke-linecap =" round" stroke-linejoin =" round" class =" lucide lucide-chevrons-left" ><path d =" m11 17-5-5 5-5" /><path d =" m18 17-5-5 5-5" /></svg >
108115 {% for imp in dynamics .index .footer %}
109116 {% include imp %}
110117 {% endfor %}
111- {% include " components/lucideIcons.njk" %}
112-
113-
114- </script >
115-
116118 <script src =" /scripts/lazy-loading.js" ></script >
117119 <script src =" /scripts/animate-stats.js" ></script >
118120 <script src =" /scripts/sidebar-toggle.js" ></script >
119121
122+ {% include " components/lucideIcons.njk" %}
120123 {% include " components/main-footer.njk" %}
121124 </body >
122125 </html >
Original file line number Diff line number Diff line change @@ -288,10 +288,10 @@ nav.navbar {
288288}
289289
290290nav .filetree-sidebar {
291- width : 285 px ;
292- font-size : 1.08 em ;
291+ width : 255 px ;
292+ font-size : 0.95 em ;
293293 top : 15px ;
294- left : 10 px ;
294+ left : 3 px ;
295295 position : fixed ;
296296 height : calc (100% - 20px );
297297 display : flex ;
@@ -990,6 +990,7 @@ body.has-fullscreen-graph #floating-control {
990990/* ----------------------------- */
991991#pwa-actions-container {
992992 margin-top : auto !important ; /* 推到底部 */
993+ margin-bottom : 60px ;
993994 padding : 15px 10px !important ;
994995 display : flex !important ;
995996 flex-wrap : wrap ;
You can’t perform that action at this time.
0 commit comments