zkxw-mobile-oa-mine-card-index-badge-demo.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  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, maximum-scale=1" />
  6. <title>我发起的 · 列表卡片左上角序号 Demo</title>
  7. <style>
  8. :root {
  9. --brand: #0a9f6d;
  10. --brand-dark: #087f57;
  11. --brand-soft: #e9f9f2;
  12. --warn: #d97706;
  13. --warn-soft: #fff7e8;
  14. --danger: #ef4444;
  15. --nav-bg: #ecfdf5;
  16. --page-bg: #f5f6f8;
  17. --text: #1f2329;
  18. --text-muted: #8f959e;
  19. --border: #e8eaed;
  20. }
  21. * { box-sizing: border-box; }
  22. body {
  23. margin: 0;
  24. font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", -apple-system, system-ui, sans-serif;
  25. color: var(--text);
  26. background:
  27. radial-gradient(900px 420px at 8% -8%, rgba(10, 159, 109, 0.12), transparent 55%),
  28. linear-gradient(180deg, #f8fffc 0%, #f4f7fb 50%, #f7f8fa 100%);
  29. line-height: 1.45;
  30. }
  31. .stage { max-width: 1180px; margin: 0 auto; padding: 28px 16px 64px; }
  32. .hero h1 { margin: 0 0 8px; font-size: 22px; font-weight: 720; }
  33. .hero p { margin: 0; color: #64748b; font-size: 14px; max-width: 860px; }
  34. .rec {
  35. margin: 16px 0 0;
  36. padding: 14px 16px;
  37. border-radius: 14px;
  38. background: var(--brand-soft);
  39. border: 1px solid #b7ebd4;
  40. font-size: 13px;
  41. color: #166534;
  42. line-height: 1.55;
  43. }
  44. .rec b { color: var(--brand-dark); }
  45. .tabs {
  46. display: flex; flex-wrap: wrap; gap: 10px;
  47. margin: 20px 0 18px;
  48. }
  49. .tab {
  50. appearance: none; border: 1px solid #e2e8f0; background: #fff;
  51. border-radius: 999px; padding: 10px 16px; font-size: 13px;
  52. font-weight: 600; color: #475569; cursor: pointer;
  53. }
  54. .tab.is-active {
  55. color: var(--brand-dark); border-color: var(--brand);
  56. background: var(--brand-soft);
  57. box-shadow: 0 0 0 3px rgba(10, 159, 109, 0.16);
  58. }
  59. .tab .badge {
  60. display: inline-block; margin-left: 6px;
  61. padding: 1px 7px; border-radius: 999px;
  62. font-size: 11px; font-weight: 700;
  63. background: #fef3c7; color: #b45309;
  64. }
  65. .tab.is-active .badge {
  66. background: #fff; color: var(--brand-dark);
  67. }
  68. .layout {
  69. display: grid;
  70. grid-template-columns: minmax(240px, 300px) 1fr;
  71. gap: 20px; align-items: start;
  72. }
  73. @media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
  74. .panel {
  75. background: rgba(255,255,255,.94);
  76. border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px;
  77. box-shadow: 0 10px 28px rgba(15,23,42,.05);
  78. }
  79. .panel h2 { margin: 0 0 4px; font-size: 15px; }
  80. .panel .sub { margin: 0 0 10px; font-size: 12px; color: #64748b; }
  81. .panel ul { margin: 0; padding-left: 18px; font-size: 13px; color: #475569; }
  82. .panel li { margin: 6px 0; }
  83. .panel .ok {
  84. margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  85. background: #ecfdf5; border: 1px solid #a7f3d0;
  86. font-size: 12px; color: #047857;
  87. }
  88. .panel .pick {
  89. margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  90. background: #fff7e8; border: 1px solid #fde68a;
  91. font-size: 12px; color: #92400e;
  92. }
  93. .phones { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
  94. .phone {
  95. width: 375px; background: #fff; border-radius: 28px; overflow: hidden;
  96. box-shadow: 0 0 0 1px rgb(15 23 42 / 6%), 0 18px 40px rgb(15 23 42 / 12%);
  97. }
  98. .cap {
  99. text-align: center; font-size: 11px; font-weight: 650; color: #64748b;
  100. padding: 8px; background: #f8fafc; border-bottom: 1px solid #eef2f0;
  101. }
  102. .nav {
  103. height: 44px; display: flex; align-items: center; padding: 0 8px 0 4px;
  104. background: var(--nav-bg); border-bottom: 1px solid #d8f3e5;
  105. position: relative;
  106. }
  107. .nav-back {
  108. width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  109. color: #0f291e; flex-shrink: 0;
  110. }
  111. .nav-back::before {
  112. content: ""; width: 10px; height: 10px;
  113. border-left: 2px solid #0f291e; border-bottom: 2px solid #0f291e;
  114. transform: rotate(45deg); margin-left: 4px;
  115. }
  116. .nav-title {
  117. position: absolute; left: 50%; transform: translateX(-50%);
  118. font-size: 16px; font-weight: 650; color: #0f291e;
  119. }
  120. .page {
  121. min-height: 640px;
  122. background: var(--page-bg);
  123. padding-bottom: 24px;
  124. }
  125. .toolbar {
  126. padding: 8px 12px;
  127. background: #fff;
  128. border-bottom: 1px solid #f1f5f9;
  129. }
  130. .search-box {
  131. height: 36px;
  132. display: flex; align-items: center; gap: 8px;
  133. padding: 0 12px; border-radius: 10px;
  134. background: #fafafa; border: 1px solid #e8eaed;
  135. }
  136. .search-ico {
  137. width: 13px; height: 13px; border: 1.5px solid #94a3b8; border-radius: 50%;
  138. position: relative; flex-shrink: 0;
  139. }
  140. .search-ico::after {
  141. content: ""; position: absolute; width: 6px; height: 1.5px;
  142. right: -4px; bottom: -2px; background: #94a3b8; border-radius: 2px;
  143. transform: rotate(45deg);
  144. }
  145. .search-ph { font-size: 13px; color: #b0b7c3; }
  146. .list {
  147. padding: 10px 12px 0;
  148. display: flex; flex-direction: column; gap: 10px;
  149. }
  150. /* ===== 对齐 mine/index.vue 现有卡片 ===== */
  151. .dd-card {
  152. position: relative;
  153. width: 100%;
  154. background: #fff;
  155. border-radius: 14px;
  156. padding: 14px 14px 12px;
  157. box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  158. overflow: hidden;
  159. }
  160. .dd-card__head {
  161. display: flex; align-items: flex-start; gap: 8px;
  162. }
  163. .dd-card__title {
  164. flex: 1; min-width: 0;
  165. font-size: 15px; font-weight: 700; line-height: 1.4; color: #1f2329;
  166. }
  167. .dd-card__time {
  168. flex-shrink: 0; font-size: 12px; line-height: 1.4; color: #8f959e; padding-top: 2px;
  169. }
  170. .dd-card__meta { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
  171. .dd-card__meta-line {
  172. font-size: 13px; line-height: 1.45; color: #8f959e;
  173. overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  174. }
  175. .dd-card__foot {
  176. margin-top: 12px; display: flex; align-items: center;
  177. justify-content: space-between; gap: 8px;
  178. }
  179. .dd-card__hint-tag {
  180. max-width: 70%;
  181. font-size: 11px; font-weight: 650; line-height: 1.2;
  182. padding: 4px 9px; border-radius: 999px;
  183. background: rgba(217, 119, 6, 0.12); color: #d97706;
  184. overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  185. }
  186. .dd-card__hint-tag.is-success {
  187. background: rgba(10, 159, 109, 0.12); color: #0a9f6d;
  188. }
  189. .dd-card__hint-tag.is-danger {
  190. background: rgba(239, 68, 68, 0.12); color: #ef4444;
  191. }
  192. .dd-card__status {
  193. flex-shrink: 0; font-size: 12px; font-weight: 600; color: #d97706;
  194. }
  195. .dd-card__status.is-success { color: #0a9f6d; }
  196. .dd-card__status.is-danger { color: #ef4444; }
  197. /* ---------- A:左上折角序号 ---------- */
  198. .style-a .dd-card { padding-left: 14px; }
  199. .style-a .idx {
  200. position: absolute; top: 0; left: 0;
  201. width: 0; height: 0;
  202. border-style: solid;
  203. border-width: 34px 34px 0 0;
  204. border-color: var(--brand) transparent transparent transparent;
  205. }
  206. .style-a .idx span {
  207. position: absolute; top: -30px; left: 4px;
  208. font-size: 10px; font-weight: 800; color: #fff;
  209. line-height: 1; letter-spacing: -0.02em;
  210. }
  211. /* ---------- B:圆点序号(标题左侧)推荐 ---------- */
  212. .style-b .dd-card__head { align-items: center; }
  213. .style-b .idx {
  214. flex-shrink: 0;
  215. width: 22px; height: 22px; border-radius: 50%;
  216. display: inline-flex; align-items: center; justify-content: center;
  217. font-size: 11px; font-weight: 800; color: #fff;
  218. background: var(--brand);
  219. box-shadow: 0 2px 6px rgba(10, 159, 109, 0.28);
  220. }
  221. .style-b .idx.is-warn { background: var(--warn); box-shadow: 0 2px 6px rgba(217, 119, 6, 0.28); }
  222. .style-b .idx.is-danger { background: var(--danger); box-shadow: 0 2px 6px rgba(239, 68, 68, 0.28); }
  223. .style-b .idx.is-mute { background: #94a3b8; box-shadow: none; }
  224. /* ---------- C:左色条 + 小号序号 ---------- */
  225. .style-c .dd-card {
  226. padding-left: 18px;
  227. border-left: 3px solid var(--brand);
  228. }
  229. .style-c .dd-card.is-warn { border-left-color: var(--warn); }
  230. .style-c .dd-card.is-danger { border-left-color: var(--danger); }
  231. .style-c .dd-card.is-mute { border-left-color: #94a3b8; }
  232. .style-c .idx {
  233. flex-shrink: 0;
  234. min-width: 18px;
  235. font-size: 12px; font-weight: 800; color: var(--brand);
  236. font-variant-numeric: tabular-nums;
  237. padding-top: 1px;
  238. }
  239. .style-c .dd-card.is-warn .idx { color: var(--warn); }
  240. .style-c .dd-card.is-danger .idx { color: var(--danger); }
  241. .style-c .dd-card.is-mute .idx { color: #94a3b8; }
  242. /* ---------- D:金额角标(有金额才显示) ---------- */
  243. .style-d .price {
  244. position: absolute; top: 0; left: 0;
  245. max-width: 72%;
  246. padding: 4px 10px 4px 8px;
  247. border-radius: 0 0 10px 0;
  248. background: linear-gradient(135deg, #0a9f6d 0%, #059669 100%);
  249. color: #fff;
  250. font-size: 11px; font-weight: 750;
  251. letter-spacing: 0.01em;
  252. box-shadow: 2px 2px 8px rgba(10, 159, 109, 0.22);
  253. white-space: nowrap;
  254. overflow: hidden; text-overflow: ellipsis;
  255. }
  256. .style-d .dd-card.has-price { padding-top: 30px; }
  257. .style-d .price .yen { opacity: 0.88; margin-right: 1px; font-weight: 600; }
  258. .style-d .price.is-empty {
  259. background: #e2e8f0; color: #64748b; box-shadow: none; font-weight: 650;
  260. }
  261. /* ---------- E:序号胶囊叠左上 ---------- */
  262. .style-e .idx {
  263. position: absolute; top: 8px; left: 8px;
  264. min-width: 20px; height: 18px; padding: 0 6px;
  265. border-radius: 6px;
  266. display: inline-flex; align-items: center; justify-content: center;
  267. font-size: 10px; font-weight: 800; color: var(--brand-dark);
  268. background: var(--brand-soft);
  269. border: 1px solid #b7ebd4;
  270. font-variant-numeric: tabular-nums;
  271. }
  272. .style-e .dd-card { padding-top: 32px; }
  273. .legend {
  274. margin-top: 22px;
  275. display: grid;
  276. grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  277. gap: 12px;
  278. }
  279. .legend .box {
  280. background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  281. padding: 12px 14px; font-size: 12px; color: #475569;
  282. }
  283. .legend h3 { margin: 0 0 6px; font-size: 13px; color: #0f291e; }
  284. code {
  285. font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  286. font-size: 11px; background: #f1f5f9; padding: 1px 5px; border-radius: 4px;
  287. }
  288. </style>
  289. </head>
  290. <body>
  291. <div class="stage">
  292. <div class="hero">
  293. <h1>我发起的 · 列表卡片左上角序号 / 价格角标</h1>
  294. <p>
  295. 对齐 <code>mobile-h5/pages/oa/mine/index</code> 现有钉钉风卡片(标题 / 相对时间 / previewFields / 待处理人 + 状态)。
  296. 对比五种「左上角」处理方式,便于选型后落地。
  297. </p>
  298. <div class="rec">
  299. <b>已选定:A 折角序号</b> —— 左上品牌绿三角 + 白字两位序号(01、02…);
  300. 序号跨页连续;不随状态变色。详见
  301. <code>docs/superpowers/specs/2026-08-13-oa-mine-card-corner-index-design.md</code>。
  302. </div>
  303. </div>
  304. <div class="tabs" id="tabs">
  305. <button type="button" class="tab is-active" data-k="a">A 折角序号<span class="badge">选定</span></button>
  306. <button type="button" class="tab" data-k="b">B 圆点序号</button>
  307. <button type="button" class="tab" data-k="c">C 左色条+序号</button>
  308. <button type="button" class="tab" data-k="e">E 左上胶囊</button>
  309. <button type="button" class="tab" data-k="d">D 金额角标</button>
  310. </div>
  311. <div class="layout">
  312. <aside class="panel" id="side">
  313. <h2>A 折角序号</h2>
  314. <p class="sub">卡片左上三角折角</p>
  315. <ul>
  316. <li>视觉强、像「价签/角标」</li>
  317. <li>会略微挤压标题可读区</li>
  318. <li>长序号(两位数)空间紧</li>
  319. </ul>
  320. <div class="ok">产品已选定本方案,仅落地「我发起的」。</div>
  321. </aside>
  322. <div class="phones">
  323. <div class="phone">
  324. <div class="cap" id="cap">A 折角序号 · 选定 · 375px</div>
  325. <div class="nav">
  326. <div class="nav-back" aria-hidden="true"></div>
  327. <div class="nav-title">我发起的</div>
  328. </div>
  329. <div class="page">
  330. <div class="toolbar">
  331. <div class="search-box">
  332. <span class="search-ico" aria-hidden="true"></span>
  333. <span class="search-ph">搜索流程名称</span>
  334. </div>
  335. </div>
  336. <div class="list style-b" id="list"></div>
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. <div class="legend">
  342. <div class="box">
  343. <h3>序号规则</h3>
  344. 与 Web 四个中心一致:跨页连续<br />
  345. <code>(page - 1) * pageSize + index + 1</code><br />
  346. 本 Demo 假设第 1 页,pageSize=10。
  347. </div>
  348. <div class="box">
  349. <h3>「价格」从哪来</h3>
  350. D 方案从 <code>previewFields</code> 里识别含「金额」的字段;
  351. 无金额则显示「无金额」灰角标或隐藏(可配置)。
  352. </div>
  353. <div class="box">
  354. <h3>落地范围建议</h3>
  355. 先只改「我发起的」;若观感好,再同步待办 / 已办 / 抄送 / 草稿,避免五页风格分裂。
  356. </div>
  357. </div>
  358. </div>
  359. <script>
  360. const ROWS = [
  361. {
  362. title: '费用报销',
  363. time: '09:12',
  364. meta: ['报销金额:1280.00', '事由:差旅交通'],
  365. amount: '1,280.00',
  366. hint: '待张敏处理',
  367. status: '进行中',
  368. tone: 'warn'
  369. },
  370. {
  371. title: '请假申请',
  372. time: '昨天',
  373. meta: ['请假类型:事假', '请假天数:1'],
  374. amount: null,
  375. hint: '待李华处理',
  376. status: '进行中',
  377. tone: 'warn'
  378. },
  379. {
  380. title: '采购申请',
  381. time: '前天',
  382. meta: ['采购金额:8600.00', '供应商:华东物资'],
  383. amount: '8,600.00',
  384. hint: '审批完成',
  385. status: '已完成',
  386. tone: 'success'
  387. },
  388. {
  389. title: '出差申请',
  390. time: '3天前',
  391. meta: ['目的地:上海', '天数:2'],
  392. amount: null,
  393. hint: '已打回',
  394. status: '已打回',
  395. tone: 'danger'
  396. },
  397. {
  398. title: '用章申请',
  399. time: '2026.08.01',
  400. meta: ['用章类型:公章', '份数:2'],
  401. amount: null,
  402. hint: '我发起的',
  403. status: '已撤销',
  404. tone: 'mute'
  405. }
  406. ]
  407. const SIDE = {
  408. a: {
  409. title: 'A 折角序号',
  410. sub: '卡片左上三角折角',
  411. items: [
  412. '视觉强、像「价签/角标」',
  413. '会略微挤压标题可读区',
  414. '长序号(两位数)空间紧'
  415. ],
  416. note: 'ok',
  417. noteText: '产品已选定本方案,仅落地「我发起的」。'
  418. },
  419. b: {
  420. title: 'B 圆点序号',
  421. sub: '标题行左侧 · 状态同色',
  422. items: [
  423. '序号:(page-1)*pageSize + i + 1',
  424. '色:进行中琥珀 / 通过绿 / 拒绝红 / 其它灰',
  425. '不占绝对定位,标题不被遮挡'
  426. ],
  427. note: 'pick',
  428. noteText: '备选;本期不采用。'
  429. },
  430. c: {
  431. title: 'C 左色条 + 序号',
  432. sub: '状态色条 + 数字',
  433. items: [
  434. '左边框表达状态,序号为纯数字',
  435. '与草稿箱「左色条」Demo 可对齐',
  436. '标题仍完整可读'
  437. ],
  438. note: 'ok',
  439. noteText: '若五列表已统一左色条,这是自然延伸。'
  440. },
  441. d: {
  442. title: 'D 金额角标',
  443. sub: '左上价格条 · 无则灰/隐',
  444. items: [
  445. '从 previewFields 抽「*金额*」',
  446. '有金额:¥1,280.00 绿角标',
  447. '无金额:灰「无金额」或隐藏'
  448. ],
  449. note: 'pick',
  450. noteText: '「价格序号」若指金额露出,用本方案;序号另议。'
  451. },
  452. e: {
  453. title: 'E 左上胶囊',
  454. sub: '绝对定位浅绿胶囊',
  455. items: [
  456. '不挤标题行,但卡片整体变高',
  457. '视觉弱于折角、强于纯色条',
  458. '两位数序号更友好'
  459. ],
  460. note: 'ok',
  461. noteText: '折中方案;若标题很长可优先于 A。'
  462. }
  463. }
  464. const CAP = {
  465. a: 'A 折角序号 · 选定 · 375px',
  466. b: 'B 圆点序号 · 375px',
  467. c: 'C 左色条+序号 · 375px',
  468. d: 'D 金额角标 · 375px',
  469. e: 'E 左上胶囊 · 375px'
  470. }
  471. function pad(n) {
  472. return n < 10 ? '0' + n : String(n)
  473. }
  474. function render(style) {
  475. const list = document.getElementById('list')
  476. list.className = 'list style-' + style
  477. list.innerHTML = ROWS.map((row, i) => {
  478. const n = i + 1
  479. const tone = row.tone === 'mute' ? 'info' : row.tone
  480. const hintCls = row.tone === 'mute' ? '' : ' is-' + (row.tone === 'warn' ? '' : row.tone)
  481. const hintClass =
  482. 'dd-card__hint-tag' +
  483. (row.tone === 'success' ? ' is-success' : '') +
  484. (row.tone === 'danger' ? ' is-danger' : '')
  485. const statusClass =
  486. 'dd-card__status' +
  487. (row.tone === 'success' ? ' is-success' : '') +
  488. (row.tone === 'danger' ? ' is-danger' : '')
  489. let badge = ''
  490. let cardExtra = ''
  491. let headPrefix = ''
  492. if (style === 'a') {
  493. badge = '<div class="idx" aria-hidden="true"><span>' + pad(n) + '</span></div>'
  494. } else if (style === 'b') {
  495. const cls =
  496. 'idx' +
  497. (row.tone === 'warn' ? ' is-warn' : '') +
  498. (row.tone === 'success' ? '' : '') +
  499. (row.tone === 'danger' ? ' is-danger' : '') +
  500. (row.tone === 'mute' ? ' is-mute' : '')
  501. // success 用默认绿;warn/danger/mute 覆盖
  502. let bCls = 'idx'
  503. if (row.tone === 'warn') bCls += ' is-warn'
  504. else if (row.tone === 'danger') bCls += ' is-danger'
  505. else if (row.tone === 'mute') bCls += ' is-mute'
  506. headPrefix = '<span class="' + bCls + '">' + n + '</span>'
  507. } else if (style === 'c') {
  508. cardExtra =
  509. ' is-' +
  510. (row.tone === 'mute' ? 'mute' : row.tone === 'success' ? 'success' : row.tone)
  511. // border uses warn/danger/mute; success stays brand via default
  512. if (row.tone === 'success') cardExtra = ''
  513. headPrefix = '<span class="idx">' + pad(n) + '</span>'
  514. } else if (style === 'd') {
  515. if (row.amount) {
  516. badge =
  517. '<div class="price"><span class="yen">¥</span>' +
  518. row.amount +
  519. '</div>'
  520. cardExtra = ' has-price'
  521. } else {
  522. badge = '<div class="price is-empty">无金额</div>'
  523. cardExtra = ' has-price'
  524. }
  525. } else if (style === 'e') {
  526. badge = '<span class="idx">' + pad(n) + '</span>'
  527. }
  528. const meta = row.meta
  529. .map((m) => '<span class="dd-card__meta-line">' + m + '</span>')
  530. .join('')
  531. return (
  532. '<div class="dd-card' +
  533. cardExtra +
  534. '">' +
  535. badge +
  536. '<div class="dd-card__head">' +
  537. headPrefix +
  538. '<div class="dd-card__title">' +
  539. row.title +
  540. '</div>' +
  541. '<div class="dd-card__time">' +
  542. row.time +
  543. '</div>' +
  544. '</div>' +
  545. '<div class="dd-card__meta">' +
  546. meta +
  547. '</div>' +
  548. '<div class="dd-card__foot">' +
  549. '<span class="' +
  550. hintClass +
  551. '">' +
  552. row.hint +
  553. '</span>' +
  554. '<span class="' +
  555. statusClass +
  556. '">' +
  557. row.status +
  558. '</span>' +
  559. '</div>' +
  560. '</div>'
  561. )
  562. }).join('')
  563. const s = SIDE[style]
  564. const side = document.getElementById('side')
  565. side.innerHTML =
  566. '<h2>' +
  567. s.title +
  568. '</h2>' +
  569. '<p class="sub">' +
  570. s.sub +
  571. '</p>' +
  572. '<ul>' +
  573. s.items.map((t) => '<li>' + t + '</li>').join('') +
  574. '</ul>' +
  575. '<div class="' +
  576. s.note +
  577. '">' +
  578. s.noteText +
  579. '</div>'
  580. document.getElementById('cap').textContent = CAP[style]
  581. }
  582. document.getElementById('tabs').addEventListener('click', (e) => {
  583. const btn = e.target.closest('.tab')
  584. if (!btn) return
  585. document.querySelectorAll('.tab').forEach((t) => t.classList.remove('is-active'))
  586. btn.classList.add('is-active')
  587. render(btn.dataset.k)
  588. })
  589. render('a')
  590. </script>
  591. </body>
  592. </html>