Skip to content

Commit 577f9bc

Browse files
committed
fix: 修复代码区玻璃模糊 + 入口改为静默跳转 + 安卓窄屏特调
- 代码编写区改为纯白实底并去除 backdrop-filter 模糊,行号栏实底,杜绝透出渐变导致的“糊住看不清” - ide 入口删除可选页面,改为无界面脚本后台检测 UA 后静默跳转至 /android/ 或 /windows/ - 安卓端针对窄屏(≤400px / ≤340px)专项特调:压缩顶栏/编辑器/底部面板,溢出省略,隐藏次要文本 - 同步离线单文件版与 old/v2.00 归档
1 parent a01ecc0 commit 577f9bc

10 files changed

Lines changed: 129 additions & 215 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ HiCode(简称 **HC**)的诞生源于一个朴素的愿望:**让编程真
3636
- ⬇️ **可下载文件变量**`it 名 app` 上传任意文件 + `名 in d` 渲染下载按钮,用户点击浏览器弹出下载;使用下载功能时导出仅支持 **.zip 打包**
3737
- 🔌 **Python 标准库导入**`use os, sys, math, json, sqlite3, urllib, threading…` 声明式白名单导入常用标准库(系统 / 数学数据 / 时间文件 / 存储 / 网络并发)。
3838
- 🎨 **图形化编程界面**:创建色块、配置触发区域,所见即所得;学习中心扩充至 15 章。
39-
- 📱 **设备分流 IDE**访问入口自动根据设备跳转 —— 手机 / 安卓走 `/android/`(触控特调、抽屉侧栏防挤压),电脑访问 `/windows/`(更高分辨率、更广显示、功能更全);亦可手动切换
39+
- 📱 **设备分流 IDE**访问入口无界面、后台检测 UA 后静默跳转 —— 手机 / 安卓自动进入 `/android/`(触控特调、抽屉侧栏防挤压),电脑自动进入 `/windows/`(更高分辨率、更广显示、功能更全)。
4040
- 🏷️ **导出可选顶部题目标识**:导出单个 `.html` / 打包 `.zip` / 合并 `.html` 时,可勾选「不包含顶部题目标识」从而**纯导出用户自己编写的页面内容**
4141
- **v1.03(控制台面板)**:新增「控制台」终端风格活动日志面板(全部 / 输出 / 错误 / 警告四档过滤与一键清空)与状态指示点。
4242
- **v1.02(界面优化)**:编程界面升级为专业 IDE 布局:问题 / 输出 / 变量三大底部面板、文件名显示、增强状态栏。

android/css/style.css

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ button { font-family: inherit; cursor: pointer; border: none; background: none;
122122
.codearea {
123123
flex: 1; min-height: 0; resize: none; border: 1px solid var(--line); border-radius: var(--radius);
124124
padding: 16px; font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 14px; line-height: 1.65;
125-
background: rgba(255,255,255,.6); color: #2d2416; outline: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
125+
background: #ffffff; color: #2d2416; outline: none;
126126
}
127127
.codearea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
128128
.codearea.src { flex: none; height: 100%; white-space: pre; width: 100%; font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.6; color: #cfd6dd; background: #1b1f27; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
129129
.preview-tools { display: inline-flex; gap: 8px; }
130130

131131
/* ---- 轻量编辑器:高亮层 + 行号 ---- */
132-
.editor-wrap { --gutter: 52px; position: relative; flex: 1; min-height: 0; }
132+
.editor-wrap { --gutter: 52px; position: relative; flex: 1; min-height: 0; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
133133
.editor-wrap textarea.codearea {
134134
position: relative; z-index: 4; width: 100%; height: 100%;
135135
padding-left: calc(var(--gutter) + 13px);
@@ -141,13 +141,13 @@ button { font-family: inherit; cursor: pointer; border: none; background: none;
141141
margin: 0; padding: 16px 16px 16px calc(var(--gutter) + 13px);
142142
pointer-events: none; overflow: hidden; white-space: pre; tab-size: 4;
143143
font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 14px; line-height: 1.65;
144-
color: #2d2416;
144+
color: #2d2416; background: #ffffff;
145145
}
146146
.editor-gutter {
147147
position: absolute; left: 0; top: 0; bottom: 0; width: var(--gutter); z-index: 3;
148148
overflow: hidden; padding: 16px 10px 16px 0; text-align: right; user-select: none;
149149
font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 14px; line-height: 1.65;
150-
color: rgba(120,90,50,.32); border-right: 1px solid var(--line); background: rgba(120,90,50,.04);
150+
color: rgba(120,90,50,.38); border-right: 1px solid var(--line); background: #f6f2ea;
151151
}
152152
.editor-mark { position: absolute; left: var(--gutter); top: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none; overflow: hidden; }
153153
.ed-diag { position: absolute; height: 0; border-bottom: 2px solid transparent; border-radius: 2px; }
@@ -447,4 +447,44 @@ body.drawer-open { overflow: hidden; }
447447
.export-opt input { width: 18px; height: 18px; vertical-align: -3px; }
448448

449449
.statusbar { margin: 8px 10px 10px; padding: 5px 10px; font-size: 11px; }
450-
.sb-right { font-size: 10.5px; }
450+
.sb-right { font-size: 10.5px; }
451+
452+
/* ---- 窄屏(≤400px)进一步压缩,避免横向溢出 ---- */
453+
@media (max-width: 400px) {
454+
.topbar { padding: 7px 8px; gap: 6px; }
455+
.btn-tree { width: 34px; height: 34px; flex-basis: 34px; }
456+
.brand { gap: 5px; min-width: 0; }
457+
.brand-name { font-size: 14px; white-space: nowrap; overflow: hidden; max-width: 72px; text-overflow: ellipsis; }
458+
.brand .ver { font-size: 9.5px; padding: 1px 5px; }
459+
.crumb { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
460+
.actions .btn { padding: 7px 10px; font-size: 12px; }
461+
.actions .btn:first-of-type { letter-spacing: 0; }
462+
.pane { padding: 8px 8px 10px; }
463+
.tabs { padding: 6px 8px 0; gap: 1px; }
464+
.tab { padding: 9px 3px; font-size: 12.5px; letter-spacing: -.2px; }
465+
.editor-head { gap: 4px; }
466+
.file-name { font-size: 13px; }
467+
.editor-snippets .snippet { padding: 6px 9px; font-size: 11px; }
468+
.codearea, .editor-highlight, .editor-gutter { font-size: 12.5px; line-height: 1.6; }
469+
.editor-wrap { --gutter: 34px; }
470+
.editor-wrap textarea.codearea { padding-left: calc(34px + 9px); }
471+
.editor-highlight { padding-left: calc(34px + 9px); }
472+
.editor-mark { left: 34px; }
473+
.bottom-panel { margin: 6px 8px 0; flex-basis: 42vh; }
474+
.btab { font-size: 12px; padding: 8px 10px; }
475+
.statusbar { margin: 6px 8px 8px; }
476+
.home-card { padding: 26px 18px; }
477+
.home-card h1 { font-size: 23px; }
478+
.menu { left: 8px; right: 8px; top: 50px; }
479+
.graph-canvas { min-height: 50vh; }
480+
}
481+
482+
/* ---- 极窄屏(≤340px):隐藏次要文本,仅保留核心操作 ---- */
483+
@media (max-width: 340px) {
484+
.brand-name { display: none; }
485+
.crumb { max-width: 40px; }
486+
.preview-bar .preview-fname { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
487+
.graph-tools label { font-size: 12px; }
488+
.console-filter { display: none; }
489+
.home-actions .btn.big { padding: 13px 12px; font-size: 14px; }
490+
}

download/HiCode-ide-offline.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@
130130
.codearea {
131131
flex: 1; min-height: 0; resize: none; border: 1px solid var(--line); border-radius: var(--radius);
132132
padding: 16px; font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 14px; line-height: 1.65;
133-
background: rgba(255,255,255,.6); color: #2d2416; outline: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
133+
background: #ffffff; color: #2d2416; outline: none;
134134
}
135135
.codearea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
136136
.codearea.src { flex: none; height: 100%; white-space: pre; width: 100%; font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.6; color: #cfd6dd; background: #1b1f27; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
137137
.preview-tools { display: inline-flex; gap: 8px; }
138138

139139
/* ---- 轻量编辑器:高亮层 + 行号 ---- */
140-
.editor-wrap { --gutter: 52px; position: relative; flex: 1; min-height: 0; }
140+
.editor-wrap { --gutter: 52px; position: relative; flex: 1; min-height: 0; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
141141
.editor-wrap textarea.codearea {
142142
position: relative; z-index: 4; width: 100%; height: 100%;
143143
padding-left: calc(var(--gutter) + 13px);
@@ -149,13 +149,13 @@
149149
margin: 0; padding: 16px 16px 16px calc(var(--gutter) + 13px);
150150
pointer-events: none; overflow: hidden; white-space: pre; tab-size: 4;
151151
font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 14px; line-height: 1.65;
152-
color: #2d2416;
152+
color: #2d2416; background: #ffffff;
153153
}
154154
.editor-gutter {
155155
position: absolute; left: 0; top: 0; bottom: 0; width: var(--gutter); z-index: 3;
156156
overflow: hidden; padding: 16px 10px 16px 0; text-align: right; user-select: none;
157157
font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 14px; line-height: 1.65;
158-
color: rgba(120,90,50,.32); border-right: 1px solid var(--line); background: rgba(120,90,50,.04);
158+
color: rgba(120,90,50,.38); border-right: 1px solid var(--line); background: #f6f2ea;
159159
}
160160
.editor-mark { position: absolute; left: var(--gutter); top: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none; overflow: hidden; }
161161
.ed-diag { position: absolute; height: 0; border-bottom: 2px solid transparent; border-radius: 2px; }

ide/css/style.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ button { font-family: inherit; cursor: pointer; border: none; background: none;
122122
.codearea {
123123
flex: 1; min-height: 0; resize: none; border: 1px solid var(--line); border-radius: var(--radius);
124124
padding: 16px; font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 14px; line-height: 1.65;
125-
background: rgba(255,255,255,.6); color: #2d2416; outline: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
125+
background: #ffffff; color: #2d2416; outline: none;
126126
}
127127
.codearea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
128128
.codearea.src { flex: none; height: 100%; white-space: pre; width: 100%; font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.6; color: #cfd6dd; background: #1b1f27; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
129129
.preview-tools { display: inline-flex; gap: 8px; }
130130

131131
/* ---- 轻量编辑器:高亮层 + 行号 ---- */
132-
.editor-wrap { --gutter: 52px; position: relative; flex: 1; min-height: 0; }
132+
.editor-wrap { --gutter: 52px; position: relative; flex: 1; min-height: 0; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
133133
.editor-wrap textarea.codearea {
134134
position: relative; z-index: 4; width: 100%; height: 100%;
135135
padding-left: calc(var(--gutter) + 13px);
@@ -141,13 +141,13 @@ button { font-family: inherit; cursor: pointer; border: none; background: none;
141141
margin: 0; padding: 16px 16px 16px calc(var(--gutter) + 13px);
142142
pointer-events: none; overflow: hidden; white-space: pre; tab-size: 4;
143143
font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 14px; line-height: 1.65;
144-
color: #2d2416;
144+
color: #2d2416; background: #ffffff;
145145
}
146146
.editor-gutter {
147147
position: absolute; left: 0; top: 0; bottom: 0; width: var(--gutter); z-index: 3;
148148
overflow: hidden; padding: 16px 10px 16px 0; text-align: right; user-select: none;
149149
font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 14px; line-height: 1.65;
150-
color: rgba(120,90,50,.32); border-right: 1px solid var(--line); background: rgba(120,90,50,.04);
150+
color: rgba(120,90,50,.38); border-right: 1px solid var(--line); background: #f6f2ea;
151151
}
152152
.editor-mark { position: absolute; left: var(--gutter); top: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none; overflow: hidden; }
153153
.ed-diag { position: absolute; height: 0; border-bottom: 2px solid transparent; border-radius: 2px; }

ide/index.html

Lines changed: 9 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -4,105 +4,22 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<meta name="description" content="HiCode 在线开发环境 v2.00 入口 —— 自动根据设备检测进入手机端(安卓)或电脑端开发界面。" />
7-
<title>HiCode · 入口 v2.00</title>
7+
<title>HiCode · v2.00 跳转中…</title>
88
<link rel="icon" href="../assets/hicode-logo.jpg" type="image/jpeg" />
9-
<style>
10-
:root {
11-
--bg: #f3eee6;
12-
--panel: rgba(255, 252, 245, .72);
13-
--line: rgba(90, 70, 40, .14);
14-
--text: #3a2f1e;
15-
--muted: #6b5f49;
16-
--dim: #9a8c73;
17-
--accent: #c2965c;
18-
--accent-strong: #b38545;
19-
--accent-soft: rgba(194, 150, 92, .16);
20-
--glass: linear-gradient(150deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .28));
21-
}
22-
* { box-sizing: border-box; margin: 0; padding: 0; }
23-
body {
24-
min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
25-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
26-
color: var(--text); line-height: 1.7; -webkit-font-smoothing: antialiased;
27-
background:
28-
radial-gradient(70% 60% at 12% 8%, rgba(228, 196, 150, .30), transparent 60%),
29-
radial-gradient(60% 55% at 90% 90%, rgba(200, 160, 120, .20), transparent 58%),
30-
var(--bg);
31-
}
32-
a { color: inherit; text-decoration: none; }
33-
.card {
34-
width: min(440px, 94vw); padding: 40px 34px; text-align: center;
35-
background: var(--glass); border: 1px solid var(--line); border-radius: 22px;
36-
box-shadow: 0 24px 70px rgba(60, 45, 20, .18); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
37-
}
38-
.logo { width: 54px; height: 54px; margin: 0 auto; border-radius: 14px;
39-
background: linear-gradient(140deg, #e2b878, #b38545); box-shadow: 0 8px 20px rgba(179,133,69,.4); }
40-
h1 { margin: 18px 0 6px; font-size: 27px; }
41-
h1 .accent { color: var(--accent-strong); }
42-
.sub { color: var(--muted); font-size: 14px; }
43-
.detect { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--dim); }
44-
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(194,150,92,.6); animation: blink 1.1s infinite; }
45-
@keyframes blink { 50% { opacity: .3; } }
46-
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
47-
.choice {
48-
display: block; padding: 18px 14px; border-radius: 14px; border: 1px solid var(--line);
49-
background: rgba(255,255,255,.5); transition: transform .18s, border-color .18s, box-shadow .2s;
50-
}
51-
.choice:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(179,133,69,.2); }
52-
.choice .ic { font-size: 26px; }
53-
.choice h3 { font-size: 15px; margin: 8px 0 2px; color: var(--accent-strong); }
54-
.choice p { font-size: 12px; color: var(--muted); }
55-
.auto { margin-top: 24px; font-size: 13px; color: var(--muted); }
56-
.auto .nobtn { color: var(--accent-strong); font-weight: 700; cursor: pointer; }
57-
.link { margin-top: 26px; font-size: 12.5px; color: var(--dim); }
58-
.link a { color: var(--accent-strong); }
59-
</style>
9+
<style>html,body{height:100%;margin:0;background:#f3eee6;}</style>
6010
</head>
6111
<body>
62-
<div class="card">
63-
<div class="logo"></div>
64-
<h1>HiCode <span class="accent">v2.00</span></h1>
65-
<div class="sub">图形化前端开发 · 触发区域 · URL 图片 · 文件下载 · 标准库导入</div>
66-
<div class="detect" id="detect"><span class="dot"></span><span id="detectTxt">正在检测设备类型…</span></div>
67-
68-
<div class="choices">
69-
<a class="choice" href="./windows/">
70-
<div class="ic">🖥️</div>
71-
<h3>电脑端</h3>
72-
<p>更高分辨率 · 功能更多 · 显示更广</p>
73-
</a>
74-
<a class="choice" href="./android/">
75-
<div class="ic">📱</div>
76-
<h3>手机端</h3>
77-
<p>触控特调 · 防挤压 · 便捷开发</p>
78-
</a>
79-
</div>
80-
81-
<div class="auto">正在自动进入 <b id="autoTarget"></b> · <span class="nobtn" onclick="cancel()">取消并在下方选择</span></div>
82-
<div class="link">没有自动跳转?<a href="#" onclick="go();return false;">立即进入手机端 / 电脑端</a> · 前往 <a href="../">官网首页</a></div>
83-
</div>
84-
8512
<script>
86-
// 设备检测:安卓 / 移动窄屏 → 手机端;其余(电脑等大屏)→ 电脑端
87-
var timer = null;
88-
function detectTarget() {
13+
// 无界面设备分流:后台检测 UA 后静默跳转,不显示任何可选页面
14+
(function () {
8915
var ua = navigator.userAgent;
9016
var mobile = /Android|iPhone|iPad|iPod|Mobile|Windows Phone/i.test(ua);
9117
var narrow = (window.innerWidth || document.documentElement.clientWidth) < 900;
92-
return (mobile || narrow) ? "../android/" : "../windows/";
93-
}
94-
function showTarget(t, name) {
95-
document.getElementById("autoTarget").textContent = name;
96-
document.getElementById("detectTxt").textContent = "已识别为" + name + "设备";
97-
}
98-
function doAuto() {
99-
var t = detectTarget();
100-
showTarget(t, /android/i.test(t) ? "手机端" : "电脑端");
101-
timer = setTimeout(function () { window.location.href = t; }, 900);
102-
}
103-
function go() { location.href = detectTarget(); }
104-
function cancel() { if (timer) clearTimeout(timer); document.getElementById("detectTxt").textContent = "已取消自动跳转,请手动选择"; document.getElementById("autoTarget").textContent = "—"; }
105-
window.addEventListener("load", doAuto);
18+
// 手机 / 安卓窄屏 → 手机端;电脑等大屏 → 电脑端
19+
var target = (mobile || narrow) ? "../android/" : "../windows/";
20+
try { localStorage.setItem("hicode_entry", target); } catch (e) {}
21+
window.location.replace(target);
22+
})();
10623
</script>
10724
</body>
10825
</html>

0 commit comments

Comments
 (0)