mirror of
https://github.com/YuleBest/FontMM.git
synced 2026-12-04 03:11:48 +08:00
- 三页结构: 主页(模块状态/捐献/开发者/设备信息) / 配置(字体槽位) / 测试(字体预览) - 视口 pager 重构: body 高度锁定 + 轨道滑动切换 + 跟手拖拽/边界阻尼, 修复 flex 轨道高度撑起与 transform+overflow 合成层渲染 bug - 主页: 顶栏滚动标题固定、重启按钮(二次确认, 仅主页)、元模块信息、 状态卡/入口卡/设备信息卡 M3 化(圆角调大) - 配置页: filled-card 替代 elevated(无阴影), 整卡点击选择(右侧箭头替代按钮), slot-meta 徽标组(大小/扩展名/可变字体), 动态扩展名提取 - 测试页: 字重 100-900 全档, 可变字体滑条(字重/字号), 测试文本可点击编辑, 加载缓存(应用后重置), info 状态卡常驻 - 滑动手势: RAF 节流修复滑过头, touchcancel 处理, 滑条组件触摸排除 - 文件选择器: find -print0 支持换行路径, 长路径换行显示 - 修复: 卡片嵌套(md-filled-card 闭合标签)、可变徽标同色融合、 isVariable 残留、点击回顶、阴影删减等
283 lines
11 KiB
HTML
283 lines
11 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta
|
|
name="viewport"
|
|
content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover"
|
|
/>
|
|
<title>FontMM</title>
|
|
</head>
|
|
<body>
|
|
<!-- Top App Bar (滚动后标题固定在左侧, 右上角重启按钮) -->
|
|
<header class="top-app-bar">
|
|
<span class="top-app-bar__title" id="top-bar-title"></span>
|
|
<div class="top-app-bar__actions">
|
|
<md-icon-button id="reboot-btn" aria-label="重启设备">
|
|
<md-icon>autorenew</md-icon>
|
|
</md-icon-button>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- 滑动视图轨道 (三页横排, 切换/手势滑动) -->
|
|
<div class="view-track" id="view-track">
|
|
<!-- 主页视图 -->
|
|
<main id="home-view" class="view view-home active">
|
|
<div class="home-title">FontMM</div>
|
|
|
|
<!-- 模块状态 -->
|
|
<md-elevated-card class="home-card home-status-card">
|
|
<div class="home-status-icon">
|
|
<md-icon>check</md-icon>
|
|
</div>
|
|
<div class="home-status-text">
|
|
<div class="home-status-title" id="home-status">已挂载字体</div>
|
|
<div class="home-status-sub">版本 <span id="home-version">-</span></div>
|
|
</div>
|
|
</md-elevated-card>
|
|
|
|
<!-- 请我喝咖啡 -->
|
|
<md-elevated-card class="home-card home-entry-card" id="donate-card">
|
|
<div class="home-entry-row" id="donate-entry">
|
|
<div class="home-entry-icon">
|
|
<md-icon>coffee</md-icon>
|
|
</div>
|
|
<div class="home-entry-text">
|
|
<div class="home-entry-title">请我喝咖啡</div>
|
|
<div class="home-entry-sub">FontMM 将保持免费开源</div>
|
|
</div>
|
|
<md-icon class="home-entry-arrow" id="donate-arrow">expand_more</md-icon>
|
|
</div>
|
|
<div class="home-entry-expand" id="donate-expand" hidden>
|
|
<div class="home-donate-note">感谢您的自愿捐献</div>
|
|
<button class="home-donate-item" id="donate-alipay">
|
|
<span class="home-donate-logo">支付宝</span>
|
|
</button>
|
|
</div>
|
|
</md-elevated-card>
|
|
|
|
<!-- 开发者 -->
|
|
<md-elevated-card class="home-card home-entry-card">
|
|
<div class="home-entry-row" id="dev-entry">
|
|
<div class="home-entry-icon">
|
|
<md-icon>code</md-icon>
|
|
</div>
|
|
<div class="home-entry-text">
|
|
<div class="home-entry-title">开发者</div>
|
|
<div class="home-entry-sub">Yule</div>
|
|
</div>
|
|
<md-icon class="home-entry-arrow">chevron_right</md-icon>
|
|
</div>
|
|
</md-elevated-card>
|
|
|
|
<!-- 设备信息 -->
|
|
<md-elevated-card class="home-card home-info-card">
|
|
<div class="home-info-title">设备信息</div>
|
|
<div class="home-info-row">
|
|
<div class="home-info-label">系统版本</div>
|
|
<div class="home-info-value" id="home-android-version">-</div>
|
|
</div>
|
|
<div class="home-info-row">
|
|
<div class="home-info-label">设备型号</div>
|
|
<div class="home-info-value" id="home-device-model">-</div>
|
|
</div>
|
|
<div class="home-info-row">
|
|
<div class="home-info-label">系统架构</div>
|
|
<div class="home-info-value" id="home-abi">-</div>
|
|
</div>
|
|
<div class="home-info-row">
|
|
<div class="home-info-label">已安装字体</div>
|
|
<div class="home-info-value" id="home-font-count">-</div>
|
|
</div>
|
|
<div class="home-info-row">
|
|
<div class="home-info-label">元模块</div>
|
|
<div class="home-info-value" id="home-metamodule">-</div>
|
|
</div>
|
|
</md-elevated-card>
|
|
</main>
|
|
|
|
<!-- 配置视图 -->
|
|
<main id="config-view" class="view view-config">
|
|
<div class="home-title">字体配置</div>
|
|
<div id="slots"></div>
|
|
</main>
|
|
|
|
<!-- 字体测试视图 -->
|
|
<div id="test-view" class="view view-test">
|
|
<div class="home-title">字体测试</div>
|
|
<md-elevated-card class="test-status-card" id="test-status">
|
|
<div class="test-status-icon">
|
|
<md-icon>info</md-icon>
|
|
</div>
|
|
<div class="test-status-text" id="test-status-text">正在加载字体...</div>
|
|
</md-elevated-card>
|
|
|
|
<div id="test-content" class="test-content" hidden>
|
|
<md-elevated-card class="test-card test-card-editable" data-edit-target="test-hans">
|
|
<div class="test-section-title">
|
|
中文简体 <span class="test-tag" id="hans-tag"></span>
|
|
</div>
|
|
<div class="test-sample test-sample-hans" id="test-hans">
|
|
天地玄黄,宇宙洪荒。日月盈昃,辰宿列张。寒来暑往,秋收冬藏。ABCDE 12345
|
|
</div>
|
|
</md-elevated-card>
|
|
|
|
<md-elevated-card class="test-card test-card-editable" data-edit-target="test-hant">
|
|
<div class="test-section-title">
|
|
中文繁体 <span class="test-tag" id="hant-tag"></span>
|
|
</div>
|
|
<div class="test-sample" id="test-hant">
|
|
天地玄黃,宇宙洪荒。日月盈昃,辰宿列張。寒來暑往,秋收冬藏。ABCDE 12345
|
|
</div>
|
|
</md-elevated-card>
|
|
|
|
<md-elevated-card class="test-card test-card-editable" data-edit-target="test-en">
|
|
<div class="test-section-title">
|
|
英文 & 数字 <span class="test-tag" id="en-tag"></span>
|
|
</div>
|
|
<div class="test-sample" id="test-en">
|
|
The quick brown fox jumps over the lazy dog. 0123456789
|
|
</div>
|
|
</md-elevated-card>
|
|
|
|
<md-elevated-card class="test-card">
|
|
<div class="test-section-title">字重<span class="test-tag" id="weight-tag"></span></div>
|
|
<div class="test-var-note">
|
|
若各字重显示相同,说明字体为静态单字重或未包含对应字重。
|
|
</div>
|
|
<div class="test-w-row" style="font-weight: 100">
|
|
<span class="test-w-text">100 - 淡体 Thin</span>
|
|
</div>
|
|
<div class="test-w-row" style="font-weight: 200">
|
|
<span class="test-w-text">200 - 特细 ExtraLight</span>
|
|
</div>
|
|
<div class="test-w-row" style="font-weight: 300">
|
|
<span class="test-w-text">300 - 细体 Light</span>
|
|
</div>
|
|
<div class="test-w-row" style="font-weight: 400">
|
|
<span class="test-w-text">400 - 标准 Regular</span>
|
|
</div>
|
|
<div class="test-w-row" style="font-weight: 500">
|
|
<span class="test-w-text">500 - 适中 Medium</span>
|
|
</div>
|
|
<div class="test-w-row" style="font-weight: 600">
|
|
<span class="test-w-text">600 - 次粗 SemiBold</span>
|
|
</div>
|
|
<div class="test-w-row" style="font-weight: 700">
|
|
<span class="test-w-text">700 - 粗体 Bold</span>
|
|
</div>
|
|
<div class="test-w-row" style="font-weight: 800">
|
|
<span class="test-w-text">800 - 特粗 ExtraBold</span>
|
|
</div>
|
|
<div class="test-w-row" style="font-weight: 900">
|
|
<span class="test-w-text">900 - 浓体 Black</span>
|
|
</div>
|
|
</md-elevated-card>
|
|
|
|
<md-elevated-card class="test-card">
|
|
<div class="test-section-title">
|
|
可变字体<span class="test-tag" id="var-tag"></span>
|
|
</div>
|
|
<div class="test-var-note">
|
|
拖动滑条调整字重,停止滑动后应用;仅对可变字体 (VF) 生效,静态字体下无变化。
|
|
</div>
|
|
<div class="test-wght-row">
|
|
<span class="test-wght-label">字重</span>
|
|
<md-slider
|
|
id="wght-slider"
|
|
min="100"
|
|
max="900"
|
|
step="1"
|
|
value="400"
|
|
aria-label="字重滑条"
|
|
></md-slider>
|
|
<span class="test-wght-value" id="wght-value">400</span>
|
|
</div>
|
|
<div class="test-wght-row">
|
|
<span class="test-wght-label">字号</span>
|
|
<md-slider
|
|
id="size-slider"
|
|
min="12"
|
|
max="40"
|
|
step="1"
|
|
value="16"
|
|
aria-label="字号滑条"
|
|
></md-slider>
|
|
<span class="test-wght-value" id="size-value">16</span>
|
|
</div>
|
|
<div class="test-var-preview" id="test-var-preview">400 - 标准 Regular</div>
|
|
</md-elevated-card>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 悬浮应用按钮 (仅配置页, 向下滚动时隐藏) -->
|
|
<button id="apply-btn" class="fab" disabled aria-label="应用字体">
|
|
<md-icon>check_circle</md-icon>
|
|
<span>应用</span>
|
|
</button>
|
|
|
|
<!-- 测试文本编辑对话框 -->
|
|
<md-dialog id="edit-text-dialog">
|
|
<div slot="headline">编辑测试文本</div>
|
|
<div slot="content">
|
|
<md-outlined-text-field
|
|
id="edit-text-input"
|
|
type="textarea"
|
|
rows="3"
|
|
label="测试文本"
|
|
style="width: 100%"
|
|
></md-outlined-text-field>
|
|
</div>
|
|
<div slot="actions">
|
|
<md-text-button id="edit-text-cancel">取消</md-text-button>
|
|
<md-text-button id="edit-text-save">保存</md-text-button>
|
|
</div>
|
|
</md-dialog>
|
|
|
|
<!-- 重启确认对话框 -->
|
|
<md-dialog id="reboot-dialog">
|
|
<div slot="headline">重启设备?</div>
|
|
<div slot="content">重启后字体才会生效,确定要立即重启设备吗?</div>
|
|
<div slot="actions">
|
|
<md-text-button id="reboot-cancel">取消</md-text-button>
|
|
<md-text-button id="reboot-confirm">重启</md-text-button>
|
|
</div>
|
|
</md-dialog>
|
|
|
|
<!-- 日志弹窗 -->
|
|
<md-dialog id="log-dialog">
|
|
<div slot="headline">应用日志</div>
|
|
<div slot="content">
|
|
<pre
|
|
id="log-content"
|
|
style="white-space: pre-wrap; font-family: monospace; font-size: 0.8rem"
|
|
></pre>
|
|
</div>
|
|
<div slot="actions">
|
|
<md-text-button id="log-close">关闭</md-text-button>
|
|
</div>
|
|
</md-dialog>
|
|
|
|
<!-- 底部导航栏 -->
|
|
<nav class="bottom-nav">
|
|
<md-navigation-bar id="nav-bar" active-index="0">
|
|
<md-navigation-tab label="主页">
|
|
<md-icon slot="active-icon">home</md-icon>
|
|
<md-icon slot="inactive-icon">home</md-icon>
|
|
</md-navigation-tab>
|
|
<md-navigation-tab label="配置">
|
|
<md-icon slot="active-icon">tune</md-icon>
|
|
<md-icon slot="inactive-icon">tune</md-icon>
|
|
</md-navigation-tab>
|
|
<md-navigation-tab label="字体测试">
|
|
<md-icon slot="active-icon">text_fields</md-icon>
|
|
<md-icon slot="inactive-icon">text_fields</md-icon>
|
|
</md-navigation-tab>
|
|
</md-navigation-bar>
|
|
</nav>
|
|
|
|
<script type="module" src="/src/main.ts"></script>
|
|
</body>
|
|
</html>
|