Changed around line 1
+ // Course Generator
+ const courseGenerator = document.getElementById('generate-course');
+ const courseContent = document.getElementById('course-content');
+
+ const mathTopics = {
+ highschool: ['Algebra', 'Geometry', 'Trigonometry', 'Calculus'],
+ college: ['Linear Algebra', 'Differential Equations', 'Probability', 'Statistics'],
+ graduate: ['Real Analysis', 'Abstract Algebra', 'Topology', 'Number Theory']
+ };
+
+ function generateCourse() {
+ const level = Object.keys(mathTopics)[Math.floor(Math.random() * 3)];
+ const topic = mathTopics[level][Math.floor(Math.random() * mathTopics[level].length)];
+
+ const courseHTML = `
+
New ${level} Course: ${topic}
+
Here's what you'll learn:
+
Introduction to ${topic}+
Core concepts and theories+
Practical applications+
Problem-solving techniques+
+ `;
+
+ courseContent.innerHTML = courseHTML;
+ }
+
+ courseGenerator.addEventListener('click', generateCourse);
+
+ // Whiteboard
+ const canvas = document.getElementById('whiteboard-canvas');
+ const ctx = canvas.getContext('2d');
+ let isDrawing = false;
+
+ canvas.width = canvas.offsetWidth;
+ canvas.height = canvas.offsetHeight;
+
+ ctx.lineWidth = 3;
+ ctx.lineCap = 'round';
+ ctx.strokeStyle = '#000';
+
+ function startDrawing(e) {
+ isDrawing = true;
+ draw(e);
+ }
+
+ function stopDrawing() {
+ isDrawing = false;
+ ctx.beginPath();
+ }
+
+ function draw(e) {
+ if (!isDrawing) return;
+
+ ctx.lineTo(e.offsetX, e.offsetY);
+ ctx.stroke();
+ ctx.beginPath();
+ ctx.moveTo(e.offsetX, e.offsetY);
+ }
+
+ canvas.addEventListener('mousedown', startDrawing);
+ canvas.addEventListener('mouseup', stopDrawing);
+ canvas.addEventListener('mousemove', draw);
+
+ document.getElementById('pen-tool').addEventListener('click', () => {
+ ctx.strokeStyle = '#000';
+ });
+
+ document.getElementById('eraser-tool').addEventListener('click', () => {
+ ctx.strokeStyle = '#fff';
+ });
+
+ document.getElementById('clear-board').addEventListener('click', () => {
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+ });
+
+ // Responsive Canvas
+ window.addEventListener('resize', () => {
+ canvas.width = canvas.offsetWidth;
+ canvas.height = canvas.offsetHeight;
+ });