|
1 | | -[![npm][npm]][npm-url] |
2 | | -[![deps][deps]][deps-url] |
3 | | -[![devdeps][devdeps]][devdeps-url] |
4 | | - |
5 | | -[![downloads][downloads]][downloads-url] |
6 | | -[![downloads-month][downloads-month]][downloads-month-url] |
7 | | - |
8 | | -[![GitHub stars][GitHub stars]][GitHub stars-url] |
9 | | -[![GitHub forks][GitHub forks]][GitHub forks-url] |
10 | | -[![GitHub issues][GitHub issues]][GitHub issues-url] |
11 | | - |
12 | | -[![Commitizen friendly][Commitizen friendly]][Commitizen friendly-url] |
13 | | -[![PRs Welcome][PRs Welcome]][PRs Welcome-url] |
14 | | -[![license][license]][license-url] |
15 | | - |
16 | | - |
17 | | - |
18 | | -# hexo-helper-live2d |
19 | | - |
20 | | -[English README](./README.md) by [@gwzz](https://github.com/gwzz) & [@xiazeyu](https://github.com/xiazeyu) |
21 | | - |
22 | | -<br> |
23 | | - |
24 | | -为你的hexo添加色气满满的live2d吧! |
25 | | - |
26 | | -崭新的示例和代码在线生成器: [https://eyhn.in/hexo-helper-live2d/](https://eyhn.in/hexo-helper-live2d/) |
27 | | - |
28 | | -作者的示例: [https://huaji8.top/post/live2d-plugin-2.0/](https://huaji8.top/post/live2d-plugin-2.0/) |
29 | | - |
30 | | - |
31 | | -## Installation 食用方法 |
32 | | - |
33 | | -### Hexo |
34 | | - |
35 | | -安装模块: |
36 | | - |
37 | | -``` |
38 | | -npm install --save hexo-helper-live2d |
39 | | -``` |
40 | | - |
41 | | -<details><summary>遇到npm的相关错误 ?</summary><br> |
42 | | - |
43 | | -> 试试 `npm cache verify` 或 `npm cache clean` 呗~ |
44 | | -
|
45 | | -</details> |
46 | | - |
47 | | -<details><summary>使用过旧版本 ?</summary><br> |
48 | | - |
49 | | -请删除在 `layout/layout.ejs` 或 `layout/_layout.swig` 文件内,位于 `</body>` 前的 `{{ live2d() }}` or `<%- live2d() %>` 。 |
50 | | - |
51 | | -</details> |
52 | | - |
53 | | -### Webpack |
54 | | - |
55 | | -<details><summary>当想要进行更高级的开发和使用时,请展开此节。</summary><br> |
56 | | - |
57 | | -安装模块: |
58 | | - |
59 | | -``` |
60 | | -npm install --save hexo-helper-live2d |
61 | | -``` |
62 | | - |
63 | | -导入模块: |
64 | | - |
65 | | -``` |
66 | | -import loadlive2d from 'hexo-helper-live2d'; |
67 | | -
|
68 | | -// TBD. |
69 | | -``` |
70 | | - |
71 | | -</details> |
72 | | - |
73 | | - |
74 | | -## Config 配置 |
75 | | - |
76 | | -在 hexo 的 `_config.yml` 中添加参数: |
77 | | - |
78 | | -示例: |
79 | | - |
80 | | -``` yml |
81 | | -live2d: |
82 | | - model: nipsilon |
83 | | -``` |
84 | | -
|
85 | | -
|
86 | | -## Settings 配置项 |
87 | | -
|
88 | | -``` yml |
89 | | -# Live2D |
90 | | -## https://github.com/EYHN/hexo-helper-live2d |
91 | | -live2d: |
92 | | - model: z16 # 模型名称 默认值: z16 |
93 | | - width: 150 # 宽度 默认值: 150 |
94 | | - height: 300 # 高度 默认值: 300 |
95 | | - scaling: 1 # 分辨率缩放倍率 默认值: 2 |
96 | | - opacityDefault: 0.7 # 初始的透明度 默认值: 0.7 |
97 | | - opacityHover: 1 # 鼠标悬浮时的透明度 默认值: 1 |
98 | | - mobileShow: true # 是否在移动设备上显示 默认值: true |
99 | | - mobileScaling: 0.5 # 移动设备缩放倍率 默认值: 0.5 |
100 | | - position: right # 模型左右侧放置位置 默认值: right |
101 | | - horizontalOffset: 0 # 元素的水平偏移 默认值: 0 |
102 | | - verticalOffset: -20 # 元素的底部偏移 默认值: -20 |
103 | | - id: live2dcanvas # 元素的id 默认值: live2dcanvas |
104 | | - deviceJsSource: local # current-device 脚本的来源 默认值: local |
105 | | -``` |
106 | | -
|
107 | | -|选项|默认值|可选值|描述| |
108 | | -|:-----|:-----------:|:------------:|:----------| |
109 | | -|model|`z16`|*部分字符串* 见下方|模型名称| |
110 | | -|width|`150`|*实数*|模型宽度| |
111 | | -|height|`300`|*实数*|模型高度| |
112 | | -|scaling|`2`|*实数 1 = 100%*|分辨率缩放倍率 越大马赛克效应越小 **目前存在BUG,详细参考#32 在BUG解决前,请将数值设置为1**| |
113 | | -|opacityDefault|`0.7`|*实数 0 - 1*|初始的透明度 *(Beta)*| |
114 | | -|opacityHover|`1`|*实数 0 - 1*|鼠标悬浮时透明度 *(Beta)*| |
115 | | -|mobileShow|`true`|*`true` / `false`*|是否在移动设备上显示| |
116 | | -|mobileScaling|`0.5`|*实数 1 = 100%*|移动设备缩放倍率| |
117 | | -|position|`right`|*`left` / `right`*|模型左右侧放置位置 `left` 左 或 `right` 右| |
118 | | -|horizontalOffset|`0`|*实数*|水平方向偏移<br>如果嫌模型位置不正确 可以调整这个参数| |
119 | | -|verticalOffset|`-20`|*实数*|竖直方向偏移<br>如果嫌模型位置不正确 可以调整这个参数| |
120 | | -|id|`live2dcanvas`|*string*|元素的id| |
121 | | -|deviceJsSource|`local`|*`local` / `official` / `string`*|current-device 脚本的来源<br>你可以选择以下三种方式:<br>`local`: **默认 推荐** 使用本地来源,已使用webpack压缩。<br>`official`: 使用官方来源。 [https://unpkg.com/current-device/umd/current-device.min.js](https://unpkg.com/current-device/umd/current-device.min.js)<br>`(your CDN url path)`: 输入你的CDN地址。尾部需要包含 `.js`。| |
122 | | - |
123 | | -<details><summary>当前支持的模型:</summary><br> |
124 | | - |
125 | | - - `chitose` |
126 | | - - `Epsilon2.1` |
127 | | - - `Gantzert_Felixander` |
128 | | - - `haru01` |
129 | | - - `haru02` |
130 | | - - `haruto` |
131 | | - - `hibiki` |
132 | | - - `hijiki` |
133 | | - - `izumi` |
134 | | - - `koharu` |
135 | | - - `miku` |
136 | | - - `nico` |
137 | | - - `ni-j` |
138 | | - - `nipsilon` |
139 | | - - `nito` |
140 | | - - `shizuku` |
141 | | - - `tororo` |
142 | | - - `tsumiki` |
143 | | - - `Unitychan` |
144 | | - - `wanko` |
145 | | - - `z16` |
146 | | - |
147 | | -</details> |
148 | | - |
149 | | -## Custom model 增加自己喜欢的模型 |
150 | | - |
151 | | -1. 在博客的根目录下新建 `live2d_models` 文件夹 |
152 | | - |
153 | | -2. 在此文件夹中以自定义模型的名称新建一个模型 |
154 | | - |
155 | | -3. 将你的模型复制到该文件夹下 |
156 | | - |
157 | | -**注意!模型json路径必须为 `/live2d_models/{name}/{name}.model.json`** |
158 | | - |
159 | | -<details><summary>示例:</summary><br> |
160 | | - |
161 | | -你的模型为 `mymiku` |
162 | | - |
163 | | -那么在 `/` 目录下(即博客的安装目录,该目录下应存在 `_config.yml` 、`sources` 、 `themes` 等内容) 新建名为 `mymiku` 的文件夹 |
164 | | - |
165 | | -将你的模型复制到 `/live2d_models/mymiku/` 下 |
166 | | - |
167 | | -此时在 `/live2d_models/mymiku/` 下应存在 `mymiku.model.json` 文件 |
168 | | - |
169 | | -</details> |
170 | | - |
171 | | -<br>~[(#22)](https://github.com/EYHN/hexo-helper-live2d/issues/22) 曾经和此问题有关。~ |
172 | | - |
173 | | -<br> |
174 | | - |
175 | | -Enjoy!:beer: |
176 | | - |
177 | | -> 我第一个hexo插件,点个star,点个watch吧,尽情地交pr吧。 |
178 | | - |
179 | | -Github: [https://github.com/EYHN/hexo-helper-live2d](https://github.com/EYHN/hexo-helper-live2d) |
180 | | - |
181 | | -issues: [https://github.com/EYHN/hexo-helper-live2d/issues](https://github.com/EYHN/hexo-helper-live2d/issues) |
182 | | - |
183 | | - |
184 | | -## Screenshots 截图 |
185 | | - |
186 | | -**注意!截图上方的名称可能非实际模型名,请进入“设置项”查看"model"的真实值** |
187 | | - |
188 | | -<details><summary>Epsilon2.1</summary><br> |
189 | | - |
190 | | - |
191 | | - |
192 | | -</details> |
193 | | -<details><summary>Gantzert_Felixander</summary><br> |
194 | | - |
195 | | - |
196 | | - |
197 | | -</details> |
198 | | -<details><summary>haru</summary><br> |
199 | | - |
200 | | - |
201 | | - |
202 | | -</details> |
203 | | -<details><summary>miku</summary><br> |
204 | | - |
205 | | - |
206 | | - |
207 | | -</details> |
208 | | -<details><summary>ni-j</summary><br> |
209 | | - |
210 | | - |
211 | | - |
212 | | -</details> |
213 | | -<details><summary>nico</summary><br> |
214 | | - |
215 | | - |
216 | | - |
217 | | -</details> |
218 | | -<details><summary>nietzche</summary><br> |
219 | | - |
220 | | - |
221 | | - |
222 | | -</details> |
223 | | -<details><summary>nipsilon</summary><br> |
224 | | - |
225 | | - |
226 | | - |
227 | | -</details> |
228 | | -<details><summary>nito</summary><br> |
229 | | - |
230 | | - |
231 | | - |
232 | | -</details> |
233 | | -<details><summary>shizuku</summary><br> |
234 | | - |
235 | | - |
236 | | - |
237 | | -</details> |
238 | | -<details><summary>tsumiki</summary><br> |
239 | | - |
240 | | - |
241 | | - |
242 | | -</details> |
243 | | -<details><summary>wanko</summary><br> |
244 | | - |
245 | | - |
246 | | - |
247 | | -</details> |
248 | | -<details><summary>z16</summary><br> |
249 | | - |
250 | | - |
251 | | - |
252 | | -</details> |
253 | | -<details><summary>hibiki</summary><br> |
254 | | - |
255 | | - |
256 | | - |
257 | | -</details> |
258 | | -<details><summary>koharu</summary><br> |
259 | | - |
260 | | - |
261 | | - |
262 | | -</details> |
263 | | -<details><summary>haruto</summary><br> |
264 | | - |
265 | | - |
266 | | - |
267 | | -</details> |
268 | | -<details><summary>Unitychan</summary><br> |
269 | | - |
270 | | - |
271 | | - |
272 | | -</details> |
273 | | -<details><summary>tororo</summary><br> |
274 | | - |
275 | | - |
276 | | - |
277 | | -</details> |
278 | | -<details><summary>hijiki</summary><br> |
279 | | - |
280 | | - |
281 | | - |
282 | | -</details> |
283 | | - |
284 | | -## Contribute 贡献 |
285 | | - |
286 | | -**如果你想提交代码或Issue,请务必仔细阅读** |
287 | | - |
288 | | -[CONTRIBUTING](./CONTRIBUTING.md) |
289 | | - |
290 | | -## Releated projects 相关项目 |
291 | | - |
292 | | -- [Cubism SDK WebGL 2.1](http://sites.cybernoids.jp/cubism-sdk2_e/webgl2-1) |
293 | | - |
294 | | -- [pixi-live2d](https://github.com/avgjs/pixi-live2d) |
295 | | - |
296 | | -- [CubismJsComponents](https://github.com/Live2D/CubismJsComponents) |
297 | | - |
298 | | - |
299 | | -## About me 关于我 |
300 | | - |
301 | | -[![Author][author]][author-url] |
302 | | - |
303 | | -[![QQ][qq]][qq-url] |
304 | | - |
305 | | -[![Email][email]][email-url] |
306 | | - |
307 | | - |
308 | | -## Imported 引入脚本 |
309 | | - |
310 | | -[![current-device][current-device]][current-device-url] |
311 | | - |
312 | | -<br> |
313 | | - |
314 | | -根据 GPL V2.0 许可证开源。 |
315 | | - |
316 | | -[npm]: https://badge.fury.io/js/hexo-helper-live2d.svg?label=hexo-helper-live2d |
317 | | -[npm-url]: https://www.npmjs.com/package/hexo-helper-live2d |
318 | | - |
319 | | -[deps]: https://img.shields.io/david/EYHN/hexo-helper-live2d.svg |
320 | | -[deps-url]: javascript:void(0); |
321 | | - |
322 | | -[devdeps]: https://img.shields.io/david/dev/EYHN/hexo-helper-live2d.svg |
323 | | -[devdeps-url]: javascript:void(0); |
324 | | - |
325 | | -[license]: https://img.shields.io/github/license/EYHN/hexo-helper-live2d.svg |
326 | | -[license-url]: https://github.com/EYHN/hexo-helper-live2d/blob/master/LICENSE |
327 | | - |
328 | | -[PRs Welcome]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square |
329 | | -[PRs Welcome-url]: http://makeapullrequest.com |
330 | | - |
331 | | -[downloads]: https://img.shields.io/npm/dt/hexo-helper-live2d.svg |
332 | | -[downloads-url]: https://www.npmjs.com/package/hexo-helper-live2d |
333 | | - |
334 | | -[downloads-month]: https://img.shields.io/npm/dm/hexo-helper-live2d.svg |
335 | | -[downloads-month-url]: https://www.npmjs.com/package/hexo-helper-live2d |
336 | | - |
337 | | -[Commitizen friendly]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg |
338 | | -[Commitizen friendly-url]: http://commitizen.github.io/cz-cli/ |
339 | | - |
340 | | -[GitHub stars]: https://img.shields.io/github/stars/EYHN/hexo-helper-live2d.svg |
341 | | -[GitHub stars-url]: https://github.com/EYHN/hexo-helper-live2d/stargazers |
342 | | - |
343 | | -[GitHub forks]: https://img.shields.io/github/forks/EYHN/hexo-helper-live2d.svg |
344 | | -[GitHub forks-url]: https://github.com/EYHN/hexo-helper-live2d/network |
345 | | - |
346 | | -[GitHub issues]: https://img.shields.io/github/issues/EYHN/hexo-helper-live2d.svg |
347 | | -[GitHub issues-url]: https://github.com/EYHN/hexo-helper-live2d/issues |
348 | | - |
349 | | -[author]: https://img.shields.io/badge/author-cneyhn-green.svg |
350 | | -[author-url]: https://delusion.coding.me/ |
351 | | - |
352 | | -[qq]: https://img.shields.io/badge/QQ-1106996185-blue.svg |
353 | | -[qq-url]: http://wpa.qq.com/msgrd?v=3&uin=&site=qq&menu=yes |
354 | | - |
355 | | -[email]: https://img.shields.io/badge/Emali%20me-cneyhn@gmail.com-green.svg |
356 | | -[email-url]: mailto:cneyhn@gmail.com |
357 | | - |
358 | | -[current-device]: https://img.shields.io/npm/v/current-device.svg?label=current-device |
359 | | -[current-device-url]: https://github.com/matthewhudson/current-device |
0 commit comments