Skip to content

feat: 歌词作者显示 & 歌词图片分享 - #32

Merged
imsyy merged 6 commits into
devfrom
dev-lyric
Jun 10, 2026
Merged

imsyy merged 6 commits into
devfrom
dev-lyric

Conversation

@imsyy

@imsyy imsyy commented Jun 10, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 10, 2026 05:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

此 PR 为播放器歌词页新增「歌词制作作者」展示,并提供「复制歌词 / 导出歌词海报图片」的分享能力;同时增强歌词渲染引擎以支持对唱左右分栏、背景人声行置顶与底部信息行插槽承载(用于作者信息等)。

Changes:

  • 新增歌词作者提取工具,并在媒体 store 中维护 lyricAuthor,FullPlayer 歌词底部展示并支持跳转作者 GitHub。
  • 新增复制歌词弹窗(可选翻译/音译/空行/歌名/歌手),并支持导出 PNG 海报:渲染端生成 canvas → 主进程保存到下载目录。
  • 歌词渲染引擎新增 bottom-line 容器与布局能力;对唱行启用左右分栏样式,优化背景人声行与主行的上下顺序/布局。

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils/lyric/poster.ts 新增歌词海报 PNG 生成逻辑(封面解析、折行布局、绘制与导出 Blob)
src/utils/lyric/author.ts 新增从 TTML/LRC 原文提取歌词制作者信息的方法
src/stores/media.ts 新增 lyricAuthor 状态并在歌词切换时解析/重置
src/i18n/locales/zh-CN.json 增加“歌词制作 / 复制歌词 / 导出图片”等文案
src/i18n/locales/en-US.json 增加对应英文文案
src/components/player/Lyrics/renderer.css 新增对唱左右分栏样式与 credit 行样式
src/components/player/Lyrics/index.vue 新增 bottom slot,通过 Teleport 挂载到底部行容器
src/components/player/Lyrics/engine/interlude.ts 扩展间奏圆点状态(锚定行索引与偏移)
src/components/player/Lyrics/engine/index.ts 引擎新增 bottom-line 弹簧与渲染;对唱/背景人声布局优化;间奏圆点锚定跟随
src/components/player/FullPlayer/LyricActions.vue 新增“复制歌词”入口按钮与弹窗挂载
src/components/player/FullPlayer/index.vue 在歌词区域 bottom slot 展示作者 credit,并支持外链跳转
src/components/modals/CopyLyricsDialog.vue 新增复制/导出弹窗与导出流程(调用海报生成 + IPC 保存)
electron/preload/index.ts 新增 window.api.system.saveImage 暴露给渲染层
electron/preload/index.d.ts 为 saveImage 增加类型声明
electron/main/ipc/system.ts 新增 system:saveImage IPC:写入下载目录并处理重名
components.d.ts 组件与图标自动声明更新(CopyLyricsDialog / IconLucideCopy)

Comment on lines +80 to +93
// 保存图片到下载目录
ipcMain.handle("system:saveImage", async (_event, data: ArrayBuffer, fileName: string) => {
try {
const dir = app.getPath("downloads");
const dot = fileName.lastIndexOf(".");
const base = dot > 0 ? fileName.slice(0, dot) : fileName;
const ext = dot > 0 ? fileName.slice(dot) : "";
let target = join(dir, fileName);
for (let i = 2; existsSync(target); i++) {
target = join(dir, `${base} (${i})${ext}`);
}
await writeFile(target, Buffer.from(data));
return { success: true, path: target };
} catch (error) {
Comment on lines +71 to +75
const toggleLine = (index: number, checked: boolean): void => {
selectedLines.value = checked
? [...selectedLines.value, index]
: selectedLines.value.filter((item) => item !== index);
};
@imsyy
imsyy merged commit 3678c62 into dev Jun 10, 2026
6 checks passed
@imsyy
imsyy deleted the dev-lyric branch June 10, 2026 06:18
roarrabbit pushed a commit to roarrabbit/SPlayer-Next that referenced this pull request Aug 27, 2026
feat: 歌词作者显示 & 歌词图片分享
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants