feat(phys9 ch4): добавлены 6 виджетов Wave D — Глава 4 «Импульс, энергия, колебания»

Новый модуль frontend/js/phys9_ch4_widgets.js — экспортирует
window.PHYS9_CH4_WIDGETS = { p31..p36: fn }.

Виджеты:
- §31 CALC: импульс p=mv с slider'ами m, v и бытовой аналогией
  (футбольный мяч / автомобиль / грузовик и т.д.)
- §32 CALC: ЗСИ — упругий и неупругий удар двух тел. m₁, v₁, m₂, v₂ →
  v₁', v₂', проверка сохранения импульса
- §33 DnD: 9 ситуаций → знак работы (A>0/A<0/A=0)
- §34 CALC: Ek+Ep с slider'ами m, v, h
- §35 CALC: ЗСМЭ — найти v в любой точке горки по высоте старта
  (h_старт=5, h_тек=0 → v=9.9 м/с)
- §36 CALC: период маятника (математ./пружинный) — переключатель,
  формула обновляется автоматически

Подключено в physics_9_ch4.html через тот же hook ensureBuilt.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Maxim Dolgolyov
2026-05-30 09:50:53 +03:00
parent 29ae219025
commit d2ce0d70b2
2 changed files with 261 additions and 1 deletions
+3 -1
View File
@@ -17,6 +17,7 @@
<script src="/js/phys.js" defer></script>
<script src="/js/phys9_palette.js" defer></script>
<script src="/js/phys9_legacy.js" defer></script>
<script src="/js/phys9_ch4_widgets.js" defer></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@600;700;800;900&family=Unbounded:wght@700;800;900&family=JetBrains+Mono:wght@500;700&display=swap" rel="stylesheet">
<style>
:root{
@@ -134,6 +135,7 @@ a{color:inherit;text-decoration:none}
.col-side-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.42);z-index:9990;display:none}
.col-side-backdrop.show{display:block}
@media(min-width:981px){#sidebar-btn{display:none}.col-side-backdrop.show{display:none}}
@media(max-width:980px){
.col-side{position:fixed;top:0;right:0;height:100vh;width:300px;max-width:88vw;background:var(--bg);box-shadow:-12px 0 24px rgba(0,0,0,.18);padding:18px 16px;overflow-y:auto;transform:translateX(100%);transition:transform .25s ease;z-index:9991;max-height:none}
.col-side.open{transform:none}
@@ -770,7 +772,7 @@ function _injectTasks(id){
var body = document.getElementById(id + '-body');
if(!body || body.querySelector('.legacy-tasks')) return;
body.insertAdjacentHTML('beforeend', _makeTaskBlock(id));
setTimeout(function(){ try { if(window.renderTask) window.renderTask(id); if(window.renderNav) window.renderNav(id); } catch(e){} }, 60);
setTimeout(function(){ try { if(window.renderTask) window.renderTask(id); if(window.renderNav) window.renderNav(id); } catch(e){} try { if(window.PHYS9_CH4_WIDGETS && window.PHYS9_CH4_WIDGETS[id]) window.PHYS9_CH4_WIDGETS[id](); } catch(e){ console.warn('phys9 widget init:', e.message); } }, 60);
}
var _origEnsureBuilt = ensureBuilt;
ensureBuilt = function(id){ _origEnsureBuilt(id); _injectTasks(id); };