Files
aurora-admin/site/sources/segmented/html.txt
T
aurora-admin c65a69c34e
Deploy to GitHub Pages / deploy (push) Failing after 16s
Regression / regression (push) Failing after 15m2s
feat(P4): precompute移植+app.js sources双向回填+回归1003/1003+验收体积/文件/data.json
2026-09-12 14:18:41 +08:00

51 lines
2.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Aurora Admin · Segmented (H5)</title>
<link rel="stylesheet" href="../.design_library/aurora-admin/colors_and_type.css">
<style>
/* 对齐 组件2.txt Segmented 规范:高32px、选项内边距8px 16px、容器 #F5F7FA、圆角4px、选中白底、禁用 #BFBFBF */
.demo { padding: 24px; background: var(--au-color-page-bg); color: var(--au-color-text-body); font-family: var(--font-family); }
h1 { font-size: 20px; margin: 0 0 4px; }
.sub { color: var(--au-color-text-secondary); margin: 0 0 24px; font-size: 12px; }
.aa-segmented {
display: inline-flex; align-items: center; background: var(--au-color-page-bg); border-radius: 4px; padding: 2px;
}
.aa-segmented-item {
height: 28px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px;
border-radius: 4px; cursor: pointer; font-size: 14px; color: var(--au-color-text-body); border: none; background: none;
transition: background .15s, color .15s;
}
.aa-segmented-item:hover:not(.is-active):not(.is-disabled) { color: var(--au-color-brand); }
.aa-segmented-item.is-active { background: var(--au-color-card-bg); color: var(--au-color-text-body); box-shadow: 0 1px 2px rgba(0,0,0,0.08); font-weight: 500; }
.aa-segmented-item.is-disabled { color: var(--au-color-text-disabled); cursor: not-allowed; }
</style>
</head>
<body>
<div class="demo">
<h1>Aurora Admin · Segmented 组件(纯 H5)</h1>
<p class="sub">对齐 Segmented 规范:高32px、选项内边距8px 16px、容器 #F5F7FA、圆角4px、选中白底、禁用 #BFBFBF</p>
<div class="aa-segmented" id="seg">
<button class="aa-segmented-item is-active" data-val="list">列表</button>
<button class="aa-segmented-item" data-val="kanban">看板</button>
<button class="aa-segmented-item" data-val="gantt">甘特图</button>
<button class="aa-segmented-item is-disabled" data-val="cal" disabled>日历</button>
</div>
</div>
<script>
const seg = document.getElementById('seg');
seg.addEventListener('click', (e) => {
const btn = e.target.closest('.aa-segmented-item');
if (!btn || btn.disabled) return;
seg.querySelectorAll('.aa-segmented-item').forEach(b => b.classList.remove('is-active'));
btn.classList.add('is-active');
});
</script>
</body>
</html>