Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ const whiteboard = document.getElementById('whiteboard');
+ const toggleButton = document.getElementById('toggle-whiteboard');
+ const courseLinks = document.querySelectorAll('#course-list a');
+ const courseDetails = document.getElementById('course-details');
+
+ // Whiteboard toggle functionality
+ toggleButton.addEventListener('click', () => {
+ whiteboard.classList.toggle('hidden');
+ });
+
+ // Course navigation functionality
+ courseLinks.forEach(link => {
+ link.addEventListener('click', function(e) {
+ e.preventDefault();
+ const courseId = this.getAttribute('href').substring(1);
+ loadCourseContent(courseId);
+ });
+ });
+
+ // Basic drawing functionality
+ const drawingArea = document.getElementById('drawing-area');
+ let isDrawing = false;
+
+ drawingArea.addEventListener('mousedown', () => {
+ isDrawing = true;
+ });
+
+ drawingArea.addEventListener('mouseup', () => {
+ isDrawing = false;
+ });
+
+ drawingArea.addEventListener('mousemove', (e) => {
+ if (isDrawing) {
+ const dot = document.createElement('div');
+ dot.style.position = 'absolute';
+ dot.style.left = `${e.offsetX}px`;
+ dot.style.top = `${e.offsetY}px`;
+ dot.style.width = '5px';
+ dot.style.height = '5px';
+ dot.style.backgroundColor = 'black';
+ drawingArea.appendChild(dot);
+ }
+ });
+
+ // Load initial course content
+ loadCourseContent('course1');
+
+ function loadCourseContent(courseId) {
+ // This would be replaced with actual course content loading
+ const courses = {
+ course1: `
Linear Algebra
+
Introduction to vectors, matrices, and linear transformations.
+
$$\\begin{bmatrix}1 & 2\\\\3 & 4\\end{bmatrix}$$
`,
+ course2: `
Calculus
+
Understanding limits, derivatives, and integrals.
+
$$\\int_{a}^{b} f(x) dx$$
`,
+ course3: `
Probability & Statistics
+
Exploring probability distributions and statistical analysis.
+
$$P(A|B) = \\frac{P(B|A)P(A)}{P(B)}$$
`
+ };
+ courseDetails.innerHTML = courses[courseId];
+ MathJax.typeset();
+ }
+ });