index.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <!DOCTYPE html>
  2. <html lang="ru">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Экран "Фарадей-1" // ТЗИ</title>
  7. <link href="https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&family=Courier+Prime:wght@400;700&display=swap" rel="stylesheet">
  8. <style>
  9. :root {
  10. --wood: #3e2723; --wood-light: #5d4037; --metal: #b0bec5;
  11. --brass: #d4af37; --crt: #4af626; --crt-dim: #1b381b;
  12. --paper: #f4f1ea; --ink: #2c3e50;
  13. }
  14. * { box-sizing: border-box; }
  15. body {
  16. background: #1a1a1a; color: var(--paper);
  17. font-family: 'Courier Prime', monospace;
  18. display: flex; justify-content: center; padding: 20px; margin: 0;
  19. }
  20. .console {
  21. background: var(--wood); border: 8px solid #2b1a16;
  22. border-radius: 10px; width: 100%; max-width: 750px;
  23. padding: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.8), inset 0 0 50px rgba(0,0,0,0.5);
  24. position: relative;
  25. }
  26. .console::before {
  27. content: ''; position: absolute; top: 10px; left: 10px; right: 10px; bottom: 10px;
  28. border: 2px solid var(--brass); border-radius: 6px; pointer-events: none; opacity: 0.5;
  29. }
  30. h1 {
  31. text-align: center; font-family: 'Oswald', sans-serif;
  32. font-size: 24px; text-transform: uppercase; letter-spacing: 2px;
  33. color: var(--brass); margin-top: 0; text-shadow: 2px 2px 0 #000;
  34. }
  35. .scene { display: none; flex-direction: column; gap: 15px; }
  36. .scene.active { display: flex; animation: fadeIn 0.5s; }
  37. @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  38. .panel {
  39. background: var(--wood-light); border: 4px solid #3e2723;
  40. padding: 15px; border-radius: 4px; box-shadow: inset 0 0 10px #000;
  41. }
  42. .screen {
  43. background: #000; border: 4px solid #333; border-radius: 8px;
  44. padding: 15px; box-shadow: inset 0 0 20px #000; position: relative;
  45. overflow: hidden;
  46. }
  47. .screen::after {
  48. content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  49. background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  50. background-size: 100% 2px, 3px 100%; pointer-events: none; opacity: 0.5;
  51. }
  52. canvas { width: 100%; height: 200px; display: block; }
  53. .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
  54. .value { font-size: 20px; font-weight: bold; color: var(--crt); text-shadow: 0 0 5px var(--crt); font-family: 'Courier Prime', monospace; }
  55. select, input[type=range] {
  56. width: 100%; margin-top: 5px; padding: 8px;
  57. background: #222; color: var(--crt); border: 1px solid var(--brass);
  58. font-family: 'Courier Prime', monospace;
  59. }
  60. input[type=range] { accent-color: var(--brass); cursor: pointer; }
  61. button {
  62. background: linear-gradient(to bottom, #6d4c41, #3e2723);
  63. color: var(--brass); border: 2px solid var(--brass);
  64. padding: 12px; font-family: 'Oswald', sans-serif; font-size: 16px;
  65. text-transform: uppercase; letter-spacing: 1px; cursor: pointer;
  66. transition: 0.2s; box-shadow: 0 4px 0 #1a100a;
  67. }
  68. button:active { transform: translateY(4px); box-shadow: none; }
  69. button:disabled { opacity: 0.5; cursor: not-allowed; }
  70. .paper {
  71. background: var(--paper); color: var(--ink);
  72. padding: 15px; font-family: 'Courier Prime', monospace;
  73. border-radius: 2px; box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
  74. font-size: 13px;
  75. }
  76. .paper h3 { margin-top: 0; font-family: 'Oswald', sans-serif; text-align: center; border-bottom: 2px solid var(--ink); padding-bottom: 5px; }
  77. .question { margin-bottom: 15px; }
  78. .question label { display: block; margin-bottom: 5px; cursor: pointer; }
  79. .question input[type="radio"] { accent-color: var(--brass); margin-right: 8px; }
  80. .note { font-size: 11px; color: #aaa; margin-top: 5px; font-style: italic; }
  81. </style>
  82. </head>
  83. <body>
  84. <div class="console">
  85. <h1>Экран "Фарадей-1"</h1>
  86. <div id="scene1" class="scene active">
  87. <div class="screen">
  88. <p style="color: var(--crt); text-align: center; font-size: 16px;">
  89. СИСТЕМА ТЕСТИРОВАНИЯ ЭКРАНОВ<br><br>
  90. Обнаружено излучение ПЭМИН от ЭВМ.<br>
  91. За окном работает станция перехвата.<br>
  92. Ваша задача — подобрать материал и толщину экрана, чтобы подавить сигнал.
  93. </p>
  94. </div>
  95. <button onclick="nextScene(2)">▶ ЗАПУСТИТЬ СТЕНД</button>
  96. </div>
  97. <div id="scene2" class="scene">
  98. <div class="screen">
  99. <canvas id="waveCanvas" width="700" height="200"></canvas>
  100. </div>
  101. <div class="panel">
  102. <div class="row">
  103. <span>МАТЕРИАЛ ЭКРАНА:</span>
  104. <select id="material" onchange="updateModel()">
  105. <option value="none">Нет (открытый канал)</option>
  106. <option value="cu">Медь (Cu)</option>
  107. <option value="al">Алюминий (Al)</option>
  108. <option value="fe">Сталь (Fe)</option>
  109. </select>
  110. </div>
  111. <div class="row">
  112. <span>ТОЛЩИНА (мм):</span>
  113. <span class="value" id="thickVal">0.0</span>
  114. </div>
  115. <!-- Ограничили максимальную толщину до 2 мм -->
  116. <input type="range" id="thickness" min="0" max="2" step="0.05" value="0" oninput="updateModel()" disabled>
  117. <div class="row" style="margin-top: 15px;">
  118. <span>ЭФФЕКТИВНОСТЬ ЭКРАНИРОВАНИЯ:</span>
  119. <span class="value" id="seVal">0.0</span> дБ
  120. </div>
  121. <div class="row">
  122. <span>УРОВЕНЬ ПЕРЕХВАТА:</span>
  123. <span class="value" id="interceptVal" style="color: #ff3333; text-shadow: 0 0 5px #ff3333;">100</span> %
  124. </div>
  125. </div>
  126. <div class="paper">
  127. <div>[ФОРМУЛА] SE = 8.686 * (t / δ)</div>
  128. <div>[ФОРМУЛА] δ = 1 / sqrt(π * f * μ * σ)</div>
  129. <div style="color: #777; margin-top: 5px;">* f = 100 МГц (фиксировано)</div>
  130. <div class="note">Сталь (Fe) имеет высокую магнитную проницаемость, поэтому достигает максимума уже при малой толщине.</div>
  131. </div>
  132. <button onclick="nextScene(3)">ЗАФИКСИРОВАТЬ РЕЗУЛЬТАТ ▶</button>
  133. </div>
  134. <div id="scene3" class="scene">
  135. <div class="paper">
  136. <h3>ПРОТОКОЛ ИСПЫТАНИЙ</h3>
  137. <p><b>Выбранный материал:</b> <span id="resMat">—</span></p>
  138. <p><b>Толщина экрана:</b> <span id="resThick">—</span> мм</p>
  139. <p><b>Эффективность:</b> <span id="resSE">—</span> дБ</p>
  140. <p><b>Вердикт:</b> <span id="resVerdict">—</span></p>
  141. <hr>
  142. <div id="testContainer"></div>
  143. </div>
  144. <button onclick="checkTest()">ПРОВЕРИТЬ ЗНАНИЯ</button>
  145. </div>
  146. </div>
  147. <script>
  148. let canvas, ctx;
  149. let animId;
  150. let currentSE = 0;
  151. let currentWavePhase = 0;
  152. // Обновленные константы (глубина скин-слоя в мм)
  153. const materials = {
  154. none: { name: 'Нет', delta: 1 },
  155. cu: { name: 'Медь', delta: 0.2 }, // Умеренное затухание
  156. al: { name: 'Алюминий', delta: 0.3 }, // Слабее меди
  157. fe: { name: 'Сталь', delta: 0.04 } // Очень быстрое затухание
  158. };
  159. function nextScene(n) {
  160. document.querySelectorAll('.scene').forEach(el => el.classList.remove('active'));
  161. document.getElementById('scene' + n).classList.add('active');
  162. if (n === 2) {
  163. initCanvas();
  164. document.getElementById('thickness').disabled = false;
  165. updateModel();
  166. }
  167. if (n === 3) {
  168. cancelAnimationFrame(animId);
  169. saveResults();
  170. renderTest();
  171. }
  172. }
  173. function initCanvas() {
  174. canvas = document.getElementById('waveCanvas');
  175. ctx = canvas.getContext('2d');
  176. drawWave();
  177. }
  178. function drawWave() {
  179. if (!canvas) return;
  180. const w = canvas.width;
  181. const h = canvas.height;
  182. ctx.fillStyle = '#000';
  183. ctx.fillRect(0, 0, w, h);
  184. // Источник (слева)
  185. ctx.fillStyle = '#333';
  186. ctx.fillRect(20, h/2 - 30, 40, 60);
  187. ctx.fillStyle = '#4af626';
  188. ctx.fillRect(25, h/2 - 25, 30, 20);
  189. // Приемник (справа)
  190. ctx.fillStyle = '#333';
  191. ctx.fillRect(w - 60, h/2 - 30, 40, 60);
  192. ctx.fillStyle = '#ff3333';
  193. ctx.fillRect(w - 55, h/2 - 25, 30, 20);
  194. let thickness = parseFloat(document.getElementById('thickness').value);
  195. let mat = document.getElementById('material').value;
  196. let screenWidth = 0;
  197. let screenStart = w/2;
  198. let screenEnd = w/2;
  199. // Рисуем экран
  200. if (thickness > 0 && mat !== 'none') {
  201. // Ширина экрана на экране зависит от толщины (макс 2мм = 60px)
  202. screenWidth = Math.max(10, thickness * 30);
  203. screenStart = w/2 - screenWidth/2;
  204. screenEnd = w/2 + screenWidth/2;
  205. ctx.fillStyle = mat === 'cu' ? '#b87333' : (mat === 'al' ? '#aaa' : '#555');
  206. ctx.fillRect(screenStart, 0, screenWidth, h);
  207. ctx.fillStyle = '#fff';
  208. ctx.font = '12px Courier Prime';
  209. ctx.textAlign = 'center';
  210. ctx.fillText('ЭКРАН', w/2, 20);
  211. }
  212. // Коэффициент затухания (перевод дБ в разы)
  213. let attenuationFactor = Math.pow(10, -currentSE / 20);
  214. ctx.beginPath();
  215. ctx.strokeStyle = 'rgba(74, 246, 38, 0.9)';
  216. ctx.lineWidth = 2;
  217. currentWavePhase += 0.1;
  218. let maxAmp = 40;
  219. for (let x = 0; x < w; x++) {
  220. let localAmp = maxAmp;
  221. if (thickness > 0 && mat !== 'none') {
  222. if (x > screenEnd) {
  223. // После экрана
  224. localAmp = maxAmp * attenuationFactor;
  225. } else if (x >= screenStart) {
  226. // Внутри экрана плавное падение
  227. let progress = (x - screenStart) / screenWidth;
  228. localAmp = maxAmp * Math.pow(attenuationFactor, progress);
  229. }
  230. }
  231. let y = h/2 + Math.sin(x * 0.05 - currentWavePhase) * localAmp;
  232. if (x === 0) ctx.moveTo(x, y);
  233. else ctx.lineTo(x, y);
  234. }
  235. ctx.stroke();
  236. ctx.fillStyle = '#888';
  237. ctx.font = '12px Courier Prime';
  238. ctx.textAlign = 'left';
  239. ctx.fillText('ИСТОЧНИК', 10, h - 10);
  240. ctx.textAlign = 'right';
  241. ctx.fillText('ПРИЕМНИК', w - 10, h - 10);
  242. animId = requestAnimationFrame(drawWave);
  243. }
  244. function updateModel() {
  245. let matKey = document.getElementById('material').value;
  246. let thickness = parseFloat(document.getElementById('thickness').value);
  247. if (matKey === 'none') {
  248. document.getElementById('thickness').value = 0;
  249. thickness = 0;
  250. }
  251. document.getElementById('thickVal').innerText = thickness.toFixed(2);
  252. let delta = materials[matKey].delta;
  253. let se = 0;
  254. if (thickness > 0 && matKey !== 'none') {
  255. // Прямая формула в дБ: SE = 8.686 * (t / delta)
  256. se = 8.686 * (thickness / delta);
  257. se = Math.min(se, 120); // Ограничение сверху
  258. }
  259. currentSE = se;
  260. let intercept = 100 * Math.pow(10, -se / 20);
  261. document.getElementById('seVal').innerText = se.toFixed(1);
  262. document.getElementById('interceptVal').innerText = intercept.toFixed(2);
  263. const iVal = document.getElementById('interceptVal');
  264. if (intercept > 50) iVal.style.color = '#ff3333';
  265. else if (intercept > 10) iVal.style.color = '#ffb000';
  266. else iVal.style.color = '#4af626';
  267. }
  268. function saveResults() {
  269. let matKey = document.getElementById('material').value;
  270. let thickness = parseFloat(document.getElementById('thickness').value);
  271. let matName = materials[matKey].name;
  272. document.getElementById('resMat').innerText = matName;
  273. document.getElementById('resThick').innerText = thickness.toFixed(2);
  274. document.getElementById('resSE').innerText = currentSE.toFixed(1);
  275. let verdict = '';
  276. if (currentSE < 20) verdict = 'КАНАЛ УТЕЧКИ ОТКРЫТ. Требуется доработка.';
  277. else if (currentSE < 60) verdict = 'ЧАСТИЧНОЕ ПОДАВЛЕНИЕ. Риск утечки остается.';
  278. else verdict = 'КАНАЛ ЗАЩИЩЕН. Эффективность высокая.';
  279. document.getElementById('resVerdict').innerText = verdict;
  280. }
  281. const questions = [
  282. { q: "Что такое скин-эффект?", a: ["Вытеснение тока к поверхности проводника", "Нагрев проводника", "Увеличение магнитного поля"], c: 0 },
  283. { q: "Как зависит эффективность экрана от толщины?", a: ["Линейно", "Экспоненциально (логарифмически в дБ)", "Не зависит"], c: 1 },
  284. { q: "Какой металл лучше экранирует магнитное поле на низких частотах?", a: ["Медь", "Алюминий", "Сталь (Fe)"], c: 2 },
  285. { q: "Если SE = 40 дБ, во сколько раз ослабляется сигнал по мощности?", a: ["В 40 раз", "В 100 раз", "В 10000 раз"], c: 2 },
  286. { q: "Зачем нужен экран в ПЭМИН?", a: ["Для красоты", "Для снижения побочного излучения", "Для увеличения скорости"], c: 1 }
  287. ];
  288. function renderTest() {
  289. let html = '<h4 style="text-align:center; margin-top:15px;">ИТОГОВЫЙ ТЕСТ</h4>';
  290. questions.forEach((item, i) => {
  291. html += `<div class="question" style="color:#2c3e50; font-size:14px;"><p><b>${i+1}. ${item.q}</b></p>`;
  292. item.a.forEach((ans, j) => {
  293. html += `<label><input type="radio" name="q${i}" value="${j}"> ${ans}</label>`;
  294. });
  295. html += `</div>`;
  296. });
  297. document.getElementById('testContainer').innerHTML = html;
  298. }
  299. function checkTest() {
  300. let score = 0;
  301. questions.forEach((item, i) => {
  302. const selected = document.querySelector(`input[name="q${i}"]:checked`);
  303. if (selected && parseInt(selected.value) === item.c) score++;
  304. });
  305. alert(`Результат: ${score} из ${questions.length}. ${score === 5 ? 'Отлично! Допуск к экранированию получен.' : 'Повторите теорию скин-эффекта.'}`);
  306. }
  307. </script>
  308. </body>
  309. </html>