File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,6 +125,9 @@ body {
125125
126126/* Topic card */
127127.topic-card {
128+ display : block;
129+ text-decoration : none;
130+ color : inherit;
128131 background : var (--c-surface );
129132 border : 1px solid var (--c-border );
130133 border-radius : var (--radius-xl );
Original file line number Diff line number Diff line change 4747 html += '<div class="face-grid">' ;
4848 cat . topics . forEach ( function ( topic ) {
4949 html +=
50- '<div class="topic-card" data-path ="' + topic . path + '">' +
50+ '<a class="topic-card" href ="' + topic . path + '">' +
5151 '<div class="topic-card-header">' +
5252 '<div class="topic-card-icon" style="background:' + ( topic . color || "#1d4ed8" ) + '">' +
5353 topic . icon +
6464 '<div class="topic-stat">Updated ' + ( topic . updated || "\u2014" ) + '</div>' +
6565 '</div>' +
6666 '<div class="topic-card-arrow">\u203a</div>' +
67- '</div >' ;
67+ '</a >' ;
6868 } ) ;
6969 html += '</div></div>' ;
7070 } ) ;
7171 mainEl . innerHTML = html ;
7272
73- mainEl . querySelectorAll ( ".topic-card" ) . forEach ( function ( card ) {
74- card . addEventListener ( "click" , function ( ) {
75- window . location . href = card . dataset . path ;
76- } ) ;
77- } ) ;
73+ // Cards are native <a> tags — no JS click handler needed
7874 }
7975
8076 loadRegistry ( ) ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ var WikiEngine = (function () {
1616 opts . features || { }
1717 ) ;
1818 var brand = opts . brand || { icon : "SB" , text : "Super Brain" } ;
19+ var homeUrl = opts . homeUrl || null ;
1920 var labels = Object . assign (
2021 {
2122 domains : "Knowledge Domains" ,
@@ -160,7 +161,15 @@ var WikiEngine = (function () {
160161 }
161162 } ) ;
162163
163- var html =
164+ var html = "" ;
165+
166+ if ( homeUrl ) {
167+ html +=
168+ '<a class="nav-home-link" href="' + homeUrl + '">' +
169+ '<span class="nav-home-arrow">\u2190</span> Super Brain</a>' ;
170+ }
171+
172+ html +=
164173 '<div class="nav-brand" id="nav-home">' +
165174 '<div class="nav-brand-icon">' +
166175 brand . icon +
Original file line number Diff line number Diff line change @@ -101,6 +101,30 @@ body {
101101 border-radius : 2px ;
102102}
103103
104+ .nav-home-link {
105+ display : flex;
106+ align-items : center;
107+ gap : 4px ;
108+ padding : 6px var (--space-sm );
109+ margin-bottom : var (--space-xs );
110+ font-family : var (--font-ui );
111+ font-size : 0.6875rem ;
112+ font-weight : 500 ;
113+ color : var (--c-text-tertiary );
114+ text-decoration : none;
115+ border-radius : var (--radius );
116+ transition : background 0.12s , color 0.12s ;
117+ }
118+
119+ .nav-home-link : hover {
120+ background : var (--c-nav-hover );
121+ color : var (--c-accent );
122+ }
123+
124+ .nav-home-arrow {
125+ font-size : 0.75rem ;
126+ }
127+
104128.nav-brand {
105129 display : flex;
106130 align-items : center;
Original file line number Diff line number Diff line change 33 data : WIKI ,
44 dataCN : typeof WIKI_CN !== "undefined" ? WIKI_CN : null ,
55 container : document . getElementById ( "wiki-shell" ) ,
6- brand : { icon : "SB" , text : "Super Brain" } ,
6+ homeUrl : "../../" ,
7+ brand : { icon : "SB" , text : "Compiler Research" } ,
78 features : {
89 search : true ,
910 conceptRail : true ,
Original file line number Diff line number Diff line change 22 var engine = WikiEngine . create ( {
33 data : WIKI ,
44 container : document . getElementById ( "wiki-shell" ) ,
5+ homeUrl : "../../" ,
56 brand : { icon : "MPV" , text : "MPV 调研" } ,
67 features : {
78 search : false ,
You can’t perform that action at this time.
0 commit comments