-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.html
More file actions
116 lines (103 loc) · 4.06 KB
/
Copy pathdebug.html
File metadata and controls
116 lines (103 loc) · 4.06 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Debug Test</title>
<style>
body {
background: #1a1a1a;
color: white;
font-family: monospace;
padding: 20px;
}
.debug-log {
background: #333;
padding: 10px;
margin: 5px 0;
border-radius: 5px;
}
</style>
</head>
<body>
<h1>Debug Test</h1>
<div id="debug-output"></div>
<script>
function log(message) {
const output = document.getElementById('debug-output');
const div = document.createElement('div');
div.className = 'debug-log';
div.textContent = new Date().toLocaleTimeString() + ': ' + message;
output.appendChild(div);
console.log(message);
}
log('Starting debug test...');
// Test Three.js loading
const script = document.createElement('script');
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js';
script.onload = () => {
log('Three.js loaded successfully');
log('THREE object available: ' + (typeof THREE !== 'undefined'));
// Test OrbitControls loading
const controlsScript = document.createElement('script');
controlsScript.src = 'https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/controls/OrbitControls.js';
controlsScript.onload = () => {
log('OrbitControls loaded successfully');
log('THREE.OrbitControls available: ' + (typeof THREE.OrbitControls !== 'undefined'));
// Test our custom scripts
testCustomScripts();
};
controlsScript.onerror = () => {
log('ERROR: Failed to load OrbitControls');
};
document.head.appendChild(controlsScript);
};
script.onerror = () => {
log('ERROR: Failed to load Three.js');
};
document.head.appendChild(script);
function testCustomScripts() {
log('Testing custom scripts...');
const scripts = [
'js/quantum-math.js',
'js/debug-utils.js',
'js/visualization.js',
'js/controls.js',
'js/tutorial.js'
];
let loadedCount = 0;
scripts.forEach((src, index) => {
const script = document.createElement('script');
script.src = src;
script.onload = () => {
log(`✓ Loaded: ${src}`);
loadedCount++;
if (loadedCount === scripts.length) {
testClasses();
}
};
script.onerror = () => {
log(`✗ Failed to load: ${src}`);
};
document.head.appendChild(script);
});
}
function testClasses() {
log('Testing class availability...');
try {
log('QuantumMath: ' + (typeof QuantumMath !== 'undefined' ? '✓' : '✗'));
log('HydrogenVisualization: ' + (typeof HydrogenVisualization !== 'undefined' ? '✓' : '✗'));
log('ControlsManager: ' + (typeof ControlsManager !== 'undefined' ? '✓' : '✗'));
log('TutorialManager: ' + (typeof TutorialManager !== 'undefined' ? '✓' : '✗'));
// Try to create instances
if (typeof QuantumMath !== 'undefined') {
const qm = new QuantumMath();
log('QuantumMath instance created successfully');
}
} catch (error) {
log('ERROR creating classes: ' + error.message);
}
}
</script>
</body>
</html>