oa-start-footer-btn-style-demo.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <title>发起审批 · 底栏按钮重设计 Demo</title>
  7. <style>
  8. :root {
  9. --ink: #0f172a;
  10. --muted: #64748b;
  11. --line: #e2e8f0;
  12. --brand: #22c55e;
  13. --brand-dark: #16a34a;
  14. --brand-deep: #15803d;
  15. --brand-soft: #ecfdf5;
  16. }
  17. * { box-sizing: border-box; }
  18. html, body { margin: 0; min-height: 100%; }
  19. body {
  20. font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", -apple-system, system-ui, sans-serif;
  21. color: var(--ink);
  22. background:
  23. radial-gradient(900px 420px at 8% -8%, rgba(52, 211, 153, 0.16), transparent 55%),
  24. radial-gradient(700px 380px at 92% 0%, rgba(148, 163, 184, 0.14), transparent 50%),
  25. linear-gradient(180deg, #f8fffc 0%, #f4f7fb 50%, #f7f8fa 100%);
  26. line-height: 1.45;
  27. }
  28. .wrap {
  29. max-width: 1180px;
  30. margin: 0 auto;
  31. padding: 28px 18px 96px;
  32. }
  33. h1 {
  34. margin: 0 0 8px;
  35. font-size: 24px;
  36. letter-spacing: -0.02em;
  37. font-weight: 720;
  38. }
  39. .sub {
  40. margin: 0;
  41. max-width: 720px;
  42. color: var(--muted);
  43. font-size: 14px;
  44. }
  45. .note {
  46. margin: 14px 0 22px;
  47. padding: 10px 12px;
  48. border-radius: 10px;
  49. background: #fff;
  50. border: 1px solid var(--line);
  51. font-size: 13px;
  52. color: var(--muted);
  53. }
  54. .note strong { color: var(--brand-deep); }
  55. .layout {
  56. display: grid;
  57. grid-template-columns: 1fr minmax(300px, 360px);
  58. gap: 22px;
  59. align-items: start;
  60. }
  61. @media (max-width: 920px) {
  62. .layout { grid-template-columns: 1fr; }
  63. }
  64. /* —— 方案列表 —— */
  65. .schemes { display: grid; gap: 12px; }
  66. .scheme {
  67. appearance: none;
  68. width: 100%;
  69. text-align: left;
  70. border: 1px solid var(--line);
  71. background: #fff;
  72. border-radius: 16px;
  73. padding: 14px 16px;
  74. cursor: pointer;
  75. transition: border-color .15s, box-shadow .15s, background .15s;
  76. font-family: inherit;
  77. color: inherit;
  78. }
  79. .scheme:hover {
  80. border-color: #cbd5e1;
  81. box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  82. }
  83. .scheme.is-on {
  84. border-color: var(--brand);
  85. background: linear-gradient(180deg, #f0fdf4, #fff);
  86. box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  87. }
  88. .scheme-top {
  89. display: flex;
  90. align-items: center;
  91. gap: 10px;
  92. margin-bottom: 6px;
  93. }
  94. .letter {
  95. width: 28px; height: 28px;
  96. border-radius: 8px;
  97. display: grid; place-items: center;
  98. font-size: 13px; font-weight: 750;
  99. background: #f1f5f9;
  100. color: #334155;
  101. flex-shrink: 0;
  102. }
  103. .scheme.is-on .letter {
  104. background: var(--brand-soft);
  105. color: var(--brand-deep);
  106. }
  107. .scheme h2 {
  108. margin: 0;
  109. font-size: 15px;
  110. font-weight: 680;
  111. }
  112. .scheme p {
  113. margin: 0 0 10px;
  114. font-size: 12.5px;
  115. color: var(--muted);
  116. padding-left: 38px;
  117. }
  118. .tag {
  119. margin-left: auto;
  120. font-size: 10px;
  121. font-weight: 700;
  122. padding: 2px 8px;
  123. border-radius: 999px;
  124. background: #f1f5f9;
  125. color: #64748b;
  126. }
  127. .tag.rec {
  128. background: var(--brand-soft);
  129. color: var(--brand-deep);
  130. }
  131. /* —— 右侧手机 —— */
  132. .stage {
  133. position: sticky;
  134. top: 16px;
  135. }
  136. .phone {
  137. background: #111827;
  138. border-radius: 36px;
  139. padding: 10px;
  140. box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
  141. }
  142. .phone-screen {
  143. border-radius: 28px;
  144. overflow: hidden;
  145. background: #f8fafc;
  146. min-height: 640px;
  147. display: flex;
  148. flex-direction: column;
  149. }
  150. .phone-nav {
  151. height: 52px;
  152. display: flex;
  153. align-items: center;
  154. justify-content: center;
  155. background: #fff;
  156. border-bottom: 1px solid #f1f5f9;
  157. font-size: 16px;
  158. font-weight: 650;
  159. color: #0f172a;
  160. position: relative;
  161. }
  162. .phone-nav .back {
  163. position: absolute;
  164. left: 14px;
  165. color: #64748b;
  166. font-size: 14px;
  167. font-weight: 500;
  168. }
  169. .form-mock {
  170. flex: 1;
  171. padding: 14px 14px 20px;
  172. display: flex;
  173. flex-direction: column;
  174. gap: 12px;
  175. }
  176. .field {
  177. background: #fff;
  178. border-radius: 12px;
  179. border: 1px solid #eef2f6;
  180. padding: 12px 14px;
  181. }
  182. .field .lab {
  183. font-size: 12px;
  184. color: #94a3b8;
  185. margin-bottom: 6px;
  186. }
  187. .field .val {
  188. font-size: 14px;
  189. color: #334155;
  190. }
  191. .field .val.ph { color: #cbd5e1; }
  192. .stage-meta {
  193. margin-top: 14px;
  194. padding: 12px 14px;
  195. background: rgba(255,255,255,.92);
  196. border: 1px solid var(--line);
  197. border-radius: 14px;
  198. font-size: 13px;
  199. color: var(--muted);
  200. }
  201. .stage-meta strong { color: var(--brand-deep); }
  202. .stage-meta .why {
  203. margin-top: 6px;
  204. font-size: 12.5px;
  205. line-height: 1.5;
  206. }
  207. /* ========== 按钮原子 ========== */
  208. .ft {
  209. display: flex;
  210. align-items: center;
  211. gap: 10px;
  212. padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  213. background: #fff;
  214. border-top: 1px solid #eef2f6;
  215. }
  216. .btn {
  217. margin: 0;
  218. appearance: none;
  219. font-family: inherit;
  220. font-size: 15px;
  221. line-height: 1;
  222. border: none;
  223. cursor: pointer;
  224. display: inline-flex;
  225. align-items: center;
  226. justify-content: center;
  227. gap: 6px;
  228. height: 44px;
  229. padding: 0 16px;
  230. border-radius: 12px;
  231. font-weight: 600;
  232. transition: transform .12s, opacity .12s, background .15s, box-shadow .15s;
  233. -webkit-tap-highlight-color: transparent;
  234. white-space: nowrap;
  235. }
  236. .btn:active { transform: scale(0.98); opacity: 0.92; }
  237. .btn svg { width: 16px; height: 16px; flex-shrink: 0; }
  238. /* 方案样式仅作用于右侧大屏,避免污染左侧迷你条 */
  239. .phone-screen.s1 .ft { gap: 10px; padding: 12px 14px; }
  240. .phone-screen.s1 .btn-cancel {
  241. flex: 0 0 auto; height: 44px; padding: 0 10px;
  242. background: transparent; color: #94a3b8;
  243. font-weight: 500; font-size: 14px; border-radius: 0;
  244. }
  245. .phone-screen.s1 .btn-draft {
  246. flex: 1; background: #f1f5f9; color: #334155; font-weight: 600;
  247. }
  248. .phone-screen.s1 .btn-submit {
  249. flex: 1.35; background: var(--brand); color: #fff; font-weight: 700;
  250. box-shadow: 0 8px 18px rgba(34, 197, 94, 0.28);
  251. }
  252. .phone-screen.s2 .ft { gap: 12px; padding: 12px 16px; }
  253. .phone-screen.s2 .btn-cancel { display: none; }
  254. .phone-screen.s2 .btn-draft {
  255. flex: 0 0 auto; background: transparent; color: #64748b;
  256. font-weight: 500; font-size: 15px; padding: 0 8px; height: 44px; border-radius: 0;
  257. }
  258. .phone-screen.s2 .btn-submit {
  259. flex: 1; height: 46px; border-radius: 12px;
  260. background: var(--brand-dark); color: #fff; font-weight: 680; letter-spacing: 0.02em;
  261. }
  262. .phone-screen.s3 .ft { gap: 12px; padding: 14px 16px; border-top-color: #f1f5f9; }
  263. .phone-screen.s3 .btn-cancel { display: none; }
  264. .phone-screen.s3 .btn-draft {
  265. flex: 1; height: 46px; border-radius: 10px; background: #fff; color: #475569;
  266. font-weight: 550; box-shadow: inset 0 0 0 1px #d0d5dd;
  267. }
  268. .phone-screen.s3 .btn-submit {
  269. flex: 1; height: 46px; border-radius: 10px; background: #0f172a; color: #fff; font-weight: 650;
  270. }
  271. .phone-screen.s3 .btn-submit span.dot {
  272. width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-right: 2px;
  273. }
  274. .phone-screen.s4 { background: #f1f5f9; }
  275. .phone-screen.s4 .ft {
  276. margin: 0 12px 12px; padding: 8px; gap: 8px; border: none; border-radius: 18px;
  277. background: rgba(255,255,255,0.92);
  278. box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset, 0 10px 28px rgba(15, 23, 42, 0.1);
  279. backdrop-filter: blur(12px);
  280. }
  281. .phone-screen.s4 .btn-cancel {
  282. flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border-radius: 14px;
  283. background: #f1f5f9; color: #64748b; font-size: 13px; font-weight: 600;
  284. }
  285. .phone-screen.s4 .btn-draft {
  286. flex: 1; height: 44px; border-radius: 14px; background: #f8fafc; color: #334155;
  287. font-weight: 600; box-shadow: inset 0 0 0 1px #e2e8f0;
  288. }
  289. .phone-screen.s4 .btn-submit {
  290. flex: 1.2; height: 44px; border-radius: 14px;
  291. background: linear-gradient(180deg, #4ade80, #16a34a); color: #fff; font-weight: 720;
  292. box-shadow: 0 6px 14px rgba(22, 163, 74, 0.35);
  293. }
  294. .phone-screen.s5 .ft { gap: 0; padding: 0; border-top: 1px solid #e5e7eb; }
  295. .phone-screen.s5 .btn { height: 52px; border-radius: 0; font-size: 15px; }
  296. .phone-screen.s5 .btn-cancel {
  297. flex: 0 0 76px; background: #fff; color: #64748b; font-weight: 500;
  298. border-right: 1px solid #f1f5f9;
  299. }
  300. .phone-screen.s5 .btn-draft {
  301. flex: 1; background: #fff; color: #1e293b; font-weight: 550;
  302. border-right: 1px solid #f1f5f9;
  303. }
  304. .phone-screen.s5 .btn-submit {
  305. flex: 1.25; background: var(--brand-dark); color: #fff; font-weight: 700;
  306. }
  307. .phone-screen.s6 .ft { gap: 10px; padding: 12px 14px; }
  308. .phone-screen.s6 .btn-cancel {
  309. flex: 0 0 auto; background: transparent; color: #94a3b8; font-weight: 500;
  310. font-size: 14px; padding: 0 8px; height: 44px; border-radius: 0;
  311. }
  312. .phone-screen.s6 .btn-draft {
  313. flex: 1; height: 44px; border-radius: 999px; background: #fff; color: var(--brand-deep);
  314. font-weight: 620; box-shadow: inset 0 0 0 1.5px #86efac;
  315. }
  316. .phone-screen.s6 .btn-submit {
  317. flex: 1.35; height: 44px; border-radius: 999px; background: var(--brand-deep);
  318. color: #fff; font-weight: 700;
  319. }
  320. .phone-screen.s7 .ft { gap: 10px; padding: 12px 14px; }
  321. .phone-screen.s7 .btn-cancel { display: none; }
  322. .phone-screen.s7 .btn-draft {
  323. flex: 0 0 auto; min-width: 108px; height: 46px; border-radius: 12px;
  324. background: #fff; color: #475569; font-weight: 550; font-size: 14px; gap: 6px;
  325. box-shadow: inset 0 0 0 1px #e2e8f0;
  326. }
  327. .phone-screen.s7 .btn-submit {
  328. flex: 1; height: 46px; border-radius: 12px; background: var(--brand); color: #fff;
  329. font-weight: 720; font-size: 16px; box-shadow: 0 10px 22px rgba(34, 197, 94, 0.28);
  330. }
  331. .phone-screen.s8 .ft {
  332. gap: 10px; padding: 12px 14px; background: #fafbfc; border-top-color: #eef2f6;
  333. }
  334. .phone-screen.s8 .btn-cancel {
  335. flex: 0 0 52px; height: 44px; padding: 0; border-radius: 12px;
  336. background: #fff; color: #64748b; font-weight: 500; font-size: 14px;
  337. box-shadow: inset 0 0 0 1px #e5e7eb;
  338. }
  339. .phone-screen.s8 .btn-draft {
  340. flex: 1; height: 44px; border-radius: 12px; background: #eff6ff; color: #1d4ed8; font-weight: 620;
  341. }
  342. .phone-screen.s8 .btn-submit {
  343. flex: 1.3; height: 44px; border-radius: 12px; background: var(--brand-dark); color: #fff; font-weight: 700;
  344. }
  345. /* 左侧迷你色条:只示意配色,不套完整底栏布局 */
  346. .mini-ft {
  347. display: flex; gap: 6px; align-items: center;
  348. margin-left: 38px; pointer-events: none;
  349. }
  350. .mini-ft .ft { display: contents; }
  351. .mini-ft .btn {
  352. height: 28px; font-size: 11px; padding: 0 10px; border-radius: 8px;
  353. box-shadow: none !important; min-width: 0;
  354. }
  355. .mini-ft .btn-cancel { display: none; }
  356. .scheme.s1 .mini-ft .btn-draft { background: #f1f5f9; color: #334155; }
  357. .scheme.s1 .mini-ft .btn-submit { background: #22c55e; color: #fff; }
  358. .scheme.s2 .mini-ft .btn-draft { background: transparent; color: #64748b; padding: 0 4px; }
  359. .scheme.s2 .mini-ft .btn-submit { flex: 1; background: #16a34a; color: #fff; }
  360. .scheme.s3 .mini-ft .btn-draft { background: #fff; color: #475569; box-shadow: inset 0 0 0 1px #d0d5dd !important; }
  361. .scheme.s3 .mini-ft .btn-submit { background: #0f172a; color: #fff; }
  362. .scheme.s3 .mini-ft .dot { display: none; }
  363. .scheme.s4 .mini-ft .btn-draft { background: #f8fafc; color: #334155; box-shadow: inset 0 0 0 1px #e2e8f0 !important; }
  364. .scheme.s4 .mini-ft .btn-submit { background: linear-gradient(180deg, #4ade80, #16a34a); color: #fff; }
  365. .scheme.s5 .mini-ft .btn { border-radius: 0; height: 30px; }
  366. .scheme.s5 .mini-ft .btn-draft { background: #fff; color: #1e293b; box-shadow: inset 0 0 0 1px #e5e7eb !important; }
  367. .scheme.s5 .mini-ft .btn-submit { background: #16a34a; color: #fff; }
  368. .scheme.s6 .mini-ft .btn { border-radius: 999px; }
  369. .scheme.s6 .mini-ft .btn-draft { background: #fff; color: #15803d; box-shadow: inset 0 0 0 1.5px #86efac !important; }
  370. .scheme.s6 .mini-ft .btn-submit { background: #15803d; color: #fff; }
  371. .scheme.s7 .mini-ft .btn-draft { background: #fff; color: #475569; box-shadow: inset 0 0 0 1px #e2e8f0 !important; }
  372. .scheme.s7 .mini-ft .btn-submit { flex: 1; background: #22c55e; color: #fff; }
  373. .scheme.s8 .mini-ft .btn-draft { background: #eff6ff; color: #1d4ed8; }
  374. .scheme.s8 .mini-ft .btn-submit { background: #16a34a; color: #fff; }
  375. </style>
  376. </head>
  377. <body>
  378. <div class="wrap">
  379. <h1>底栏按钮 · 重新设计</h1>
  380. <p class="sub">
  381. 上一版问题:草稿与提交都抢绿色、圆角/描边千篇一律、缩略图看不出层级。
  382. 这一版只保留 <strong>8 个差异化方向</strong>,右侧大屏实时预览;核心原则是
  383. <strong>草稿弱、提交强</strong>,避免双绿对撞。
  384. </p>
  385. <div class="note">
  386. 点左侧方案切换右侧手机。选好后回复编号,例如「用 <strong>S1</strong>」。
  387. 取消是否保留也可一并说明。
  388. </div>
  389. <div class="layout">
  390. <div class="schemes" id="schemes"></div>
  391. <aside class="stage">
  392. <div class="phone">
  393. <div class="phone-screen" id="phoneScreen">
  394. <div class="phone-nav">
  395. <span class="back">‹ 返回</span>
  396. 请假申请
  397. </div>
  398. <div class="form-mock">
  399. <div class="field">
  400. <div class="lab">请假类型</div>
  401. <div class="val">年假</div>
  402. </div>
  403. <div class="field">
  404. <div class="lab">开始时间</div>
  405. <div class="val">2026-08-12 09:00</div>
  406. </div>
  407. <div class="field">
  408. <div class="lab">结束时间</div>
  409. <div class="val">2026-08-13 18:00</div>
  410. </div>
  411. <div class="field">
  412. <div class="lab">请假事由</div>
  413. <div class="val ph">请填写事由…</div>
  414. </div>
  415. </div>
  416. <div class="ft" id="liveFt"></div>
  417. </div>
  418. </div>
  419. <div class="stage-meta">
  420. 当前:<strong id="liveName">—</strong>
  421. <div class="why" id="liveWhy"></div>
  422. </div>
  423. </aside>
  424. </div>
  425. </div>
  426. <script>
  427. const ICO_SAVE = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>`
  428. const schemes = [
  429. {
  430. id: 'S1',
  431. title: '石板次钮 + 薄荷主钮',
  432. rec: true,
  433. why: '草稿用中性灰底,不再抢绿;提交纯色+轻阴影,层级一眼可读。保留取消文字链。',
  434. markup: `
  435. <button class="btn btn-cancel" type="button">取消</button>
  436. <button class="btn btn-draft" type="button">暂存草稿</button>
  437. <button class="btn btn-submit" type="button">提交</button>`
  438. },
  439. {
  440. id: 'S2',
  441. title: '飞书式 · 文字草稿 + 宽提交',
  442. why: '草稿降为次级文字操作,主视线落在提交。信息密度低、决策成本低。',
  443. markup: `
  444. <button class="btn btn-cancel" type="button">取消</button>
  445. <button class="btn btn-draft" type="button">暂存草稿</button>
  446. <button class="btn btn-submit" type="button">提交审批</button>`
  447. },
  448. {
  449. id: 'S3',
  450. title: '等宽双钮 · 白描边 + 墨黑提交',
  451. why: '提交用近黑而非绿,品牌绿只做小圆点点缀,克制、偏工具产品。',
  452. markup: `
  453. <button class="btn btn-cancel" type="button">取消</button>
  454. <button class="btn btn-draft" type="button">暂存草稿</button>
  455. <button class="btn btn-submit" type="button"><span class="dot"></span>提交</button>`
  456. },
  457. {
  458. id: 'S4',
  459. title: '悬浮胶囊底栏',
  460. why: '底栏浮起成卡片;取消为方块、草稿线框、提交亮绿渐变,现代感强。',
  461. markup: `
  462. <button class="btn btn-cancel" type="button">取消</button>
  463. <button class="btn btn-draft" type="button">草稿</button>
  464. <button class="btn btn-submit" type="button">提交</button>`
  465. },
  466. {
  467. id: 'S5',
  468. title: '通栏三段 · 右主色块',
  469. why: '无圆角贴底通栏,右段深绿实心。偏企业后台/工具效率感。',
  470. markup: `
  471. <button class="btn btn-cancel" type="button">取消</button>
  472. <button class="btn btn-draft" type="button">暂存草稿</button>
  473. <button class="btn btn-submit" type="button">提交</button>`
  474. },
  475. {
  476. id: 'S6',
  477. title: '双胶囊 · 线框绿字 + 实心深绿',
  478. why: '同圆角语言,但草稿只留线框墨绿字,提交实心深绿,绿不打架。',
  479. markup: `
  480. <button class="btn btn-cancel" type="button">取消</button>
  481. <button class="btn btn-draft" type="button">暂存草稿</button>
  482. <button class="btn btn-submit" type="button">提交</button>`
  483. },
  484. {
  485. id: 'S7',
  486. title: '紧凑草稿 + 超宽提交',
  487. why: '草稿缩成带图标的次钮,提交占满剩余宽度,强调「主行动只有一个」。',
  488. markup: `
  489. <button class="btn btn-cancel" type="button">取消</button>
  490. <button class="btn btn-draft" type="button">${ICO_SAVE}草稿</button>
  491. <button class="btn btn-submit" type="button">提交</button>`
  492. },
  493. {
  494. id: 'S8',
  495. title: '冷暖分层 · 蓝草稿 / 绿提交',
  496. why: '用色相区分动作:草稿偏冷蓝、提交偏暖绿,语义分离最强(略跳脱品牌单色)。',
  497. markup: `
  498. <button class="btn btn-cancel" type="button">取消</button>
  499. <button class="btn btn-draft" type="button">暂存草稿</button>
  500. <button class="btn btn-submit" type="button">提交</button>`
  501. }
  502. ]
  503. const list = document.getElementById('schemes')
  504. const phone = document.getElementById('phoneScreen')
  505. const liveFt = document.getElementById('liveFt')
  506. const liveName = document.getElementById('liveName')
  507. const liveWhy = document.getElementById('liveWhy')
  508. function apply(id) {
  509. const s = schemes.find((x) => x.id === id)
  510. phone.className = 'phone-screen ' + id.toLowerCase()
  511. liveFt.innerHTML = s.markup
  512. liveName.textContent = id + ' · ' + s.title
  513. liveWhy.textContent = s.why
  514. list.querySelectorAll('.scheme').forEach((el) => {
  515. el.classList.toggle('is-on', el.dataset.id === id)
  516. })
  517. }
  518. schemes.forEach((s) => {
  519. const btn = document.createElement('button')
  520. btn.type = 'button'
  521. btn.className = 'scheme ' + s.id.toLowerCase()
  522. btn.dataset.id = s.id
  523. btn.innerHTML = `
  524. <div class="scheme-top">
  525. <span class="letter">${s.id.replace('S', '')}</span>
  526. <h2>${s.title}</h2>
  527. ${s.rec ? '<span class="tag rec">推荐</span>' : '<span class="tag">' + s.id + '</span>'}
  528. </div>
  529. <p>${s.why}</p>
  530. <div class="mini-ft"><div class="ft">${s.markup}</div></div>`
  531. btn.addEventListener('click', () => apply(s.id))
  532. list.appendChild(btn)
  533. })
  534. apply('S1')
  535. </script>
  536. </body>
  537. </html>