@applemusic-like-lyrics/core

中文文档
0.6.0发布于 2026/09/20AGPL-3.0-onlyTypeScriptESM + CJS构建来源已验证近 30 天下载 7388

AMLL 的纯 JS 核心组件框架,包括歌词显示组件和背景组件等其它可以复用的组件

原始使用文档
文档目录6 节
  1. Features
  2. Installation
  3. Usage Summary
  4. Data Model
  5. Styling
  6. Development

AMLL Core

English / 简体中文

Warning: This is a personal project and is still under development. There may still be many issues, so please do not use it directly in production environments!

AMLL-Core npm npm

AMLL's pure JS core component framework, including lyric display components and background components and other reusable components.

Everything here is UI framework-independent, so it can be indirectly referenced under various dynamic page frameworks.

Or if you need to use component bindings, there's a React binding version and a Vue binding version

Features

  • Pure frontend rendering for lyrics and background
  • Word-level timed lyrics with translation and romanization
  • Multi-line, duet, and background line support
  • Style customization via CSS variables

Installation

Install the required dependencies (if the dependencies listed below are not installed, you need to install them yourself):

npm install @pixi/app @pixi/core @pixi/display @pixi/filter-blur @pixi/filter-bulge-pinch @pixi/filter-color-matrix @pixi/sprite # using npm
yarn add @pixi/app @pixi/core @pixi/display @pixi/filter-blur @pixi/filter-bulge-pinch @pixi/filter-color-matrix @pixi/sprite # using yarn

Install the framework:

npm install @applemusic-like-lyrics/core # using npm
yarn add @applemusic-like-lyrics/core # using yarn

Usage Summary

For detailed API documentation, please refer to AMLL Docs.

import { LyricPlayer } from "@applemusic-like-lyrics/core";
import "@applemusic-like-lyrics/core/style.css"; // Import required styles

const player = new LyricPlayer(); // Create a lyric player component
document.body.appendChild(player.getElement()); // Add the component's element to the page
player.setLyricLines([]) // Set lyrics
player.setCurrentTime(0) // Set current playback time (needs to be called every frame)
player.update(0) // Update lyric component animation (needs to be called every frame)

The lyrics set through LyricPlayer.setLyricLines is a LyricLine[] parameter. For details, please refer to the code in ./src/interfaces.ts.

Data Model

Lyrics input is LyricLine[], with each line containing:

  • words: timed word array, each word includes startTime / endTime / word, with optional romanWord, ruby, and obscene
  • translatedLyric: translation text
  • romanLyric: romanization text
  • startTime / endTime: line timestamps
  • isBG / isDuet: background and duet flags

Styling

The main styles are provided by @applemusic-like-lyrics/core/style.css. Common overrides are via CSS variables:

.amll-lyric-player {
  --amll-lp-color: #ffffff;
  --amll-lp-bg-color: rgba(0, 0, 0, 0.35);
}

Development

pnpm --filter @applemusic-like-lyrics/core dev
pnpm --filter @applemusic-like-lyrics/core build

版本与发布记录

@applemusic-like-lyrics/core 共发布 35 个版本,首次发布于 2023/07/24;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.6.0latest2026/09/201 个月前
0.5.22026/07/103 个月前
0.5.12026/05/185 个月前
0.5.02026/05/125 个月前
0.4.22026/05/016 个月前
0.4.12026/04/236 个月前

其他发布通道:next → 0.2.0-alpha.5。

关于 @applemusic-like-lyrics/core 的常见问题

@applemusic-like-lyrics/core 是什么?

AMLL 的纯 JS 核心组件框架,包括歌词显示组件和背景组件等其它可以复用的组件

如何安装 @applemusic-like-lyrics/core?

在项目目录运行 npm install @applemusic-like-lyrics/core,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@pixi/app(*)、@pixi/core(*)、@pixi/sprite(*)、@pixi/display(*)、@pixi/filter-blur(*)、@pixi/filter-bulge-pinch(*)、@pixi/filter-color-matrix(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@applemusic-like-lyrics/core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@applemusic-like-lyrics/core 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@applemusic-like-lyrics/core 可以商用吗?

@applemusic-like-lyrics/core 使用 AGPL-3.0-only 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@applemusic-like-lyrics/core 的下载量有多少?

根据 npm 官方下载统计,@applemusic-like-lyrics/core 在 2026/10/07 – 2026/11/05 这 30 天内被下载 7,388 次,日均约 246 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@applemusic-like-lyrics/core 还在维护吗?

最新版本 0.6.0 发布于 2026/09/20(1 个月前);至今共发布 35 个版本,其中过去 12 个月发布了 10 个;首次发布于 2023/07/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。