-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
428 lines (396 loc) · 25 KB
/
Copy pathindex.html
File metadata and controls
428 lines (396 loc) · 25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
<!DOCTYPE html>
<html lang="en">
<head>
<!-- FontAwesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Primary Meta Tags -->
<title>Java Learning Hub - Learn Java with AI Tutor</title>
<meta name="title" content="Java Learning Hub - Learn Java with AI Tutor">
<meta name="description" content="Learn Java programming with an interactive AI tutor. 53 lessons, built-in code editor, instant code execution. Perfect for beginners!">
<meta name="keywords" content="java, java learning, java tutorial, learn programming, java course, AI tutor, coding education, java for beginners">
<meta name="author" content="Java Learning Hub">
<meta name="robots" content="index, follow">
<meta name="language" content="English">
<!-- Theme Color -->
<meta name="theme-color" content="#0f172a">
<meta name="msapplication-navbutton-color" content="#0f172a">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- PWA -->
<link rel="manifest" href="manifest.json">
<meta name="mobile-web-app-capable" content="yes">
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' rx='20' fill='%23f97316'/><text x='50' y='68' font-size='55' font-weight='bold' text-anchor='middle' fill='white'>J</text></svg>">
<link rel="icon" type="image/png" sizes="32x32" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' rx='20' fill='%23f97316'/><text x='50' y='68' font-size='55' font-weight='bold' text-anchor='middle' fill='white'>J</text></svg>">
<link rel="apple-touch-icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' rx='20' fill='%23f97316'/><text x='50' y='68' font-size='55' font-weight='bold' text-anchor='middle' fill='white'>J</text></svg>">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://erolledph.github.io/learn-java/">
<meta property="og:title" content="Java Learning Hub - Learn Java with AI Tutor">
<meta property="og:description" content="Learn Java programming with an interactive AI tutor. 53 lessons, built-in code editor, instant code execution. Perfect for beginners!">
<meta property="og:image" content="https://erolledph.github.io/learn-java/og-image.png">
<meta property="og:site_name" content="Java Learning Hub">
<meta property="og:locale" content="en_US">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://erolledph.github.io/learn-java/">
<meta property="twitter:title" content="Java Learning Hub - Learn Java with AI Tutor">
<meta property="twitter:description" content="Learn Java programming with an interactive AI tutor. 53 lessons, built-in code editor, instant code execution. Perfect for beginners!">
<meta property="twitter:image" content="https://erolledph.github.io/learn-java/og-image.png">
<meta property="twitter:creator" content="@javahub">
<!-- Canonical URL -->
<link rel="canonical" href="https://erolledph.github.io/learn-java/">
<!-- Preconnect for performance -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://api.groq.com">
<link rel="preconnect" href="https://ce.judge0.com">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.css">
</head>
<body>
<a href="#main-content" class="skip-link">Skip to main content</a>
<!-- App Container -->
<div class="app" role="application" aria-label="Java Learning Hub Application">
<!-- Top Header -->
<header class="header" role="banner">
<div class="header-left">
<button class="mobile-menu-btn" id="mobileMenuBtn" title="Menu" aria-label="Open navigation menu" role="button">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/>
</svg>
</button>
<div class="logo" role="img" aria-label="Java Learning Hub logo">
<svg class="logo-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
<path d="M17 8h1a4 4 0 1 1 0 8h-1"/>
<path d="M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z"/>
<line x1="6" y1="2" x2="6" y2="4"/>
<line x1="10" y1="2" x2="10" y2="4"/>
<line x1="14" y1="2" x2="14" y2="4"/>
</svg>
<span class="logo-text">Java<span class="logo-accent">Hub</span></span>
</div>
<div class="header-divider" aria-hidden="true"></div>
<nav class="breadcrumb" aria-label="Current location">
<span class="breadcrumb-module" id="headerModule" aria-live="polite">Select a lesson</span>
<svg class="breadcrumb-arrow" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
<span class="breadcrumb-lesson" id="headerLesson">Getting Started</span>
</nav>
</div>
<div class="header-right">
<div class="ai-status" role="status" aria-live="polite" aria-label="AI tutor status">
<span class="ai-status-dot" aria-hidden="true"></span>
<span class="ai-status-text">Byte AI Active</span>
</div>
<button class="header-btn" id="openSettings" title="Settings" aria-label="Open settings" role="button">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
</svg>
</button>
</div>
</header>
<!-- Mobile Sidebar Overlay -->
<div class="sidebar-overlay" id="sidebarOverlay" role="presentation"></div>
<!-- Main Content -->
<main id="main-content" class="main" role="main" tabindex="-1">
<!-- Left Sidebar - Lessons/Curriculum -->
<aside class="sidebar" id="sidebarLeft">
<div class="sidebar-progress">
<h3 class="sidebar-section-title">Course Progress</h3>
<div class="progress-bar">
<div class="progress-fill" id="progressFill"></div>
</div>
<div class="progress-stats">
<span class="progress-percent" id="progressText">0%</span>
</div>
</div>
<div class="sidebar-content" id="sidebarContent">
<!-- Lessons will be rendered here -->
</div>
<div class="sidebar-footer">
<button class="btn-secondary w-full">Curriculum Overview</button>
</div>
</aside>
<!-- Content Area -->
<div class="content-area">
<!-- Left: Lesson Instructions -->
<div class="lesson-section" id="lessonSection">
<div class="lesson-panel" id="lessonPanel">
<div class="lesson-panel-header">
<div class="lesson-panel-title">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
</svg>
<h3>Lesson Instructions</h3>
</div>
<div class="lesson-nav-btns">
<button class="lesson-nav-btn" id="prevLesson" title="Previous" aria-label="Previous lesson">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/>
</svg>
</button>
<button class="lesson-nav-btn" id="nextLesson" title="Next" aria-label="Next lesson">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</button>
</div>
</div>
<div class="lesson-panel-content" id="lessonContent">
<!-- Lesson content will be rendered here -->
</div>
</div>
</div>
<!-- Resize Handle: Lesson ↔ Editor -->
<div class="resize-handle-v" id="resizeHandleV"></div>
<!-- Right: Code Editor + Output -->
<div class="editor-section" id="editorSection">
<!-- Code Editor Panel -->
<div class="editor-panel" id="editorPanel">
<div class="editor-tabs">
<div class="editor-tab active">
<span class="editor-tab-icon">{}</span>
<span>Main.java</span>
</div>
<div class="editor-actions">
<button class="btn-icon" id="resetCode" title="Reset" aria-label="Reset Code">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" aria-hidden="true"/>
</svg>
<span>Reset</span>
</button>
<button class="btn-primary" id="runCode" title="Run Code" aria-label="Run Java code" role="button">
<svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path d="M8 5v14l11-7z"/>
</svg>
<span>Run Code</span>
</button>
</div>
</div>
<div class="editor-wrapper" role="textbox" aria-label="Java code editor" aria-multiline="true">
<div id="codeMirrorEditor"></div>
</div>
</div>
<!-- Resize Handle: Editor ↔ Output -->
<div class="resize-handle-h" id="resizeHandleH" role="separator" aria-orientation="horizontal" aria-label="Resize output panel"></div>
<!-- Output Panel -->
<div class="output-panel" id="outputPanel" role="region" aria-label="Code output">
<div class="output-header">
<div class="output-title">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l3 3-3 3m5 0h3M4 15V9a2 2 0 012-2h12a2 2 0 012 2v6a2 2 0 01-2 2H6a2 2 0 01-2-2z"/>
</svg>
<span>Terminal Output</span>
</div>
<button class="output-clear" id="clearOutput" aria-label="Clear output">Clear</button>
</div>
<div class="output-content" id="outputContent" role="log" aria-live="polite" aria-label="Program output">
<pre id="output"></pre>
</div>
</div>
</div>
</div>
</main>
<!-- Floating Chat Button -->
<button class="chat-toggle-btn" id="chatToggleBtn" title="Chat with Byte AI" aria-label="Open chat with Byte AI tutor" role="button">
<span class="chat-btn-icon" aria-hidden="true"><i class="fa-solid fa-robot"></i></span>
<span class="chat-toggle-badge" id="chatBadge" aria-hidden="true">1</span>
</button>
<!-- Floating Chat Panel -->
<div class="floating-chat" id="floatingChat" role="dialog" aria-label="Chat with Byte AI" aria-modal="false">
<div class="floating-chat-header">
<div class="chat-avatar"><i class="fa-solid fa-robot"></i></div>
<div class="floating-chat-info">
<h4>Byte AI Online</h4>
<span class="status-online" role="status" aria-live="polite">Online</span>
</div>
<button class="floating-chat-close" id="closeChat" aria-label="Close chat">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<div class="floating-chat-messages" id="chatMessages" role="log" aria-live="polite" aria-label="Chat messages">
<!-- Messages will be rendered here -->
</div>
<div class="floating-chat-typing" id="typingIndicator" role="status" aria-live="polite" aria-label="AI is typing">
<span></span><span></span><span></span>
</div>
<form class="floating-chat-input" onsubmit="event.preventDefault(); sendChatMessage();">
<label for="chatInput" class="sr-only">Type your message</label>
<textarea id="chatInput" placeholder="Ask Byte about your code..." rows="1" aria-label="Type your message"></textarea>
<button type="submit" class="send-btn" id="sendMessage" aria-label="Send message">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M12 5l7 7-7 7"/>
</svg>
</button>
</form>
</div>
<!-- Status Bar -->
<footer class="status-bar">
<div class="status-left">
<span class="status-item">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
</svg>
<span>Ready</span>
</span>
</div>
<div class="status-right">
<span class="status-item">Java 17</span>
<span class="status-item">UTF-8</span>
<span class="status-item">Spaces: 4</span>
</div>
</footer>
</div>
<!-- Welcome Modal -->
<div class="modal" id="welcomeModal">
<div class="modal-content welcome-modal">
<div class="welcome-header">
<div class="welcome-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M17 8h1a4 4 0 1 1 0 8h-1"/>
<path d="M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z"/>
</svg>
</div>
<h1>Java Learning Hub</h1>
<p>Learn Java with Byte, your AI tutor</p>
</div>
<div class="welcome-features">
<div class="feature">
<span class="feature-icon"><i class="fa-solid fa-pen-to-square"></i></span>
<h3>Code Editor</h3>
<p>Write & run Java instantly</p>
</div>
<div class="feature">
<span class="feature-icon"><i class="fa-solid fa-robot"></i></span>
<h3>Byte AI</h3>
<p>Guides you step by step</p>
</div>
<div class="feature">
<span class="feature-icon"><i class="fa-solid fa-book"></i></span>
<h3>55 Lessons</h3>
<p>Java fundamentals to advanced</p>
</div>
<div class="feature">
<span class="feature-icon"><i class="fa-solid fa-laptop-code"></i></span>
<h3>Practice</h3>
<p>Exercises & challenges</p>
</div>
</div>
<div class="welcome-setup">
<div class="setup-note">
<span class="setup-icon"><i class="fa-solid fa-gear"></i></span>
<div class="setup-content">
<h3>Ready for Real Java Development?</h3>
<p>To start programming Java on your computer, you'll need:</p>
<ul>
<li><strong>JDK (Java Development Kit)</strong> - Download from Oracle's official website</li>
<li><strong>IDE or Text Editor</strong> - IntelliJ IDEA is highly recommended for beginners</li>
</ul>
<p>This online editor is perfect for learning, but local development gives you full control!</p>
</div>
</div>
</div>
<div class="welcome-actions">
<button id="startLearning" class="btn-primary-lg">
<svg fill="currentColor" viewBox="0 0 24 24">
<path d="M8 5v14l11-7z"/>
</svg>
Start Guided Learning
</button>
<button id="browseLessons" class="btn-secondary-lg">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
</svg>
Browse Lessons
</button>
</div>
</div>
</div>
<!-- Settings Modal -->
<div class="modal" id="settingsModal">
<div class="modal-content settings-modal">
<div class="modal-header">
<h2>Settings</h2>
<button class="close-modal" aria-label="Close settings">×</button>
</div>
<div class="modal-body">
<div class="setting-group">
<h3>API Configuration</h3>
<div class="setting-item">
<label for="groqApiKey">Groq API Key</label>
<div class="input-with-btn">
<input type="password" id="groqApiKey" placeholder="Enter your Groq API key">
<button id="saveApiKey" aria-label="Save API Key">Save</button>
</div>
<small>Get your free API key from <a href="https://console.groq.com/keys" target="_blank">Groq Console</a></small>
</div>
</div>
<div class="setting-group">
<h3>Theme</h3>
<div class="setting-item">
<label id="app-theme-label">App Theme</label>
<div class="theme-selector" role="radiogroup" aria-labelledby="app-theme-label">
<button class="theme-option active" data-theme="dark" title="Dark Theme" role="radio" aria-checked="true">
<span class="theme-preview dark"></span>
<span class="theme-label">Dark</span>
</button>
<button class="theme-option" data-theme="light" title="Light Theme" role="radio" aria-checked="false">
<span class="theme-preview light"></span>
<span class="theme-label">Light</span>
</button>
<button class="theme-option" data-theme="night" title="Night/Amber Theme" role="radio" aria-checked="false">
<span class="theme-preview night"></span>
<span class="theme-label">Night</span>
</button>
</div>
</div>
</div>
<div class="setting-group">
<h3>Editor Settings</h3>
<div class="setting-item">
<label for="fontFamily">Font Family</label>
<select id="fontFamily">
<option value="JetBrains Mono">JetBrains Mono</option>
<option value="Fira Code">Fira Code</option>
<option value="Monaco">Monaco</option>
<option value="Consolas">Consolas</option>
<option value="Source Code Pro">Source Code Pro</option>
</select>
</div>
<div class="setting-item">
<label for="fontSize">Font Size</label>
<select id="fontSize">
<option value="12">12px</option>
<option value="14" selected>14px</option>
<option value="16">16px</option>
<option value="18">18px</option>
<option value="20">20px</option>
</select>
</div>
</div>
<div class="setting-actions">
<button id="saveAllSettings" class="btn-primary-full" aria-label="Save all settings">Save Settings</button>
</div>
</div>
</div>
</div>
<!-- Toast Notifications -->
<div class="toast-container" id="toastContainer"></div>
<!-- Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/clike/clike.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/edit/matchbrackets.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/edit/closebrackets.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/selection/active-line.min.js"></script>
<script src="lessons.js"></script>
<script src="groq-service.js"></script>
<script src="app.js"></script>
</body>
</html>