Skip to content

Commit d7f049d

Browse files
committed
update
1 parent 34d5dee commit d7f049d

2 files changed

Lines changed: 37 additions & 6 deletions

File tree

app/learn/page.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,21 @@ export default function LearnPage() {
1616
<div className="max-w-4xl mx-auto text-center">
1717
<h1 className="text-5xl md:text-6xl font-bold mb-6">
1818
<span className="bg-gradient-to-r from-blue-400 via-purple-400 to-cyan-400 bg-clip-text text-transparent">
19-
{language === 'en' ? 'Learn AI from Scratch' : '从零开始学习AI'}
19+
{language === 'en' ? 'Learn Everything You Need To Be An AI Researcher' : '从零开始学习AI'}
2020
</span>
2121
</h1>
2222
<p className="text-xl text-slate-300 mb-8">
2323
{language === 'en'
2424
? 'Master the fundamentals and build your own neural networks'
2525
: '掌握基础知识,构建你自己的神经网络'}
2626
</p>
27+
<div className="max-w-3xl mx-auto bg-amber-500/10 border border-amber-500/30 rounded-xl p-6 mb-8">
28+
<p className="text-amber-200 text-sm leading-relaxed">
29+
{language === 'en'
30+
? 'Under active development, some parts are AI generated and not reviewed yet. In the end everything will be carefully reviewed and rewritten by humans to the highest quality'
31+
: '正在积极开发中,部分内容由AI生成尚未审核。最终所有内容都将由人工仔细审核和重写,确保最高质量'}
32+
</p>
33+
</div>
2734
</div>
2835
</div>
2936
</section>

components/course-navigation.tsx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,30 @@ export function CourseNavigation() {
2929

3030
// Auto-scroll to active lesson on mount and pathname change
3131
useEffect(() => {
32-
if (activeLinkRef.current) {
33-
activeLinkRef.current.scrollIntoView({
34-
behavior: 'smooth',
35-
block: 'center'
36-
});
32+
// Only scroll if we're on a lesson page (pathname starts with /learn/)
33+
if (!pathname?.startsWith('/learn/')) {
34+
return;
3735
}
36+
37+
// Use a small delay to ensure the DOM is fully rendered
38+
const timer = setTimeout(() => {
39+
if (activeLinkRef.current) {
40+
try {
41+
activeLinkRef.current.scrollIntoView({
42+
behavior: 'smooth',
43+
block: 'center',
44+
inline: 'nearest'
45+
});
46+
console.log('Scrolled to active lesson:', pathname);
47+
} catch (error) {
48+
console.error('Error scrolling to active lesson:', error);
49+
}
50+
} else {
51+
console.log('Active link ref not found for:', pathname);
52+
}
53+
}, 100);
54+
55+
return () => clearTimeout(timer);
3856
}, [pathname]);
3957

4058
const NavigationContent = () => (
@@ -63,6 +81,12 @@ export function CourseNavigation() {
6381
{module.lessons.map((lesson, lessonIndex) => {
6482
const isActive = pathname === lesson.href;
6583
const lessonNumber = lessonIndex + 1;
84+
85+
// Debug log
86+
if (isActive) {
87+
console.log('Active lesson found:', lesson.title, 'at', lesson.href);
88+
}
89+
6690
return (
6791
<li key={lessonIndex}>
6892
<Link

0 commit comments

Comments
 (0)