{"id":23269026,"url":"https://github.com/lilgg/plugin-live2d","last_synced_at":"2025-04-04T13:06:08.562Z","repository":{"id":64924071,"uuid":"571447073","full_name":"LIlGG/plugin-live2d","owner":"LIlGG","description":"为你的网站领养一只可爱的看板娘吧！Live2d Plugin for Halo","archived":false,"fork":false,"pushed_at":"2025-03-01T03:05:57.000Z","size":6051,"stargazers_count":176,"open_issues_count":25,"forks_count":30,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T12:02:34.467Z","etag":null,"topics":["halo","halo-plugin","live2d","live2d-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LIlGG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-28T06:33:29.000Z","updated_at":"2025-03-22T14:26:01.000Z","dependencies_parsed_at":"2024-11-02T09:30:44.932Z","dependency_job_id":"18ae2587-fe3c-42cb-b535-74049cd48e72","html_url":"https://github.com/LIlGG/plugin-live2d","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":"halo-dev/plugin-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIlGG%2Fplugin-live2d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIlGG%2Fplugin-live2d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIlGG%2Fplugin-live2d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIlGG%2Fplugin-live2d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LIlGG","download_url":"https://codeload.github.com/LIlGG/plugin-live2d/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174458,"owners_count":20896078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["halo","halo-plugin","live2d","live2d-plugin"],"created_at":"2024-12-19T17:40:52.948Z","updated_at":"2025-04-04T13:06:08.543Z","avatar_url":"https://github.com/LIlGG.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eLive2d Plugin for Halo\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/halo-dev/halo\"\u003e\u003cimg alt=\"Halo version\" src=\"https://img.shields.io/badge/halo-2.4.0%2B-brightgreen?style=for-the-badge\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/LIlGG/halo-theme-sakura\"\u003e\u003cimg alt=\"Build Status\" src=\"https://img.shields.io/badge/build-positive-brightgreen?style=for-the-badge\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/prettier/prettier\"\u003e\u003cimg alt=\"Code Style: Prettier\" src=\"https://img.shields.io/badge/release-1.1.2-blue?style=for-the-badge\"\u003e\u003c/a\u003e\n  \u003ca href=\"./LICENSE\"\u003e\u003cimg alt=\"LICENSE MIT\" src=\"https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e 难道不想为您的网站添加一只萌萌的看板娘吗？？ (ノ≧∇≦)ノ |\n\n## 简介\n仅仅是一只可爱的看板娘哦！\n\n![](assert/live2d.jpg)\n\n**注：本仓库仅提供基础渲染框架，不包含任何 Live2d 模型及其接口**\n\n## 下载及使用说明\n1. 前往 [Github Release](https://github.com/LIlGG/plugin-live2d/releases/latest) 下载 jar 包\n2. 通过 Halo-2.x [安装插件](https://docs.halo.run/user-guide/plugins#%E5%AE%89%E8%A3%85%E6%8F%92%E4%BB%B6) 功能安装本插件\n3. 打开网站，即可在左下角看到萌萌哒的看板娘哦~\n\n## 功能介绍\n- [x] 一只萌萌的看板娘，为网站增添一份活力\n- [x] 基于 OpenAi 的对话交互功能【会思考的萌娘】\n- [x] 一键换装、换肤\n- [x] 支持一言功能\n- [x] 小飞机游戏（把坏人全都打跑！）\n- [x] 自定义看板娘接口\n- [x] 支持外部自定义 TIPS 文件，更适合你的网站\n\n## 自定义配置\n\u003e 此部分内容建议初步尝试过 Live2d 的用户观看。\n\n### 自定义 Live2d 接口\n若主题内置接口不满足用户使用，可以参考 [live2d_api](https://github.com/fghrsh/live2d_api) 自行开发接口。\n\n之后修改 `插件配置 -\u003e 基本设置 -\u003e Live2d 模型地址` 即可。\n\n### 自定义 TIPS 文件\n[TIPS文件](/src/main/resources/static/live2d-tips.json) 文件是一个 JSON 文件，其内容为 Live2d 消息框对用户各种事件的反馈。\n例如当用户鼠标点击网页中的某个链接时，Live2d 的消息框就会呈现出各种各样的文本。而这个绑定事件就是通过 TIPS 文件来处理的。\n\n因此可以说，**TIPS 文件与所用主题强绑定甚至需要用户高度自定义。**\n\n默认的 TIPS 保证了用户的基础使用，但如果想丰富 Live2d，那么就需要自定义 TIPS 文件。本插件提供了多种方式自定义 TIPS。\n\nTIPS 文件格式\n\n```json\n{\n  \"mouseover\": [                 // 鼠标移动事件\n    \"selector\": \"#live2d\",       // css 选择器\n    \"text\": []                   // Live2d 消息框显示内容。为数组则随机选择一条显示\n  ],\n  \"click\": [                     // 鼠标点击事件\n    \"selector\": \"#live2d\",       // css 选择器\n    \"text\": []                   // Live2d 消息框显示内容。为数组则随机选择一条显示\n  ],\n  \"seasons\": [                   // 日期事件，当前日期处于目标日期或目标区间内，则进行显示\n    \"date\": \"09/10\",             // 日期或日期区间。区间使用 - 区分\n    \"text\": []                   // Live2d 消息框显示内容。为数组则随机选择一条显示\n  ],\n  \"time\": [                      // 时间事件，到每日固定的时间则进行提示\n    \"hour\": \"6-7\",               // 时间，小时为单位，需要为区间，例如 6-7 代表 6 点到 7 点之间\n    \"text\": []                   // Live2d 消息框显示内容。为数组则随机选择一条显示\n  ],\n  \"message\": {                   // 固定消息，通常代表特定事件\n    \"default\": [],               // 页面空闲时显示的消息\n    \"console\": [],               // 打开控制台时显示的消息\n    \"copy\": [],                  // 复制内容时显示的消息\n    \"visibilitychange\": []       // 多标签页，从其他标签页返回当前标签页时显示的消息\n  }\n}\n```\n\n#### 1. 使用主题提供的 TIPS 文件（推荐）\n此功能属于为主题开发者定制。如果用户使用某款主题，但它并未支持此 TIPS 文件，不如向主题作者提交一个 ISSUE 吧！！！\n\n由于 Live2d 的 TIPS 通常需要使用 css 选择器来进行鼠标定位，因此将 TIPS 文件交由主题来适配是最好的方式。\n\n1. 主题开发者可以参考  [主题 TIPS 文件](/assert/live2d/tips.json) 文件来编写适配自己主题的 TIPS 文件。\n2. 将 json 文件命名为 `tips.json` 并放置在主题静态目录 `/assert/live2d/` 目录下\n\nlive2d 渲染页面时将自动读取当前启用主题下的文件。\n\n**注：主题所适配的 TIPS 只支持 mouseover 及 click 属性，主题提供的 TIPS 文件若与默认 TIPS 文件 css 选择器冲突，则以主题提供的为主**\n\n#### 2. 使用插件配置单独制定 TIPS\n当主题开发者未适配 Live2d 或者用户觉得其不太符合自己需求，那么可以使用插件内置的配置文件单独定制 TIPS 文件。\n\n使用 Halo 后台 `插件设置 -\u003e 事件及提示语绑定 -\u003e 选择器提示语` 添加自己想要的提示语。\n![](assert/img2.png)\n\n**注：插件设置的 css 选择器与主题或默认的 TIPS 文件冲突时，将以插件设置的为准**\n\n#### 3. 全量自定义 TIPS 文件\n当用户想完全自定义 TIPS 文件或者上述两种方式不满足用户的需求，例如想更改 `seasons, time, message` 属性时，可以采用此种方式。\n\n1. 用户可以参照 [默认 TIPS 文件](/src/main/resources/static/live2d-tips.json) 或者按照 [自定义TIPS文件](#自定义-tips-文件) 中的 TIPS 文件格式来编写 TIPS 文件。\n2. 使用 Halo 后台 `插件设置 -\u003e 事件及提示语绑定 -\u003e 自定义提示语文件`，更改对应的文件即可。\n\n\u003e 小提示: 可以将文件上传到 Halo 附件内，再进行选择！\n\n![img.png](assert/img.png)\n\n**需要特别注意的是，一旦用户指定了此 TIPS 文件，那么默认的 TIPS 文件将不再生效（除非当前文件加载失败，此时会回退使用默认的 TIPS 文件），因此建议自定义时将属性设置完整**\n\n## 鸣谢\n- 本插件代码借鉴了 [live2d-widget](https://github.com/stevenjoezhang/live2d-widget) 的理念及代码并完全重写 JS\n- 使用了 [hitokoto](https://hitokoto.cn/) 的一言接口\n- 默认使用了 [ZSQIM](https://zsq.im/) 的 live2d 接口\n- 纸飞机小游戏源自于 [WebsiteAsteroids](http://www.websiteasteroids.com/)\n- Live2d 官方地址 [https://live2d.github.io](https://live2d.github.io)\n\n## 赞助\n\u003e 如果您喜欢我的插件，可以考虑资助一下~ 您的支持将是我继续进行开源的动力。\n\n| \u003cimg src=\"https://cdn.lixingyong.com/img/other/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210114094011.jpg\" width=\"160px;\"/\u003e\u003cbr /\u003e\u003cb\u003e微信\u003c/b\u003e\u003cbr /\u003e | \u003cimg src=\"https://v-lxy-cdn.oss-cn-beijing.aliyuncs.com/img/other/%E6%94%AF%E4%BB%98%E5%AE%9D.png\" width=\"160px;\"/\u003e\u003cbr /\u003e\u003cb\u003e支付宝\u003c/b\u003e\u003cbr /\u003e  | \n| :---: | :---: |\n\n欢迎其他各种形式的捐助！\n\n## 许可证\n**plugin-live2d** © [LIlGG](https://github.com/LIlGG)，基于 [MIT](./LICENSE) 许可证发行。\u003cbr\u003e\n\n本仓库所使用的接口等版权均属原作者，仅供研究学习，不得用于商业用途，请善待接口。\n\n作者及其贡献者共有版权 （[帮助维护列表](https://github.com/LIlGG/plugin-live2d/graphs/contributors) ）\n\u003e [lixingyong.com](https://lixingyong.com) · GitHub [@LIlGG](https://github.com/LIlGG)\n\n## 希望你喜欢！\n\n![Alt](https://repobeats.axiom.co/api/embed/1a0fed4cb4d4d2ea076c3481473cdbf9bc0471d6.svg \"Repobeats analytics image\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilgg%2Fplugin-live2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flilgg%2Fplugin-live2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilgg%2Fplugin-live2d/lists"}