refactor: distribute lab-init.js into 34 engine files
lab-init.js: 4098 -> 543 lines (infrastructure + THEORY only) Each sim's _open*() + UI helpers moved to its engine file: graph.js, projectile.js, collision.js, magnetic.js, triangle.js, geometry.js, trigcircle.js, gas.js (molphys), coulomb.js, circuit.js, reactions.js (chemistry), newton.js (dynamics), chemsandbox.js, celldivision.js, photosynthesis.js, angrybirds.js, quadratic.js, normaldist.js, graphtransform.js, pendulum.js, equilibrium.js, thinlens.js, mirror.js, isoprocess.js, titration.js, refraction.js, probability.js, bohratom.js, electrolysis.js, waves.js, crystal.js, orbitals.js, stereo.js, hydrostatics.js All 34 engine files syntax-checked OK.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
/* ═══════════════════════════════════════════════
|
||||
OrbitalsSim — 3D molecular orbitals (Three.js)
|
||||
@@ -340,3 +340,26 @@ class OrbitalsSim {
|
||||
this.renderer.render(this.scene, this.camera);
|
||||
}
|
||||
}
|
||||
|
||||
/* ─── lab UI init ─────────────────────────────────── */
|
||||
var orbitalsSim = null;
|
||||
function _openOrbitals() {
|
||||
document.getElementById('sim-topbar-title').textContent = 'Молекулярные орбитали';
|
||||
_simShow('sim-orbitals');
|
||||
requestAnimationFrame(() => requestAnimationFrame(() => {
|
||||
if (!orbitalsSim) {
|
||||
orbitalsSim = new OrbitalsSim(document.getElementById('orbitals-container'));
|
||||
} else {
|
||||
orbitalsSim.fit();
|
||||
orbitalsSim.play();
|
||||
}
|
||||
}));
|
||||
}
|
||||
function setOrbital(mode, btn) {
|
||||
document.querySelectorAll('.orbital-mode-btn').forEach(b => { b.classList.remove('active'); b.style.borderColor = ''; b.style.color = ''; });
|
||||
btn.classList.add('active');
|
||||
btn.style.borderColor = '#9B5DE5'; btn.style.color = '#9B5DE5';
|
||||
if (orbitalsSim) orbitalsSim.setMode(mode);
|
||||
}
|
||||
|
||||
/* ── stereometry 3D ── */
|
||||
|
||||
Reference in New Issue
Block a user