mirror of
https://github.com/Neonity2020/web-os.git
synced 2026-12-02 02:59:31 +08:00
- 手写递归下降表达式解析器(不用 eval):括号/优先级/右结合幂/一元负号/隐式乘法/函数/阶乘/百分号/科学计数法,含浮点误差清理与定义域校验 - 三角与双曲函数、对数、幂与根、阶乘、常量,支持 DEG/RAD、2nd 反函数、Ans、mc/mr/m+/m- 记忆、最近 30 条历史 - 49 键科学键盘、实时结果预览、键盘输入、深浅主题与窄窗口适配 - 接入启动台/程序坞/聚焦搜索,与基本计算器双向切换;新增 scicalc 图标 - 资源版本号更新为 20261113-61ac5c82(资源数 14)
57 lines
4.1 KiB
CSS
57 lines
4.1 KiB
CSS
/* ============================================================
|
|
科学计算器 Scientific Calculator
|
|
============================================================ */
|
|
.scicalc { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--win-solid); }
|
|
.sc-display { flex: none; padding: 8px 16px 12px; border-bottom: 1px solid var(--win-sep); }
|
|
.sc-flags { display: flex; align-items: center; gap: 6px; height: 24px; }
|
|
.sc-flag { font-size: 10px; letter-spacing: .4px; color: var(--win-muted); border: 1px solid var(--win-sep); border-radius: 4px; padding: 1px 5px; opacity: .42; transition: opacity .15s; }
|
|
.sc-flag.on { opacity: 1; color: var(--win-text); background: var(--win-fill); }
|
|
.sc-link { font-size: 11px; color: var(--win-muted); padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
|
|
.sc-link:hover { color: var(--win-text); background: var(--win-fill); }
|
|
.sc-expr { height: 20px; margin-top: 6px; font-size: 12px; color: var(--win-muted); text-align: right; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
|
|
.sc-expr.err { color: #ff453a; }
|
|
.sc-value { font-size: 46px; font-weight: 300; letter-spacing: -1.2px; line-height: 1.18; text-align: right; color: var(--win-text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
|
|
.sc-expr::-webkit-scrollbar, .sc-value::-webkit-scrollbar { display: none; }
|
|
|
|
.sc-body { flex: 1; position: relative; min-height: 0; display: flex; container-type: inline-size; }
|
|
.sc-keys { flex: 1; display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(5, 1fr); gap: 6px; padding: 10px 12px 12px; }
|
|
.sc-keys button {
|
|
border-radius: 8px; font-size: 13px; font-weight: 400; min-width: 0; padding: 0 2px;
|
|
background: var(--win-fill); border: 1px solid var(--win-sep); color: var(--win-text);
|
|
transition: filter .12s, transform .08s, background .15s; overflow: hidden; white-space: nowrap;
|
|
}
|
|
.sc-keys button:hover { filter: brightness(1.18); }
|
|
.sc-keys button:active, .sc-keys button.pressed { transform: scale(.93); filter: brightness(1.35); }
|
|
.sc-keys button.num { font-size: 19px; }
|
|
.sc-keys button.fn { background: rgba(140, 140, 150, .28); font-size: 16px; }
|
|
.sc-keys button.op { background: #ff9f0a; color: #fff; border-color: transparent; font-size: 22px; }
|
|
.sc-keys button.toggle { background: rgba(140, 140, 150, .16); }
|
|
.sc-keys button.toggle.on { background: var(--accent); color: #fff; border-color: transparent; }
|
|
.sc-keys button.zero { grid-column: span 2; }
|
|
|
|
/* 历史记录 */
|
|
.sc-history { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--win-solid); }
|
|
.sc-hist-head { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--win-sep); font-size: 12px; font-weight: 600; color: var(--win-text); }
|
|
.sc-hist-list { flex: 1; overflow-y: auto; padding: 6px 8px; }
|
|
.sc-hist-item { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; width: 100%; text-align: right; padding: 8px 10px; border-radius: 8px; }
|
|
.sc-hist-item:hover { background: var(--win-fill); }
|
|
.sc-hist-expr { font-size: 11.5px; color: var(--win-subtle); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
.sc-hist-result { font-size: 20px; color: var(--win-text); font-variant-numeric: tabular-nums; }
|
|
.sc-hist-empty { padding: 40px 16px; text-align: center; color: var(--win-muted); font-size: 12.5px; line-height: 1.9; }
|
|
.sc-hist-empty span { font-size: 11px; color: var(--win-subtle); }
|
|
|
|
.sc-title-tool { font-size: 11px; color: var(--win-muted); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--win-sep); }
|
|
.sc-title-tool:hover { color: var(--win-text); background: var(--win-fill); }
|
|
|
|
/* 窄窗口:按钮随窗口宽度收缩(容器查询,跟随窗口而非屏幕) */
|
|
@container (max-width: 600px) {
|
|
.sc-keys { gap: 4px; padding: 8px; }
|
|
.sc-keys button { font-size: 11px; border-radius: 6px; }
|
|
.sc-keys button.num { font-size: 16px; }
|
|
.sc-keys button.op { font-size: 18px; }
|
|
.sc-keys button.fn { font-size: 13px; }
|
|
}
|
|
@media (max-width: 700px) {
|
|
.sc-value { font-size: 34px; }
|
|
}
|