@namewta/skills-hub 0.1.48 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/home/home-project-changelog/SKILL.md +3 -3
- package/skills/home/home-project-changelog/assets/project-changelog.md +7 -7
- package/skills/home/home-project-changelog/assets/worker-brief.md +1 -1
- package/skills/home/home-project-changelog/references/git-ranges.md +3 -0
- package/skills/home/home-project-changelog/references/tools.md +14 -4
- package/skills/home/home-project-changelog/references/workflow.md +2 -2
- package/skills/home/home-project-changelog/references/writing.md +20 -2
- package/skills/home/home-project-changelog/scripts/changelog.mjs +47 -5
- package/skills/home/home-project-changelog/scripts/contract.mjs +46 -2
- package/skills/home/home-project-changelog/scripts/git.mjs +15 -0
- package/skills/home/home-project-changelog/scripts/revision.mjs +231 -0
- package/skills/home/home-project-changelog/scripts/storage.mjs +24 -6
- package/skills/home/home-project-changelog/scripts/summary.mjs +17 -3
- package/skills/home/home-project-changelog/scripts/tasks.mjs +40 -0
- package/skills/home/home-website/SKILL.md +2 -2
- package/skills/home/home-website/assets/website/scripts/inputs.mjs +56 -14
- package/skills/home/home-website/assets/website/scripts/render.mjs +10 -5
- package/skills/home/home-website/assets/website/site/public/home-assets/app.js +69 -99
- package/skills/home/home-website/assets/website/site/public/home-assets/site.css +76 -83
- package/skills/home/home-website/assets/website/site/templates/layout.mjs +27 -15
- package/skills/home/home-website/assets/website/site/templates/ledger.mjs +55 -39
- package/skills/home/home-website/assets/website/site/templates/model.mjs +39 -1
- package/skills/home/home-website/assets/website/site/templates/pages.mjs +39 -57
- package/skills/home/home-website/assets/website/site/templates/project-logs.mjs +26 -10
- package/skills/home/home-website/references/website.md +8 -11
|
@@ -74,127 +74,97 @@
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function initTimeline() {
|
|
77
|
-
const
|
|
78
|
-
if (!
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
77
|
+
const input = one('#timeline-query');
|
|
78
|
+
if (!input) return;
|
|
79
|
+
const project = one('#timeline-project');
|
|
80
|
+
const month = one('#timeline-month');
|
|
81
|
+
const category = one('#timeline-category');
|
|
82
|
+
const fields = [['repo', project], ['month', month], ['category', category], ['q', input]].filter(([, field]) => field);
|
|
83
|
+
const number = value => value.toLocaleString('zh-CN');
|
|
84
|
+
const months = all('.ledger-window').map(section => ({
|
|
85
|
+
section,
|
|
86
|
+
key: section.dataset.month,
|
|
87
|
+
count: section.querySelector('.window-count'),
|
|
88
|
+
groups: [...section.querySelectorAll('.ledger-group')].map(group => ({
|
|
89
|
+
group,
|
|
90
|
+
id: group.dataset.ledgerRepo,
|
|
91
|
+
projectText: normalize(group.dataset.ledgerRepo + ' ' + group.dataset.repoName),
|
|
92
|
+
commits: Number(group.dataset.commits),
|
|
93
|
+
rows: [...group.querySelectorAll('[data-kind]')].map(row => ({
|
|
94
|
+
row,
|
|
95
|
+
category: row.dataset.kind,
|
|
96
|
+
text: normalize(row.textContent),
|
|
97
|
+
task: row.hasAttribute('data-entry'),
|
|
93
98
|
})),
|
|
94
99
|
})),
|
|
95
100
|
}));
|
|
96
|
-
let requestedAll = false;
|
|
97
101
|
|
|
98
102
|
function restore() {
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
requestedAll = openAll;
|
|
103
|
-
for (const [key,field] of fields) {
|
|
104
|
-
field.value = args.get(key) ?? '';
|
|
103
|
+
const params = new URL(location.href).searchParams;
|
|
104
|
+
for (const [key, field] of fields) {
|
|
105
|
+
field.value = params.get(key) ?? '';
|
|
105
106
|
if (field.tagName === 'SELECT' && field.selectedIndex < 0) field.value = '';
|
|
106
107
|
}
|
|
107
|
-
return changed;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function syncExpand() {
|
|
111
|
-
const visible = all('.more-entries').filter(detail => !detail.closest('[hidden]'));
|
|
112
|
-
const expanded = visible.length > 0 && visible.every(detail => detail.open);
|
|
113
|
-
expand.textContent = expanded ? '收起全部' : '展开全部';
|
|
114
|
-
expand.setAttribute('aria-pressed',String(expanded));
|
|
115
|
-
expand.disabled = visible.length === 0;
|
|
116
|
-
return visible;
|
|
117
108
|
}
|
|
118
109
|
|
|
119
|
-
function render(
|
|
120
|
-
const
|
|
121
|
-
const filtered = Boolean(select.value || category.value || query);
|
|
110
|
+
function render() {
|
|
111
|
+
const tokens = normalize(input.value).split(/\s+/u).filter(Boolean);
|
|
122
112
|
const projects = new Set();
|
|
123
|
-
let
|
|
124
|
-
for (const
|
|
125
|
-
let
|
|
126
|
-
for (const group of
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (more) {
|
|
141
|
-
const remaining = visible.filter(item => more.contains(item.row)).length;
|
|
142
|
-
more.hidden = remaining === 0;
|
|
143
|
-
more.querySelector('[data-more-count]').textContent = remaining;
|
|
144
|
-
if (resetOpen) more.open = requestedAll || Boolean(remaining && (query || category.value));
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
group.group.hidden = matches === 0;
|
|
148
|
-
if (matches) {
|
|
149
|
-
groupCount += 1;
|
|
150
|
-
periods += matches;
|
|
151
|
-
projects.add(group.id);
|
|
152
|
-
}
|
|
113
|
+
let dated = 0, undated = false, tasks = 0;
|
|
114
|
+
for (const entry of months) {
|
|
115
|
+
let groups = 0, entries = 0, commits = 0;
|
|
116
|
+
for (const group of entry.groups) {
|
|
117
|
+
const matchesScope = (!project?.value || project.value === group.id) && (!month.value || month.value === entry.key);
|
|
118
|
+
const visible = group.rows.filter(item => {
|
|
119
|
+
item.row.hidden = !matchesScope || (category.value !== '' && category.value !== item.category)
|
|
120
|
+
|| !tokens.every(token => item.text.includes(token) || group.projectText.includes(token));
|
|
121
|
+
return !item.row.hidden;
|
|
122
|
+
});
|
|
123
|
+
const commitOnly = !group.rows.length && !category.value && tokens.every(token => group.projectText.includes(token));
|
|
124
|
+
group.group.hidden = !matchesScope || (!visible.length && !commitOnly);
|
|
125
|
+
if (group.group.hidden) continue;
|
|
126
|
+
groups++;
|
|
127
|
+
projects.add(group.id);
|
|
128
|
+
entries += visible.filter(item => item.task).length;
|
|
129
|
+
commits += group.commits;
|
|
153
130
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
|
|
131
|
+
entry.section.hidden = groups === 0;
|
|
132
|
+
if (!groups) continue;
|
|
133
|
+
if (entry.key === 'undated') undated = true;
|
|
134
|
+
else dated++;
|
|
135
|
+
tasks += entries;
|
|
136
|
+
const commitLabel = category.value || tokens.length
|
|
137
|
+
? `所示项目共 ${number(commits)} 次 Git 提交`
|
|
138
|
+
: `${number(commits)} 次 Git 提交`;
|
|
139
|
+
entry.count.textContent = `${number(entries)} 项任务 · ${commitLabel}`;
|
|
159
140
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
141
|
+
const monthCount = dated ? `${dated} 个月${undated ? '及日期未记录条目' : ''}` : undated ? '日期未记录条目' : '0 个月';
|
|
142
|
+
const projectCount = project ? ` · ${projects.size} 个项目` : '';
|
|
143
|
+
one('#timeline-count').textContent = `${monthCount}${projectCount} · ${number(tasks)} 项任务`;
|
|
144
|
+
one('#timeline-empty').hidden = dated > 0 || undated;
|
|
163
145
|
}
|
|
164
146
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
requestedAll = false;
|
|
169
|
-
setQueryParam('view','');
|
|
170
|
-
}
|
|
171
|
-
syncExpand();
|
|
172
|
-
},true);
|
|
173
|
-
expand.addEventListener('click', () => {
|
|
174
|
-
const next = expand.getAttribute('aria-pressed') !== 'true';
|
|
175
|
-
requestedAll = next;
|
|
176
|
-
setQueryParam('view',next ? 'all' : '');
|
|
177
|
-
for (const detail of syncExpand()) detail.open = next;
|
|
178
|
-
syncExpand();
|
|
179
|
-
});
|
|
180
|
-
for (const [key,field] of fields) field.addEventListener(field === input ? 'input' : 'change', () => {
|
|
181
|
-
setQueryParam(key,field.value);
|
|
182
|
-
render(true);
|
|
147
|
+
for (const [key, field] of fields) field.addEventListener(field === input ? 'input' : 'change', () => {
|
|
148
|
+
setQueryParam(key, field.value);
|
|
149
|
+
render();
|
|
183
150
|
});
|
|
184
151
|
one('#reset-timeline').addEventListener('click', () => {
|
|
185
|
-
for (const [key,field] of fields) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
152
|
+
for (const [key, field] of fields) {
|
|
153
|
+
field.value = '';
|
|
154
|
+
setQueryParam(key, '');
|
|
155
|
+
}
|
|
156
|
+
render();
|
|
189
157
|
input.focus();
|
|
190
158
|
});
|
|
191
159
|
window.addEventListener('pageshow', event => {
|
|
192
|
-
if (event.persisted)
|
|
160
|
+
if (event.persisted) {
|
|
161
|
+
restore();
|
|
162
|
+
render();
|
|
163
|
+
}
|
|
193
164
|
});
|
|
194
165
|
restore();
|
|
195
|
-
render(
|
|
166
|
+
render();
|
|
196
167
|
}
|
|
197
|
-
|
|
198
168
|
function addHighlighted(parent, value, needle) {
|
|
199
169
|
// The source index is text. Insert text nodes even when a phrase looks like markup.
|
|
200
170
|
const position = needle ? value.toLocaleLowerCase('zh-CN').indexOf(needle) : -1;
|
|
@@ -44,7 +44,7 @@ h1, h2, h3 { color: var(--ink); }
|
|
|
44
44
|
.main-content { min-height: calc(100vh - 189px); padding-block: 32px 62px; }
|
|
45
45
|
:where(h2,article,section,[id]) { scroll-margin-top: 92px; }
|
|
46
46
|
.masthead { position: sticky; z-index: 10; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
|
|
47
|
-
.mast-inner, .brand, .main-nav, .mast-tools, .search-open, .icon-button, .text-link, .button-row, .primary-button, .secondary-button, .section-heading, .hero-date, .chart-label, .
|
|
47
|
+
.mast-inner, .brand, .main-nav, .mast-tools, .search-open, .icon-button, .text-link, .button-row, .primary-button, .secondary-button, .section-heading, .hero-date, .chart-label, .card-top, .card-foot, .project-chip, .footer-inner, .field, .filter-pills, .period-heading, .detail-intro, .crumbs { display: flex; align-items: center; }
|
|
48
48
|
.mast-inner { height: 70px; gap: clamp(20px, 4vw, 62px); }
|
|
49
49
|
.brand { color: var(--ink); gap: 12px; white-space: nowrap; font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: -.055em; }
|
|
50
50
|
.brand-stamp { position: relative; display: inline-block; width: 32px; height: 32px; border-radius: 9px; background: #162840; }
|
|
@@ -56,7 +56,7 @@ h1, h2, h3 { color: var(--ink); }
|
|
|
56
56
|
.main-nav a[aria-current] { font-weight: 650; }
|
|
57
57
|
.main-nav a[aria-current]::after { content: ""; position: absolute; height: 3px; background: var(--gold); bottom: 0; inset-inline: 0; border-radius: 3px 3px 0 0; }
|
|
58
58
|
.mast-tools { margin-left: auto; gap: 10px; }
|
|
59
|
-
.search-open, .icon-button, .field
|
|
59
|
+
.search-open, .icon-button, .field { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
|
|
60
60
|
.search-open { min-height: 36px; padding: 0 9px 0 12px; color: var(--muted); gap: 9px; font-size: 13px; }
|
|
61
61
|
kbd { font: 11px/1.4 var(--mono); border: 1px solid var(--line); border-radius: 4px; background: var(--soft); color: var(--muted); padding: 1px 4px; }
|
|
62
62
|
.search-open kbd { margin-left: 11px; }
|
|
@@ -81,42 +81,33 @@ kbd { font: 11px/1.4 var(--mono); border: 1px solid var(--line); border-radius:
|
|
|
81
81
|
.overview-hero>* { position:relative; }
|
|
82
82
|
.hero-date { color:#e4c48c; gap:8px; font-size:12px; letter-spacing:.04em; }
|
|
83
83
|
.hero-date i { width:22px; height:2px; background:#d7aa66; }
|
|
84
|
-
.hero-date time, .
|
|
85
|
-
.hero-copy h1 { color:#fcf8ef; font:700 clamp(
|
|
84
|
+
.hero-date time, .repo-id, .card-foot time, .period-heading>span:last-child { font-family:var(--mono); }
|
|
85
|
+
.hero-copy h1 { color:#fcf8ef; font:700 clamp(36px,3.5vw,51px)/1.18 var(--serif); letter-spacing:.03em; margin:13px 0 10px; }
|
|
86
86
|
.hero-copy>p { color:#d3dce5; font-size:15px; }
|
|
87
87
|
.hero-stats { display:flex; gap:0; margin-top:26px; }
|
|
88
88
|
.hero-stats>div { display:flex; flex-direction:column-reverse; gap:1px; border-right:1px solid #93a7bd45; padding-inline:clamp(15px,2vw,31px); }
|
|
89
89
|
.hero-stats>div:first-child { padding-left:0; } .hero-stats>div:last-child { border:none; padding-right:0; }
|
|
90
|
-
.hero-stats dd { color:#f7e8ce; font:
|
|
91
|
-
.hero-stats dt { color:#ccd5df; font-size:
|
|
90
|
+
.hero-stats dd { color:#f7e8ce; font:500 clamp(34px,3.5vw,53px)/1.15 var(--serif); font-variant-numeric:lining-nums tabular-nums; }
|
|
91
|
+
.hero-stats dt { color:#ccd5df; font-size:13px; }
|
|
92
92
|
.activity-figure { min-width:0; border:1px solid #9bafbd48; background:#0c1c2c5e; padding:16px 20px 12px; border-radius:11px; color:#d5dfe9; }
|
|
93
93
|
.activity-figure figcaption { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
|
|
94
|
-
.chart-label { font-weight:650; font-size:14px; gap:8px; color:#f6ecd9; }
|
|
95
|
-
.chart-window,.chart-axis { font-size:10px; color:#c1cdd8; letter-spacing:.025em; }
|
|
96
|
-
.chart-lane { display:grid; grid-template-columns:67px 1fr; align-items:center; min-height:21px; }
|
|
97
|
-
.lane-name { font-size:11px; color:#d6e1e9; width:max-content; } .lane-name:hover { color:white; text-decoration:underline; }
|
|
98
|
-
.lane-track { position:relative; min-height:21px; background-image:repeating-linear-gradient(90deg,#b1c1d01f 0 1px,transparent 1px calc(100% / 13)); }
|
|
99
|
-
.lane-track::before { content:""; position:absolute; top:50%; inset-inline:0; border-bottom:1px dashed #bac9d128; }
|
|
100
|
-
.range-bar { position:absolute; top:calc(50% - 1px); left:var(--left); width:var(--width); height:2px; background:var(--chart); opacity:.62; }
|
|
101
|
-
.plot-point { position:absolute; z-index:1; top:50%; left:var(--x); transform:translate(-50%,-50%); width:17px; height:19px; display:grid; place-items:center; border-radius:4px; }
|
|
102
|
-
.plot-point i { display:block; width:7px; height:7px; background:var(--chart); border-radius:50%; box-shadow:0 0 0 2px #233649; }
|
|
103
|
-
.plot-point.multiple i { outline:1px solid var(--chart); outline-offset:2px; } .plot-point.baseline-point i { background:#152638; border:1.5px solid var(--chart); }
|
|
104
|
-
.plot-point:hover i, .plot-point:focus-visible i { transform:scale(1.35); }
|
|
105
|
-
.chart-axis { margin:2px 0 0 67px; display:flex; justify-content:space-between; }
|
|
106
|
-
.chart-key { border-top:1px solid #9bafbd30; margin-top:8px; padding-top:7px; gap:14px; font-size:10px; color:#c3d1df; }
|
|
107
|
-
.chart-key span { gap:5px; } .key-line { width:13px; height:2px; background:#cbaa78; } .key-dot,.key-ring { width:6px;height:6px;border-radius:50%;background:#d8b77f; } .key-ring { background:none;border:1px solid #d8b77f; }
|
|
94
|
+
.chart-label { font-weight:650; font-size:14px; gap:8px; color:#f6ecd9; }
|
|
108
95
|
.key-multi { width:5px; height:5px; margin:0 2px; border-radius:50%; background:#d8b77f; outline:1px solid #d8b77f; outline-offset:1px; }
|
|
109
|
-
.overview-columns { display:grid; grid-template-columns:minmax(0,1.72fr) minmax(285px,1fr); gap:clamp(22px,2.6vw,38px); margin-top:32px; align-items:start; }
|
|
110
96
|
.section-heading { justify-content:space-between; gap:12px; margin-bottom:16px; }
|
|
111
|
-
.section-heading h2
|
|
97
|
+
.section-heading h2 { font-size:24px; letter-spacing:-.04em; }
|
|
112
98
|
.text-link { background:none; border:0; padding:0; width:fit-content; gap:8px; font-weight:600; color:var(--gold); font-size:13px; }
|
|
113
99
|
.text-link:hover { text-decoration:underline; text-underline-offset:4px; }
|
|
114
100
|
.arrow { font-family:Arial,sans-serif; font-size:18px; line-height:1; }
|
|
115
101
|
.project-grid { display:grid; gap:15px; }
|
|
116
|
-
.home-grid { grid-template-columns:repeat(
|
|
117
|
-
.catalog-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
|
|
102
|
+
.home-grid, .catalog-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
|
|
118
103
|
.project-card { position:relative; min-width:0; display:flex; flex-direction:column; padding:21px 22px 14px; background:var(--surface); border:1px solid var(--line); border-radius:11px; box-shadow:0 1px 2px #17253b03; transition:border-color .16s,transform .16s,box-shadow .16s; }
|
|
119
104
|
.project-card:hover { border-color:var(--tone); transform:translateY(-2px); box-shadow:var(--shadow); }
|
|
105
|
+
.card-identity { display:flex; gap:14px; align-items:center; min-width:0; }
|
|
106
|
+
.card-identity > div { min-width:0; }
|
|
107
|
+
.project-card .card-identity h3 { margin:0; overflow-wrap:anywhere; }
|
|
108
|
+
.card-identity h3 a::after { content:""; position:absolute; inset:0; border-radius:11px; }
|
|
109
|
+
.card-identity h3 a:focus-visible { outline:0; }
|
|
110
|
+
.card-identity h3 a:focus-visible::after { outline:3px solid var(--focus); outline-offset:2px; }
|
|
120
111
|
.card-top { justify-content:space-between; gap:10px; }
|
|
121
112
|
.group-tag { color:var(--muted); border:1px solid var(--line); border-radius:5px; font-size:11px; line-height:1.6; padding:1px 7px; }
|
|
122
113
|
.project-card h3 { font-family:var(--serif); font-size:27px; line-height:1.15; letter-spacing:-.035em; margin:12px 0 1px; }
|
|
@@ -149,21 +140,9 @@ kbd { font: 11px/1.4 var(--mono); border: 1px solid var(--line); border-radius:
|
|
|
149
140
|
.motif-code::before { left:2px; transform:rotate(-45deg); } .motif-code::after { right:2px; transform:rotate(135deg); }
|
|
150
141
|
.motif-book::before,.motif-book::after { content:""; top:4px;width:10px;height:15px;border:1.5px solid;border-radius:2px; }
|
|
151
142
|
.motif-book::before { left:1px;transform:skewY(12deg); } .motif-book::after { right:1px;transform:skewY(-12deg); }
|
|
152
|
-
.recent-panel { border:1px solid var(--line); border-radius:11px; background:var(--surface); padding:20px 23px 15px; }
|
|
153
|
-
.recent-heading { gap:9px; } .recent-heading h2 { font-size:20px; } .section-accent { height:18px;width:3px;background:var(--gold);border-radius:2px; }
|
|
154
|
-
.recent-list { list-style:none; padding:0; margin:10px 0 13px; }
|
|
155
|
-
.recent-list li { position:relative; padding:0 0 0 19px; }
|
|
156
|
-
.recent-list li::before { content:""; position:absolute; left:2px; top:18px; bottom:-17px; border-left:1px solid var(--line); }
|
|
157
|
-
.recent-list li:last-child::before { display:none; }
|
|
158
|
-
.recent-list li::after { content:""; position:absolute; left:-1px; top:17px; height:7px; width:7px; border-radius:50%; background:var(--tone); }
|
|
159
|
-
.recent-list a { display:block; padding:9px 0; } .recent-list a:hover strong,.timeline-row:hover h3 { color:var(--gold); }
|
|
160
|
-
.recent-meta { gap:9px; font-size:11px; color:var(--muted); }
|
|
161
143
|
.project-chip { display:inline-flex; width:max-content; gap:5px; line-height:1.45; font:600 11px/1.5 var(--sans); color:var(--tone); }
|
|
162
144
|
.project-chip i { width:5px; height:5px; background:var(--tone); border-radius:2px; }
|
|
163
145
|
.project-chip small { font:10px var(--mono); }
|
|
164
|
-
.recent-list strong { display:block; color:var(--ink); font-weight:600; font-size:14px; line-height:1.6; margin:2px 0 1px; }
|
|
165
|
-
.recent-sub { color:var(--muted); font-size:11px; }
|
|
166
|
-
.recent-all { border-top:1px solid var(--line); padding-top:13px; width:100%; justify-content:space-between; }
|
|
167
146
|
.site-footer { border-top:1px solid var(--line); }
|
|
168
147
|
.footer-inner { min-height:73px; flex-wrap:wrap; gap:15px; color:var(--muted); font-size:12px; }
|
|
169
148
|
.footer-brand { font-family:var(--serif); font-size:17px; font-weight:bold; color:var(--ink); letter-spacing:-.04em; }
|
|
@@ -192,30 +171,17 @@ kbd { font: 11px/1.4 var(--mono); border: 1px solid var(--line); border-radius:
|
|
|
192
171
|
.primary-button { color:var(--button-ink); background:var(--button); border:1px solid var(--button); }
|
|
193
172
|
.primary-button:hover { filter:brightness(1.16); } .secondary-button { color:var(--ink); background:var(--surface); border:1px solid var(--line); }
|
|
194
173
|
.empty-panel .secondary-button { margin:auto; }
|
|
195
|
-
.timeline-controls { justify-content:space-between; gap:12px; padding:12px 0; border-block:1px solid var(--line); margin-bottom:7px; }
|
|
196
|
-
.timeline-controls .list-count { margin:0; }
|
|
197
174
|
.select-field { gap:8px; padding:4px 8px; font-size:13px; }
|
|
198
175
|
.select-field>span { font-size:12px; color:var(--muted); }
|
|
199
176
|
.select-field select { color:var(--ink); background:var(--surface); border:0; min-height:30px; }
|
|
200
|
-
.date-group { display:grid; grid-template-columns:minmax(128px,18%) 1fr; border-bottom:1px solid var(--line); padding-block:18px; gap:14px; }
|
|
201
|
-
.date-group>h2 { font-size:14px; font-weight:550; padding-top:11px; }
|
|
202
|
-
.timeline-row { display:flex; gap:14px; align-items:center; padding:13px 10px; border-block-end:1px solid var(--line); }
|
|
203
|
-
.timeline-row:last-child { border:0; }
|
|
204
|
-
.timeline-row:hover { background:var(--soft); border-radius:5px; }
|
|
205
|
-
.row-copy { flex:1; min-width:0; } .row-label { gap:8px; flex-wrap:wrap; }
|
|
206
|
-
.row-copy h3 { font-size:16px; margin:2px 0; overflow-wrap:anywhere; }
|
|
207
|
-
.row-count { color:var(--muted); white-space:nowrap; font-size:12px; } .range-caption { font-size:11px; }
|
|
208
|
-
.timeline-row>.arrow { color:var(--gold); }
|
|
209
177
|
.detail-head { background:var(--surface); border:1px solid var(--line); padding:30px; border-radius:12px; }
|
|
210
178
|
.detail-intro { gap:17px; }.detail-intro .project-mark { width:62px;height:62px;border-radius:13px; }.detail-intro .motif { transform:scale(1.4); }
|
|
211
179
|
.detail-head h1 { font-size:43px; }
|
|
212
180
|
.detail-head>p { color:var(--text); }
|
|
213
181
|
.button-row { gap:10px; flex-wrap:wrap; } .button-row:not(:empty) { margin-top:18px; }
|
|
214
182
|
.external-arrow { font-size:16px;line-height:1; }
|
|
215
|
-
.detail-stats {
|
|
183
|
+
.detail-stats { padding:14px 0; border-bottom:1px solid var(--line); }
|
|
216
184
|
.detail-stats dt,.stat-strip dt { color:var(--muted); font-size:12px; }
|
|
217
|
-
.detail-stats dd { margin-top:4px; color:var(--ink); font:19px var(--mono); }
|
|
218
|
-
.detail-recent { margin-top:29px; } .detail-recent .timeline-row { background:var(--surface); padding-inline:18px; } .detail-recent .timeline-row:hover { background:var(--soft); }
|
|
219
185
|
.empty-book { display:inline-grid; place-items:center; background:var(--soft); width:40px; height:40px; border-radius:10px; margin-bottom:10px; }
|
|
220
186
|
.log-layout { display:grid; grid-template-columns:225px minmax(0,1fr); gap:28px; align-items:start; }
|
|
221
187
|
.log-index { position:sticky; top:90px; border-left:2px solid var(--line); padding-left:13px; }
|
|
@@ -227,13 +193,13 @@ kbd { font: 11px/1.4 var(--mono); border: 1px solid var(--line); border-radius:
|
|
|
227
193
|
.period-heading { justify-content:space-between; font-size:11px; }
|
|
228
194
|
.log-period h2 { font:600 clamp(18px,2.5vw,26px)/1.5 var(--mono); margin:9px 0; }
|
|
229
195
|
.period-title { color:var(--text); } .period-note { margin-top:10px; padding:8px 12px; border-left:2px solid var(--gold); background:var(--gold-soft); font-size:13px; }
|
|
230
|
-
.stat-strip { display:
|
|
231
|
-
.stat-strip
|
|
196
|
+
.stat-strip { display:flex; flex-wrap:wrap; gap:12px 40px; margin:14px 0; }
|
|
197
|
+
.stat-strip dd { font:600 27px/1.3 var(--mono); color:var(--ink); margin-top:2px; }
|
|
232
198
|
.stat-strip dt { overflow-wrap:anywhere; }
|
|
233
|
-
.stat-summary { margin:
|
|
199
|
+
.stat-summary { margin:10px 0 24px; padding:18px 24px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
|
|
234
200
|
.stat-summary h2 { font-size:16px; margin:0; }
|
|
235
201
|
.stat-summary p { color:var(--muted); font-size:12px; margin-top:3px; }
|
|
236
|
-
.stat-summary .stat-strip
|
|
202
|
+
.stat-summary .stat-strip { margin:8px 0 0; }
|
|
237
203
|
.category-block { margin-top:12px; } .category-block h3 { font-size:14px; } .category-block ul,.sample-sheet ol { padding-left:1.5em; }.category-block li { font-size:14px; }
|
|
238
204
|
#demo-status { color:var(--gold); }.demo-footnote { margin-top:15px; }.demo-panel input { accent-color:var(--gold); }
|
|
239
205
|
dialog { color:var(--text); width:min(590px,calc(100vw - 28px)); max-height:min(650px,82vh); padding:0; border-radius:12px; border:1px solid var(--line); background:var(--surface); box-shadow:0 24px 90px #09132459; margin: min(15vh,115px) auto auto; }
|
|
@@ -251,24 +217,20 @@ dialog::backdrop { background:#111c2b80; backdrop-filter:blur(3px); }
|
|
|
251
217
|
mark { background:var(--gold-soft);color:var(--ink);border-radius:2px; }
|
|
252
218
|
@media (max-width:1040px) {
|
|
253
219
|
.wrap { width:calc(100% - 56px); }.overview-hero { gap:26px;padding:27px; }.hero-copy>p { max-width:29em; }
|
|
254
|
-
.overview-columns { grid-template-columns:minmax(0,1.55fr) minmax(258px,1fr); gap:20px; }.project-card { padding:17px 16px 12px; }.recent-panel { padding:17px; }
|
|
255
220
|
}
|
|
256
221
|
@media (max-width:780px) {
|
|
257
222
|
.wrap { width:calc(100% - 34px); }.mast-inner { gap:20px; height:60px; }.main-nav { gap:15px; }
|
|
258
223
|
.search-open kbd { display:none; }.overview-hero { grid-template-columns:1fr 1fr;gap:18px;padding:22px; }.activity-figure { padding:12px; }.chart-lane { grid-template-columns:57px 1fr; }.chart-axis { margin-left:57px; }.chart-key { gap:7px; }
|
|
259
|
-
.overview-columns { grid-template-columns:1fr; }.recent-panel { margin-top:4px; }.catalog-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
|
|
260
224
|
.log-layout { grid-template-columns:170px minmax(0,1fr);gap:16px; }.stat-strip dt { font-size:10px; }
|
|
261
225
|
}
|
|
262
226
|
@media (max-width:600px) {
|
|
263
227
|
.wrap { width:calc(100% - 32px); }.mast-inner { height:auto;display:grid;grid-template-columns:1fr auto;gap:0; }.brand { min-height:51px;font-size:24px;width:fit-content; }.brand-stamp { width:30px;height:30px; }.mast-tools { grid-column:2;grid-row:1; }.main-nav { grid-column:1 / -1;grid-row:2;gap:24px; }.main-nav a { min-height:37px;font-size:13px; }.main-nav a[aria-current]::after { height:2px; }
|
|
264
228
|
.mast-tools { gap:7px; }.search-open { min-height:32px; }.theme-button { width:33px; height:33px; }.main-content { padding-block:17px 36px; }
|
|
265
229
|
.overview-hero { grid-template-columns:1fr;gap:17px;padding:22px 20px 16px;border-radius:12px; }.hero-copy h1 { font-size:45px;margin:8px 0; }.hero-copy>p { font-size:13px; }.hero-date { font-size:11px; }.hero-stats { margin-top:16px; }.hero-stats dd {font-size:26px;}.hero-stats dt {font-size:11px;}
|
|
266
|
-
.activity-figure { padding:10px 12px 8px; }.activity-figure figcaption { margin-bottom:4px; }.chart-lane,.lane-track { min-height:17px; }.chart-label { font-size:12px; }.chart-key { margin-top:4px;padding-top:4px; }.overview-columns { margin-top:20px; }.section-heading { margin-bottom:12px; }.section-heading h2 { font-size:21px; }
|
|
267
230
|
.home-grid { gap:10px; }.project-card { padding:13px 12px 10px; }.card-top { gap:5px; }.group-tag {padding:0 4px;font-size:10px;}.project-mark { width:33px;height:33px;border-radius:8px; }.motif { transform:scale(.86); }.project-card h3 { font-size:23px; margin-top:10px; }.project-card p { font-size:12px; }.card-foot { font-size:10px; }.catalog-grid { gap:10px; }
|
|
268
231
|
.crumbs { margin-bottom:15px; }.page-head { padding-bottom:17px; }.page-head h1 { font-size:35px; }.page-head p { font-size:13px; }.field {width:100%;}.filter-bar { gap:10px;padding:12px 0; }.filter-pills button { padding:4px 8px; }
|
|
269
|
-
.date-group { grid-template-columns:1fr;gap:3px;padding:10px 0; }.date-group>h2 { padding-top:0;font-size:12px; }.timeline-row { gap:9px;padding:10px 0; }.timeline-row .project-mark.small { width:29px;height:29px; }.row-count { font-size:11px; }.row-copy h3 { font-size:14px; }
|
|
270
232
|
.log-layout,.demo-layout { grid-template-columns:1fr; }.log-index { position:static;display:flex;gap:9px;flex-wrap:wrap;align-items:center; }.log-index h2 { margin:0; }.log-index a { margin:0;padding:4px 6px;background:var(--soft);border-radius:4px; }.log-index a span { display:none; }.log-period { padding:16px;scroll-margin-top:100px; }
|
|
271
|
-
.detail-head { padding:18px; }.detail-head h1 {font-size:34px;}
|
|
233
|
+
.detail-head { padding:18px; }.detail-head h1 {font-size:34px;}
|
|
272
234
|
.footer-inner { gap:8px;font-size:11px; }.footer-brand { font-size:15px; }.sample-sheet h1 { font-size:32px; }
|
|
273
235
|
}
|
|
274
236
|
@media (max-width:360px) {
|
|
@@ -282,56 +244,87 @@ mark { background:var(--gold-soft);color:var(--ink);border-radius:2px; }
|
|
|
282
244
|
}
|
|
283
245
|
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; } }
|
|
284
246
|
|
|
285
|
-
.ledger-intro { margin:18px 0 19px; }
|
|
286
|
-
.ledger-intro h1 { margin:0; font-size:clamp(30px,3vw,44px); line-height:1.16; letter-spacing:-.04em; }
|
|
287
|
-
.ledger-intro p { margin:7px 0 0; color:var(--muted); font-size:14px; }
|
|
288
247
|
.ledger-tools { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 20px; padding:9px 0 13px; border-bottom:1px solid var(--line); }
|
|
289
248
|
.ledger-count { margin:0; font-size:13px; font-weight:600; font-variant-numeric:tabular-nums; color:var(--text); }
|
|
290
249
|
.enhanced .ledger-filters.enhanced-only { display:flex !important; align-items:center; flex-wrap:wrap; gap:7px; }
|
|
291
|
-
.ledger-filters select,.ledger-
|
|
292
|
-
.ledger-filters select
|
|
293
|
-
.ledger-toggle:disabled { opacity:.5; cursor:default; }
|
|
250
|
+
.ledger-filters select,.ledger-search { height:32px; font-size:12px; color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:5px; }
|
|
251
|
+
.ledger-filters select { max-width:min(12rem,100%); padding:0 9px; }
|
|
294
252
|
.ledger-search { display:flex; align-items:center; gap:7px; padding:0 8px; }
|
|
295
|
-
.ledger-search input { min-width:0; width:
|
|
253
|
+
.ledger-search input { min-width:0; width:9rem; border:0; background:transparent; color:var(--ink); outline:none; font:inherit; }
|
|
296
254
|
.ledger-search:focus-within { outline:2px solid var(--focus); outline-offset:1px; }
|
|
297
255
|
.ledger-window { margin:16px 0 23px; border:1px solid var(--line); border-radius:6px; background:var(--surface); }
|
|
298
|
-
.window-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:2px 12px; padding:
|
|
299
|
-
.window-head
|
|
300
|
-
.
|
|
301
|
-
.
|
|
302
|
-
.
|
|
303
|
-
.ledger-group {
|
|
304
|
-
.ledger-group + .ledger-group, .ledger-period + .ledger-period { border-top:1px solid var(--line); }
|
|
305
|
-
.ledger-group h3 { margin:0 0 2px; }
|
|
256
|
+
.window-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:2px 12px; padding:10px 16px; background:var(--soft); border-bottom:1px solid var(--line); border-radius:5px 5px 0 0; }
|
|
257
|
+
.window-head h3 { font:600 clamp(13px,1.2vw,16px)/1.45 var(--mono); margin:0; color:var(--ink); font-variant-numeric:tabular-nums; }
|
|
258
|
+
.window-count { font-size:12px; color:var(--muted); }
|
|
259
|
+
.ledger-group { padding:10px 16px; }
|
|
260
|
+
.ledger-group + .ledger-group { border-top:1px solid var(--line); }
|
|
261
|
+
.ledger-group h4 { margin:0; }
|
|
306
262
|
.ledger-project { display:inline-flex; align-items:center; gap:6px; max-width:100%; font:600 13px/22px var(--mono); overflow-wrap:anywhere; color:var(--ink); }
|
|
307
263
|
.ledger-project i { flex:none; width:6px; height:6px; background:var(--tone); border-radius:50%; }
|
|
308
|
-
.ledger-period + .ledger-period { margin-top:6px; padding-top:5px; }
|
|
309
|
-
.ledger-period h4 { margin:0; color:var(--muted); font:400 12px/1.65 var(--mono); }
|
|
310
|
-
.ledger-period h4 a:hover { text-decoration:underline; text-underline-offset:3px; }
|
|
311
264
|
.ledger-lines { list-style:none; padding:0; margin:0; }
|
|
312
|
-
.ledger-entry { display:grid; grid-template-columns:minmax(3.2rem,max-content) minmax(0,1fr); gap:6px; padding:
|
|
265
|
+
.ledger-entry { display:grid; grid-template-columns:minmax(3.2rem,max-content) minmax(0,1fr); gap:6px; padding:8px 1px; font-size:14px; line-height:22px; }
|
|
313
266
|
.ledger-entry + .ledger-entry { border-top:1px solid var(--line); }
|
|
314
267
|
.type-label { color:var(--muted); font-size:12px; }
|
|
315
268
|
.change-cell { overflow-wrap:anywhere; color:var(--ink); }
|
|
316
269
|
.ledger-project:hover,.change-cell:hover { color:var(--gold); text-decoration:underline; text-underline-offset:3px; }
|
|
317
270
|
.impact-tag { display:inline-block; margin-right:5px; padding:0 4px; border:1px solid var(--line); border-radius:3px; font:500 11px/16px var(--sans); color:var(--gold); vertical-align:1px; }
|
|
318
|
-
.more-entries summary,.window-statistics summary { width:fit-content; padding:4px 1px; color:var(--gold); font-size:12px; font-weight:600; cursor:pointer; }
|
|
319
|
-
.more-entries:not([open]) .show-less,.more-entries[open] .show-more { display:none; }
|
|
320
271
|
.log-entry { scroll-margin-top:100px; }
|
|
321
272
|
.log-entry:target { background:var(--gold-soft); outline:2px solid var(--gold-soft); color:var(--ink); }
|
|
322
273
|
.legacy-text,.period-note { white-space:pre-line; overflow-wrap:anywhere; }
|
|
323
274
|
@media (max-width:650px) {
|
|
324
|
-
.ledger-intro { margin:12px 0 10px; }
|
|
325
275
|
.ledger-tools { align-items:flex-start; padding:5px 0 10px; }
|
|
326
276
|
.ledger-count { width:100%; }
|
|
327
277
|
.enhanced .ledger-filters.enhanced-only { width:100%; gap:5px; }
|
|
328
278
|
.ledger-search input { width:96px; }
|
|
329
|
-
.ledger-filters select
|
|
279
|
+
.ledger-filters select { max-width:135px; padding-inline:5px; }
|
|
330
280
|
.window-head { padding:6px 7px; }
|
|
331
281
|
.window-count { font-size:11px; }
|
|
332
282
|
.ledger-window { margin:10px 0 16px; }
|
|
333
|
-
.ledger-group
|
|
283
|
+
.ledger-group { padding-inline:8px; }
|
|
334
284
|
.ledger-entry { grid-template-columns:minmax(2.7rem,max-content) minmax(0,1fr); font-size:13px; line-height:19px; padding-block:4px; }
|
|
335
285
|
.type-label { font-size:11px; }
|
|
336
286
|
.log-entry { scroll-margin-top:110px; }
|
|
337
287
|
}
|
|
288
|
+
.home-catalog { margin-top: 32px; }
|
|
289
|
+
.hero-no-activity { grid-template-columns: 1fr; }
|
|
290
|
+
.activity-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
|
|
291
|
+
.activity-table :is(th, td) { padding: 5px 0; text-align: right; }
|
|
292
|
+
.activity-table th:first-child { text-align: left; }
|
|
293
|
+
.activity-table thead { font-size: 12px; color: #c1cdd8; }
|
|
294
|
+
.activity-table tbody tr { border-top: 1px solid #9bafbd48; }
|
|
295
|
+
.activity-table tbody th { font-weight: 550; }
|
|
296
|
+
.activity-value { display:flex; align-items:center; gap:8px; justify-content:flex-end; }
|
|
297
|
+
.activity-value i { width:clamp(1.5rem,4vw,4rem); height:4px; border-radius:4px; background:linear-gradient(to right,#e4c48c var(--share),#76889b55 var(--share)); }
|
|
298
|
+
.activity-table a:hover { color: #f7e8ce; text-decoration: underline; text-underline-offset: 4px; }
|
|
299
|
+
.activity-figure .text-link { color: #e4c48c; margin-top: 7px; }
|
|
300
|
+
.card-stats, .detail-stats { display: flex; flex-wrap: wrap; gap: 10px clamp(16px, 4vw, 36px); }
|
|
301
|
+
.card-stats { margin: 1px 0 13px; }
|
|
302
|
+
.card-stats dt { font-size: 11px; color: var(--muted); }
|
|
303
|
+
.card-stats dd, .detail-stats dd { color: var(--ink); font: 600 20px/1.4 var(--mono); }
|
|
304
|
+
.detail-stats dd { font-size: 26px; }
|
|
305
|
+
.task-breakdown { margin-block:14px 4px; }
|
|
306
|
+
.mix-bar { display:flex; gap:2px; height:5px; border-radius:3px; overflow:hidden; }
|
|
307
|
+
[data-kind="功能"] { --kind:var(--gold); }
|
|
308
|
+
[data-kind="修复"] { --kind:#6383a4; } [data-kind="重构"] { --kind:#9a7ca0; }
|
|
309
|
+
[data-kind="优化"] { --kind:#559588; } [data-kind="维护"] { --kind:#87917c; }
|
|
310
|
+
.mix-bar i { background:var(--kind); }
|
|
311
|
+
.mix-legend { display:flex; flex-wrap:wrap; gap:5px 18px; margin-top:8px; font-size:12px; }
|
|
312
|
+
.mix-legend div { display:flex; align-items:baseline; gap:5px; }
|
|
313
|
+
.mix-legend dt { color:var(--muted); }
|
|
314
|
+
.mix-legend dd { color:var(--ink); font-variant-numeric:tabular-nums; }
|
|
315
|
+
.mix-legend [data-kind]::before { content:""; align-self:center; width:7px; height:7px; border-radius:2px; background:var(--kind); }
|
|
316
|
+
.ledger { margin-top: 24px; }
|
|
317
|
+
.ledger > h2 { font: 700 24px/1.4 var(--serif); }
|
|
318
|
+
.legacy-window-anchor { display: block; }
|
|
319
|
+
.ledger-group-head { display: flex; align-items: baseline; gap: 6px 14px; justify-content: space-between; }
|
|
320
|
+
.group-count, .entry-context, .commit-only { color: var(--muted); font-size: 12px; }
|
|
321
|
+
.group-count { flex-shrink: 0; text-align: right; }
|
|
322
|
+
.entry-context { display: flex; flex-wrap: wrap; gap: 3px 12px; }
|
|
323
|
+
a.entry-context, .entry-context a { text-decoration: underline; text-underline-offset: 2px; }
|
|
324
|
+
.ledger .empty-panel button { margin-top: 12px; }
|
|
325
|
+
|
|
326
|
+
@media (max-width: 600px) {
|
|
327
|
+
.home-catalog { margin-top: 22px; }
|
|
328
|
+
.detail-stats dd { font-size: 22px; }
|
|
329
|
+
.window-head, .ledger-group { padding-inline: 10px; }
|
|
330
|
+
}
|
|
@@ -7,6 +7,7 @@ export const logPath = (project, period) => projectPath(project) + 'changelog/'
|
|
|
7
7
|
export const availableGroups = (projects) => [...new Set(projects.flatMap(project => project.groups))];
|
|
8
8
|
export const arrow = '<span aria-hidden="true" class="arrow">→</span>';
|
|
9
9
|
export const external = '<span aria-hidden="true" class="external-arrow">↗</span>';
|
|
10
|
+
export const formatCount = value => value == null ? '未核实' : value.toLocaleString('zh-CN');
|
|
10
11
|
|
|
11
12
|
export function symbol(name) {
|
|
12
13
|
return `<span class="symbol sym-${name}" aria-hidden="true"><i></i></span>`;
|
|
@@ -21,7 +22,7 @@ export function projectChip(project) {
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
function header(root, section, siteTitle) {
|
|
24
|
-
const nav = [['home', '总览', ''], ['projects', '项目目录', 'projects/'], ['changelog', '
|
|
25
|
+
const nav = [['home', '总览', ''], ['projects', '项目目录', 'projects/'], ['changelog', '跨项目变更', 'changelog/']];
|
|
25
26
|
return `<header class="masthead"><div class="wrap mast-inner">
|
|
26
27
|
<a class="brand" href="${root}" aria-label="${escapeHtml(siteTitle)} 总览"><span class="brand-stamp" aria-hidden="true"><i></i><b></b></span><span>${escapeHtml(siteTitle)}</span></a>
|
|
27
28
|
<nav aria-label="主导航" class="main-nav">${nav.map(([id,label,path]) => `<a href="${root}${path}"${section === id ? ' aria-current="page"' : ''}>${label}</a>`).join('')}</nav>
|
|
@@ -54,25 +55,36 @@ ${searchDialog()}</div>`;
|
|
|
54
55
|
|
|
55
56
|
export function projectCard(root, project) {
|
|
56
57
|
const recent = periodsByEnd(project)[0];
|
|
57
|
-
return `<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<p>${escapeHtml(project.purpose)}</p
|
|
62
|
-
</
|
|
58
|
+
return `<article class="project-card tone-${project.color}" data-project="${escapeHtml(project.id)}" data-groups="${escapeHtml(JSON.stringify(project.groups))}">
|
|
59
|
+
<div class="card-identity">${mark(project)}<div><h3><a href="${escapeHtml(root + projectPath(project))}">${escapeHtml(project.name)}</a></h3>
|
|
60
|
+
${project.id !== project.name ? `<span class="repo-id">${escapeHtml(project.id)}</span>` : ''}
|
|
61
|
+
${project.groups.length ? `<span class="detail-group">${escapeHtml(project.groups.join(" · "))}</span>` : ''}</div></div>
|
|
62
|
+
<p>${escapeHtml(project.purpose)}</p>${projectMetrics(project, 'card-stats')}<div class="card-foot"><span>${recent ? `最近记录 <time datetime="${recent.to}">${recent.to.replaceAll('-', '.')}</time>` : '暂无变更记录'}</span>${arrow}</div>
|
|
63
|
+
</article>`;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
export function
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
export function projectMetrics(project, className, stats = project.stats) {
|
|
67
|
+
const rangeCount = className === 'detail-stats' && project.headCommits !== stats?.commits
|
|
68
|
+
? `<div><dt>记录区间提交</dt><dd>${formatCount(stats?.commits)}</dd></div>` : '';
|
|
69
|
+
return `<dl class="${className}"><div><dt>仓库累计提交</dt><dd>${formatCount(project.headCommits)}</dd></div><div><dt>已记录任务</dt><dd>${formatCount(stats?.changes)}</dd></div>${rangeCount}</dl>`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function categoryBreakdown(stats) {
|
|
73
|
+
if (!stats.changes) return '';
|
|
74
|
+
const active = categories.filter(category => stats.byCategory?.[category] > 0);
|
|
75
|
+
return `<div class="task-breakdown"><div class="mix-bar" aria-hidden="true">${active.map(category =>
|
|
76
|
+
`<i data-kind="${category}" style="flex-grow:${stats.byCategory[category]}"></i>`).join('')}</div>
|
|
77
|
+
<dl aria-label="任务分类" class="mix-legend">${active.map(category => `<div data-kind="${category}" data-stat="${category}"><dt>${category}</dt><dd>${formatCount(stats.byCategory[category])}</dd></div>`).join('')}
|
|
78
|
+
${stats.added != null && stats.byCategory['功能'] > 0 ? `<div><dt>功能中新增</dt><dd>${formatCount(stats.added)}</dd></div>` : ''}</dl></div>`;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function statStrip(stats, commitLabel = '记录区间提交') {
|
|
82
|
+
return `<dl class="stat-strip"><div data-stat="changes"><dt>已记录任务</dt><dd>${formatCount(stats.changes)}</dd></div>
|
|
83
|
+
<div data-stat="commits"><dt>${commitLabel}</dt><dd>${formatCount(stats.commits)}</dd></div></dl>${categoryBreakdown(stats)}`;
|
|
72
84
|
}
|
|
73
85
|
|
|
74
86
|
export function statSummary(id, title, stats, scope) {
|
|
75
|
-
return `<section class="stat-summary" id="${id}" aria-labelledby="${id}-title"><h2 id="${id}-title">${title}</h2
|
|
87
|
+
return `<section class="stat-summary" id="${id}" aria-labelledby="${id}-title"><h2 id="${id}-title">${title}</h2>${scope ? `<p>${scope}</p>` : ''}${statStrip(stats)}</section>`;
|
|
76
88
|
}
|
|
77
89
|
|
|
78
90
|
export function intervalCount(period) {
|