Skip to content

Releases: miaoledor/Lolicount

v0.4.0-Emote/Spine/Live2D counters, 500+ themes, 7× lighter memory!🚀

Choose a tag to compare

@miaoledor miaoledor released this 30 Sep 14:12

v0.4.0 — Emote/Spine/Live2D counters, 500+ themes, 7× lighter memory

This release spans a month of work (126 commits since v0.3.2): three new animated counter types, a theme library grown from ~30 to 517 themes, a rebuilt playground, and a 7× reduction in resident memory.

Highlights

  • Three new animated counter types: E-mote (PSB) widgets, Spine skeletal counters, and Live2D (Cubism 2/3) counters — all counting real visits.
  • Theme library: ~30 → 517 themes — Arknights (255), Blue Archive (194), Senren Banka (19), Magical Girl Witch Trials (26), Sabbat of the Witch (11), Cafe Stella (7), STEINS;GATE RE:BOOT, and more, contributed via PRs #7–#13.
  • 7× lighter memory: themes render via a one-image-per-slot lazy strategy (resident heap ≈0.94 GiB → ≈0.13 GiB); PSB models stream from disk instead of riding inside the binary.
  • Rebuilt Playground: source-grouped collapsible gallery with a usage-based hot list, hi-res frame download, route-synced theme sharing, and a fireworks generate animation.

New counter types

  • E-mote (PSB) widgets: vendored FreeMote WebGL driver + widget script; JSON count API; 9 model packs (Chocola, Vanilla, Azuki, Coconut, Cinnamon, Maple, Shigure, Yatai-Neko, Yuni/Ixia/Nai/Fukami). Models are stored gzip-compressed and streamed from disk per request (PSB_DIR), no longer embedded in the binary.
  • Spine counters with animated skeleton rendering.
  • Live2D counters: BanG Dream model packs render via the official Cubism 2 legacy runtime with automatic runtime selection; interactive player (click to cycle motions, eye-tracking disabled), fixed manifest probing and Pixi v8 canvas fit.

Theme library

  • Arknights: 255 story-portrait card themes with expression variants (PR #13), including $-suffix alternate-body and multi-layer composition fixes.
  • Blue Archive: 194 character themes (PR #11) + face/panel fixes.
  • Senren Banka: 19 per-character themes (PR #9) with sprite fixes (nude pose removal, mask layering, faceless-render fixes).
  • Cafe Stella: 7 character themes, identities verified against layer names/eye colors/official art (folder slugs unchanged so embed URLs keep counting).
  • Sabbat of the Witch (11 per-character), Magical Girl Witch Trials (13 + 13 witchified, PR #8), STEINS;GATE RE:BOOT E-mote (PR #10/#11).
  • Static gallery thumbnails (webp) pre-rendered for all card themes, fixing rate-limited card images in the gallery.

Playground & site

  • Dedicated gallery page: search + type filter, per-source collapsible groups (collapsed by default), and a hot themes list — top 10 by real usage, recomputed at startup and hourly (tb_theme_usage + GET /api/themes/hot).
  • Selected theme synced to the URL (/themes?theme=…) for sharing; variation counts on cards; hi-res "download current frame" (~1600px supersampled PNG).
  • Home page: polaroid-style showcase, star-plea card, English-first UI; About page redesigned around the star-plea card.
  • Custom text template ({n}) support in the generator and server.
  • Fireworks generate animation; unshowf toggle removed (generated links keep unshowf=true; server param unchanged).

Performance & correctness

  • Lazy memory strategy + FrameDims canvas stability (no size jumps across frame swaps).
  • Real-count responses use the no-store, no-cache, max-age=0, must-revalidate combo — GitHub camo/Fastly edge ignored bare no-store, freezing README counters (MISS→HIT verified).
  • Editor: proportional scaling, multi-image quick upload, aspect-ratio preservation, grid fixes (PRs #5, #6).
  • gofmt across legacy files, manifest-completeness and renderer unit tests, Docker pnpm pin.

Upgrade notes

  • No database migration: tb_count and tb_theme_usage are auto-created (CREATE TABLE IF NOT EXISTS) at startup — just restart with the new binary.
  • Emote models are no longer embedded: keep assets/psb/ on disk next to the binary (or point PSB_DIR at it) or emote pages will 404; everything else stays single-binary.
  • Rebuild to embed the new frontend: cd web && pnpm generate && go build ./cmd/server.

中文说明

  • 三种新计数器:E-mote(PSB) 挂件、Spine 骨骼动画、Live2D(Cubism 2/3) 动态立绘,全部真实计数;PSB 模型 gzip 存储并从磁盘流式分发,不再打进二进制。
  • 主题库 ~30 → 517:明日方舟 255、碧蓝档案 194、千恋万花 19、魔女之夜 26、星光咖啡馆 7、魔女的夜宴 11、STEINS;GATE 等(PR #7–#13),画廊缩略图预渲染。
  • Playground 重构:按来源分组折叠 + 基于真实使用量的热门榜(启动/每小时重算)、?theme= 分享链接、高分辨率下载当前帧、烟花生成动画、自定义文字模板。
  • 性能与正确性:懒加载内存策略(0.94→0.13GiB)、FrameDims 画布稳定、GitHub camo 边缘缓存计数冻结修复(组合缓存头)、编辑器多项修复。
  • 升级:无迁移(两表启动自动建);保留 assets/psb/ 目录或设置 PSB_DIR;重新 pnpm generate + go build。

Full changelog: v0.3.2...v0.4.0

v0.3.2

Choose a tag to compare

@miaoledor miaoledor released this 28 Aug 02:16

What's New in v0.3.0 – v0.3.2

This release is the biggest update since the initial counter launch — 142 commits across three minor versions. The headline changes are a completely rewritten rendering engine (imgcore), a unified theme model (cards + characters merged into one), a brand-new in-browser theme editor, and 6 new character themes.


🎨 New: In-Browser Theme Editor (v0.3.2)

A full visual workbench for creating and editing themes without leaving the browser — no local toolchain required.

  • Visual canvas with zoom controls, collapsible sidebars, grid overlay, and coordinate display
  • Layer panel: drag-to-reorder with FLIP animation, editable layer names, per-layer image picker, index badges
  • Quick edit mode with animated mode-switching; defaults to quick mode on load
  • Drag images directly onto the canvas; position editing via drag or numeric inputs
  • Text layer controls (collapsible by default) for counter text styling
  • Export: preview as SVG, export as PNG image, or export full theme ZIP
  • Auto-save to localStorage with manual save-as-draft and draft management
  • Upload guide: GitHub PR flow modal with email hint (replaces disabled upload button)
  • Mobile-first layout: sidebars stack on top, canvas gets priority space, pointer-capture fixes for touch dragging
  • Light theme matching the main site (previously dark)

New API endpoints:

  • POST /api/editor/preview — render a preview SVG from editor state
  • POST /api/editor/export — export a full theme package (ZIP)

The upload channel (POST /api/themes) is reserved for a future release and not yet implemented.


🏗️ New: Unified Rendering Engine (imgcore)

The rendering core was rewritten from scratch around a clean layer-stack model. The server now only calls composer.Compose — all rendering logic lives in internal/imgcore.

  • Layer interface with four implementations: ImageLayer, RandomPickLayer (multi-frame random), GroupLayer (PSD coordinate mapping), TextLayer (counter text)
  • composer.Compose merges all layers sorted by ZIndex; viewBox = max(bg width, text width) × (bg height + text height)
  • Seed-driven PRNG for deterministic per-request random rendering (every request picks a fresh frame/layer combo)
  • scale (controls background display size) and fsize (controls text font size) are now independent
  • Text positioning: x/y (pixels) or rx/ry (ratio 0–1); defaults to centered below the image
  • Theme registry loads f-theme JSON from embedded assets at startup

🔀 Unified Theme Model

Cards and characters are no longer separate concepts — they're all just themes with different layer stacks.

  • Merged character themes into assets/theme/<name>/ (previously separate directories)
  • Loader auto-dispatches single-layer (frames directly in dir) vs. multi-layer (ren.json + config.json + ren/*.webp) based on whether ren.json exists
  • Removed the mode/kind/seq parameters entirely — all themes now random-pick per request
  • Unified theme showcase gallery on the website (single gallery section, no more tabs)
  • Variant count exposed via GET /api/themes and shown as a badge on showcase cards (variations: N)
  • Z-order convention documented and enforced: ascending bottom-to-top; gen-character uses natural order (lass → eye → mouth → face)

🎭 New Character Themes

6 new character themes added, all generated via a parameterized multi-character pipeline:

  • furi
  • miyu
  • minato
  • yuzu
  • nanami
  • hinata (regenerated via the unified pipeline)

The old single-purpose gen-hinata script was replaced by a reusable gen-character generator.


⚡ Performance & Asset Optimization

  • All theme PNGs converted to WebP format (smaller payload, faster loads)
  • Added PNG/JPG → WebP conversion script (scripts/)
  • Removed unreachable arc-text and geometry helper dead code from imgcore
  • Removed unused ImageCarousel component and randomNum util from the frontend

🔐 Admin & Security

  • ADMIN_KEY config and admin auth middleware added
  • Server BodyLimit and timeouts increased to handle large editor payloads safely
  • Tests cover demo multi-frame caching and admin auth flows

🌐 Website & UX

  • Language switcher: pinned to top-right, scrolls with content, added to editor toolbar
  • About page: split into a separate page with a KUN-style auto-paging notice board
  • Navigation: anchor links now correctly navigate back to home from other pages
  • Theme showcase: dropdown polish, variant badge anchored to card corner
  • Replaced Google Fonts fetch with a local font stack (no external dependency, faster, privacy-friendly)

🧪 Testing

Significantly expanded test coverage:

  • imgcore/composer: integration tests for card scale, text, Z-order; f-theme registry loader tests
  • server: bridge helper unit tests, position Y-coordinate verification, demo multi-frame cache + admin auth
  • editor: end-to-end tests for card and character theme flows
  • gen-character: unit tests for pure generation functions

📚 Documentation

  • Multi-layer theme format and Z-order convention documented
  • Character theme JSON schemas documented
  • Theme export workflow and admin key auth design docs
  • Theme upload + review/voting design docs (for the future upload channel)
  • All stale references synced with the current codebase after the theme unification refactor

📦 Upgrade Notes

  • No database migration needed — tb_count schema is unchanged
  • New env var: ADMIN_KEY (optional — only needed if you use admin-protected endpoints)
  • Theme directory structure changed: character themes moved into assets/theme/<name>/. If you have custom themes outside the standard structure, regenerate them via gen-character or move them manually
  • All theme assets are now WebP; ensure your gen-themes-json.js / check-theme workflows are up to date
  • godotenv is now a direct dependency (was previously transitive)

Full changelog: compare [v0.2.10...v0.3.2](https://github.com/miaoledor/Lolicount/compare/v0.2.10...v0.3.2)

v0.2.10

Choose a tag to compare

@miaoledor miaoledor released this 25 Aug 10:40

v0.2.10

自 [v0.2.3](https://github.com/miaoledor/Lolicount/releases/tag/v0.2.3) 以来共 112 个 commit。

Highlights

  • 新增第二个角色立绘主题「ひなた (hinata)」
  • 重构渲染层为三层独立 drawer 架构(card / character / fdrawer)
  • 前端全面改版:导航栏、Playground 工具表、关于轮播、粉/灰主题、三语 i18n

New Features

角色立绘主题

  • ひなた (hinata) 角色主题:从 fgimage stand 数据导入,随机组装身体/眼睛/嘴/脸颊
  • cmd/gen-hinata 生成器:从 PSD 源自动生成 ren.json + config.json + webp 图层
  • config.json per-theme 配置:自定义画布尺寸和部件类别索引范围
  • display.json 渲染尺寸控制:size(等比缩放目标高度)+ crop(裁剪空白边距)
  • 前端 LoliCharacter 组件:直接请求后端 SVG,点击刷新换立绘
  • 前端角色主题选择器:下拉切换角色

渲染架构

  • 三层独立 drawer:cardthemedrawer(卡片底图)/ characterthemedrawer(立绘底图)/ fdrawer(文字层)
  • renderer 包合并三层输出,支持文字居中于完整画布宽度
  • imgcore 共享 Layer 契约和 Kind/Mode 类型

前端

  • 顶部导航栏(GitHub star 按钮、功能链接)
  • Playground 重新设计为萌系工具表样式
  • 关于区块(图片轮播)
  • 粉/灰主题色切换(默认灰,消除 SSG 首屏闪烁)
  • 三语 i18n(中文/英文/日文),分段式语言按钮
  • Open Graph / Twitter Card 元数据
  • Lolicount 图标(README / favicon / 页面标题)
  • 模式选择器(快速/精细/专家)
  • 计数器名称独立输入栏 + @name 实时预览

Bug Fixes

  • 修复 hinata 脸身不对齐(缩放图层导致坐标偏移)
  • 修复重复眼睛(PSD 无眉毛层,"目"被误归入 brow)
  • 修复 lian-ren 嘴巴变形(grid-padded webp 被 manifest 尺寸拉伸)
  • 修复立绘顶部大片空白(PSD canvas 空白未裁剪)
  • 修复 hinata 图片加载慢(PNG → webp,SVG 5MB → 500KB)
  • 修复渲染器文字未居中于完整画布宽度
  • 修复 imgcore 负帧索引和未排序角色列表
  • 修复 SSG 首屏主题闪烁
  • 修复主题目录名不允许大写字母
  • 修复 ParamPanel 硬编码颜色未跟随主题

Performance

  • hinata 图层 PNG → webp(q=80),磁盘 22.6MB → 1.6MB,SVG 5.0MB → ~500KB,加载 33ms → 2ms
  • 内置卡片主题 PNG 无损优化
  • 新增 PNG 无损优化脚本 scripts/optimize-images.mjs

Refactor

  • lian-ren 图层编号从 PSD 大数字改为 0-based 连续序列
  • 删除前端 web/public 下不再使用的立绘资源副本(176 个文件)
  • imgcore 包重构消除循环依赖,utils 移入子包
  • 服务端测试迁移至 renderer 包,删除旧 theme/ftheme 包
  • 清理死代码(logger.Fatal、cardthemedrawer ListWithKind/ThemeInfo)

Tests

  • 测试覆盖率达 88.5%
  • 新增角色主题回归测试:脸身对齐、display.json 尺寸/裁剪、webp 解码器注册
  • 新增渲染器文字居中回归测试
  • 新增服务端 backslash 转义覆盖测试

Full Changelog: v0.2.3...v0.2.10

v0.2.3

Choose a tag to compare

@github-actions github-actions released this 19 Aug 14:38

Full Changelog: v0.2.2...v0.2.3

v0.2.2

Choose a tag to compare

@github-actions github-actions released this 19 Aug 07:33

Full Changelog: v0.2.1...v0.2.2

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 19 Aug 06:46

Full Changelog: v0.2.0...v0.2.1

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 18 Aug 11:08

Full Changelog: v0.1.0...v0.2.0

Full Changelog: v0.1.0...v0.2.0

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 18 Aug 05:22