File size: 5,708 Bytes
6b67b15 53fbf1a | 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 | <!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Code Playground Lite — код на смартфоне</title>
<!--
Лёгкая кодовая площадка для слабых смартфонов.
- Редактор HTML/CSS/JS с мгновенным запуском прямо в браузере
- Работает офлайн, без серверов, без установки
- Минимальный вес
-->
<style>
:root{--bg:#0f1115;--panel:#171a21;--accent:#4f8cff;--text:#e6e9ef;--muted:#8b93a3;--ok:#2ecc71;--err:#e74c3c}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",monospace,Roboto;background:var(--bg);color:var(--text);display:flex;flex-direction:column;height:100dvh;overflow:hidden;font-size:14px}
header{padding:9px 12px;background:var(--panel);display:flex;align-items:center;gap:9px;border-bottom:1px solid #ffffff12;flex-shrink:0}
header .logo{width:28px;height:28px;border-radius:7px;background:var(--accent);display:flex;align-items:center;justify-content:center;font-weight:700;color:#fff}
header h1{font-size:14px;font-weight:600}
button.run{margin-left:auto;background:var(--ok);border:none;color:#052e16;font-weight:700;padding:7px 16px;border-radius:9px;font-size:13px;cursor:pointer}
button.run:active{transform:scale(.96)}
.tabs{display:flex;gap:2px;background:var(--panel);padding:6px 12px 0;flex-shrink:0}
.tab{background:none;border:none;color:var(--muted);padding:8px 14px;font-size:13px;cursor:pointer;border-bottom:2px solid transparent;font-family:inherit}
.tab.active{color:var(--text);border-bottom-color:var(--accent)}
.tab:disabled{opacity:.4;cursor:not-allowed}
#editor-wrap{flex:1;position:relative;min-height:0}
textarea#code{width:100%;height:100%;background:#0a0c10;color:#c9d1d9;border:none;resize:none;padding:14px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px;line-height:1.5;white-space:pre;overflow:auto;tab-size:2}
#result{display:none;flex:1;background:#fff;color:#000;min-height:0}
#result.show{display:block}
#console{flex-shrink:0;background:#0a0c10;color:#9faeff;font-family:ui-monospace,monospace;font-size:12px;padding:8px 12px;max-height:38%;overflow:auto;border-top:1px solid #ffffff14;white-space:pre-wrap}
#console .err{color:var(--err)}
#controls-bar{flex-shrink:0;display:flex;gap:6px;padding:8px 12px;background:var(--panel);border-top:1px solid #ffffff12;flex-wrap:wrap}
#controls-bar button{background:#ffffff12;border:1px solid #ffffff16;color:var(--text);padding:6px 11px;border-radius:8px;font-size:12px;cursor:pointer;font-family:inherit}
#controls-bar button:active{background:#ffffff24}
</style>
</head>
<body>
<header>
<div class="logo"></></div>
<h1>Code Playground Lite</h1>
<button class="run" id="run">▶ Запустить</button>
</header>
<div class="tabs">
<button class="tab active" data-mode="html">HTML</button>
<button class="tab" data-mode="js" disabled>REPL JS</button>
</div>
<div id="editor-wrap">
<textarea id="code" spellcheck="false" placeholder="<h1>Привет!</h1> <p>Это бесплатная тестовая площадка для кода. Пиши HTML, CSS и JS здесь — результат появится ниже. <button onclick="say()">Нажми</button> <script> function say(){ alert('Привет из кода!') } </script>"></textarea>
<iframe id="result" sandbox="allow-scripts allow-forms allow-modals"></iframe>
</div>
<div id="console"></div>
<div id="controls-bar">
<button id="example">Пример</button>
<button id="clear">Очистить</button>
<button id="reset">Сбросить</button>
</div>
<script>
</script>
</body>
</html>
|