Skip to content

Commit 82d44a2

Browse files
committed
update:sidebar
1 parent 8425333 commit 82d44a2

File tree

10 files changed

+38
-25
lines changed

10 files changed

+38
-25
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ Rockchip-AI-Lab/
4141
│ │ │ ├── llm/ # Large Language Model content
4242
│ │ │ ├── ui/ # User Interface content
4343
│ │ │ └── vlm/ # Visual Language Model content
44-
│ │ ├── rk3568(3588)/ # Content for RK3568 chip
44+
│ │ ├── rk3576(3588)/ # Content for RK3576/3588 chip
4545
│ │ │ ├── cv/
4646
│ │ │ ├── llm/
4747
│ │ │ ├── ui/
4848
│ │ │ └── vlm/
4949
│ │ ├── rk1820.json # RK1820 content index configuration
50-
│ │ └── rk3568.json # RK3568 content index configuration
50+
│ │ └── rk3576(3588).json # RK3576/3588 content index configuration
5151
│ ├── img/ # Image assets
5252
│ ├── js/ # JavaScript files
5353
│ │ └── app.js # Main application script
@@ -63,7 +63,7 @@ Rockchip-AI-Lab/
6363

6464
## 🤝 Contribute
6565

66-
To run the project locally:
66+
Fork this project and run the project locally:
6767

6868
>💡Note: Every time you modify the `src` folder, you need to run `npm run build` to rebuild.
6969

public/styles.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
--text-secondary: #4a5568;
1313
--border-color: #e0e0e0;
1414
--hover-bg: #f1f8e9;
15-
--chip-rk3568: #76b900;
15+
--chip-rk3576(3588): #76b900;
1616
--chip-rk1820: #ffb74d;
1717
}
1818

@@ -62,7 +62,7 @@ body {
6262
transform: translateX(3px);
6363
}
6464

65-
.chip-folder[data-chip="rk3568"] {
65+
.chip-folder[data-chip="rk3576(3588)"] {
6666
background: linear-gradient(to right, rgba(118, 185, 0, 0.15), transparent);
6767
border-left: none; /* Remove the green border */
6868
}
@@ -77,7 +77,7 @@ body {
7777
background: linear-gradient(to right, rgba(118, 185, 0, 0.25), transparent) !important;
7878
}
7979

80-
.chip-folder[data-chip="rk3568"]:hover {
80+
.chip-folder[data-chip="rk3576(3588)"]:hover {
8181
background: linear-gradient(to right, rgba(118, 185, 0, 0.25), transparent);
8282
}
8383

src/index.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<a href="#" class="nav-link" data-page="cv">CV</a>
1919
<div class="sub-menu" id="cv-submenu" style="display: none;">
2020
<!-- CV files will be loaded here -->
21-
<a href="#" class="chip-folder" data-chip="rk3568">RK3568</a>
22-
<div class="chip-submenu" id="cv-rk3568-submenu" style="display: none;">
23-
<!-- RK3568 CV files will be loaded here -->
21+
<a href="#" class="chip-folder" data-chip="rk3576(3588)">RK3576/3588</a>
22+
<div class="chip-submenu" id="cv-rk3576(3588)-submenu" style="display: none;">
23+
<!-- RK3576/3588 CV files will be loaded here -->
2424
</div>
2525
<a href="#" class="chip-folder" data-chip="rk1820">RK1820</a>
2626
<div class="chip-submenu" id="cv-rk1820-submenu" style="display: none;">
@@ -32,9 +32,9 @@
3232
<a href="#" class="nav-link" data-page="llm">LLM</a>
3333
<div class="sub-menu" id="llm-submenu" style="display: none;">
3434
<!-- LLM files will be loaded here -->
35-
<a href="#" class="chip-folder" data-chip="rk3568">RK3568</a>
36-
<div class="chip-submenu" id="llm-rk3568-submenu" style="display: none;">
37-
<!-- RK3568 LLM files will be loaded here -->
35+
<a href="#" class="chip-folder" data-chip="rk3576(3588)">RK3576/3588</a>
36+
<div class="chip-submenu" id="llm-rk3576(3588)-submenu" style="display: none;">
37+
<!-- RK3576/3588 LLM files will be loaded here -->
3838
</div>
3939
<a href="#" class="chip-folder" data-chip="rk1820">RK1820</a>
4040
<div class="chip-submenu" id="llm-rk1820-submenu" style="display: none;">
@@ -46,9 +46,9 @@
4646
<a href="#" class="nav-link" data-page="vlm">VLM</a>
4747
<div class="sub-menu" id="vlm-submenu" style="display: none;">
4848
<!-- VLM files will be loaded here -->
49-
<a href="#" class="chip-folder" data-chip="rk3568">RK3568</a>
50-
<div class="chip-submenu" id="vlm-rk3568-submenu" style="display: none;">
51-
<!-- RK3568 VLM files will be loaded here -->
49+
<a href="#" class="chip-folder" data-chip="rk3576(3588)">RK3576/3588</a>
50+
<div class="chip-submenu" id="vlm-rk3576(3588)-submenu" style="display: none;">
51+
<!-- RK3576/3588 VLM files will be loaded here -->
5252
</div>
5353
<a href="#" class="chip-folder" data-chip="rk1820">RK1820</a>
5454
<div class="chip-submenu" id="vlm-rk1820-submenu" style="display: none;">
@@ -60,9 +60,9 @@
6060
<a href="#" class="nav-link" data-page="ui">UI</a>
6161
<div class="sub-menu" id="ui-submenu" style="display: none;">
6262
<!-- UI files will be loaded here -->
63-
<a href="#" class="chip-folder" data-chip="rk3568">RK3568</a>
64-
<div class="chip-submenu" id="ui-rk3568-submenu" style="display: none;">
65-
<!-- RK3568 UI files will be loaded here -->
63+
<a href="#" class="chip-folder" data-chip="rk3576(3588)">RK3576/3588</a>
64+
<div class="chip-submenu" id="ui-rk3576(3588)-submenu" style="display: none;">
65+
<!-- RK3576/3588 UI files will be loaded here -->
6666
</div>
6767
<a href="#" class="chip-folder" data-chip="rk1820">RK1820</a>
6868
<div class="chip-submenu" id="ui-rk1820-submenu" style="display: none;">
@@ -81,7 +81,7 @@
8181
<div id="home-page" class="page active">
8282
<h1>Welcome to Rockchip AI Lab</h1>
8383
<p>Explore our cutting-edge research and development in AI technologies.</p>
84-
<p>Our lab focuses on advanced AI solutions using Rockchip processors like RK3588 and RK1820.</p>
84+
<p>Our lab focuses on advanced AI solutions using Rockchip processors like RK3568/3588 and RK1820.</p>
8585
</div>
8686

8787
<div id="cv-page" class="page">

src/js/app.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
document.addEventListener('DOMContentLoaded', function() {
22
// Current selected chip
3-
let currentChip = 'rk3568'; // Default to rk3568
3+
let currentChip = 'rk3576(3588)'; // Default to rk3576(3588)
44

55
// Page navigation
66
const navLinks = document.querySelectorAll('.nav-link');
@@ -114,13 +114,23 @@ document.addEventListener('DOMContentLoaded', function() {
114114
e.preventDefault();
115115

116116
const chipType = this.getAttribute('data-chip');
117-
const targetPage = this.closest('.sub-menu').id.replace('-submenu', '');
117+
let targetPage;
118+
if (this.closest('.sub-menu')) {
119+
targetPage = this.closest('.sub-menu').id.replace('-submenu', '');
120+
} else {
121+
// Handle the case where the folder is directly in the main menu
122+
targetPage = this.closest('.nav-item').querySelector('.nav-link').getAttribute('data-page');
123+
}
118124

119125
// Update current chip
120126
currentChip = chipType;
121127

122128
// Toggle submenu visibility for this chip
123-
const chipSubmenu = document.getElementById(`${targetPage}-${chipType}-submenu`);
129+
let chipSubmenuId = `${targetPage}-${chipType}-submenu`;
130+
// Replace any special characters in the ID to make it valid
131+
chipSubmenuId = chipSubmenuId.replace(/\(/g, '\\(').replace(/\)/g, '\\)');
132+
const chipSubmenu = document.getElementById(chipSubmenuId.replace(/\\/g, '')); // Simple approach for this case
133+
124134
if (chipSubmenu) {
125135
// Hide all other chip submenus in this page
126136
document.querySelectorAll(`#${targetPage}-submenu .chip-submenu`).forEach(menu => {
@@ -232,6 +242,9 @@ document.addEventListener('DOMContentLoaded', function() {
232242
case 'help':
233243
mdFiles = ['index.md', 'quick-start.md', 'demo1.md', 'demo2.md'];
234244
break;
245+
case 'rk3576(3588)': // Special case for chip-specific content
246+
mdFiles = ['index.md', 'demo1.md', 'demo2.md'];
247+
break;
235248
default:
236249
mdFiles = ['index.md'];
237250
}

src/styles.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
--text-secondary: #4a5568;
1313
--border-color: #e0e0e0;
1414
--hover-bg: #f1f8e9;
15-
--chip-rk3568: #76b900;
15+
--chip-rk3576(3588): #76b900;
1616
--chip-rk1820: #ffb74d;
1717
}
1818

@@ -62,7 +62,7 @@ body {
6262
transform: translateX(3px);
6363
}
6464

65-
.chip-folder[data-chip="rk3568"] {
65+
.chip-folder[data-chip="rk3576(3588)"] {
6666
background: linear-gradient(to right, rgba(118, 185, 0, 0.15), transparent);
6767
border-left: none; /* Remove the green border */
6868
}
@@ -77,7 +77,7 @@ body {
7777
background: linear-gradient(to right, rgba(118, 185, 0, 0.25), transparent) !important;
7878
}
7979

80-
.chip-folder[data-chip="rk3568"]:hover {
80+
.chip-folder[data-chip="rk3576(3588)"]:hover {
8181
background: linear-gradient(to right, rgba(118, 185, 0, 0.25), transparent);
8282
}
8383

0 commit comments

Comments
 (0)