live2dapi-noa 1.0.6 → 1.0.8

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/index.html CHANGED
@@ -3,10 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <title>Live2D 看板娘 / Demo</title>
6
- <link
7
- rel="stylesheet"
8
- href="https://jsd.cdn.zzko.cn/gh/nova1751/live2d-api@latest/css/left.css"
9
- />
6
+ <link rel="stylesheet" href="./css/left.css" />
10
7
  <style>
11
8
  #github svg {
12
9
  transition: all 1s;
@@ -2,18 +2,18 @@
2
2
  // const live2d_path =
3
3
  // "https://fastly.jsdelivr.net/gh/nova1751/live2d-widget@latest/";
4
4
 
5
- const live2d_path = "https://jsd.cdn.zzko.cn/gh/nova1751/live2d-api@latest/";
5
+ const live2d_path = 'https://cdn.jsdelivr.net/gh/nova1751/live2d-api@latest/';
6
6
 
7
7
  // 封装异步加载资源的方法
8
8
  function loadExternalResource(url, type) {
9
9
  return new Promise((resolve, reject) => {
10
10
  let tag;
11
- if (type === "css") {
12
- tag = document.createElement("link");
13
- tag.rel = "stylesheet";
11
+ if (type === 'css') {
12
+ tag = document.createElement('link');
13
+ tag.rel = 'stylesheet';
14
14
  tag.href = url;
15
- } else if (type === "js") {
16
- tag = document.createElement("script");
15
+ } else if (type === 'js') {
16
+ tag = document.createElement('script');
17
17
  tag.src = url;
18
18
  }
19
19
  if (tag) {
@@ -27,24 +27,24 @@ function loadExternalResource(url, type) {
27
27
  // 加载 waifu.css live2d.min.js waifu-tips.js
28
28
  if (screen.width >= 768) {
29
29
  Promise.all([
30
- loadExternalResource(live2d_path + "live2d.min.js", "js"),
31
- loadExternalResource(live2d_path + "jsdelivr/random/waifu-tips.js", "js"),
30
+ loadExternalResource(live2d_path + 'live2d.min.js', 'js'),
31
+ loadExternalResource(live2d_path + 'jsdelivr/random/waifu-tips.js', 'js'),
32
32
  ]).then(() => {
33
33
  // 配置选项的具体用法见 README.md
34
34
  initWidget({
35
- waifuPath: live2d_path + "waifu-tips.json",
35
+ waifuPath: live2d_path + 'waifu-tips.json',
36
36
 
37
37
  // apiPath: "https://live2d.fghrsh.net/api/",
38
38
  cdnPath: live2d_path,
39
39
 
40
40
  tools: [
41
- "hitokoto",
42
- "asteroids",
43
- "switch-model",
44
- "switch-texture",
45
- "photo",
46
- "info",
47
- "quit",
41
+ 'hitokoto',
42
+ 'asteroids',
43
+ 'switch-model',
44
+ 'switch-texture',
45
+ 'photo',
46
+ 'info',
47
+ 'quit',
48
48
  ],
49
49
  });
50
50
  });
@@ -2,18 +2,18 @@
2
2
  // const live2d_path =
3
3
  // "https://fastly.jsdelivr.net/gh/nova1751/live2d-widget@latest/";
4
4
 
5
- const live2d_path = "https://jsd.cdn.zzko.cn/gh/nova1751/live2d-api@latest/";
5
+ const live2d_path = 'https://cdn.jsdelivr.net/gh/nova1751/live2d-api@latest/';
6
6
 
7
7
  // 封装异步加载资源的方法
8
8
  function loadExternalResource(url, type) {
9
9
  return new Promise((resolve, reject) => {
10
10
  let tag;
11
- if (type === "css") {
12
- tag = document.createElement("link");
13
- tag.rel = "stylesheet";
11
+ if (type === 'css') {
12
+ tag = document.createElement('link');
13
+ tag.rel = 'stylesheet';
14
14
  tag.href = url;
15
- } else if (type === "js") {
16
- tag = document.createElement("script");
15
+ } else if (type === 'js') {
16
+ tag = document.createElement('script');
17
17
  tag.src = url;
18
18
  }
19
19
  if (tag) {
@@ -27,27 +27,27 @@ function loadExternalResource(url, type) {
27
27
  // 加载 waifu.css live2d.min.js waifu-tips.js
28
28
  if (screen.width >= 768) {
29
29
  Promise.all([
30
- loadExternalResource(live2d_path + "live2d.min.js", "js"),
30
+ loadExternalResource(live2d_path + 'live2d.min.js', 'js'),
31
31
  loadExternalResource(
32
- live2d_path + "jsdelivr/sequential/waifu-tips.js",
33
- "js"
32
+ live2d_path + 'jsdelivr/sequential/waifu-tips.js',
33
+ 'js'
34
34
  ),
35
35
  ]).then(() => {
36
36
  // 配置选项的具体用法见 README.md
37
37
  initWidget({
38
- waifuPath: live2d_path + "waifu-tips.json",
38
+ waifuPath: live2d_path + 'waifu-tips.json',
39
39
 
40
40
  // apiPath: "https://live2d.fghrsh.net/api/",
41
41
  cdnPath: live2d_path,
42
42
 
43
43
  tools: [
44
- "hitokoto",
45
- "asteroids",
46
- "switch-model",
47
- "switch-texture",
48
- "photo",
49
- "info",
50
- "quit",
44
+ 'hitokoto',
45
+ 'asteroids',
46
+ 'switch-model',
47
+ 'switch-texture',
48
+ 'photo',
49
+ 'info',
50
+ 'quit',
51
51
  ],
52
52
  });
53
53
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "live2dapi-noa",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "nova1751自建的live-2d api",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -24,19 +24,19 @@
24
24
 
25
25
  ```html
26
26
  <!-- 顺序切换模型材质 -->
27
- <script src="https://jsd.cdn.zzko.cn/gh/nova1751/live2d-api@latest/jsdelivr/sequential/autoload.min.js"></script>
27
+ <script src="https://cdn.jsdelivr.net/gh/nova1751/live2d-api@latest/jsdelivr/sequential/autoload.min.js"></script>
28
28
  <!-- 随机切换模型材质 -->
29
- <script src="https://jsd.cdn.zzko.cn/gh/nova1751/live2d-api@latest/jsdelivr/random/autoload.min.js"></script>
29
+ <script src="https://cdn.jsdelivr.net/gh/nova1751/live2d-api@latest/jsdelivr/random/autoload.min.js"></script>
30
30
 
31
31
  <!-- 看板娘位置靠左 -->
32
32
  <link
33
33
  rel="stylesheet"
34
- href="https://jsd.cdn.zzko.cn/gh/nova1751/live2d-api@latest/css/left.min.css"
34
+ href="https://cdn.jsdelivr.net/gh/nova1751/live2d-api@latest/css/left.min.css"
35
35
  />
36
36
  <!-- 看板娘位置靠右 -->
37
37
  <link
38
38
  rel="stylesheet"
39
- href="https://jsd.cdn.zzko.cn/gh/nova1751/live2d-api@latest/css/right.min.css"
39
+ href="https://cdn.jsdelivr.net/gh/nova1751/live2d-api@latest/css/right.min.css"
40
40
  />
41
41
  ```
42
42