rspress-plugin-live2d 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/README.zh-CN.md +41 -0
- package/components/Live2DWidget.tsx +4 -3
- package/dist/index.d.ts +1 -1
- package/package.json +4 -4
- package/components/Live2DWidget.d.ts +0 -4
- package/components/Live2DWidget.jsx +0 -9
package/README.md
CHANGED
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# rspress-plugin-live2d 
|
|
2
|
+
|
|
3
|
+
Rspress 的看板娘插件, 基于 [on-my-live2d](https://oml2d.com/).
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## 使用
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install rspress-plugin-live2d
|
|
11
|
+
pnpm install rspress-plugin-live2d
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import * as path from 'path';
|
|
16
|
+
import { defineConfig } from 'rspress/config';
|
|
17
|
+
import live2d from 'rspress-plugin-live2d';
|
|
18
|
+
|
|
19
|
+
export default defineConfig({
|
|
20
|
+
root: path.join(__dirname, 'docs'),
|
|
21
|
+
title: 'Rspress x Live2d Example',
|
|
22
|
+
plugins: [
|
|
23
|
+
live2d({
|
|
24
|
+
models: [
|
|
25
|
+
{
|
|
26
|
+
path: 'https://model.oml2d.com/HK416-1-normal/model.json',
|
|
27
|
+
position: [0, 60],
|
|
28
|
+
scale: 0.08,
|
|
29
|
+
stageStyle: {
|
|
30
|
+
height: 450,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 配置
|
|
40
|
+
|
|
41
|
+
参考 [On My Live2D](https://oml2d.com/guide/models.html) 来查找更多模型和配置。
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
import { loadOml2d } from 'oh-my-live2d';
|
|
4
|
-
|
|
5
3
|
import type { Live2DWidgetProps } from '../src/typings';
|
|
6
4
|
|
|
7
5
|
const Live2DWidget: React.FC<Live2DWidgetProps> = (options) => {
|
|
8
6
|
useEffect(() => {
|
|
9
|
-
|
|
7
|
+
import('oh-my-live2d').then(({ loadOml2d }) => {
|
|
8
|
+
console.log(1111111);
|
|
9
|
+
loadOml2d(options);
|
|
10
|
+
});
|
|
10
11
|
}, []);
|
|
11
12
|
|
|
12
13
|
return null;
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rspress-plugin-live2d",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Rspress plugin with live 2d.",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"files": [
|
|
6
7
|
"dist",
|
|
7
8
|
"components"
|
|
@@ -27,9 +28,8 @@
|
|
|
27
28
|
"access": "public"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"@rspress/shared": "^1.17.1",
|
|
31
31
|
"oh-my-live2d": "^0.15.2",
|
|
32
|
-
"rspress-plugin-devkit": "^0.
|
|
32
|
+
"rspress-plugin-devkit": "^1.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "^20.12.5",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typescript": "^5.4.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"rspress": "
|
|
40
|
+
"@rspress/core": "^2.0.0-rc.4 || ^2.0.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsc --declarationMap false",
|