diff --git a/README.md b/README.md index c9eb932..d904a9a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ┌───────────────────────────────────────────────┐ │ 代 打 台 · 代打管理平台 │ └───────────────────────────────────────────────┘ - 版本 1.11.0 配置文件 daili.ini + 版本 1.11.1 配置文件 daili.ini 数据库 D:\代打台\daili.db 访问地址: 本机 http://127.0.0.1:17777 diff --git a/internal/web/handlers_calendar.go b/internal/web/handlers_calendar.go index 11dc231..cfc59a2 100644 --- a/internal/web/handlers_calendar.go +++ b/internal/web/handlers_calendar.go @@ -32,6 +32,8 @@ type DayCell struct { BlockTotal int BlockText string BlockTitle string + // BlockPercent 色块底色浓度:通行证固定 18%,深渊按周期依次减淡 + BlockPercent int // PendingCount 当日还没完成的单数(= TaskCount - DoneCount) PendingCount int Tickets []Ticket @@ -448,6 +450,11 @@ func (s *Server) handleCalendar(w http.ResponseWriter, r *http.Request) { cell.BlockTotal = cs.blockTotal() cell.BlockText = fmt.Sprintf("%d/%d", cell.BlockDone, cell.BlockTotal) cell.BlockTitle = cs.sub.PackageName + " · " + cell.BlockText + cell.BlockPercent = 18 + if cs.sub.Abyss && cs.sub.CycleDays > 0 { + idx := domain.CycleIndex(cs.start, day, cs.sub.CycleDays) + cell.BlockPercent = abyssBlockPercent(idx, cs.sub.TotalCount) + } } continue } @@ -657,6 +664,25 @@ func assigneeStrip(tickets []Ticket) []string { return out } +// abyssBlockPercent 深渊色块浓度:第一个周期 22%,之后每个周期依次减淡, +// 最后一个周期 10%(周期数大于 1 时线性过渡)。 +func abyssBlockPercent(idx, total int) int { + if total <= 1 { + return 22 + } + if idx < 0 { + idx = 0 + } + if idx >= total { + idx = total - 1 + } + pct := 22 - (idx*12)/(total-1) + if pct < 10 { + pct = 10 + } + return pct +} + func heatLevel(n int) int { switch { case n <= 0: diff --git a/internal/web/static/app.css b/internal/web/static/app.css index 7243f46..4684ed4 100644 --- a/internal/web/static/app.css +++ b/internal/web/static/app.css @@ -798,10 +798,10 @@ fieldset { border: 0; margin: 0; padding: 0; min-width: 0; } /* 通行证 / 深渊:整段连续着色,每格显示同一个「已完成/总数」 */ .cal-cell.has-block { - background: color-mix(in srgb, var(--block) 18%, var(--app-surface)); + background: color-mix(in srgb, var(--block) var(--block-pct, 18%), var(--app-surface)); border-color: color-mix(in srgb, var(--block) 24%, var(--app-border)); } -.cal-cell.has-block:hover { background: color-mix(in srgb, var(--block) 26%, var(--app-surface)); } +.cal-cell.has-block:hover { background: color-mix(in srgb, var(--block) calc(var(--block-pct, 18%) + 6%), var(--app-surface)); } .cal-cell.has-block.today .dnum { background: var(--block); color: #fff; } .cell-block { display: inline-flex; align-items: center; gap: 4px; diff --git a/internal/web/templates/pages/calendar.html b/internal/web/templates/pages/calendar.html index 5af21b0..7ec4dcb 100644 --- a/internal/web/templates/pages/calendar.html +++ b/internal/web/templates/pages/calendar.html @@ -41,7 +41,7 @@