Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
159 lines (139 loc) · 7.27 KB
/
Copy pathindex.html
File metadata and controls
159 lines (139 loc) · 7.27 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>简易x4刷写器</title>
<!-- 1. 引入 esp-web-tools (用于界面按钮) -->
<script type="module" src="https://unpkg.com/esp-web-tools@10/dist/web/install-button.js?module"></script>
<!-- 2. 引入 esptool-js (用于底层备份操作) -->
<!-- 注意:路径已修正,指向正确的 .mjs 文件 -->
<script type="module">
import { run } from 'https://cdn.jsdelivr.net/npm/esptool-js@0.4.8/dist/esptool-js.mjs';
// 将 run 方法挂载到 window 上,以便下面的脚本能访问到
window.espWebToolsRun = run;
</script>
<style>
:root {
--white: #ffffff;
--black: #1a1a1a;
--gray: #dddddd;
--gray-dark: #888888;
--gray-light: #f2f0ed;
--red: #c8352c;
--red-light: #e8443a;
--red-dark: #a02a22;
--desktop: #f5f3f0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Geneva', 'Helvetica Neue', Helvetica, sans-serif;
font-size: 13px;
background: var(--desktop);
min-height: 100vh;
color: var(--black);
padding: 20px;
}
.header {
text-align: center;
margin-bottom: 24px;
padding-top: 20px;
}
.header img { display: block; margin: 0 auto 16px; }
.header h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 2px; }
.header h1 span { color: var(--red); }
.header .tagline { font-size: 11px; color: var(--gray-dark); letter-spacing: 2px; }
.window {
max-width: 520px; margin: 0 auto 20px;
background: var(--white); border: 1px solid #c0c0c0; border-radius: 10px;
box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
}
.title-bar {
background: linear-gradient(180deg, #fafafa, #e8e8e8);
border-bottom: 1px solid #c0c0c0; padding: 8px 14px;
display: flex; align-items: center; gap: 8px; border-radius: 10px 10px 0 0;
}
.window-dots { display: flex; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.12); }
.dot-red { background: #ff5f57; } .dot-yellow { background: #febc2e; } .dot-green { background: #28c840; }
.title-bar h2 { flex: 1; text-align: center; font-size: 13px; font-weight: 600; color: #444; }
.title-bar .spacer { width: 54px; }
.window-body { padding: 20px; }
.steps { font-size: 12px; color: #555; margin-bottom: 16px; }
.steps ol { margin-left: 20px; }
.steps li { margin-bottom: 6px; }
esp-web-install-button { display: block; margin: 16px 0; }
esp-web-install-button::part(button) {
background: linear-gradient(180deg, var(--red-light), var(--red));
border: 1px solid var(--red-dark); border-radius: 6px;
padding: 14px 20px; font-family: inherit; font-size: 14px; font-weight: 600;
color: white; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
width: 100%; transition: all 0.15s;
}
esp-web-install-button::part(button):hover {
background: linear-gradient(180deg, #ee4e44, var(--red-light));
box-shadow: 0 2px 8px rgba(200,53,44,0.3);
}
.note {
background: #fef9e7; border: 1px solid #e6c84e; border-radius: 4px;
padding: 10px 12px; font-size: 11px; line-height: 1.5; margin-top: 12px;
}
.note strong { color: #b8860b; }
.browser-warning { background: #fff0f0; border: 1px solid #cc3333; border-radius: 6px; padding: 12px; text-align: center; margin-bottom: 14px; display: none; }
.browser-warning h3 { color: #cc3333; font-size: 12px; margin-bottom: 4px; }
.features-bar { max-width: 520px; margin: 0 auto 20px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.feat-card { background: var(--white); border: 1px solid #e0e0e0; border-radius: 8px; padding: 14px 10px; text-align: center; }
.feat-card .icon { font-size: 18px; margin-bottom: 4px; }
.feat-card .label { font-size: 10px; font-weight: 600; color: #555; letter-spacing: 0.5px; }
.controls-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 11px; }
.ctrl-key { color: var(--red); font-weight: 600; }
.ctrl-val { color: #666; }
footer { max-width: 520px; margin: 0 auto; text-align: center; padding: 16px; font-size: 10px; color: var(--gray-dark); }
@media (max-width: 540px) { body { padding: 12px; } .features-bar { grid-template-columns: 1fr; } }
</style>
</head>
<body>
<div class="header">
<img src="logo.png" width="240" height="240" alt="logo" />
<h1>Crosspoint <span>_Chinesetype</span> </h1>
<div class="tagline">allocate-x4刷写器(基于sumi page修改适配)</div>
<div class="tagline">开源库地址:<a href="https://github.com/icannotttt/crosspoint-chinesetype" target="_blank" rel="noopener">github库</a> <a href="https://gitee.com/allocated/crosspoint_chinesetype" target="_blank" rel="noopener">gitee库</a></div>
</div>
<div class="window">
<div class="title-bar">
<div class="window-dots"><div class="dot dot-red"></div><div class="dot dot-yellow"></div><div class="dot dot-green"></div></div>
<h2>刷写框</h2>
<div class="spacer"></div>
</div>
<div class="window-body">
<div id="browserWarning" class="browser-warning">
<h3>浏览器不受支持</h3>
<p>建议使用: <strong>Chrome</strong>, <strong>Edge</strong>, or <strong>Opera</strong>.</p>
</div>
<div class="steps"><ol>
<li>用一根typec数据线连接x4和电脑</li>
<li>点击下方的 <strong>安装</strong> </li>
<li>选择端口--COM5或者COM7</li>
</ol></div>
<!-- 备份按钮区域
<div style="margin: 20px 0; padding: 16px; background: #f5f5f5; border-radius: 8px;">
<h3 style="margin:0 0 10px 0;">全闪存保存</h3>
<button id="backupBtn" style="padding: 10px 20px; background: #d32f2f; color: white; border:none; border-radius:6px; cursor:pointer;">
开始备份 16MB
</button>
<div id="status" style="margin-top:8px; font-size:14px;"></div>
</div> -->
<!-- 原有刷写按钮 -->
<esp-web-install-button manifest="manifest.json">
<button slot="activate">点击此处安装</button>
<span slot="unsupported">你的浏览器不支持 Web Serial</span>
<span slot="not-allowed">未获得 Web Serial 权限,无法使用</span>
</esp-web-install-button>
<div class="note">
<strong>注意:</strong> 刷写前请备份
</div>
</div>
</div>
<footer>Crosspoint_chinesetype · 还原阅读本色</footer>
</body>
</html>