lyb-js 1.6.22 → 1.6.23

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.
@@ -1,4 +1,8 @@
1
1
  /** @description 用于游戏判断是否为横版状态
2
2
  * @param mode h-纯横版游戏 v-纯竖版
3
3
  */
4
- export declare const libJsHorizontal: (mode: string) => boolean;
4
+ export declare const libJsHorizontal: (mode: string) => {
5
+ isH: boolean;
6
+ w: number;
7
+ h: number;
8
+ };
@@ -2,14 +2,22 @@
2
2
  * @param mode h-纯横版游戏 v-纯竖版
3
3
  */
4
4
  export const libJsHorizontal = (mode) => {
5
- const w = window.innerWidth;
6
- const h = window.innerHeight;
5
+ let w = window.innerWidth;
6
+ let h = window.innerHeight;
7
7
  let isH = w > h;
8
8
  if (mode === "h") {
9
9
  isH = true;
10
+ w = 1920;
11
+ h = 1080;
10
12
  }
11
13
  else if (mode === "v") {
12
14
  isH = false;
15
+ w = 1080;
16
+ h = 1920;
13
17
  }
14
- return isH;
18
+ return {
19
+ isH,
20
+ w,
21
+ h,
22
+ };
15
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-js",
3
- "version": "1.6.22",
3
+ "version": "1.6.23",
4
4
  "description": "自用JS方法库",
5
5
  "license": "ISC",
6
6
  "type": "module",