Skip to content

Commit 9e1f61b

Browse files
committed
fix: improve dark theme functionality and fix storage provider descriptions
1 parent a839bfd commit 9e1f61b

File tree

4 files changed

+164
-9
lines changed

4 files changed

+164
-9
lines changed

docs/assets/css/style.css

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,55 @@
3131
--shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
3232
}
3333

34+
/* Dark Theme Specific Styles */
35+
[data-theme="dark"] .card {
36+
background: var(--dark-bg);
37+
border-color: var(--border-color);
38+
color: var(--text-primary);
39+
}
40+
41+
[data-theme="dark"] .navbar {
42+
background: var(--darker-bg) !important;
43+
border-bottom: 1px solid var(--border-color);
44+
}
45+
46+
[data-theme="dark"] .content-wrapper {
47+
background: var(--dark-bg);
48+
border-color: var(--border-color);
49+
color: var(--text-primary);
50+
}
51+
52+
[data-theme="dark"] .provider-card {
53+
background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
54+
border-color: var(--border-color);
55+
color: var(--text-primary);
56+
}
57+
58+
[data-theme="dark"] .provider-card h6 {
59+
color: var(--text-primary);
60+
}
61+
62+
[data-theme="dark"] .provider-card small {
63+
color: var(--text-secondary);
64+
}
65+
66+
[data-theme="dark"] .alert {
67+
background: var(--dark-bg);
68+
border-color: var(--border-color);
69+
color: var(--text-primary);
70+
}
71+
72+
[data-theme="dark"] .btn-outline-light {
73+
border-color: var(--border-color);
74+
color: var(--text-primary);
75+
}
76+
77+
[data-theme="dark"] .btn-outline-light:hover {
78+
background: var(--primary-color);
79+
border-color: var(--primary-color);
80+
color: white;
81+
}
82+
3483
* {
3584
margin: 0;
3685
padding: 0;
@@ -43,6 +92,11 @@ body {
4392
color: var(--text-primary);
4493
background: linear-gradient(135deg, var(--light-bg) 0%, #ffffff 100%);
4594
min-height: 100vh;
95+
transition: all 0.3s ease;
96+
}
97+
98+
body[data-theme="dark"] {
99+
background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
46100
}
47101

48102
/* Hero Section */
@@ -205,7 +259,7 @@ body {
205259
background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
206260
backdrop-filter: blur(10px);
207261
box-shadow: var(--shadow-lg);
208-
padding: 1rem 0;
262+
padding: 1.5rem 0;
209263
transition: all 0.3s ease;
210264
}
211265

@@ -215,6 +269,9 @@ body {
215269
color: white !important;
216270
text-decoration: none;
217271
transition: all 0.3s ease;
272+
padding: 0.5rem 0;
273+
display: flex;
274+
align-items: center;
218275
}
219276

220277
.navbar-brand:hover {
@@ -232,11 +289,14 @@ body {
232289
.navbar-nav .nav-link {
233290
color: rgba(255, 255, 255, 0.8) !important;
234291
font-weight: 500;
235-
padding: 0.5rem 1rem !important;
236-
margin: 0 0.25rem;
292+
padding: 0.75rem 1.25rem !important;
293+
margin: 0 0.5rem;
237294
border-radius: 8px;
238295
transition: all 0.3s ease;
239296
position: relative;
297+
display: flex;
298+
align-items: center;
299+
gap: 0.5rem;
240300
}
241301

242302
.navbar-nav .nav-link:hover {
@@ -263,8 +323,8 @@ body {
263323

264324
/* Main Content */
265325
.main-content {
266-
margin-top: 80px;
267-
min-height: calc(100vh - 80px);
326+
margin-top: 120px;
327+
min-height: calc(100vh - 120px);
268328
}
269329

270330
/* Content Area - Full Width */
@@ -286,8 +346,8 @@ body {
286346
}
287347

288348
.main-content {
289-
margin-top: 80px;
290-
min-height: calc(100vh - 80px);
349+
margin-top: 120px;
350+
min-height: calc(100vh - 120px);
291351
width: 100%;
292352
max-width: 100%;
293353
}

docs/assets/js/script.js

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// SmartRAG Documentation - Main JavaScript
2+
3+
document.addEventListener('DOMContentLoaded', function() {
4+
// Theme Toggle Functionality
5+
const themeToggle = document.getElementById('themeToggle');
6+
const themeIcon = document.getElementById('themeIcon');
7+
const body = document.body;
8+
9+
// Check for saved theme preference or default to 'light'
10+
const currentTheme = localStorage.getItem('theme') || 'light';
11+
12+
// Apply the current theme
13+
function applyTheme(theme) {
14+
if (theme === 'dark') {
15+
body.setAttribute('data-theme', 'dark');
16+
themeIcon.className = 'fas fa-moon';
17+
localStorage.setItem('theme', 'dark');
18+
} else {
19+
body.removeAttribute('data-theme');
20+
themeIcon.className = 'fas fa-sun';
21+
localStorage.setItem('theme', 'light');
22+
}
23+
}
24+
25+
// Initialize theme
26+
applyTheme(currentTheme);
27+
28+
// Theme toggle click handler
29+
if (themeToggle) {
30+
themeToggle.addEventListener('click', function() {
31+
const currentTheme = localStorage.getItem('theme') || 'light';
32+
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
33+
applyTheme(newTheme);
34+
});
35+
}
36+
37+
// Back to Top Button
38+
const backToTopButton = document.getElementById('backToTop');
39+
40+
if (backToTopButton) {
41+
// Show button when scrolling down
42+
window.addEventListener('scroll', function() {
43+
if (window.pageYOffset > 300) {
44+
backToTopButton.classList.add('show');
45+
} else {
46+
backToTopButton.classList.remove('show');
47+
}
48+
});
49+
50+
// Scroll to top when clicked
51+
backToTopButton.addEventListener('click', function() {
52+
window.scrollTo({
53+
top: 0,
54+
behavior: 'smooth'
55+
});
56+
});
57+
}
58+
59+
// Smooth scrolling for anchor links
60+
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
61+
anchor.addEventListener('click', function (e) {
62+
e.preventDefault();
63+
const target = document.querySelector(this.getAttribute('href'));
64+
if (target) {
65+
target.scrollIntoView({
66+
behavior: 'smooth',
67+
block: 'start'
68+
});
69+
}
70+
});
71+
});
72+
73+
// Add fade-in animation to content
74+
const observerOptions = {
75+
threshold: 0.1,
76+
};
77+
78+
const observer = new IntersectionObserver((entries, observer) => {
79+
entries.forEach(entry => {
80+
if (entry.isIntersecting) {
81+
entry.target.style.opacity = '1';
82+
entry.target.style.transform = 'translateY(0)';
83+
observer.unobserve(entry.target);
84+
}
85+
});
86+
}, observerOptions);
87+
88+
// Observe content elements
89+
document.querySelectorAll('.content-wrapper, .card, .alert').forEach(el => {
90+
el.style.opacity = '0';
91+
el.style.transform = 'translateY(20px)';
92+
el.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
93+
observer.observe(el);
94+
});
95+
});

docs/en/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ SmartRAG integrates with leading AI providers and storage solutions to give you
211211
<i class="fas fa-cogs fa-3x text-dark"></i>
212212
</div>
213213
<h6 class="mb-1">Custom</h6>
214-
<small class="text-muted">Extensible Storage</small>
214+
<small class="text-muted">Universal API Support</small>
215215
</div>
216216
</div>
217217
</div>

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ var document = await documentService.UploadDocumentAsync(file);
243243
<i class="fas fa-cogs"></i>
244244
</div>
245245
<h6>Custom</h6>
246-
<small>Extensible Storage</small>
246+
<small>Any OpenAI-compatible API</small>
247247
</div>
248248
</div>
249249
</div>

0 commit comments

Comments
 (0)