@namewta/skills-hub 0.1.47 → 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/README.md +1 -1
- package/THIRD_PARTY_NOTICES.md +3 -3
- package/package.json +1 -1
- package/scripts/persistence/home.md +1 -0
- package/skills/dev/dev-archive/references/change-closure.md +4 -0
- package/skills/home/home-project-changelog/SKILL.md +5 -5
- 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 +20 -2
- package/skills/home/home-project-changelog/references/workflow.md +5 -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 +32 -8
- 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-setup/SKILL.md +1 -1
- package/skills/home/home-setup/references/registry.md +4 -0
- package/skills/home/home-setup/scripts/git.mjs +2 -0
- package/skills/home/home-website/SKILL.md +20 -0
- package/skills/home/home-website/assets/website/gitignore.tmpl +4 -0
- package/skills/home/home-website/assets/website/package-lock.json +2376 -0
- package/skills/home/home-website/assets/website/package.json +11 -0
- package/skills/home/home-website/assets/website/scripts/artifact.mjs +84 -0
- package/skills/home/home-website/assets/website/scripts/inputs.mjs +251 -0
- package/skills/home/home-website/assets/website/scripts/preview.mjs +50 -0
- package/skills/home/home-website/assets/website/scripts/render.mjs +97 -0
- package/skills/home/home-website/assets/website/scripts/site.mjs +173 -0
- package/skills/home/home-website/assets/website/site/.vitepress/theme/index.js +3 -0
- package/skills/home/home-website/assets/website/site/public/home-assets/app.js +262 -0
- package/skills/home/home-website/assets/website/site/public/home-assets/site.css +330 -0
- package/skills/home/home-website/assets/website/site/public/home-assets/start.js +7 -0
- package/skills/home/home-website/assets/website/site/templates/layout.mjs +93 -0
- package/skills/home/home-website/assets/website/site/templates/ledger.mjs +69 -0
- package/skills/home/home-website/assets/website/site/templates/model.mjs +104 -0
- package/skills/home/home-website/assets/website/site/templates/pages.mjs +75 -0
- package/skills/home/home-website/assets/website/site/templates/project-logs.mjs +130 -0
- package/skills/home/home-website/assets/website/site.config.json +6 -0
- package/skills/home/home-website/references/website.md +82 -0
- package/skills/home/home-website/scripts/init.mjs +57 -0
- package/skills/home/home-workflow/SKILL.md +1 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: light;
|
|
3
|
+
--paper: #f8f7f3;
|
|
4
|
+
--surface: #fffefa;
|
|
5
|
+
--soft: #f1f0ea;
|
|
6
|
+
--ink: #101f38;
|
|
7
|
+
--text: #34445a;
|
|
8
|
+
--muted: #5e6b7c;
|
|
9
|
+
--line: #dcded9;
|
|
10
|
+
--gold: #9b6b29;
|
|
11
|
+
--gold-soft: #f5ead5;
|
|
12
|
+
--button: #172942;
|
|
13
|
+
--button-ink: #fff;
|
|
14
|
+
--focus: #946124;
|
|
15
|
+
--shadow: 0 8px 24px #1527400b;
|
|
16
|
+
--sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
17
|
+
--serif: Baskervville, Georgia, "Songti SC", "Noto Serif CJK SC", SimSun, serif;
|
|
18
|
+
--mono: "IBM Plex Mono", Consolas, "SFMono-Regular", monospace;
|
|
19
|
+
}
|
|
20
|
+
:root[data-theme="dark"] {
|
|
21
|
+
color-scheme: dark;
|
|
22
|
+
--paper: #0e1725; --surface: #152234; --soft: #1c2c40; --ink: #e6edf5; --text: #ccd5df;
|
|
23
|
+
--muted: #abb9c8; --line: #354356; --gold: #edbd72; --gold-soft: #372e22;
|
|
24
|
+
--button: #eed9ae; --button-ink: #192333; --focus: #f5c57d; --shadow: none;
|
|
25
|
+
}
|
|
26
|
+
* { box-sizing: border-box; }
|
|
27
|
+
body { margin: 0; background: var(--paper); color: var(--text); font: 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
|
|
28
|
+
a { color: inherit; text-decoration: none; }
|
|
29
|
+
button, input, select { font: inherit; }
|
|
30
|
+
button, select { cursor: pointer; }
|
|
31
|
+
button { color: inherit; }
|
|
32
|
+
button, input, select { -webkit-tap-highlight-color: transparent; }
|
|
33
|
+
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
|
|
34
|
+
[hidden], .enhanced-only { display: none !important; }
|
|
35
|
+
.enhanced .enhanced-only { display: inline-flex !important; }
|
|
36
|
+
.enhanced .filter-bar.enhanced-only { display: flex !important; }
|
|
37
|
+
.enhanced .demo-actions.enhanced-only { display: grid !important; }
|
|
38
|
+
::selection { background: #d8b37c66; }
|
|
39
|
+
h1, h2, h3, p, figure, dl, dd, ul, ol { margin: 0; }
|
|
40
|
+
h1, h2, h3 { color: var(--ink); }
|
|
41
|
+
.wrap { width: min(1248px, calc(100% - 96px)); margin-inline: auto; }
|
|
42
|
+
.sr, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
43
|
+
.skip-link:focus { position: fixed; left: 16px; top: 8px; z-index: 90; padding: 8px 16px; border-radius: 6px; background: var(--surface); }
|
|
44
|
+
.main-content { min-height: calc(100vh - 189px); padding-block: 32px 62px; }
|
|
45
|
+
:where(h2,article,section,[id]) { scroll-margin-top: 92px; }
|
|
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, .card-top, .card-foot, .project-chip, .footer-inner, .field, .filter-pills, .period-heading, .detail-intro, .crumbs { display: flex; align-items: center; }
|
|
48
|
+
.mast-inner { height: 70px; gap: clamp(20px, 4vw, 62px); }
|
|
49
|
+
.brand { color: var(--ink); gap: 12px; white-space: nowrap; font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: -.055em; }
|
|
50
|
+
.brand-stamp { position: relative; display: inline-block; width: 32px; height: 32px; border-radius: 9px; background: #162840; }
|
|
51
|
+
.brand-stamp i, .brand-stamp b { position: absolute; display: block; width: 14px; height: 14px; transform: rotate(45deg) skew(-11deg,-11deg); border: 1.5px solid #e2ba78; left: 9px; }
|
|
52
|
+
.brand-stamp i { top: 7px; background: #162840; z-index: 1; } .brand-stamp b { top: 11px; border-color: #a8b7cb; }
|
|
53
|
+
.main-nav { align-self: stretch; gap: 27px; }
|
|
54
|
+
.main-nav a { display: flex; align-items: center; min-height: 44px; position: relative; color: var(--muted); font-size: 14px; white-space: nowrap; }
|
|
55
|
+
.main-nav a:hover, .main-nav a[aria-current] { color: var(--ink); }
|
|
56
|
+
.main-nav a[aria-current] { font-weight: 650; }
|
|
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
|
+
.mast-tools { margin-left: auto; gap: 10px; }
|
|
59
|
+
.search-open, .icon-button, .field { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
|
|
60
|
+
.search-open { min-height: 36px; padding: 0 9px 0 12px; color: var(--muted); gap: 9px; font-size: 13px; }
|
|
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
|
+
.search-open kbd { margin-left: 11px; }
|
|
63
|
+
.icon-button { align-items: center; justify-content: center; width: 37px; height: 37px; }
|
|
64
|
+
.search-open:hover, .icon-button:hover, .secondary-button:hover { border-color: var(--gold); color: var(--gold); }
|
|
65
|
+
.symbol { width: 15px; height: 15px; flex: 0 0 auto; position: relative; display: inline-block; color: inherit; }
|
|
66
|
+
.sym-search::before { content:""; position: absolute; left:1px; top:1px; border:1.6px solid currentColor; width:8px; height:8px; border-radius:50%; }
|
|
67
|
+
.sym-search::after { content:""; position: absolute; width:6px; height:1.6px; background:currentColor; left:10px; top:11px; transform:rotate(46deg); transform-origin:left; }
|
|
68
|
+
.sym-moon { border:1.5px solid currentColor; border-radius:50%; width:14px; height:14px; }
|
|
69
|
+
.sym-moon::after { content:""; position:absolute; width:11px; height:11px; border-radius:50%; background:var(--surface); left:4px; top:-4px; border-bottom:1.5px solid currentColor; transform:rotate(35deg); }
|
|
70
|
+
.sym-sun { width:13px;height:13px; border:1.5px solid currentColor; border-radius:50%; box-shadow:0 -7px 0 -5px currentColor,0 7px 0 -5px currentColor,7px 0 0 -5px currentColor,-7px 0 0 -5px currentColor; }
|
|
71
|
+
.theme-button .sym-sun, [data-theme="dark"] .theme-button .sym-moon { display:none; }
|
|
72
|
+
[data-theme="dark"] .theme-button .sym-sun { display:block; }
|
|
73
|
+
.sym-clock { border: 1.2px solid currentColor; border-radius: 50%; width: 12px; height: 12px; }
|
|
74
|
+
.sym-clock::after { content:""; position:absolute; left:4px; top:2px; width:3px; height:4px; border-left:1px solid; border-bottom:1px solid; }
|
|
75
|
+
.sym-activity { width:18px; height:15px; border-bottom:1.5px solid; }
|
|
76
|
+
.sym-activity::after { content:""; display:block; width:3px; height:6px; position:absolute; bottom:2px; left:1px; background:currentColor; box-shadow:6px -4px currentColor,12px -1px currentColor; }
|
|
77
|
+
.sym-book { border:1.5px solid; border-radius:2px; }
|
|
78
|
+
.sym-book::after { content:""; position:absolute; inset:0 45% 0 auto; border-left:1px solid; }
|
|
79
|
+
.overview-hero { position:relative; display:grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); gap: clamp(32px,5vw,90px); align-items:center; overflow:hidden; padding: 32px clamp(28px,3.3vw,51px); border-radius:16px; border:1px solid #273a52; background:radial-gradient(ellipse at 93% 0%, #31465c 0%, transparent 57%),linear-gradient(110deg,#101e33,#1c3045); color:#f8f5ee; }
|
|
80
|
+
.overview-hero::before { content:""; position:absolute; inset:0; pointer-events:none; background-image:radial-gradient(#d5c4a117 .8px,transparent .8px); background-size:14px 14px; mask-image:linear-gradient(90deg,transparent 2%,black 100%); }
|
|
81
|
+
.overview-hero>* { position:relative; }
|
|
82
|
+
.hero-date { color:#e4c48c; gap:8px; font-size:12px; letter-spacing:.04em; }
|
|
83
|
+
.hero-date i { width:22px; height:2px; background:#d7aa66; }
|
|
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
|
+
.hero-copy>p { color:#d3dce5; font-size:15px; }
|
|
87
|
+
.hero-stats { display:flex; gap:0; margin-top:26px; }
|
|
88
|
+
.hero-stats>div { display:flex; flex-direction:column-reverse; gap:1px; border-right:1px solid #93a7bd45; padding-inline:clamp(15px,2vw,31px); }
|
|
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: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
|
+
.activity-figure { min-width:0; border:1px solid #9bafbd48; background:#0c1c2c5e; padding:16px 20px 12px; border-radius:11px; color:#d5dfe9; }
|
|
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
|
+
.key-multi { width:5px; height:5px; margin:0 2px; border-radius:50%; background:#d8b77f; outline:1px solid #d8b77f; outline-offset:1px; }
|
|
96
|
+
.section-heading { justify-content:space-between; gap:12px; margin-bottom:16px; }
|
|
97
|
+
.section-heading h2 { font-size:24px; letter-spacing:-.04em; }
|
|
98
|
+
.text-link { background:none; border:0; padding:0; width:fit-content; gap:8px; font-weight:600; color:var(--gold); font-size:13px; }
|
|
99
|
+
.text-link:hover { text-decoration:underline; text-underline-offset:4px; }
|
|
100
|
+
.arrow { font-family:Arial,sans-serif; font-size:18px; line-height:1; }
|
|
101
|
+
.project-grid { display:grid; gap:15px; }
|
|
102
|
+
.home-grid, .catalog-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
|
|
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; }
|
|
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; }
|
|
111
|
+
.card-top { justify-content:space-between; gap:10px; }
|
|
112
|
+
.group-tag { color:var(--muted); border:1px solid var(--line); border-radius:5px; font-size:11px; line-height:1.6; padding:1px 7px; }
|
|
113
|
+
.project-card h3 { font-family:var(--serif); font-size:27px; line-height:1.15; letter-spacing:-.035em; margin:12px 0 1px; }
|
|
114
|
+
.repo-id { color:var(--muted); font-size:11px; }
|
|
115
|
+
.project-card p { flex:1; color:var(--text); font-size:13px; line-height:1.65; margin:8px 0 14px; overflow-wrap:anywhere; }
|
|
116
|
+
.card-foot { border-top:1px solid var(--line); padding-top:10px; justify-content:space-between; color:var(--muted); font-size:11px; }
|
|
117
|
+
.card-foot>span:first-child { display:flex; align-items:center; gap:6px; }
|
|
118
|
+
.card-foot>.arrow { color:var(--ink); }
|
|
119
|
+
.tone-amber { --tone:#916326; --tint:#f4e7cd; --chart:#efc379; }
|
|
120
|
+
.tone-teal { --tone:#246d67; --tint:#dcefe9; --chart:#79d6c2; }
|
|
121
|
+
.tone-coral { --tone:#a45740; --tint:#f8e3d9; --chart:#ee9e85; }
|
|
122
|
+
.tone-plum { --tone:#795288; --tint:#eee3f1; --chart:#cdb1e5; }
|
|
123
|
+
.tone-blue { --tone:#48659d; --tint:#e3eaf8; --chart:#96baf4; }
|
|
124
|
+
.tone-moss { --tone:#576f4f; --tint:#e2ebda; --chart:#a2c490; }
|
|
125
|
+
[data-theme="dark"] :is(.tone-amber,.tone-teal,.tone-coral,.tone-plum,.tone-blue,.tone-moss) { --tone:var(--chart); --tint:color-mix(in srgb,var(--chart) 15%,#132034); }
|
|
126
|
+
.project-mark { width:40px; height:40px; border-radius:10px; background:var(--tint); color:var(--tone); display:inline-grid; place-items:center; flex:none; }
|
|
127
|
+
.project-mark.small { width:36px; height:36px; }
|
|
128
|
+
.motif { position:relative; display:block; width:24px; height:24px; }
|
|
129
|
+
.motif i,.motif b,.motif::before,.motif::after { position:absolute; display:block; }
|
|
130
|
+
.motif-layers i,.motif-layers b,.motif-layers::before { content:""; width:13px;height:13px;left:5px; transform:rotate(45deg) skew(-12deg,-12deg); border:1.65px solid; background:var(--tint); }
|
|
131
|
+
.motif-layers i { top:2px; z-index:2; } .motif-layers b { top:6px; z-index:1; } .motif-layers::before { top:10px; }
|
|
132
|
+
.motif-signal { border:1.65px solid; border-radius:50%; width:22px;height:22px; }
|
|
133
|
+
.motif-signal::before,.motif-signal::after { content:""; border:1.6px solid; border-radius:50%; inset:3px; } .motif-signal::after { inset:7px; background:currentColor; }
|
|
134
|
+
.motif-route::before,.motif-route::after { content:""; width:6px;height:6px; border:1.7px solid; border-radius:2px; transform:rotate(45deg); background:var(--tint); }
|
|
135
|
+
.motif-route::before { left:2px;bottom:3px; } .motif-route::after { right:2px;top:3px; }
|
|
136
|
+
.motif-route i { width:16px; height:2px; background:currentColor; transform:rotate(-36deg); left:4px;top:11px; }
|
|
137
|
+
.motif-folio::before,.motif-folio i,.motif-folio b { content:""; width:12px;height:15px; border:1.5px solid; border-radius:2px; background:var(--tint); }
|
|
138
|
+
.motif-folio::before { left:1px;top:2px; transform:rotate(-15deg); } .motif-folio i { left:5px;top:4px; } .motif-folio b { left:9px;top:6px; transform:rotate(12deg); }
|
|
139
|
+
.motif-code::before,.motif-code::after { content:""; width:8px;height:8px; border-block-start:1.8px solid; border-inline-start:1.8px solid; top:8px; }
|
|
140
|
+
.motif-code::before { left:2px; transform:rotate(-45deg); } .motif-code::after { right:2px; transform:rotate(135deg); }
|
|
141
|
+
.motif-book::before,.motif-book::after { content:""; top:4px;width:10px;height:15px;border:1.5px solid;border-radius:2px; }
|
|
142
|
+
.motif-book::before { left:1px;transform:skewY(12deg); } .motif-book::after { right:1px;transform:skewY(-12deg); }
|
|
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); }
|
|
144
|
+
.project-chip i { width:5px; height:5px; background:var(--tone); border-radius:2px; }
|
|
145
|
+
.project-chip small { font:10px var(--mono); }
|
|
146
|
+
.site-footer { border-top:1px solid var(--line); }
|
|
147
|
+
.footer-inner { min-height:73px; flex-wrap:wrap; gap:15px; color:var(--muted); font-size:12px; }
|
|
148
|
+
.footer-brand { font-family:var(--serif); font-size:17px; font-weight:bold; color:var(--ink); letter-spacing:-.04em; }
|
|
149
|
+
.footer-inner>a:last-child { margin-left:auto; display:flex; align-items:center; gap:6px; }
|
|
150
|
+
.crumbs { gap:9px; color:var(--muted); font-size:12px; flex-wrap:wrap; margin:1px 0 21px; }
|
|
151
|
+
.crumbs a:hover { color:var(--gold); } .crumbs [aria-current] { color:var(--ink); }
|
|
152
|
+
.page-head { padding-bottom:24px; max-width:840px; }
|
|
153
|
+
.page-head h1,.detail-head h1,.sample-sheet h1 { color:var(--ink); font:700 clamp(36px,4.4vw,55px)/1.22 var(--serif); letter-spacing:-.035em; }
|
|
154
|
+
.page-head p,.detail-head>p,.sample-sheet>p { margin-top:10px; color:var(--muted); }
|
|
155
|
+
.filter-bar { align-items:center; flex-wrap:wrap; justify-content:space-between; gap:16px; border-block:1px solid var(--line); padding:15px 0; }
|
|
156
|
+
.filter-pills { flex-wrap:wrap; gap:5px; }
|
|
157
|
+
.filter-pills button,.close-search { background:transparent; color:var(--muted); border:1px solid transparent; font-size:13px; padding:6px 12px; border-radius:6px; }
|
|
158
|
+
.filter-pills button[aria-pressed="true"] { color:var(--button-ink); background:var(--button); }
|
|
159
|
+
.filter-pills button:hover:not([aria-pressed="true"]) { background:var(--soft); }
|
|
160
|
+
.field { padding:0 9px; gap:8px; color:var(--muted); }
|
|
161
|
+
.field input,.search-dialog-field input { border:none; outline:none; color:var(--ink); width:100%; min-width:0; background:transparent; }
|
|
162
|
+
.field:focus-within { outline:2px solid var(--focus); outline-offset:2px; }
|
|
163
|
+
.field input { font-size:13px; height:35px; }
|
|
164
|
+
.list-count,.range-caption,.detail-group,.period-heading,.demo-footnote { font-size:12px; color:var(--muted); }
|
|
165
|
+
.list-count { margin-block:14px; }
|
|
166
|
+
.empty-panel,.sample-sheet,.demo-panel,.log-period { border:1px solid var(--line); border-radius:12px; background:var(--surface); }
|
|
167
|
+
.empty-panel { padding:42px 20px; text-align:center; }
|
|
168
|
+
.empty-panel h2,.empty-panel h3 { font-size:21px; }.empty-panel p { margin:8px 0 15px; color:var(--muted); }
|
|
169
|
+
.empty-panel .text-link { margin:auto; }
|
|
170
|
+
.primary-button,.secondary-button { min-height:38px; width:fit-content; justify-content:center; gap:8px; border-radius:6px; padding:7px 13px; font-size:13px; font-weight:600; }
|
|
171
|
+
.primary-button { color:var(--button-ink); background:var(--button); border:1px solid var(--button); }
|
|
172
|
+
.primary-button:hover { filter:brightness(1.16); } .secondary-button { color:var(--ink); background:var(--surface); border:1px solid var(--line); }
|
|
173
|
+
.empty-panel .secondary-button { margin:auto; }
|
|
174
|
+
.select-field { gap:8px; padding:4px 8px; font-size:13px; }
|
|
175
|
+
.select-field>span { font-size:12px; color:var(--muted); }
|
|
176
|
+
.select-field select { color:var(--ink); background:var(--surface); border:0; min-height:30px; }
|
|
177
|
+
.detail-head { background:var(--surface); border:1px solid var(--line); padding:30px; border-radius:12px; }
|
|
178
|
+
.detail-intro { gap:17px; }.detail-intro .project-mark { width:62px;height:62px;border-radius:13px; }.detail-intro .motif { transform:scale(1.4); }
|
|
179
|
+
.detail-head h1 { font-size:43px; }
|
|
180
|
+
.detail-head>p { color:var(--text); }
|
|
181
|
+
.button-row { gap:10px; flex-wrap:wrap; } .button-row:not(:empty) { margin-top:18px; }
|
|
182
|
+
.external-arrow { font-size:16px;line-height:1; }
|
|
183
|
+
.detail-stats { padding:14px 0; border-bottom:1px solid var(--line); }
|
|
184
|
+
.detail-stats dt,.stat-strip dt { color:var(--muted); font-size:12px; }
|
|
185
|
+
.empty-book { display:inline-grid; place-items:center; background:var(--soft); width:40px; height:40px; border-radius:10px; margin-bottom:10px; }
|
|
186
|
+
.log-layout { display:grid; grid-template-columns:225px minmax(0,1fr); gap:28px; align-items:start; }
|
|
187
|
+
.log-index { position:sticky; top:90px; border-left:2px solid var(--line); padding-left:13px; }
|
|
188
|
+
.log-index h2 { font-size:15px; margin-bottom:12px; }
|
|
189
|
+
.log-index a { display:block; font-size:12px; margin-bottom:11px; line-height:1.5; } .log-index a time { font-family:var(--mono); color:var(--gold); } .log-index a span { display:block; }
|
|
190
|
+
.log-index a:hover { color:var(--gold); }
|
|
191
|
+
.log-period { padding:22px 25px; margin-bottom:15px; scroll-margin-top:88px; }
|
|
192
|
+
.log-period:target { border-color:var(--gold); box-shadow:0 0 0 1px var(--gold); }
|
|
193
|
+
.period-heading { justify-content:space-between; font-size:11px; }
|
|
194
|
+
.log-period h2 { font:600 clamp(18px,2.5vw,26px)/1.5 var(--mono); margin:9px 0; }
|
|
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; }
|
|
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; }
|
|
198
|
+
.stat-strip dt { overflow-wrap:anywhere; }
|
|
199
|
+
.stat-summary { margin:10px 0 24px; padding:18px 24px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
|
|
200
|
+
.stat-summary h2 { font-size:16px; margin:0; }
|
|
201
|
+
.stat-summary p { color:var(--muted); font-size:12px; margin-top:3px; }
|
|
202
|
+
.stat-summary .stat-strip { margin:8px 0 0; }
|
|
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; }
|
|
204
|
+
#demo-status { color:var(--gold); }.demo-footnote { margin-top:15px; }.demo-panel input { accent-color:var(--gold); }
|
|
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; }
|
|
206
|
+
dialog::backdrop { background:#111c2b80; backdrop-filter:blur(3px); }
|
|
207
|
+
.search-dialog-field { display:flex; align-items:center;gap:12px;padding:16px 18px;border-bottom:1px solid var(--line); }
|
|
208
|
+
.search-dialog-field input { font-size:16px; height:32px; }
|
|
209
|
+
.close-search { border-color:var(--line); padding:2px 6px; font:12px var(--mono); }
|
|
210
|
+
.result-summary,.search-help { padding:10px 18px; font-size:12px;color:var(--muted); }
|
|
211
|
+
#search-results { padding:0 8px 8px; overflow-y:auto; max-height:min(48vh,390px); }
|
|
212
|
+
.search-result { display:block; padding:9px 11px; border-radius:6px; }
|
|
213
|
+
.search-result:hover,.search-result.is-selected,.search-result:focus { background:var(--soft); outline-offset:-2px; }
|
|
214
|
+
.search-result small,.search-result span { display:block; color:var(--muted); font-size:12px; }
|
|
215
|
+
.search-result strong { display:block; color:var(--ink); font-size:15px; }
|
|
216
|
+
.search-help { display:flex; gap:16px;border-top:1px solid var(--line); }
|
|
217
|
+
mark { background:var(--gold-soft);color:var(--ink);border-radius:2px; }
|
|
218
|
+
@media (max-width:1040px) {
|
|
219
|
+
.wrap { width:calc(100% - 56px); }.overview-hero { gap:26px;padding:27px; }.hero-copy>p { max-width:29em; }
|
|
220
|
+
}
|
|
221
|
+
@media (max-width:780px) {
|
|
222
|
+
.wrap { width:calc(100% - 34px); }.mast-inner { gap:20px; height:60px; }.main-nav { gap:15px; }
|
|
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; }
|
|
224
|
+
.log-layout { grid-template-columns:170px minmax(0,1fr);gap:16px; }.stat-strip dt { font-size:10px; }
|
|
225
|
+
}
|
|
226
|
+
@media (max-width:600px) {
|
|
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; }
|
|
228
|
+
.mast-tools { gap:7px; }.search-open { min-height:32px; }.theme-button { width:33px; height:33px; }.main-content { padding-block:17px 36px; }
|
|
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;}
|
|
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; }
|
|
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; }
|
|
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; }
|
|
233
|
+
.detail-head { padding:18px; }.detail-head h1 {font-size:34px;}
|
|
234
|
+
.footer-inner { gap:8px;font-size:11px; }.footer-brand { font-size:15px; }.sample-sheet h1 { font-size:32px; }
|
|
235
|
+
}
|
|
236
|
+
@media (max-width:360px) {
|
|
237
|
+
.home-grid,.catalog-grid { grid-template-columns:1fr; }.hero-stats>div { padding-inline:11px; }.hero-stats>div:first-child {padding-left:0;}.hero-stats>div:last-child {padding-right:0;}
|
|
238
|
+
}
|
|
239
|
+
@media (max-width:600px) {
|
|
240
|
+
.log-index { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
|
|
241
|
+
.log-index h2 { grid-column:1 / -1; }
|
|
242
|
+
.log-index a { min-width:0; }
|
|
243
|
+
.log-index a span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
244
|
+
}
|
|
245
|
+
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; } }
|
|
246
|
+
|
|
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); }
|
|
248
|
+
.ledger-count { margin:0; font-size:13px; font-weight:600; font-variant-numeric:tabular-nums; color:var(--text); }
|
|
249
|
+
.enhanced .ledger-filters.enhanced-only { display:flex !important; align-items:center; flex-wrap:wrap; gap:7px; }
|
|
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; }
|
|
252
|
+
.ledger-search { display:flex; align-items:center; gap:7px; padding:0 8px; }
|
|
253
|
+
.ledger-search input { min-width:0; width:9rem; border:0; background:transparent; color:var(--ink); outline:none; font:inherit; }
|
|
254
|
+
.ledger-search:focus-within { outline:2px solid var(--focus); outline-offset:1px; }
|
|
255
|
+
.ledger-window { margin:16px 0 23px; border:1px solid var(--line); border-radius:6px; background:var(--surface); }
|
|
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; }
|
|
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); }
|
|
263
|
+
.ledger-project i { flex:none; width:6px; height:6px; background:var(--tone); border-radius:50%; }
|
|
264
|
+
.ledger-lines { list-style:none; padding:0; margin:0; }
|
|
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; }
|
|
266
|
+
.ledger-entry + .ledger-entry { border-top:1px solid var(--line); }
|
|
267
|
+
.type-label { color:var(--muted); font-size:12px; }
|
|
268
|
+
.change-cell { overflow-wrap:anywhere; color:var(--ink); }
|
|
269
|
+
.ledger-project:hover,.change-cell:hover { color:var(--gold); text-decoration:underline; text-underline-offset:3px; }
|
|
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; }
|
|
271
|
+
.log-entry { scroll-margin-top:100px; }
|
|
272
|
+
.log-entry:target { background:var(--gold-soft); outline:2px solid var(--gold-soft); color:var(--ink); }
|
|
273
|
+
.legacy-text,.period-note { white-space:pre-line; overflow-wrap:anywhere; }
|
|
274
|
+
@media (max-width:650px) {
|
|
275
|
+
.ledger-tools { align-items:flex-start; padding:5px 0 10px; }
|
|
276
|
+
.ledger-count { width:100%; }
|
|
277
|
+
.enhanced .ledger-filters.enhanced-only { width:100%; gap:5px; }
|
|
278
|
+
.ledger-search input { width:96px; }
|
|
279
|
+
.ledger-filters select { max-width:135px; padding-inline:5px; }
|
|
280
|
+
.window-head { padding:6px 7px; }
|
|
281
|
+
.window-count { font-size:11px; }
|
|
282
|
+
.ledger-window { margin:10px 0 16px; }
|
|
283
|
+
.ledger-group { padding-inline:8px; }
|
|
284
|
+
.ledger-entry { grid-template-columns:minmax(2.7rem,max-content) minmax(0,1fr); font-size:13px; line-height:19px; padding-block:4px; }
|
|
285
|
+
.type-label { font-size:11px; }
|
|
286
|
+
.log-entry { scroll-margin-top:110px; }
|
|
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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
const html = document.documentElement;
|
|
3
|
+
let choice;
|
|
4
|
+
try { choice = localStorage.getItem('skills-hub.home-website.theme'); } catch {}
|
|
5
|
+
if (choice !== 'dark' && choice !== 'light') choice = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
6
|
+
html.dataset.theme = choice;
|
|
7
|
+
})();
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { categories, periodsByEnd } from './model.mjs';
|
|
2
|
+
|
|
3
|
+
export const escapeHtml = value => String(value).replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"');
|
|
4
|
+
export const shortDate = date => date.slice(5).replace('-', '.');
|
|
5
|
+
export const projectPath = project => 'projects/' + project.id + '/';
|
|
6
|
+
export const logPath = (project, period) => projectPath(project) + 'changelog/' + (period ? '#range-' + period.key : '');
|
|
7
|
+
export const availableGroups = (projects) => [...new Set(projects.flatMap(project => project.groups))];
|
|
8
|
+
export const arrow = '<span aria-hidden="true" class="arrow">→</span>';
|
|
9
|
+
export const external = '<span aria-hidden="true" class="external-arrow">↗</span>';
|
|
10
|
+
export const formatCount = value => value == null ? '未核实' : value.toLocaleString('zh-CN');
|
|
11
|
+
|
|
12
|
+
export function symbol(name) {
|
|
13
|
+
return `<span class="symbol sym-${name}" aria-hidden="true"><i></i></span>`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function mark(project, small = false) {
|
|
17
|
+
return `<span aria-hidden="true" class="project-mark tone-${project.color} ${small ? 'small' : ''}"><span class="motif motif-${project.mark}"><i></i><b></b></span></span>`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function projectChip(project) {
|
|
21
|
+
return `<span class="project-chip tone-${project.color}"><i></i>${escapeHtml(project.name)}</span>`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function header(root, section, siteTitle) {
|
|
25
|
+
const nav = [['home', '总览', ''], ['projects', '项目目录', 'projects/'], ['changelog', '跨项目变更', 'changelog/']];
|
|
26
|
+
return `<header class="masthead"><div class="wrap mast-inner">
|
|
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>
|
|
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>
|
|
29
|
+
<div class="mast-tools"><button type="button" class="search-open enhanced-only" data-open-search aria-label="搜索全站">${symbol('search')}<span>搜索</span><kbd>Ctrl K</kbd></button>
|
|
30
|
+
<button type="button" class="icon-button theme-button enhanced-only" data-theme-toggle aria-label="切换深色模式" title="切换深色模式">${symbol('moon')}${symbol('sun')}</button></div>
|
|
31
|
+
</div></header>`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function searchDialog() {
|
|
35
|
+
return `<dialog closedby="any" id="search-dialog" aria-labelledby="search-title"><h2 id="search-title" class="sr">搜索项目与变更</h2>
|
|
36
|
+
<div class="search-dialog-field">${symbol('search')}<input id="global-query" type="search" placeholder="搜索项目、仓库 ID 或变更内容" aria-label="搜索项目与变更" autocomplete="off">
|
|
37
|
+
<button class="close-search" type="button" data-close-search aria-label="关闭搜索">Esc</button></div>
|
|
38
|
+
<p class="result-summary" aria-live="polite" id="search-summary"></p><div id="search-results"></div>
|
|
39
|
+
<div class="search-help"><span><kbd>↑</kbd> <kbd>↓</kbd> 选择结果</span><span><kbd>Enter</kbd> 打开</span></div>
|
|
40
|
+
</dialog>`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function crumbs(root, parts) {
|
|
44
|
+
return `<nav class="crumbs" aria-label="当前位置"><a href="${root}">总览</a>${parts.map(([label, url]) => `<span aria-hidden="true">/</span>${url ? `<a href="${root}${url}">${escapeHtml(label)}</a>` : `<span aria-current="page">${escapeHtml(label)}</span>`}`).join('')}</nav>`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function frame({base, title, section, content}) {
|
|
48
|
+
const html = `<div class="home-site" data-root="${base}"><a class="skip-link" href="#main">跳到正文</a>
|
|
49
|
+
${header(base, section, title)}
|
|
50
|
+
<main class="wrap main-content" id="main" tabindex="-1">${content}</main>
|
|
51
|
+
<footer class="site-footer"><div class="wrap footer-inner"><a class="footer-brand" href="${base}">${escapeHtml(title)}</a></div></footer>
|
|
52
|
+
${searchDialog()}</div>`;
|
|
53
|
+
return html.replace(/<a\b([^>]+)>/gu, (tag, attrs) => attrs.includes(' target=') ? tag : '<a target="_self"'+attrs+'>');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function projectCard(root, project) {
|
|
57
|
+
const recent = periodsByEnd(project)[0];
|
|
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>`;
|
|
64
|
+
}
|
|
65
|
+
|
|
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)}`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function statSummary(id, title, stats, scope) {
|
|
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>`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function intervalCount(period) {
|
|
91
|
+
if (period.baseline) return '零项基线';
|
|
92
|
+
return `${period.items.length} 条变更`;
|
|
93
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { activityMonths, categories, distinctRangeLabel, itemId } from './model.mjs';
|
|
2
|
+
import { crumbs, escapeHtml as esc, formatCount, logPath, projectPath, statSummary, symbol } from './layout.mjs';
|
|
3
|
+
|
|
4
|
+
export const impactLabels = markers => (markers ?? []).map(name => `<span class="impact-tag">${esc(name)}</span>`).join('');
|
|
5
|
+
export const monthLabel = key => key === 'undated' ? '日期未记录' : `${key.slice(0, 4)} 年 ${Number(key.slice(5))} 月`;
|
|
6
|
+
|
|
7
|
+
function row(root, project, {period, index}) {
|
|
8
|
+
const item = period.items[index];
|
|
9
|
+
const [category, text, markers, meta] = item ?? [
|
|
10
|
+
'区间说明', period.note || (period.baseline ? '建立日志记录基线' : '完成本次区间核对'),
|
|
11
|
+
];
|
|
12
|
+
const url = root + logPath(project) + (item ? '#' + itemId(period, index) : '#range-' + period.key);
|
|
13
|
+
const date = meta?.date
|
|
14
|
+
? `<time datetime="${esc(meta.date)}">${esc(meta.date)}</time>`
|
|
15
|
+
: `<a href="${esc(root + logPath(project, period))}" title="查看日志区间">${esc(distinctRangeLabel(project, period))}</a>`;
|
|
16
|
+
return `<li class="ledger-entry" data-kind="${esc(category)}"${item ? ' data-entry' : ''}>
|
|
17
|
+
<span class="type-label">${esc(category)}</span>
|
|
18
|
+
<div><a class="change-cell" href="${esc(url)}">${impactLabels(markers)}${esc(text)}</a>
|
|
19
|
+
<div class="entry-context">${date}${meta?.area ? `<span>${esc(meta.area)}</span>` : ''}</div></div>
|
|
20
|
+
</li>`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function monthSection(root, month, showProject, undatedAnchors) {
|
|
24
|
+
const {key, groups, changes, commits} = month;
|
|
25
|
+
return `<section class="ledger-window" id="month-${key}" data-month="${key}" aria-labelledby="month-title-${key}">
|
|
26
|
+
${key === 'undated' ? undatedAnchors.map(to => `<span id="window-${esc(to)}" class="legacy-window-anchor" aria-hidden="true"></span>`).join('') : ''}
|
|
27
|
+
<header class="window-head"><h3 id="month-title-${key}">${monthLabel(key)}</h3><span class="window-count">${formatCount(changes)} 项任务 · ${formatCount(commits)} 次 Git 提交</span></header>
|
|
28
|
+
${groups.map(({project, rows, commits: projectCommits}) => {
|
|
29
|
+
const legacy = key === 'undated' && project.legacy;
|
|
30
|
+
return `<section class="ledger-group tone-${project.color}" data-ledger-repo="${esc(project.id)}" data-commits="${projectCommits}" data-repo-name="${esc(project.name)}">
|
|
31
|
+
${showProject ? `<div class="ledger-group-head"><h4><a class="ledger-project" href="${esc(root + projectPath(project))}"><i></i>${esc(project.name)}</a></h4><span class="group-count">${formatCount(projectCommits)} 次 Git 提交</span></div>` : ''}
|
|
32
|
+
${rows.length || legacy ? `<ul class="ledger-lines" role="list">
|
|
33
|
+
${rows.map(item => row(root, project, item)).join('')}
|
|
34
|
+
${legacy ? `<li class="ledger-entry" data-kind="区间说明"><span class="type-label">旧版日志</span><div><p class="legacy-text">${esc(legacy)}</p><a class="entry-context" href="${esc(root + logPath(project))}#legacy">查看旧版原文</a></div></li>` : ''}
|
|
35
|
+
</ul>` : '<p class="commit-only">此月有 Git 提交,暂无任务记录。</p>'}
|
|
36
|
+
</section>`;
|
|
37
|
+
}).join('')}
|
|
38
|
+
</section>`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function monthlyLedger(root, projects, {showProject = true, undatedAnchors = []} = {}) {
|
|
42
|
+
const months = activityMonths(projects);
|
|
43
|
+
const monthCount = months.filter(({key}) => key !== 'undated').length;
|
|
44
|
+
const taskCount = months.reduce((total, month) => total + month.changes, 0);
|
|
45
|
+
const projectCount = new Set(months.flatMap(month => month.groups.map(group => group.project.id))).size;
|
|
46
|
+
const hasUndated = months.some(({key}) => key === 'undated');
|
|
47
|
+
const count = monthCount || !hasUndated
|
|
48
|
+
? `${monthCount} 个月${hasUndated ? '及日期未记录条目' : ''}`
|
|
49
|
+
: '日期未记录条目';
|
|
50
|
+
return `<section class="ledger" aria-labelledby="ledger-title"><h2 id="ledger-title">月度明细</h2>
|
|
51
|
+
<div class="ledger-tools"><p class="ledger-count" id="timeline-count" aria-live="polite">${count}${showProject ? ` · ${projectCount} 个项目` : ''} · ${formatCount(taskCount)} 项任务</p>
|
|
52
|
+
${months.length ? `<search class="ledger-filters enhanced-only" aria-label="筛选月度明细">
|
|
53
|
+
<label class="ledger-search">${symbol('search')}<input id="timeline-query" type="search" aria-label="筛选关键词" placeholder="筛选关键词" autocomplete="off"></label>
|
|
54
|
+
${showProject ? `<label><span class="sr">项目</span><select id="timeline-project"><option value="">全部项目</option>${projects.map(p => `<option value="${esc(p.id)}">${esc(p.name)}</option>`).join('')}</select></label>` : ''}
|
|
55
|
+
<label><span class="sr">月份</span><select id="timeline-month"><option value="">全部月份</option>${months.map(({key}) => `<option value="${key}">${monthLabel(key)}</option>`).join('')}</select></label>
|
|
56
|
+
<label><span class="sr">类别</span><select id="timeline-category"><option value="">全部类别</option>${[...categories, '区间说明'].map(c => `<option>${esc(c)}</option>`).join('')}</select></label>
|
|
57
|
+
</search>` : ''}</div>
|
|
58
|
+
${months.map(month => monthSection(root, month, showProject, undatedAnchors)).join('')}
|
|
59
|
+
<div id="timeline-empty" class="empty-panel"${months.length ? ' hidden' : ''}><h3>${months.length ? '没有符合条件的记录' : '暂无月度记录'}</h3>${months.length ? '<button type="button" id="reset-timeline" class="secondary-button enhanced-only">清除筛选</button>' : ''}</div>
|
|
60
|
+
</section>`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function changelog(root, projects, windows, stats) {
|
|
64
|
+
const undatedAnchors = windows.filter(window => window.groups.some(group =>
|
|
65
|
+
group.periods.some(period => !period.commitMonths))).map(window => window.to);
|
|
66
|
+
return `${crumbs(root, [['跨项目变更']])}<header class="page-head"><h1>跨项目变更</h1><p>按月份查看任务与 Git 提交,可按项目、类别及关键词筛选。</p></header>
|
|
67
|
+
${statSummary('site-statistics', '全站累计', stats)}
|
|
68
|
+
${monthlyLedger(root, projects, {undatedAnchors})}`;
|
|
69
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export const categories = ['功能', '修复', '重构', '优化', '维护'];
|
|
2
|
+
|
|
3
|
+
export function timeline(projects) {
|
|
4
|
+
return projects.flatMap(project => project.periods.map((period, order) => ({project, period, order})))
|
|
5
|
+
.sort((a, b) => b.period.to.localeCompare(a.period.to) || a.project.id.localeCompare(b.project.id, 'en') || a.order - b.order);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function periodsByEnd(project) {
|
|
9
|
+
return [...project.periods].sort((a, b) => b.to.localeCompare(a.to));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function statistics(periods) {
|
|
13
|
+
function sum(value) {
|
|
14
|
+
let total = 0;
|
|
15
|
+
for (const period of periods) {
|
|
16
|
+
const count = value(period);
|
|
17
|
+
if (!Number.isSafeInteger(count) || !Number.isSafeInteger(total + count)) return null;
|
|
18
|
+
total += count;
|
|
19
|
+
}
|
|
20
|
+
return total;
|
|
21
|
+
}
|
|
22
|
+
const changes = sum(period => period.verified === false ? null : period.items.length);
|
|
23
|
+
return {
|
|
24
|
+
changes,
|
|
25
|
+
commits: sum(period => period.commits),
|
|
26
|
+
byCategory: changes === null ? null : Object.fromEntries(categories.map(category => [
|
|
27
|
+
category, sum(period => period.items.filter(([type]) => type === category).length),
|
|
28
|
+
])),
|
|
29
|
+
added: sum(period => period.added),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function observationWindows(projects) {
|
|
34
|
+
const byEnd = new Map();
|
|
35
|
+
for (const {project, period} of timeline(projects)) {
|
|
36
|
+
if (!byEnd.has(period.to)) byEnd.set(period.to, new Map());
|
|
37
|
+
const groups = byEnd.get(period.to);
|
|
38
|
+
if (!groups.has(project.id)) groups.set(project.id, {project, periods:[]});
|
|
39
|
+
groups.get(project.id).periods.push(period);
|
|
40
|
+
}
|
|
41
|
+
const ends = [...byEnd.keys()];
|
|
42
|
+
return ends.map((to, index) => {
|
|
43
|
+
const previous = ends[index + 1];
|
|
44
|
+
const from = previous ? new Date(Date.parse(previous) + 86_400_000).toISOString().slice(0, 10) : null;
|
|
45
|
+
const groups = [...byEnd.get(to).values()];
|
|
46
|
+
const periods = groups.flatMap(group => group.periods);
|
|
47
|
+
return {from, to, groups, rangeCount:periods.length, stats:statistics(periods)};
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function periodTitle(period) {
|
|
52
|
+
return period.items[0]?.[1] ?? (period.baseline ? '建立日志记录基线' : '完成本次区间核对');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function rangeLabel(period) {
|
|
56
|
+
return period.from ? period.from + ' 至 ' + period.to : period.to;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function distinctRangeLabel(project, period) {
|
|
60
|
+
const repeated = project.periods.some(p => p !== period && p.from === period.from && p.to === period.to);
|
|
61
|
+
return rangeLabel(period) + (repeated ? ' · 第 ' + period.key.split('-').at(-1) + ' 段' : '');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function itemId(period, index) {
|
|
65
|
+
return period.items[index]?.[3]?.id ?? 'entry-' + period.key + '-' + (index + 1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Tasks use the Git date of the change. A legacy observation window has no known task dates.
|
|
69
|
+
export function activityMonths(projects) {
|
|
70
|
+
const months = new Map();
|
|
71
|
+
function groupAt(key, project) {
|
|
72
|
+
if (!months.has(key)) months.set(key, new Map());
|
|
73
|
+
const month = months.get(key);
|
|
74
|
+
if (!month.has(project.id)) month.set(project.id, {project, commits:0, rows:[]});
|
|
75
|
+
return month.get(project.id);
|
|
76
|
+
}
|
|
77
|
+
for (const project of projects) {
|
|
78
|
+
for (const period of periodsByEnd(project)) {
|
|
79
|
+
if (period.commitMonths) {
|
|
80
|
+
for (const [month, count] of Object.entries(period.commitMonths)) groupAt(month,project).commits += count;
|
|
81
|
+
} else groupAt('undated',project).commits += period.commits;
|
|
82
|
+
period.items.forEach((item, index) => {
|
|
83
|
+
const month = period.commitMonths ? item[3].date.slice(0,7) : 'undated';
|
|
84
|
+
groupAt(month,project).rows.push({period,index});
|
|
85
|
+
});
|
|
86
|
+
if (!period.items.length && (!period.commitMonths || period.baseline)) {
|
|
87
|
+
groupAt('undated',project).rows.push({period,index:-1});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (project.legacy) groupAt('undated',project);
|
|
91
|
+
}
|
|
92
|
+
const keys = [...months.keys()].sort((a,b) => a === b ? 0 : a === 'undated' ? 1 : b === 'undated' ? -1 : b.localeCompare(a));
|
|
93
|
+
return keys.map(key => {
|
|
94
|
+
const groups = [...months.get(key).values()];
|
|
95
|
+
let commits = 0, changes = 0;
|
|
96
|
+
for (const group of groups) {
|
|
97
|
+
const rowDate = ({period,index}) => period.items[index]?.[3]?.date ?? period.to;
|
|
98
|
+
group.rows.sort((a,b) => rowDate(b).localeCompare(rowDate(a)));
|
|
99
|
+
changes += group.rows.filter(row => row.index >= 0).length;
|
|
100
|
+
commits += group.commits;
|
|
101
|
+
}
|
|
102
|
+
return {key,groups,commits,changes};
|
|
103
|
+
});
|
|
104
|
+
}
|