mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-04-16 12:52:41 +08:00
Compare commits
45 Commits
329c2f09c4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f12a147093 | ||
|
|
59a10587a7 | ||
|
|
dd5a003801 | ||
|
|
ddc87ebf40 | ||
|
|
23bcae0b74 | ||
|
|
e075dfc23d | ||
|
|
9088ab0eb1 | ||
|
|
39388c6eaf | ||
|
|
0ce9b0ed02 | ||
|
|
aee4fcf164 | ||
|
|
5c0fe56915 | ||
|
|
b82da6c9a7 | ||
|
|
b1ffae9eaf | ||
|
|
fee986432d | ||
|
|
25fc74398a | ||
|
|
35c5fe36fb | ||
|
|
3f58e3deae | ||
|
|
788c864e71 | ||
|
|
680a4f8a5a | ||
|
|
8f46e286dd | ||
|
|
2eaf7a1ba2 | ||
|
|
6b58fa99cf | ||
|
|
5d1b623230 | ||
|
|
6e442c14c1 | ||
|
|
2eadb6fb23 | ||
|
|
d19afd7b1a | ||
|
|
98eda94f66 | ||
|
|
e0f5cb71c5 | ||
|
|
58140fd4d2 | ||
|
|
b44e0e65a5 | ||
|
|
cc460d6108 | ||
|
|
1dd1927612 | ||
|
|
21d4c9d568 | ||
|
|
35eac7d19d | ||
|
|
c1ed14385a | ||
|
|
50ad3d35e7 | ||
|
|
4df53d9f58 | ||
|
|
8a6f50dda6 | ||
|
|
49488505e2 | ||
|
|
dd64e8f44e | ||
|
|
b39772fd94 | ||
|
|
fc1135a621 | ||
|
|
d7ea91a1b8 | ||
|
|
53a8729968 | ||
|
|
ad93703a45 |
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "" # See documentation for possible values
|
||||||
|
directory: "/" # Location of package manifests
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
29
.github/workflows/deploy.yml
vendored
Normal file
29
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Build and Deploy
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout 🛎️
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 10
|
||||||
|
|
||||||
|
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
|
||||||
|
run: |
|
||||||
|
pnpm install
|
||||||
|
pnpm xlsx2json
|
||||||
|
pnpm build
|
||||||
|
|
||||||
|
- name: Deploy 🚀
|
||||||
|
uses: JamesIves/github-pages-deploy-action@v4
|
||||||
|
with:
|
||||||
|
folder: template # The folder the action should deploy.
|
||||||
31
.github/workflows/node.js.yml
vendored
31
.github/workflows/node.js.yml
vendored
@@ -1,31 +0,0 @@
|
|||||||
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
||||||
|
|
||||||
name: Node.js CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [14.x, 16.x]
|
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm install
|
|
||||||
- run: npm run build --if-present
|
|
||||||
- run: npm test
|
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -107,4 +107,7 @@ utils/xlsxTransform-*
|
|||||||
|
|
||||||
/.idea
|
/.idea
|
||||||
|
|
||||||
__localStorage.json
|
__localStorage.json
|
||||||
|
|
||||||
|
template/public
|
||||||
|
public/data
|
||||||
29
.vscode/launch.json
vendored
29
.vscode/launch.json
vendored
@@ -4,40 +4,15 @@
|
|||||||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
|
||||||
"name": "Launch Chrome",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "pwa-chrome",
|
|
||||||
"url": "http://127.0.0.1:8000/public/index.html",
|
|
||||||
"webRoot": "${workspaceFolder}"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "test",
|
"name": "test",
|
||||||
"program": "${workspaceFolder}/test",
|
"program": "${workspaceFolder}/test",
|
||||||
"skipFiles": [
|
"skipFiles": [
|
||||||
"<node_internals>/**"
|
"<node_internals>/**",
|
||||||
|
"**/node_modumes/**"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "node",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "xlsx2json",
|
|
||||||
"program": "${workspaceFolder}/node_modules/v-transform/src/index.js",
|
|
||||||
"args": ["transform", "jobs/xlsx2json/config.json"],
|
|
||||||
"skipFiles": [
|
|
||||||
"<node_internals>/**"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Attach by Process ID",
|
|
||||||
"processId": "${command:PickProcess}",
|
|
||||||
"request": "attach",
|
|
||||||
"skipFiles": [
|
|
||||||
"<node_internals>/**"
|
|
||||||
],
|
|
||||||
"type": "node"
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"cSpell.words": [
|
|
||||||
"Laya"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -14,38 +14,22 @@
|
|||||||
<summary><strong>网页版</strong></summary>
|
<summary><strong>网页版</strong></summary>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
1. 下载项目代码。
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# 1. 下载项目代码
|
||||||
git clone https://github.com/VickScarlet/lifeRestart.git my-project
|
git clone https://github.com/VickScarlet/lifeRestart.git my-project
|
||||||
|
|
||||||
|
# 2. 进入目录安装依赖
|
||||||
cd my-project
|
cd my-project
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
# 3. 转换XLSX表
|
||||||
|
pnpm xlsx2json
|
||||||
|
|
||||||
|
# 4. 启动本地开发服务器
|
||||||
|
pnpm dev
|
||||||
```
|
```
|
||||||
|
|
||||||
2. 进入目录安装依赖。
|
启动完成后打开浏览器访问 [http://localhost:5173](http://localhost:5173)。
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
或者
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
3. 启动本地服务器。
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn dev
|
|
||||||
```
|
|
||||||
|
|
||||||
或者
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
4. 启动完成后会自动打开浏览器访问 [http://localhost:8081/view/index.html](http://localhost:8081/view/index.html)。
|
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|||||||
37
README.md
37
README.md
@@ -14,38 +14,23 @@ English | [简体中文](./README-zh_CN.md)
|
|||||||
<summary><strong>Web Version</strong></summary>
|
<summary><strong>Web Version</strong></summary>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
1. Clone project code.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# 1. Clone project code.
|
||||||
git clone git@github.com:VickScarlet/lifeRestart.git my-project
|
git clone git@github.com:VickScarlet/lifeRestart.git my-project
|
||||||
cd my-project
|
cd my-project
|
||||||
|
|
||||||
|
# 2. Installation dependence.
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
# 3. Transform XLSX
|
||||||
|
pnpm xlsx2json
|
||||||
|
|
||||||
|
# 4. Start local dev server.
|
||||||
|
pnpm dev
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Installation dependence.
|
After the startup is complete, open a browser and visit [http://localhost:5173](http://localhost:5173).
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
Or
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Start local server.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Or
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
4. After the startup is complete, will automatically open a browser and visit [http://localhost:8081/view/index.html](http://localhost:8081/view/index.html).
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,12 +15,22 @@
|
|||||||
<meta name="laya" screenorientation ="landscape"/>
|
<meta name="laya" screenorientation ="landscape"/>
|
||||||
<meta http-equiv="expires" content="0"/>
|
<meta http-equiv="expires" content="0"/>
|
||||||
<meta http-equiv="Cache-Control" content="no-siteapp"/>
|
<meta http-equiv="Cache-Control" content="no-siteapp"/>
|
||||||
|
<font-face font-family="方正像素12" src="fonts/方正像素12.ttf"/>
|
||||||
<title>Life Restart</title>
|
<title>Life Restart</title>
|
||||||
|
<!--
|
||||||
|
<script type="text/javascript" src="libs/laya/laya.core.js"></script>
|
||||||
|
<script type="text/javascript" src="libs/laya/laya.webgl.js"></script>
|
||||||
|
<script type="text/javascript" src="libs/laya/laya.filter.js"></script>
|
||||||
|
<script type="text/javascript" src="libs/laya/laya.html.js"></script>
|
||||||
|
<script type="text/javascript" src="libs/laya/laya.particle.js"></script>
|
||||||
|
<script type="text/javascript" src="libs/laya/laya.ui.js"></script>
|
||||||
|
-->
|
||||||
<script type="text/javascript" src="libs/laya/min/laya.core.min.js"></script>
|
<script type="text/javascript" src="libs/laya/min/laya.core.min.js"></script>
|
||||||
<script type="text/javascript" src="libs/laya/min/laya.webgl.min.js"></script>
|
<script type="text/javascript" src="libs/laya/min/laya.webgl.min.js"></script>
|
||||||
<script type="text/javascript" src="libs/laya/min/laya.filter.min.js"></script>
|
<script type="text/javascript" src="libs/laya/min/laya.filter.min.js"></script>
|
||||||
<script type="text/javascript" src="libs/laya/min/laya.particle.min.js"></script>
|
<script type="text/javascript" src="libs/laya/min/laya.particle.min.js"></script>
|
||||||
<script type="text/javascript" src="libs/laya/min/laya.ui.min.js"></script>
|
<script type="text/javascript" src="libs/laya/min/laya.ui.min.js"></script>
|
||||||
|
<script type="module" src="src/index.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body style="background:black"></body>
|
<body style="background:black"></body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"source": [
|
|
||||||
"../../data/specialthanks-afd.xlsx",
|
|
||||||
"../../data/specialthanks-dun.xlsx"
|
|
||||||
],
|
|
||||||
"target": "../../public/data"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "../../data/zh-cn",
|
|
||||||
"target": "../../public/data/zh-cn"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "../../data/en-us",
|
|
||||||
"target": "../../public/data/en-us"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
{
|
{
|
||||||
// See http://go.microsoft.com/fwlink/?LinkId=759670
|
// See http://go.microsoft.com/fwlink/?LinkId=759670
|
||||||
// for the documentation about the jsconfig.json format
|
// for the documentation about the jsconfig.json format
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5"
|
"module": "esnext",
|
||||||
},
|
"target": "es6",
|
||||||
"exclude": [
|
},
|
||||||
"node_modules",
|
"include":["src", "repl", "vite.config.js"],
|
||||||
"public",
|
"exclude": ["node_modules", "public", "view"]
|
||||||
"view"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"x":0,
|
"x":0,
|
||||||
"type":"View",
|
"type":"View",
|
||||||
"selectedBox":1,
|
"selectedBox":93,
|
||||||
"selecteID":12,
|
"selecteID":94,
|
||||||
"props":{"y":1218,"x":562,"width":1125,"sceneColor":"#000000","sceneBg":"laya/views/view/CyberTheme/CyberMain.png","runtime":"Laya.runtime.ViewBase","height":2436,"anchorY":0.5,"anchorX":0.5},
|
"props":{"y":1218,"x":562,"width":1125,"sceneColor":"#000000","sceneBg":"laya/views/view/CyberTheme/CyberMain.png","runtime":"Laya.runtime.ViewBase","height":2436,"anchorY":0.5,"anchorX":0.5},
|
||||||
"nodeParent":-1,
|
"nodeParent":-1,
|
||||||
"label":"View",
|
"label":"View",
|
||||||
@@ -548,14 +548,13 @@
|
|||||||
"props":{"width":1,"left":0,"height":1,"bottom":0},
|
"props":{"width":1,"left":0,"height":1,"bottom":0},
|
||||||
"nodeParent":1,
|
"nodeParent":1,
|
||||||
"label":"Box",
|
"label":"Box",
|
||||||
"isOpen":true,
|
"isOpen":false,
|
||||||
"isDirectory":true,
|
"isDirectory":true,
|
||||||
"isAniNode":true,
|
"isAniNode":true,
|
||||||
"hasChild":true,
|
"hasChild":true,
|
||||||
"compId":85,
|
"compId":85,
|
||||||
"child":[
|
"child":[
|
||||||
{
|
{
|
||||||
"x":30,
|
|
||||||
"type":"Box",
|
"type":"Box",
|
||||||
"props":{"y":-175,"x":100,"width":160,"var":"btnGithub","runtime":"Laya.runtime.ScaleButton","name":"btnGithub","height":160,"anchorY":0.5,"anchorX":0.5},
|
"props":{"y":-175,"x":100,"width":160,"var":"btnGithub","runtime":"Laya.runtime.ScaleButton","name":"btnGithub","height":160,"anchorY":0.5,"anchorX":0.5},
|
||||||
"nodeParent":85,
|
"nodeParent":85,
|
||||||
@@ -580,7 +579,6 @@
|
|||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"x":30,
|
|
||||||
"type":"Box",
|
"type":"Box",
|
||||||
"props":{"y":-355,"x":100,"width":160,"var":"btnDiscord","runtime":"Laya.runtime.ScaleButton","name":"btnDiscord","height":160,"anchorY":0.5,"anchorX":0.5},
|
"props":{"y":-355,"x":100,"width":160,"var":"btnDiscord","runtime":"Laya.runtime.ScaleButton","name":"btnDiscord","height":160,"anchorY":0.5,"anchorX":0.5},
|
||||||
"nodeParent":85,
|
"nodeParent":85,
|
||||||
@@ -611,14 +609,13 @@
|
|||||||
"props":{"right":0,"bottom":0},
|
"props":{"right":0,"bottom":0},
|
||||||
"nodeParent":1,
|
"nodeParent":1,
|
||||||
"label":"Box",
|
"label":"Box",
|
||||||
"isOpen":true,
|
"isOpen":false,
|
||||||
"isDirectory":true,
|
"isDirectory":true,
|
||||||
"isAniNode":true,
|
"isAniNode":true,
|
||||||
"hasChild":true,
|
"hasChild":true,
|
||||||
"compId":88,
|
"compId":88,
|
||||||
"child":[
|
"child":[
|
||||||
{
|
{
|
||||||
"x":30,
|
|
||||||
"type":"Box",
|
"type":"Box",
|
||||||
"props":{"y":-300,"x":-100,"width":110,"runtime":"Laya.runtime.ScaleButton","height":110,"anchorY":0.5,"anchorX":0.5},
|
"props":{"y":-300,"x":-100,"width":110,"runtime":"Laya.runtime.ScaleButton","height":110,"anchorY":0.5,"anchorX":0.5},
|
||||||
"nodeParent":88,
|
"nodeParent":88,
|
||||||
@@ -630,7 +627,6 @@
|
|||||||
"compId":90,
|
"compId":90,
|
||||||
"child":[
|
"child":[
|
||||||
{
|
{
|
||||||
"x":45,
|
|
||||||
"type":"Box",
|
"type":"Box",
|
||||||
"props":{"width":110,"var":"btnSaveLoad","runtime":"Laya.runtime.ColorfulBox","name":"btnSmall","height":110,"centerY":0,"centerX":0,"anchorY":0.5,"anchorX":0.5},
|
"props":{"width":110,"var":"btnSaveLoad","runtime":"Laya.runtime.ColorfulBox","name":"btnSmall","height":110,"centerY":0,"centerX":0,"anchorY":0.5,"anchorX":0.5},
|
||||||
"nodeParent":90,
|
"nodeParent":90,
|
||||||
@@ -642,7 +638,6 @@
|
|||||||
"compId":91,
|
"compId":91,
|
||||||
"child":[
|
"child":[
|
||||||
{
|
{
|
||||||
"x":60,
|
|
||||||
"type":"Image",
|
"type":"Image",
|
||||||
"props":{"width":80,"skin":"images/icons/icon_save.png","height":80,"centerY":0,"centerX":0},
|
"props":{"width":80,"skin":"images/icons/icon_save.png","height":80,"centerY":0,"centerX":0},
|
||||||
"nodeParent":91,
|
"nodeParent":91,
|
||||||
@@ -657,7 +652,6 @@
|
|||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"x":30,
|
|
||||||
"type":"Box",
|
"type":"Box",
|
||||||
"props":{"y":-175,"x":-100,"width":110,"runtime":"Laya.runtime.ScaleButton","height":110,"anchorY":0.5,"anchorX":0.5},
|
"props":{"y":-175,"x":-100,"width":110,"runtime":"Laya.runtime.ScaleButton","height":110,"anchorY":0.5,"anchorX":0.5},
|
||||||
"nodeParent":88,
|
"nodeParent":88,
|
||||||
@@ -669,7 +663,6 @@
|
|||||||
"compId":89,
|
"compId":89,
|
||||||
"child":[
|
"child":[
|
||||||
{
|
{
|
||||||
"x":45,
|
|
||||||
"type":"Box",
|
"type":"Box",
|
||||||
"props":{"width":110,"var":"btnThemes","runtime":"Laya.runtime.ColorfulBox","name":"btnThemes","height":110,"centerY":0,"centerX":0,"anchorY":0.5,"anchorX":0.5},
|
"props":{"width":110,"var":"btnThemes","runtime":"Laya.runtime.ColorfulBox","name":"btnThemes","height":110,"centerY":0,"centerX":0,"anchorY":0.5,"anchorX":0.5},
|
||||||
"nodeParent":89,
|
"nodeParent":89,
|
||||||
@@ -694,6 +687,32 @@
|
|||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x":15,
|
||||||
|
"type":"Box",
|
||||||
|
"props":{"x":572,"var":"banner","centerX":0,"bottom":100,"anchorY":1,"anchorX":0.5},
|
||||||
|
"nodeParent":1,
|
||||||
|
"label":"Box(banner)",
|
||||||
|
"isOpen":true,
|
||||||
|
"isDirectory":true,
|
||||||
|
"isAniNode":true,
|
||||||
|
"hasChild":true,
|
||||||
|
"compId":93,
|
||||||
|
"child":[
|
||||||
|
{
|
||||||
|
"x":30,
|
||||||
|
"type":"Label",
|
||||||
|
"props":{"text":"UI_Banner","fontSize":40,"font":"方正像素12","color":"#00fffd"},
|
||||||
|
"nodeParent":93,
|
||||||
|
"label":"Label",
|
||||||
|
"isDirectory":false,
|
||||||
|
"isAniNode":true,
|
||||||
|
"hasChild":false,
|
||||||
|
"compId":94,
|
||||||
|
"child":[
|
||||||
|
]
|
||||||
|
}]
|
||||||
}],
|
}],
|
||||||
"animations":[
|
"animations":[
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"x":0,
|
"x":0,
|
||||||
"type":"View",
|
"type":"View",
|
||||||
"selectedBox":99,
|
"selectedBox":101,
|
||||||
"selecteID":100,
|
"selecteID":102,
|
||||||
"props":{"y":1218,"x":562,"width":1125,"sceneColor":"#000000","runtime":"Laya.runtime.ViewBase","height":2436,"anchorY":0.5,"anchorX":0.5},
|
"props":{"y":1218,"x":562,"width":1125,"sceneColor":"#000000","runtime":"Laya.runtime.ViewBase","height":2436,"anchorY":0.5,"anchorX":0.5},
|
||||||
"nodeParent":-1,
|
"nodeParent":-1,
|
||||||
"label":"View",
|
"label":"View",
|
||||||
@@ -276,6 +276,32 @@
|
|||||||
"child":[
|
"child":[
|
||||||
]
|
]
|
||||||
}]
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x":15,
|
||||||
|
"type":"Box",
|
||||||
|
"props":{"x":562,"var":"banner","centerX":0,"bottom":100,"anchorY":1,"anchorX":0.5},
|
||||||
|
"nodeParent":1,
|
||||||
|
"label":"Box(banner)",
|
||||||
|
"isOpen":true,
|
||||||
|
"isDirectory":true,
|
||||||
|
"isAniNode":true,
|
||||||
|
"hasChild":true,
|
||||||
|
"compId":101,
|
||||||
|
"child":[
|
||||||
|
{
|
||||||
|
"x":30,
|
||||||
|
"type":"Label",
|
||||||
|
"props":{"text":"UI_Banner","name":"title","fontSize":40,"font":"SimHei","color":"#ffffff"},
|
||||||
|
"nodeParent":101,
|
||||||
|
"label":"Label(title)",
|
||||||
|
"isDirectory":false,
|
||||||
|
"isAniNode":true,
|
||||||
|
"hasChild":false,
|
||||||
|
"compId":102,
|
||||||
|
"child":[
|
||||||
|
]
|
||||||
|
}]
|
||||||
}],
|
}],
|
||||||
"animations":[
|
"animations":[
|
||||||
{
|
{
|
||||||
|
|||||||
27
package.json
27
package.json
@@ -1,24 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "life_restart",
|
"name": "life_restart",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": "repl/index.js",
|
"main": "repl/index.js",
|
||||||
"version": "2.0.0",
|
"version": "2.1.0",
|
||||||
|
"author": "Vick Scarlet <vick@syaro.io>",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node test",
|
"xlsx2json": "vt transform -d public \"data/**/*.xlsx\"",
|
||||||
"xlsxTransform": "vt transform data",
|
"dev": "vite",
|
||||||
"xlsx2json": "vt transform jobs/xlsx2json/config.json",
|
"build": "vite build",
|
||||||
"dev": "webpack serve --open /view/index.html",
|
"start": "vite preview",
|
||||||
"build": "webpack --mode production"
|
"test": "vitest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.15.4",
|
"v-transform": "^2.2.1",
|
||||||
"@babel/preset-env": "^7.15.4",
|
"vite": "^8.0.3",
|
||||||
"babel-loader": "^8.2.2",
|
"vitest": "^4.1.2"
|
||||||
"core-js": "^3.17.2",
|
|
||||||
"html-webpack-plugin": "^5.5.0",
|
|
||||||
"v-transform": "^1.0.2",
|
|
||||||
"webpack": "^5.64.4",
|
|
||||||
"webpack-cli": "^4.8.0",
|
|
||||||
"webpack-dev-server": "^4.1.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1111
pnpm-lock.yaml
generated
Normal file
1111
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,74 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
|
|
||||||
<meta name="description" content="やり直すんだ。そして、次はうまくやる。"/>
|
|
||||||
<meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/>
|
|
||||||
<meta name="renderer" content="webkit"/>
|
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
|
||||||
<meta name="full-screen" content="true"/>
|
|
||||||
<meta name="x5-fullscreen" content="true"/>
|
|
||||||
<meta name="360-fullscreen" content="true"/>
|
|
||||||
<meta name="theme-color" content="#157878"/>
|
|
||||||
<meta name="laya" screenorientation ="landscape"/>
|
|
||||||
<meta http-equiv="expires" content="0"/>
|
|
||||||
<meta http-equiv="Cache-Control" content="no-siteapp"/>
|
|
||||||
<font-face font-family="方正像素12" src="fonts/方正像素12.ttf"/>
|
|
||||||
<title>Life Restart</title>
|
|
||||||
</head>
|
|
||||||
<body style="background:black">
|
|
||||||
<!--以下引用了常用类库,如果不使用,可以删除-->
|
|
||||||
|
|
||||||
<!--核心包,封装了显示对象渲染,事件,时间管理,时间轴动画,缓动,消息交互,socket,本地存储,鼠标触摸,声音,加载,颜色滤镜,位图字体等-->
|
|
||||||
<script type="text/javascript" src="libs/laya/laya.core.js"></script>
|
|
||||||
<!--提供了微信小游戏的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.wxmini.js"></script> -->
|
|
||||||
<!--提供了百度小游戏的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.bdmini.js"></script> -->
|
|
||||||
<!--提供了小米小游戏的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.xmmini.js"></script> -->
|
|
||||||
<!--提供了OPPO小游戏的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.quickgamemini.js"></script> -->
|
|
||||||
<!--提供了bilibili小游戏的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.bilimini.js"></script> -->
|
|
||||||
<!--提供了Alipay小游戏的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.Alipaymini.js"></script> -->
|
|
||||||
<!--提供了qq小游戏的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.qqmini.js"></script> -->
|
|
||||||
<!--提供了字节跳动小游戏的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.ttmini.js"></script> -->
|
|
||||||
<!--提供了华为快游戏的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.hwmini.js"></script> -->
|
|
||||||
<!--提供了淘宝商家应用的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.tbmini.js"></script> -->
|
|
||||||
<!--提供了淘宝小部件的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.tbplugin.js"></script> -->
|
|
||||||
<!--封装了webgl渲染管线,如果使用webgl渲染,可以在初始化时调用Laya.init(1000,800,laya.webgl.WebGL);-->
|
|
||||||
<script type="text/javascript" src="libs/laya/laya.webgl.js"></script>
|
|
||||||
<!--提供了VIVO小游戏的适配-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.vvmini.js"></script> -->
|
|
||||||
<!--是动画模块,包含了swf动画,骨骼动画等-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.ani.js"></script> -->
|
|
||||||
<!--包含更多webgl滤镜,比如外发光,阴影,模糊以及更多-->
|
|
||||||
<script type="text/javascript" src="libs/laya/laya.filter.js"></script>
|
|
||||||
<!--封装了html动态排版功能-->
|
|
||||||
<script type="text/javascript" src="libs/laya/laya.html.js"></script>
|
|
||||||
<!--粒子类库-->
|
|
||||||
<script type="text/javascript" src="libs/laya/laya.particle.js"></script>
|
|
||||||
<!--提供tileMap解析支持-->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.tiledmap.js"></script> -->
|
|
||||||
<!--提供了制作UI的各种组件实现-->
|
|
||||||
<script type="text/javascript" src="libs/laya/laya.ui.js"></script>
|
|
||||||
<!-- 提供LayaAir3d接口 -->
|
|
||||||
<!-- <script type="text/javascript" src="libs/laya/laya.d3.js"></script> -->
|
|
||||||
|
|
||||||
<!-- 物理引擎matter.js -->
|
|
||||||
<!--自定义的js(src文件夹下)文件自动添加到下面jsfile模块标签里面里,js的顺序可以手动修改,修改后保留修改的顺序,新增加的js会默认依次追加到标签里-->
|
|
||||||
<!--删除标签,ide不会自动添加js文件,请谨慎操作-->
|
|
||||||
<!--jsfile--startTag-->
|
|
||||||
<script type="module" src="../src/index.js"></script>
|
|
||||||
<!--jsfile--endTag-->
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><meta name="description" content="やり直すんだ。そして、次はうまくやる。"/><meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/><meta name="renderer" content="webkit"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="full-screen" content="true"/><meta name="x5-fullscreen" content="true"/><meta name="360-fullscreen" content="true"/><meta name="theme-color" content="#157878"/><meta name="laya" screenorientation="landscape"/><meta http-equiv="expires" content="0"/><meta http-equiv="Cache-Control" content="no-siteapp"/><title>Life Restart</title><script src="libs/laya/min/laya.core.min.js"></script><script src="libs/laya/min/laya.webgl.min.js"></script><script src="libs/laya/min/laya.filter.min.js"></script><script src="libs/laya/min/laya.particle.min.js"></script><script src="libs/laya/min/laya.ui.min.js"></script><script defer="defer" src="chunk/main.76985.js"></script></head><body style="background:black"></body></html>
|
|
||||||
768
repl/app.js
768
repl/app.js
File diff suppressed because it is too large
Load Diff
@@ -1,32 +1,44 @@
|
|||||||
import App from './app.js';
|
import { fileURLToPath } from 'url'
|
||||||
import { readFile, writeFile } from 'fs/promises';
|
import { dirname } from 'path'
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url)
|
||||||
|
const __dirname = dirname(__filename)
|
||||||
|
|
||||||
|
import App from './app.js'
|
||||||
|
import { readFile, writeFile } from 'fs/promises'
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
globalThis.localStorage = JSON.parse(await readFile('__localStorage.json'));
|
globalThis.localStorage = JSON.parse(
|
||||||
|
await readFile(__dirname + '/__localStorage.json')
|
||||||
|
)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
globalThis.localStorage = {};
|
globalThis.localStorage = {}
|
||||||
}
|
}
|
||||||
localStorage.getItem = key => localStorage[key]===void 0? null: localStorage[key];
|
localStorage.getItem = key =>
|
||||||
localStorage.setItem = (key, value) => (localStorage[key] = value);
|
localStorage[key] === void 0 ? null : localStorage[key]
|
||||||
|
localStorage.setItem = (key, value) => (localStorage[key] = value)
|
||||||
|
|
||||||
globalThis.dumpLocalStorage = async ()=>await writeFile('__localStorage.json', JSON.stringify( global.localStorage))
|
globalThis.dumpLocalStorage = async () =>
|
||||||
|
await writeFile(
|
||||||
|
__dirname + '/__localStorage.json',
|
||||||
|
JSON.stringify(global.localStorage)
|
||||||
|
)
|
||||||
|
|
||||||
const app = new App();
|
const app = new App()
|
||||||
app.io(
|
app.io(
|
||||||
repl => process.stdin.on('data', data=>repl(data.toString().trim())),
|
repl => process.stdin.on('data', data => repl(data.toString().trim())),
|
||||||
(data, isRepl) => process.stdout.write(`${data}${isRepl?'\n>':''}`),
|
(data, isRepl) => process.stdout.write(`${data}${isRepl ? '\n>' : ''}`),
|
||||||
code=>process.exit(code)
|
code => process.exit(code)
|
||||||
)
|
)
|
||||||
await app.initial();
|
await app.initial()
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main()
|
||||||
|
|
||||||
// process.stdin.setRawMode(true);
|
// process.stdin.setRawMode(true);
|
||||||
|
|
||||||
// process.openStdin().on('keypress', function (chunk, key) {
|
// process.openStdin().on('keypress', function (chunk, key) {
|
||||||
// process.stdout.write('Get Chunk: ' + chunk + '\n');
|
// process.stdout.write('Get Chunk: ' + chunk + '\n');
|
||||||
// if (key && key.ctrl && key.name == 'c') process.exit();
|
// if (key && key.ctrl && key.name == 'c') process.exit();
|
||||||
// });
|
// });
|
||||||
|
|||||||
52
src/app.js
52
src/app.js
@@ -7,21 +7,21 @@ import UIManager from './ui/uiManager.js';
|
|||||||
import * as utils from './functions/util.js';
|
import * as utils from './functions/util.js';
|
||||||
|
|
||||||
globalThis.UIManager =
|
globalThis.UIManager =
|
||||||
globalThis.UI =
|
globalThis.UI =
|
||||||
UIManager;
|
UIManager;
|
||||||
|
|
||||||
globalThis.$_ = utils;
|
globalThis.$_ = utils;
|
||||||
|
|
||||||
globalThis.goto = async tag => {
|
globalThis.goto = async tag => {
|
||||||
let url;
|
let url;
|
||||||
switch(tag) {
|
switch (tag) {
|
||||||
case 'github': url = 'https://github.com/VickScarlet/lifeRestart'; break;
|
case 'github': url = 'https://github.com/VickScarlet/lifeRestart'; break;
|
||||||
case 'discord': url = 'https://discord.gg/U3qrf49NMQ'; break;
|
case 'discord': url = 'https://discord.gg/U3qrf49NMQ'; break;
|
||||||
case 'sponsor_afd': url = 'https://afdian.net/@LifeRestart'; break;
|
case 'sponsor_afd': url = 'https://afdian.com/a/LifeRestart'; break;
|
||||||
case 'sponsor_ddf': url = 'https://dun.mianbaoduo.com/@vickscarlet'; break;
|
case 'sponsor_ddf': url = 'https://dun.mianbaoduo.com/@vickscarlet'; break;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if(Laya.Browser.onIOS) {
|
if (Laya.Browser.onIOS) {
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
} else {
|
} else {
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
@@ -30,8 +30,8 @@ globalThis.goto = async tag => {
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class App{
|
class App {
|
||||||
constructor(){
|
constructor() {
|
||||||
this.name = 'lifeRestart';
|
this.name = 'lifeRestart';
|
||||||
this.version = '2.0.0';
|
this.version = '2.0.0';
|
||||||
console.log(`${this.name} ${this.version}`);
|
console.log(`${this.name} ${this.version}`);
|
||||||
@@ -50,10 +50,10 @@ class App{
|
|||||||
//class laya.webgl.text.CharSegment
|
//class laya.webgl.text.CharSegment
|
||||||
class CharSegment {
|
class CharSegment {
|
||||||
constructor() {
|
constructor() {
|
||||||
this._sourceStr=null;
|
this._sourceStr = null;
|
||||||
}
|
}
|
||||||
textToSpit(str) {
|
textToSpit(str) {
|
||||||
this._sourceStr=str;
|
this._sourceStr = str;
|
||||||
var texLen = str.length;
|
var texLen = str.length;
|
||||||
var idx = -1;
|
var idx = -1;
|
||||||
this._words = [];
|
this._words = [];
|
||||||
@@ -67,18 +67,18 @@ class App{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getChar(i){
|
getChar(i) {
|
||||||
return this._words;
|
return this._words;
|
||||||
}
|
}
|
||||||
getCharCode(i){
|
getCharCode(i) {
|
||||||
return this._words[i].codePointAt(0);
|
return this._words[i].codePointAt(0);
|
||||||
}
|
}
|
||||||
length(){
|
length() {
|
||||||
return this._words.length;
|
return this._words.length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Laya.class(CharSegment,'laya.webgl.text.CharSegment');
|
Laya.class(CharSegment, 'laya.webgl.text.CharSegment');
|
||||||
Laya.imps(CharSegment.prototype,{"laya.webgl.text.ICharSegment":true})
|
Laya.imps(CharSegment.prototype, { "laya.webgl.text.ICharSegment": true })
|
||||||
|
|
||||||
|
|
||||||
// Laya.init(1125, 2436, Laya.WebGL);
|
// Laya.init(1125, 2436, Laya.WebGL);
|
||||||
@@ -103,15 +103,15 @@ class App{
|
|||||||
const screenWidth = window.innerWidth;
|
const screenWidth = window.innerWidth;
|
||||||
const screenHeight = window.innerHeight;
|
const screenHeight = window.innerHeight;
|
||||||
const screenRatio = screenWidth / screenHeight;
|
const screenRatio = screenWidth / screenHeight;
|
||||||
if(screenRatio > designRatio) {
|
if (screenRatio > designRatio) {
|
||||||
return [
|
return [
|
||||||
Math.min(screenWidth*designHeight/screenHeight, maxWidth),
|
Math.min(screenWidth * designHeight / screenHeight, maxWidth),
|
||||||
designHeight
|
designHeight
|
||||||
]
|
]
|
||||||
} else {
|
} else {
|
||||||
return [
|
return [
|
||||||
designWidth,
|
designWidth,
|
||||||
Math.min(screenHeight*designWidth/screenWidth, maxHeight)
|
Math.min(screenHeight * designWidth / screenWidth, maxHeight)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,7 +121,7 @@ class App{
|
|||||||
}
|
}
|
||||||
|
|
||||||
async #setLanguage(language) {
|
async #setLanguage(language) {
|
||||||
switch(language) {
|
switch (language) {
|
||||||
case App.languages['en-us']:
|
case App.languages['en-us']:
|
||||||
case App.languages['zh-cn']:
|
case App.languages['zh-cn']:
|
||||||
this.#language = language;
|
this.#language = language;
|
||||||
@@ -131,23 +131,23 @@ class App{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
globalThis.$lang =
|
globalThis.$lang =
|
||||||
Laya.Text.langPacks =
|
Laya.Text.langPacks =
|
||||||
(await import(`./i18n/${this.#language}.js`)).default;
|
(await import(`./i18n/${this.#language}.js`)).default;
|
||||||
}
|
}
|
||||||
|
|
||||||
resigterEvent() {
|
resigterEvent() {
|
||||||
$$on('achievement', achievement => {
|
$$on('achievement', achievement => {
|
||||||
$ui.popup(UI.popups.ACHIEVEMENT, {achievement});
|
$ui.popup(UI.popups.ACHIEVEMENT, { achievement });
|
||||||
})
|
})
|
||||||
$$on('message', ([message, ...args]) => {
|
$$on('message', ([message, ...args]) => {
|
||||||
if(Array.isArray(message)) {
|
if (Array.isArray(message)) {
|
||||||
message = message.map(([m, ...a]) => $_.format($lang[m], ...a)) .join('\n');
|
message = message.map(([m, ...a]) => $_.format($lang[m], ...a)).join('\n');
|
||||||
} else {
|
} else {
|
||||||
message = $_.format(
|
message = $_.format(
|
||||||
$lang[message], ...args
|
$lang[message], ...args
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$ui.popup(UI.popups.MESSAGE, {message});
|
$ui.popup(UI.popups.MESSAGE, { message });
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ class App{
|
|||||||
this.#initLaya();
|
this.#initLaya();
|
||||||
globalThis.$ui = UIManager.getInstance();
|
globalThis.$ui = UIManager.getInstance();
|
||||||
|
|
||||||
if(theme=='default') {
|
if (theme == 'default') {
|
||||||
theme = localStorage.getItem('theme') || 'default';
|
theme = localStorage.getItem('theme') || 'default';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,8 +168,8 @@ class App{
|
|||||||
await $ui.setLoading(UI.pages.LOADING);
|
await $ui.setLoading(UI.pages.LOADING);
|
||||||
await $ui.switchView(UI.pages.LOADING);
|
await $ui.switchView(UI.pages.LOADING);
|
||||||
await core.initial(
|
await core.initial(
|
||||||
dataSet=>Laya.promises.loader.load(`data/${this.#language}/${dataSet}.json`, null, Laya.Loader.JSON),
|
dataSet => Laya.promises.loader.load(`data/${this.#language}/${dataSet}.json`, null, Laya.Loader.JSON),
|
||||||
dataSet=>Laya.promises.loader.load(`data/${dataSet}.json`, null, Laya.Loader.JSON),
|
dataSet => Laya.promises.loader.load(`data/${dataSet}.json`, null, Laya.Loader.JSON),
|
||||||
);
|
);
|
||||||
await $ui.switchView(UI.pages.MAIN);
|
await $ui.switchView(UI.pages.MAIN);
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ function parseCondition(condition) {
|
|||||||
return conditions;
|
return conditions;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkCondition(property, condition) {
|
export function checkCondition(property, condition) {
|
||||||
const conditions = parseCondition(condition);
|
const conditions = parseCondition(condition);
|
||||||
return checkParsedConditions(property, conditions);
|
return checkParsedConditions(property, conditions);
|
||||||
}
|
}
|
||||||
@@ -113,7 +113,7 @@ function checkProp(property, condition) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function extractMaxTriggers(condition) {
|
export function extractMaxTriggers(condition) {
|
||||||
// Assuming only age related talents can be triggered multiple times.
|
// Assuming only age related talents can be triggered multiple times.
|
||||||
const RE_AGE_CONDITION = /AGE\?\[([0-9\,]+)\]/;
|
const RE_AGE_CONDITION = /AGE\?\[([0-9\,]+)\]/;
|
||||||
const match_object = RE_AGE_CONDITION.exec(condition);
|
const match_object = RE_AGE_CONDITION.exec(condition);
|
||||||
@@ -124,6 +124,4 @@ function extractMaxTriggers(condition) {
|
|||||||
|
|
||||||
const age_list = match_object[1].split(",");
|
const age_list = match_object[1].split(",");
|
||||||
return age_list.length;
|
return age_list.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { checkCondition, extractMaxTriggers };
|
|
||||||
103
src/functions/condition.spec.js
Normal file
103
src/functions/condition.spec.js
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
import { expect, test, describe } from 'vitest'
|
||||||
|
import { checkCondition } from './condition'
|
||||||
|
|
||||||
|
function withProp(prop) {
|
||||||
|
const p = {
|
||||||
|
get(key) {
|
||||||
|
return prop[key]
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return condition => checkCondition(p, condition)
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('condition', () => {
|
||||||
|
const check = withProp({
|
||||||
|
n1: 0,
|
||||||
|
n2: -10,
|
||||||
|
n3: 10,
|
||||||
|
nl1: [1, 2, 3],
|
||||||
|
nl2: [0],
|
||||||
|
nl3: [],
|
||||||
|
})
|
||||||
|
test('gt(>)', () => {
|
||||||
|
expect(check('n3>11')).toBe(false)
|
||||||
|
expect(check('n3>10')).toBe(false)
|
||||||
|
expect(check('n3>9')).toBe(true)
|
||||||
|
})
|
||||||
|
test('gte(>=)', () => {
|
||||||
|
expect(check('n3>=11')).toBe(false)
|
||||||
|
expect(check('n3>=10')).toBe(true)
|
||||||
|
expect(check('n3>=9')).toBe(true)
|
||||||
|
})
|
||||||
|
test('lt(<)', () => {
|
||||||
|
expect(check('n3<9')).toBe(false)
|
||||||
|
expect(check('n3<10')).toBe(false)
|
||||||
|
expect(check('n3<11')).toBe(true)
|
||||||
|
})
|
||||||
|
test('lte(<=)', () => {
|
||||||
|
expect(check('n3<=9')).toBe(false)
|
||||||
|
expect(check('n3<=10')).toBe(true)
|
||||||
|
expect(check('n3<=11')).toBe(true)
|
||||||
|
})
|
||||||
|
test('eq(=)', () => {
|
||||||
|
expect(check('n3=9')).toBe(false)
|
||||||
|
expect(check('n3=10')).toBe(true)
|
||||||
|
expect(check('n3=11')).toBe(false)
|
||||||
|
expect(check('nl1=0')).toBe(false)
|
||||||
|
expect(check('nl1=1')).toBe(true)
|
||||||
|
expect(check('nl1=2')).toBe(true)
|
||||||
|
expect(check('nl1=3')).toBe(true)
|
||||||
|
})
|
||||||
|
test('ne(!=)', () => {
|
||||||
|
expect(check('n3!=9')).toBe(true)
|
||||||
|
expect(check('n3!=10')).toBe(false)
|
||||||
|
expect(check('n3!=11')).toBe(true)
|
||||||
|
expect(check('nl1!=0')).toBe(true)
|
||||||
|
expect(check('nl1!=1')).toBe(false)
|
||||||
|
expect(check('nl1!=2')).toBe(false)
|
||||||
|
expect(check('nl1!=3')).toBe(false)
|
||||||
|
})
|
||||||
|
test('in(?)', () => {
|
||||||
|
expect(check('n3?[1,2,3]')).toBe(false)
|
||||||
|
expect(check('n3?[10,11,12]')).toBe(true)
|
||||||
|
expect(check('nl1?[0,1]')).toBe(true)
|
||||||
|
expect(check('nl2?[1,2,3]')).toBe(false)
|
||||||
|
expect(check('nl3?[1,2,3]')).toBe(false)
|
||||||
|
expect(check('nl2?[]')).toBe(false)
|
||||||
|
expect(check('nl3?[]')).toBe(false)
|
||||||
|
})
|
||||||
|
test('notin(!)', () => {
|
||||||
|
expect(check('n3![1,2,3]')).toBe(true)
|
||||||
|
expect(check('n3![10,11,12]')).toBe(false)
|
||||||
|
expect(check('nl1![0,1]')).toBe(false)
|
||||||
|
expect(check('nl2![1,2,3]')).toBe(true)
|
||||||
|
expect(check('nl3![1,2,3]')).toBe(true)
|
||||||
|
expect(check('nl2![]')).toBe(true)
|
||||||
|
expect(check('nl3![]')).toBe(true)
|
||||||
|
})
|
||||||
|
test('and(&)', () => {
|
||||||
|
expect(check('n1>=0&n2<0')).toBe(true)
|
||||||
|
expect(check('n2>0&n3>0')).toBe(false)
|
||||||
|
expect(check('n2<0&n3<0')).toBe(false)
|
||||||
|
expect(check('n2<0&n3>0')).toBe(true)
|
||||||
|
expect(check('n1=0&n2<0&n3>0')).toBe(true)
|
||||||
|
expect(check('n1=0&n2>0&n3>0')).toBe(false)
|
||||||
|
})
|
||||||
|
test('or(|)', () => {
|
||||||
|
expect(check('n1>=0|n2<0')).toBe(true)
|
||||||
|
expect(check('n2>0|n3>0')).toBe(true)
|
||||||
|
expect(check('n2<0|n3<0')).toBe(true)
|
||||||
|
expect(check('n2<0|n3>0')).toBe(true)
|
||||||
|
expect(check('n2>0|n3<0')).toBe(false)
|
||||||
|
expect(check('n1=0|n2<0|n3>0')).toBe(true)
|
||||||
|
expect(check('n1=0|n2>0|n3>0')).toBe(true)
|
||||||
|
expect(check('n1!=0|n2>0|n3<0')).toBe(false)
|
||||||
|
})
|
||||||
|
test('mix', () => {
|
||||||
|
expect(check('(n1=0|n2<0|n3>0)&(n1=0|n2>0|n3>0)')).toBe(true)
|
||||||
|
expect(check('(n1=0|n2<0|n3>0)&(n1!=0|n2>0|n3<0)')).toBe(false)
|
||||||
|
expect(check('n1=0|n2<0|n3>0&n1!=0|n2>0|n3<0')).toBe(true)
|
||||||
|
expect(check('(n1>0|n1?[-10,0])&(n2>0|n3![0,1])')).toBe(true)
|
||||||
|
expect(check('(n1>0&n1?[-10,0])|(n2<0&n3![0,1])')).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -31,6 +31,7 @@ export default ({
|
|||||||
UI_Thanks: 'Thx',
|
UI_Thanks: 'Thx',
|
||||||
UI_Achievement: 'Achv',
|
UI_Achievement: 'Achv',
|
||||||
UI_Cyber_Theme_Art_Design: 'UI Design by 晰晰',
|
UI_Cyber_Theme_Art_Design: 'UI Design by 晰晰',
|
||||||
|
UI_Banner: '作者的新作《纸上谈亲》已上线小程序\n微信/抖音搜索“纸上谈亲”即可游玩~',
|
||||||
|
|
||||||
UI_Title_Talent: 'Talent Draw',
|
UI_Title_Talent: 'Talent Draw',
|
||||||
UI_Talent_Draw: '!10 Pulls!',
|
UI_Talent_Draw: '!10 Pulls!',
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export default ({
|
|||||||
UI_Thanks: '感谢',
|
UI_Thanks: '感谢',
|
||||||
UI_Achievement: '成就',
|
UI_Achievement: '成就',
|
||||||
UI_Cyber_Theme_Art_Design: 'UI 设计 by 晰晰',
|
UI_Cyber_Theme_Art_Design: 'UI 设计 by 晰晰',
|
||||||
|
UI_Banner: '作者的新作《纸上谈亲》已上线小程序\n微信/抖音搜索“纸上谈亲”即可游玩~',
|
||||||
|
|
||||||
UI_Title_Talent: '天赋抽卡',
|
UI_Title_Talent: '天赋抽卡',
|
||||||
UI_Talent_Draw: '10连抽!',
|
UI_Talent_Draw: '10连抽!',
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class Life {
|
|||||||
this.#specialThanks = specialThanks;
|
this.#specialThanks = specialThanks;
|
||||||
|
|
||||||
const total = {
|
const total = {
|
||||||
[this.PropertyTypes.TACEV]: this.#achievement.initial({achievements}),
|
[this.PropertyTypes.TACHV]: this.#achievement.initial({achievements}),
|
||||||
[this.PropertyTypes.TEVT]: this.#event.initial({events}),
|
[this.PropertyTypes.TEVT]: this.#event.initial({events}),
|
||||||
[this.PropertyTypes.TTLT]: this.#talent.initial({talents}),
|
[this.PropertyTypes.TTLT]: this.#talent.initial({talents}),
|
||||||
};
|
};
|
||||||
@@ -174,7 +174,7 @@ class Life {
|
|||||||
type: this.PropertyTypes.TLT,
|
type: this.PropertyTypes.TLT,
|
||||||
name,
|
name,
|
||||||
grade,
|
grade,
|
||||||
description,
|
description: this.format(description),
|
||||||
})
|
})
|
||||||
if(!effect) continue;
|
if(!effect) continue;
|
||||||
this.#property.effect(effect);
|
this.#property.effect(effect);
|
||||||
@@ -188,8 +188,8 @@ class Life {
|
|||||||
this.#property.effect(effect);
|
this.#property.effect(effect);
|
||||||
const content = {
|
const content = {
|
||||||
type: this.PropertyTypes.EVT,
|
type: this.PropertyTypes.EVT,
|
||||||
description,
|
description: this.format(description),
|
||||||
postEvent,
|
postEvent: postEvent && this.format(postEvent),
|
||||||
grade,
|
grade,
|
||||||
}
|
}
|
||||||
if(next) return [content, this.doEvent(next)].flat();
|
if(next) return [content, this.doEvent(next)].flat();
|
||||||
@@ -245,6 +245,23 @@ class Life {
|
|||||||
return util.getListValuesMap(types.flat(), key => this.#property.get(key));
|
return util.getListValuesMap(types.flat(), key => this.#property.get(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
format(discription) {
|
||||||
|
return `${discription}`.replaceAll(/\{\s*[0-9a-zA-Z_-]+\s*?\}/g, (match) => this.#format(match));
|
||||||
|
}
|
||||||
|
|
||||||
|
#format(key) {
|
||||||
|
switch (key.slice(1, -1).trim().toLowerCase()) {
|
||||||
|
case 'currentyear': return new Date().getFullYear()
|
||||||
|
case 'age': return this.#property.get(this.PropertyTypes.AGE)
|
||||||
|
case 'charm': return this.#property.get(this.PropertyTypes.CHR)
|
||||||
|
case 'intelligence': return this.#property.get(this.PropertyTypes.INT)
|
||||||
|
case 'strength': return this.#property.get(this.PropertyTypes.STR)
|
||||||
|
case 'money': return this.#property.get(this.PropertyTypes.MNY)
|
||||||
|
case 'spirit': return this.#property.get(this.PropertyTypes.SPR)
|
||||||
|
default: return key
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get lastExtendTalent() {
|
get lastExtendTalent() {
|
||||||
return this.#property.get(this.PropertyTypes.EXT);
|
return this.#property.get(this.PropertyTypes.EXT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,10 +68,17 @@ class Talent {
|
|||||||
|
|
||||||
exclude(talents, excludeId) {
|
exclude(talents, excludeId) {
|
||||||
const { exclude } = this.get(excludeId);
|
const { exclude } = this.get(excludeId);
|
||||||
if(!exclude) return null;
|
|
||||||
for(const talent of talents) {
|
for(const talent of talents) {
|
||||||
for(const e of exclude) {
|
if(exclude) {
|
||||||
if(talent == e) return talent;
|
for(const e of exclude) {
|
||||||
|
if(talent == e) return talent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const excludeReverse = this.get(talent).exclude;
|
||||||
|
if(excludeReverse) {
|
||||||
|
for (const e of excludeReverse) {
|
||||||
|
if (excludeId == e) return talent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -30,6 +30,7 @@ export default class CyberMain extends ui.view.CyberTheme.CyberMainUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
this.banner.visible =
|
||||||
this.btnDiscord.visible =
|
this.btnDiscord.visible =
|
||||||
this.btnAchievement.visible =
|
this.btnAchievement.visible =
|
||||||
this.btnThanks.visible = !!core.times;
|
this.btnThanks.visible = !!core.times;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export default class Main extends ui.view.DefaultTheme.MainUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
this.banner.visible =
|
||||||
this.btnDiscord.visible =
|
this.btnDiscord.visible =
|
||||||
this.btnAchievement.visible =
|
this.btnAchievement.visible =
|
||||||
this.btnThanks.visible = !!core.times;
|
this.btnThanks.visible = !!core.times;
|
||||||
|
|||||||
@@ -1,360 +1,397 @@
|
|||||||
import Views from './themes/views.js';
|
import Views from './views.js'
|
||||||
export default class UIManager {
|
export default class UIManager {
|
||||||
constructor(stage) {
|
constructor(stage) {
|
||||||
UIManager.#views = Views;
|
UIManager.#views = Views
|
||||||
|
|
||||||
if(!stage) {
|
if (!stage) {
|
||||||
stage = Laya.stage;
|
stage = Laya.stage
|
||||||
}
|
}
|
||||||
this.#stage = stage;
|
this.#stage = stage
|
||||||
|
|
||||||
stage.addChild(this.#viewLayer);
|
stage.addChild(this.#viewLayer)
|
||||||
this.#viewLayer.zOrder = 1;
|
this.#viewLayer.zOrder = 1
|
||||||
stage.addChild(this.#dialogLayer);
|
stage.addChild(this.#dialogLayer)
|
||||||
this.#dialogLayer.zOrder = 2;
|
this.#dialogLayer.zOrder = 2
|
||||||
stage.addChild(this.#popupLayer);
|
stage.addChild(this.#popupLayer)
|
||||||
this.#popupLayer.zOrder = 3;
|
this.#popupLayer.zOrder = 3
|
||||||
this.#viewLayer.top =
|
this.#viewLayer.top =
|
||||||
this.#viewLayer.bottom =
|
this.#viewLayer.bottom =
|
||||||
this.#viewLayer.left =
|
this.#viewLayer.left =
|
||||||
this.#viewLayer.right =
|
this.#viewLayer.right =
|
||||||
this.#dialogLayer.top =
|
this.#dialogLayer.top =
|
||||||
this.#dialogLayer.bottom =
|
this.#dialogLayer.bottom =
|
||||||
this.#dialogLayer.left =
|
this.#dialogLayer.left =
|
||||||
this.#dialogLayer.right =
|
this.#dialogLayer.right =
|
||||||
this.#popupLayer.top =
|
this.#popupLayer.top =
|
||||||
this.#popupLayer.bottom =
|
this.#popupLayer.bottom =
|
||||||
this.#popupLayer.left =
|
this.#popupLayer.left =
|
||||||
this.#popupLayer.right =
|
this.#popupLayer.right =
|
||||||
this.#dialogMask.top =
|
this.#dialogMask.top =
|
||||||
this.#dialogMask.bottom =
|
this.#dialogMask.bottom =
|
||||||
this.#dialogMask.left =
|
this.#dialogMask.left =
|
||||||
this.#dialogMask.right = 0;
|
this.#dialogMask.right =
|
||||||
this.#dialogMask.graphics.drawRect(0, 0, 5000, 5000, '#000000');
|
0
|
||||||
this.#dialogMask.alpha = 0.4;
|
this.#dialogMask.graphics.drawRect(0, 0, 5000, 5000, '#000000')
|
||||||
this.#dialogMask.on(Laya.Event.CLICK, this, ()=>{
|
this.#dialogMask.alpha = 0.4
|
||||||
this.#dialogStack[this.#dialogStack.length - 1]?.close?.();
|
this.#dialogMask.on(Laya.Event.CLICK, this, () => {
|
||||||
|
this.#dialogStack[this.#dialogStack.length - 1]?.close?.()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
static #instance = {};
|
static #instance = {}
|
||||||
static #views;
|
static #views
|
||||||
#stage;
|
#stage
|
||||||
#loading;
|
#loading
|
||||||
#currentView;
|
#currentView
|
||||||
#viewLayer = new Laya.Panel();
|
#viewLayer = new Laya.Panel()
|
||||||
#dialogLayer = new Laya.Panel();
|
#dialogLayer = new Laya.Panel()
|
||||||
#popupLayer = new Laya.Panel();
|
#popupLayer = new Laya.Panel()
|
||||||
#dialogMask = new Laya.Sprite();
|
#dialogMask = new Laya.Sprite()
|
||||||
#viewMap = new Map();
|
#viewMap = new Map()
|
||||||
#class = new Map();
|
#class = new Map()
|
||||||
#dialogStack = [];
|
#dialogStack = []
|
||||||
|
|
||||||
static get inst() {
|
static get inst() {
|
||||||
return this.getInstance();
|
return this.getInstance()
|
||||||
}
|
}
|
||||||
static getInstance(name="default") {
|
static getInstance(name = 'default') {
|
||||||
return this.#instance[name] || (this.#instance[name] = new UIManager());
|
return this.#instance[name] || (this.#instance[name] = new UIManager())
|
||||||
}
|
}
|
||||||
|
|
||||||
static get pages() {
|
static get pages() {
|
||||||
return this.#views.pages;
|
return this.#views.pages
|
||||||
}
|
}
|
||||||
|
|
||||||
static get popups() {
|
static get popups() {
|
||||||
return this.#views.popups;
|
return this.#views.popups
|
||||||
}
|
}
|
||||||
|
|
||||||
static theme(theme, prop) {
|
static theme(theme, prop) {
|
||||||
return this.#views.themes[theme][prop];
|
return this.#views.themes[theme][prop]
|
||||||
}
|
}
|
||||||
|
|
||||||
async setLoading(loading) {
|
async setLoading(loading) {
|
||||||
const className = this.#pages[loading];
|
const className = this.#pages[loading]
|
||||||
const view = await this.getView(className, null, null, loading);
|
const view = await this.getView(className, null, null, loading)
|
||||||
view.top = view.bottom = view.left = view.right = 0;
|
view.top = view.bottom = view.left = view.right = 0
|
||||||
view.zOrder = 4;
|
view.zOrder = 4
|
||||||
this.#loading = view;
|
this.#loading = view
|
||||||
}
|
}
|
||||||
|
|
||||||
async switchView(viewName, args, actions) {
|
async switchView(viewName, args, actions) {
|
||||||
const className = this.#pages[viewName];
|
const className = this.#pages[viewName]
|
||||||
// get view instance
|
// get view instance
|
||||||
const view = await this.getView(className, args, actions?.load, viewName, 'pages');
|
const view = await this.getView(
|
||||||
|
className,
|
||||||
|
args,
|
||||||
|
actions?.load,
|
||||||
|
viewName,
|
||||||
|
'pages'
|
||||||
|
)
|
||||||
|
|
||||||
view.top = view.bottom = view.left = view.right = 0;
|
view.top = view.bottom = view.left = view.right = 0
|
||||||
// close current view
|
// close current view
|
||||||
this.clearAllDialog();
|
this.clearAllDialog()
|
||||||
await this.#currentView?.__close?.(view);
|
await this.#currentView?.__close?.(view)
|
||||||
await this.#currentView?.close?.(view);
|
await this.#currentView?.close?.(view)
|
||||||
this.#viewLayer.removeChildren();
|
this.#viewLayer.removeChildren()
|
||||||
|
|
||||||
// open new view
|
// open new view
|
||||||
await view.init?.(args);
|
await view.init?.(args)
|
||||||
|
|
||||||
this.#currentView = view;
|
this.#currentView = view
|
||||||
this.#viewLayer.addChild(view);
|
this.#viewLayer.addChild(view)
|
||||||
|
|
||||||
view.__close = actions?.close;
|
view.__close = actions?.close
|
||||||
await actions?.open?.(view);
|
await actions?.open?.(view)
|
||||||
await view.show?.();
|
await view.show?.()
|
||||||
}
|
}
|
||||||
|
|
||||||
async getView(className, args, preload, viewName, type) {
|
async getView(className, args, preload, viewName, type) {
|
||||||
// check if view is already loaded
|
// check if view is already loaded
|
||||||
let view = await this.#viewMap.get(className);
|
let view = await this.#viewMap.get(className)
|
||||||
|
|
||||||
let timeout;
|
let timeout
|
||||||
if(this.#loading) {
|
if (this.#loading) {
|
||||||
timeout = setTimeout(
|
timeout = setTimeout(
|
||||||
()=>this.#stage.addChild(this.#loading),
|
() => this.#stage.addChild(this.#loading),
|
||||||
3000
|
3000
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
const onProgress = this.#loading?.onProgress;
|
const onProgress = this.#loading?.onProgress
|
||||||
|
|
||||||
if(!view) {
|
if (!view) {
|
||||||
// load view
|
// load view
|
||||||
const ViewClass = await this.loadView(className);
|
const ViewClass = await this.loadView(className)
|
||||||
const resourceList = await ViewClass.load?.(args);
|
const resourceList = await ViewClass.load?.(args)
|
||||||
const scanedResourceList = this.#loading? this.scanResource(ViewClass.uiView): [];
|
const scanedResourceList = this.#loading
|
||||||
if(preload) {
|
? this.scanResource(ViewClass.uiView)
|
||||||
preload = [].concat(preload).concat(scanedResourceList);
|
: []
|
||||||
|
if (preload) {
|
||||||
|
preload = [].concat(preload).concat(scanedResourceList)
|
||||||
} else {
|
} else {
|
||||||
preload = scanedResourceList;
|
preload = scanedResourceList
|
||||||
}
|
}
|
||||||
await this.loadRes(resourceList, preload, onProgress);
|
await this.loadRes(resourceList, preload, onProgress)
|
||||||
|
|
||||||
// create view
|
// create view
|
||||||
view = new ViewClass();
|
view = new ViewClass()
|
||||||
// add view to map
|
// add view to map
|
||||||
this.#viewMap.set(className, view);
|
this.#viewMap.set(className, view)
|
||||||
} else {
|
} else {
|
||||||
// load resource
|
// load resource
|
||||||
const resourceList = await view.constructor.load?.(args);
|
const resourceList = await view.constructor.load?.(args)
|
||||||
await this.loadRes(resourceList, preload, onProgress);
|
await this.loadRes(resourceList, preload, onProgress)
|
||||||
}
|
}
|
||||||
if(timeout) clearTimeout(timeout);
|
if (timeout) clearTimeout(timeout)
|
||||||
this.#loading?.removeSelf();
|
this.#loading?.removeSelf()
|
||||||
|
|
||||||
this.#config(view, viewName, type);
|
this.#config(view, viewName, type)
|
||||||
// return view
|
// return view
|
||||||
return view;
|
return view
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadView(className) {
|
async loadView(className) {
|
||||||
// load view
|
// load view
|
||||||
if(this.#class.has(className)) return this.#class.get(className);
|
if (this.#class.has(className)) return this.#class.get(className)
|
||||||
const c = (await import(`./themes/${className}.js`)).default;
|
const views = import.meta.glob('./themes/**/*.js')
|
||||||
this.#class.set(className, c);
|
const view = (await views[`./themes/${className}.js`]()).default
|
||||||
return c;
|
this.#class.set(className, view)
|
||||||
|
return view
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadRes(resourceList, preload, onProgress) {
|
async loadRes(resourceList, preload, onProgress) {
|
||||||
const cnt = (resourceList?.length || 0)
|
const cnt = (resourceList?.length || 0) + (preload?.length || 0)
|
||||||
+(preload?.length || 0);
|
if (resourceList && resourceList.length) {
|
||||||
if(resourceList && resourceList.length) {
|
const s = resourceList.length / cnt
|
||||||
const s = resourceList.length / cnt;
|
await Laya.promises.loader.load(
|
||||||
await Laya.promises.loader.load(resourceList, Laya.Handler.create(null, prg=>onProgress?.(prg*s)));
|
resourceList,
|
||||||
|
Laya.Handler.create(null, prg => onProgress?.(prg * s))
|
||||||
|
)
|
||||||
}
|
}
|
||||||
if(preload && preload.length) {
|
if (preload && preload.length) {
|
||||||
const s = 1 - preload.length / cnt;
|
const s = 1 - preload.length / cnt
|
||||||
const l = preload.length / cnt;
|
const l = preload.length / cnt
|
||||||
await Laya.promises.loader.load(preload, Laya.Handler.create(null, prg=>onProgress?.(prg*l+s)));
|
await Laya.promises.loader.load(
|
||||||
|
preload,
|
||||||
|
Laya.Handler.create(null, prg => onProgress?.(prg * l + s))
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#showDialogStack() {
|
#showDialogStack() {
|
||||||
if(this.#dialogStack.length == 0) {
|
if (this.#dialogStack.length == 0) {
|
||||||
this.#dialogLayer.visible = false;
|
this.#dialogLayer.visible = false
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
this.#dialogLayer.visible = true;
|
this.#dialogLayer.visible = true
|
||||||
this.#dialogStack.forEach((dialog, i)=>{
|
this.#dialogStack.forEach((dialog, i) => {
|
||||||
this.#dialogLayer.addChild(dialog);
|
this.#dialogLayer.addChild(dialog)
|
||||||
dialog.zOrder = i;
|
dialog.zOrder = i
|
||||||
})
|
})
|
||||||
this.#dialogLayer.addChild(this.#dialogMask);
|
this.#dialogLayer.addChild(this.#dialogMask)
|
||||||
const l = this.#dialogStack.length;
|
const l = this.#dialogStack.length
|
||||||
this.#dialogMask.zOrder = l -1;
|
this.#dialogMask.zOrder = l - 1
|
||||||
this.#dialogStack[l -1].zOrder = l;
|
this.#dialogStack[l - 1].zOrder = l
|
||||||
}
|
}
|
||||||
|
|
||||||
async showDialog(dialogName, args, actions) {
|
async showDialog(dialogName, args, actions) {
|
||||||
const className = this.#pages[dialogName];
|
const className = this.#pages[dialogName]
|
||||||
const dialog = await this.getView(className, args, actions?.load, dialogName, 'pages');
|
const dialog = await this.getView(
|
||||||
|
className,
|
||||||
|
args,
|
||||||
|
actions?.load,
|
||||||
|
dialogName,
|
||||||
|
'pages'
|
||||||
|
)
|
||||||
|
|
||||||
const index = this.#dialogStack.indexOf(dialog);
|
const index = this.#dialogStack.indexOf(dialog)
|
||||||
if(index != -1) {
|
if (index != -1) {
|
||||||
this.#dialogStack.splice(index, 1);
|
this.#dialogStack.splice(index, 1)
|
||||||
}
|
}
|
||||||
this.#dialogStack.push(dialog);
|
this.#dialogStack.push(dialog)
|
||||||
dialog.init?.(args);
|
dialog.init?.(args)
|
||||||
dialog.centerX = dialog.centerY = 0;
|
dialog.centerX = dialog.centerY = 0
|
||||||
this.#showDialogStack();
|
this.#showDialogStack()
|
||||||
|
|
||||||
const open = actions?.open || (async () => {
|
const open =
|
||||||
dialog.scaleX = 0;
|
actions?.open ||
|
||||||
dialog.scaleY = 0;
|
(async () => {
|
||||||
await Laya.promises.Tween.to(dialog, { scaleX: 1, scaleY: 1 }, 300, Laya.Ease.backOut);
|
dialog.scaleX = 0
|
||||||
});
|
dialog.scaleY = 0
|
||||||
await open(dialog);
|
await Laya.promises.Tween.to(
|
||||||
dialog.mouseThrough = true;
|
dialog,
|
||||||
dialog.mouseEnabled = true;
|
{ scaleX: 1, scaleY: 1 },
|
||||||
dialog.close = async ()=>{
|
300,
|
||||||
if(actions?.close) {
|
Laya.Ease.backOut
|
||||||
await actions.close();
|
)
|
||||||
|
})
|
||||||
|
await open(dialog)
|
||||||
|
dialog.mouseThrough = true
|
||||||
|
dialog.mouseEnabled = true
|
||||||
|
dialog.close = async () => {
|
||||||
|
if (actions?.close) {
|
||||||
|
await actions.close()
|
||||||
} else {
|
} else {
|
||||||
await Laya.promises.Tween.to(dialog, { scaleX: 0, scaleY: 0 }, 300, Laya.Ease.strongIn);
|
await Laya.promises.Tween.to(
|
||||||
|
dialog,
|
||||||
|
{ scaleX: 0, scaleY: 0 },
|
||||||
|
300,
|
||||||
|
Laya.Ease.strongIn
|
||||||
|
)
|
||||||
}
|
}
|
||||||
const index = this.#dialogStack.indexOf(dialog);
|
const index = this.#dialogStack.indexOf(dialog)
|
||||||
if(index != -1) {
|
if (index != -1) {
|
||||||
this.#dialogStack.splice(index, 1);
|
this.#dialogStack.splice(index, 1)
|
||||||
}
|
}
|
||||||
this.#showDialogStack();
|
this.#showDialogStack()
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#dialogLayer.addChild(dialog);
|
this.#dialogLayer.addChild(dialog)
|
||||||
}
|
}
|
||||||
|
|
||||||
async popup(type, args) {
|
async popup(type, args) {
|
||||||
const className = this.#popups[type];
|
const className = this.#popups[type]
|
||||||
const popup = await this.getView(className, args, null, type, 'popups');
|
const popup = await this.getView(className, args, null, type, 'popups')
|
||||||
this.#popupLayer.addChild(popup);
|
this.#popupLayer.addChild(popup)
|
||||||
await popup.popup(args, this.#popupLayer);
|
await popup.popup(args, this.#popupLayer)
|
||||||
this.#popupLayer.removeChild(popup);
|
this.#popupLayer.removeChild(popup)
|
||||||
}
|
}
|
||||||
|
|
||||||
clearAllDialog() {
|
clearAllDialog() {
|
||||||
this.#dialogStack = [];
|
this.#dialogStack = []
|
||||||
this.#showDialogStack();
|
this.#showDialogStack()
|
||||||
}
|
}
|
||||||
|
|
||||||
#config(view, key, type) {
|
#config(view, key, type) {
|
||||||
const config = this.#configs?.[type]?.[key];
|
const config = this.#configs?.[type]?.[key]
|
||||||
if(!config) return;
|
if (!config) return
|
||||||
if(view.config && view.config(config)) return;
|
if (view.config && view.config(config)) return
|
||||||
const applyConfig = (target, config) => {
|
const applyConfig = (target, config) => {
|
||||||
if(!target) return;
|
if (!target) return
|
||||||
if(typeof config == 'string') {
|
if (typeof config == 'string') {
|
||||||
config = this.#configs?.class?.[config];
|
config = this.#configs?.class?.[config]
|
||||||
}
|
}
|
||||||
$_.deepMapSet(target, config);
|
$_.deepMapSet(target, config)
|
||||||
};
|
}
|
||||||
|
|
||||||
if(config.names)
|
if (config.names)
|
||||||
for(const name in config.names)
|
for (const name in config.names)
|
||||||
this.#deepGetChildsByName(view, name)
|
this.#deepGetChildsByName(view, name).forEach(child =>
|
||||||
.forEach(child => applyConfig(child, config.names[name]));
|
applyConfig(child, config.names[name])
|
||||||
|
)
|
||||||
if(config.vars)
|
|
||||||
for(const key in config.vars)
|
|
||||||
applyConfig(view[key], config.vars[key]);
|
|
||||||
|
|
||||||
|
if (config.vars)
|
||||||
|
for (const key in config.vars)
|
||||||
|
applyConfig(view[key], config.vars[key])
|
||||||
}
|
}
|
||||||
|
|
||||||
#deepGetChildsByName(parent, name) {
|
#deepGetChildsByName(parent, name) {
|
||||||
const list = [];
|
const list = []
|
||||||
if(!parent || !parent._childs) return list;
|
if (!parent || !parent._childs) return list
|
||||||
|
|
||||||
for(const child of parent._childs) {
|
for (const child of parent._childs) {
|
||||||
if(child.name == name) list.push(child);
|
if (child.name == name) list.push(child)
|
||||||
if(child._childs) list.push(...this.#deepGetChildsByName(child, name));
|
if (child._childs)
|
||||||
|
list.push(...this.#deepGetChildsByName(child, name))
|
||||||
}
|
}
|
||||||
return list;
|
return list
|
||||||
}
|
}
|
||||||
|
|
||||||
#cutPath(path) {
|
#cutPath(path) {
|
||||||
path = ''+path;
|
path = '' + path
|
||||||
let index = path.length;
|
let index = path.length
|
||||||
do {
|
do {
|
||||||
index --;
|
index--
|
||||||
if(path[index] == '.') {
|
if (path[index] == '.') {
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
} while (index>0)
|
} while (index > 0)
|
||||||
return [
|
return [path.substring(0, index), path.substring(index, path.length)]
|
||||||
path.substring(0, index),
|
|
||||||
path.substring(index, path.length)
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#subSkin(skin, type) {
|
#subSkin(skin, type) {
|
||||||
if(!skin || !skin.replace(/\s/g, '')) return [];
|
if (!skin || !skin.replace(/\s/g, '')) return []
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'ProgressBar':
|
case 'ProgressBar':
|
||||||
return [ skin, ...this.#progressBarSkin(skin) ];
|
return [skin, ...this.#progressBarSkin(skin)]
|
||||||
case 'ScrollBar':
|
case 'ScrollBar':
|
||||||
return [ skin, ...this.#scrollBarSkin(skin) ];
|
return [skin, ...this.#scrollBarSkin(skin)]
|
||||||
default:
|
default:
|
||||||
return [skin]
|
return [skin]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#progressBarSkin(skin) {
|
#progressBarSkin(skin) {
|
||||||
if(!skin.replace(/\s/g, '')) return [];
|
if (!skin.replace(/\s/g, '')) return []
|
||||||
let p = this.#cutPath(skin);
|
let p = this.#cutPath(skin)
|
||||||
return [`${p[0]}$bar${p[1]}`];
|
return [`${p[0]}$bar${p[1]}`]
|
||||||
}
|
}
|
||||||
|
|
||||||
#scrollBarSkin(skin) {
|
#scrollBarSkin(skin) {
|
||||||
if(!skin.replace(/\s/g, '')) return [];
|
if (!skin.replace(/\s/g, '')) return []
|
||||||
let p = this.#cutPath(skin);
|
let p = this.#cutPath(skin)
|
||||||
return [
|
return [
|
||||||
`${p[0]}$bar${p[1]}`,
|
`${p[0]}$bar${p[1]}`,
|
||||||
`${p[0]}$up${p[1]}`,
|
`${p[0]}$up${p[1]}`,
|
||||||
`${p[0]}$down${p[1]}`
|
`${p[0]}$down${p[1]}`,
|
||||||
];
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
scanResource(uiView) {
|
scanResource(uiView) {
|
||||||
if(!uiView) return [];
|
if (!uiView) return []
|
||||||
const resourceList = [];
|
const resourceList = []
|
||||||
|
|
||||||
resourceList.push(...this.#subSkin(uiView.props?.skin, uiView.type));
|
resourceList.push(...this.#subSkin(uiView.props?.skin, uiView.type))
|
||||||
resourceList.push(...this.#subSkin(uiView.props?.hScrollBarSkin, 'ScrollBar'));
|
resourceList.push(
|
||||||
resourceList.push(...this.#subSkin(uiView.props?.vScrollBarSkin, 'ScrollBar'));
|
...this.#subSkin(uiView.props?.hScrollBarSkin, 'ScrollBar')
|
||||||
|
)
|
||||||
|
resourceList.push(
|
||||||
|
...this.#subSkin(uiView.props?.vScrollBarSkin, 'ScrollBar')
|
||||||
|
)
|
||||||
|
|
||||||
uiView.child?.forEach(child => {
|
uiView.child?.forEach(child => {
|
||||||
resourceList.push(...this.scanResource(child));
|
resourceList.push(...this.scanResource(child))
|
||||||
});
|
})
|
||||||
|
|
||||||
return resourceList;
|
return resourceList
|
||||||
}
|
}
|
||||||
|
|
||||||
get currentView() {
|
get currentView() {
|
||||||
return this.#currentView;
|
return this.#currentView
|
||||||
}
|
}
|
||||||
|
|
||||||
get currentDialog() {
|
get currentDialog() {
|
||||||
return this.#dialogStack[this.#dialogStack.length -1];
|
return this.#dialogStack[this.#dialogStack.length - 1]
|
||||||
}
|
}
|
||||||
|
|
||||||
get theme() {
|
get theme() {
|
||||||
return localStorage.getItem('theme');
|
return localStorage.getItem('theme')
|
||||||
}
|
}
|
||||||
set theme(value) {
|
set theme(value) {
|
||||||
localStorage.setItem('theme', value);
|
localStorage.setItem('theme', value)
|
||||||
this.#stage.bgColor = this.#configs.bgColor;
|
this.#stage.bgColor = this.#configs.bgColor
|
||||||
document?.querySelector?.('meta[name="theme-color"]')?.setAttribute?.('content', this.#configs.bgColor);
|
document
|
||||||
|
?.querySelector?.('meta[name="theme-color"]')
|
||||||
|
?.setAttribute?.('content', this.#configs.bgColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
get #pages() {
|
get #pages() {
|
||||||
return UIManager.theme(this.theme, 'pages');
|
return UIManager.theme(this.theme, 'pages')
|
||||||
}
|
}
|
||||||
get #popups() {
|
get #popups() {
|
||||||
return UIManager.theme(this.theme, 'popups');
|
return UIManager.theme(this.theme, 'popups')
|
||||||
}
|
}
|
||||||
get #configs() {
|
get #configs() {
|
||||||
return UIManager.theme(this.theme, 'configs');
|
return UIManager.theme(this.theme, 'configs')
|
||||||
}
|
}
|
||||||
get common() {
|
get common() {
|
||||||
return this.#configs.common;
|
return this.#configs.common
|
||||||
}
|
}
|
||||||
gradeColor(grade) {
|
gradeColor(grade) {
|
||||||
return this.common.grade[grade];
|
return this.common.grade[grade]
|
||||||
}
|
}
|
||||||
gradeFilter(grade) {
|
gradeFilter(grade) {
|
||||||
return this.common.filter[grade];
|
return this.common.filter[grade]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,32 +10,32 @@ const pages = {
|
|||||||
THEMES: 'THEMES',
|
THEMES: 'THEMES',
|
||||||
SAVELOAD: 'SAVELOAD',
|
SAVELOAD: 'SAVELOAD',
|
||||||
MODE: 'MODE',
|
MODE: 'MODE',
|
||||||
CELEBRITY: 'CELEBRITY'
|
CELEBRITY: 'CELEBRITY',
|
||||||
};
|
}
|
||||||
|
|
||||||
const popups = {
|
const popups = {
|
||||||
ACHIEVEMENT: 'POPUP_ACHIEVEMENT',
|
ACHIEVEMENT: 'POPUP_ACHIEVEMENT',
|
||||||
MESSAGE: 'POPUP_MESSAGE',
|
MESSAGE: 'POPUP_MESSAGE',
|
||||||
};
|
}
|
||||||
|
|
||||||
const cyber = {
|
const cyber = {
|
||||||
pages: {
|
pages: {
|
||||||
[pages.LOADING]: "loading",
|
[pages.LOADING]: 'loading',
|
||||||
[pages.MAIN]: "cyber/main",
|
[pages.MAIN]: 'cyber/main',
|
||||||
[pages.TALENT]: "cyber/talent",
|
[pages.TALENT]: 'cyber/talent',
|
||||||
[pages.PROPERTY]: "cyber/property",
|
[pages.PROPERTY]: 'cyber/property',
|
||||||
[pages.TRAJECTORY]: "cyber/trajectory",
|
[pages.TRAJECTORY]: 'cyber/trajectory',
|
||||||
[pages.SUMMARY]: "cyber/summary",
|
[pages.SUMMARY]: 'cyber/summary',
|
||||||
[pages.ACHIEVEMENT]: "cyber/achievement",
|
[pages.ACHIEVEMENT]: 'cyber/achievement',
|
||||||
[pages.THANKS]: "default/thanks",
|
[pages.THANKS]: 'default/thanks',
|
||||||
[pages.THEMES]: 'themes',
|
[pages.THEMES]: 'themes',
|
||||||
[pages.SAVELOAD]: 'saveload',
|
[pages.SAVELOAD]: 'saveload',
|
||||||
[pages.MODE]: 'cyber/mode',
|
[pages.MODE]: 'cyber/mode',
|
||||||
[pages.CELEBRITY]: 'cyber/celebrity',
|
[pages.CELEBRITY]: 'cyber/celebrity',
|
||||||
},
|
},
|
||||||
popups: {
|
popups: {
|
||||||
[popups.ACHIEVEMENT]: "cyber/popup/achievementPopup",
|
[popups.ACHIEVEMENT]: 'cyber/popup/achievementPopup',
|
||||||
[popups.MESSAGE]: "message",
|
[popups.MESSAGE]: 'message',
|
||||||
},
|
},
|
||||||
configs: {
|
configs: {
|
||||||
bgColor: '#04131f',
|
bgColor: '#04131f',
|
||||||
@@ -47,18 +47,8 @@ const cyber = {
|
|||||||
hoverStroke: '#ffa500',
|
hoverStroke: '#ffa500',
|
||||||
},
|
},
|
||||||
defaultFontColor: '#cccccc',
|
defaultFontColor: '#cccccc',
|
||||||
grade: [
|
grade: ['#cccccc', '#55fffe', '#b17cff', '#ffce45'],
|
||||||
'#cccccc',
|
filter: ['#ccccccff', '#55fffeff', '#b17cffff', '#ffce45ff'],
|
||||||
'#55fffe',
|
|
||||||
'#b17cff',
|
|
||||||
'#ffce45',
|
|
||||||
],
|
|
||||||
filter: [
|
|
||||||
'#ccccccff',
|
|
||||||
'#55fffeff',
|
|
||||||
'#b17cffff',
|
|
||||||
'#ffce45ff',
|
|
||||||
],
|
|
||||||
gradeBlk: [
|
gradeBlk: [
|
||||||
{
|
{
|
||||||
visible: false,
|
visible: false,
|
||||||
@@ -78,7 +68,7 @@ const cyber = {
|
|||||||
hoverColor: '#ffce45',
|
hoverColor: '#ffce45',
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
pages: {
|
pages: {
|
||||||
[pages.MAIN]: {
|
[pages.MAIN]: {
|
||||||
@@ -97,7 +87,7 @@ const cyber = {
|
|||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
radius: 100,
|
radius: 100,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.THANKS]: {
|
[pages.THANKS]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -147,7 +137,7 @@ const cyber = {
|
|||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
radius: 80,
|
radius: 80,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.SAVELOAD]: {
|
[pages.SAVELOAD]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -184,31 +174,31 @@ const cyber = {
|
|||||||
radius: 80,
|
radius: 80,
|
||||||
defaultLabel: '#ffffff',
|
defaultLabel: '#ffffff',
|
||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const dark = {
|
const dark = {
|
||||||
pages: {
|
pages: {
|
||||||
[pages.LOADING]: "loading",
|
[pages.LOADING]: 'loading',
|
||||||
[pages.MAIN]: "default/main",
|
[pages.MAIN]: 'default/main',
|
||||||
[pages.TALENT]: "default/talent",
|
[pages.TALENT]: 'default/talent',
|
||||||
[pages.PROPERTY]: "default/property",
|
[pages.PROPERTY]: 'default/property',
|
||||||
[pages.TRAJECTORY]: "default/trajectory",
|
[pages.TRAJECTORY]: 'default/trajectory',
|
||||||
[pages.SUMMARY]: "default/summary",
|
[pages.SUMMARY]: 'default/summary',
|
||||||
[pages.ACHIEVEMENT]: "default/achievement",
|
[pages.ACHIEVEMENT]: 'default/achievement',
|
||||||
[pages.THANKS]: "default/thanks",
|
[pages.THANKS]: 'default/thanks',
|
||||||
[pages.THEMES]: 'themes',
|
[pages.THEMES]: 'themes',
|
||||||
[pages.SAVELOAD]: 'saveload',
|
[pages.SAVELOAD]: 'saveload',
|
||||||
[pages.MODE]: 'default/mode',
|
[pages.MODE]: 'default/mode',
|
||||||
[pages.CELEBRITY]: 'default/celebrity',
|
[pages.CELEBRITY]: 'default/celebrity',
|
||||||
},
|
},
|
||||||
popups: {
|
popups: {
|
||||||
[popups.ACHIEVEMENT]: "default/popup/achievementPopup",
|
[popups.ACHIEVEMENT]: 'default/popup/achievementPopup',
|
||||||
[popups.MESSAGE]: "message",
|
[popups.MESSAGE]: 'message',
|
||||||
},
|
},
|
||||||
configs: {
|
configs: {
|
||||||
bgColor: '#222831',
|
bgColor: '#222831',
|
||||||
@@ -248,18 +238,8 @@ const dark = {
|
|||||||
hoverColor: '#ffc500',
|
hoverColor: '#ffc500',
|
||||||
hoverStroke: '#ffa500',
|
hoverStroke: '#ffa500',
|
||||||
},
|
},
|
||||||
grade: [
|
grade: ['#cccccc', '#55fffe', '#b17cff', '#ffce45'],
|
||||||
'#cccccc',
|
filter: ['#ccccccff', '#55fffeff', '#b17cffff', '#ffce45ff'],
|
||||||
'#55fffe',
|
|
||||||
'#b17cff',
|
|
||||||
'#ffce45',
|
|
||||||
],
|
|
||||||
filter: [
|
|
||||||
'#ccccccff',
|
|
||||||
'#55fffeff',
|
|
||||||
'#b17cffff',
|
|
||||||
'#ffce45ff',
|
|
||||||
],
|
|
||||||
card: [
|
card: [
|
||||||
{
|
{
|
||||||
normal: {
|
normal: {
|
||||||
@@ -281,7 +261,7 @@ const dark = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
normal: {
|
normal: {
|
||||||
@@ -303,7 +283,7 @@ const dark = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
normal: {
|
normal: {
|
||||||
@@ -325,7 +305,7 @@ const dark = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
normal: {
|
normal: {
|
||||||
@@ -347,8 +327,8 @@ const dark = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
summary: [
|
summary: [
|
||||||
{
|
{
|
||||||
@@ -360,7 +340,8 @@ const dark = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 2,
|
lineWidth: 2,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
defaultColor: '#6495ed',
|
defaultColor: '#6495ed',
|
||||||
defaultStroke: '#f8f8f8',
|
defaultStroke: '#f8f8f8',
|
||||||
defaultLabel: '#eeeeee',
|
defaultLabel: '#eeeeee',
|
||||||
@@ -369,7 +350,8 @@ const dark = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 2,
|
lineWidth: 2,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
defaultColor: '#e2a7ff',
|
defaultColor: '#e2a7ff',
|
||||||
defaultStroke: '#f8f8f8',
|
defaultStroke: '#f8f8f8',
|
||||||
defaultLabel: '#eeeeee',
|
defaultLabel: '#eeeeee',
|
||||||
@@ -388,7 +370,7 @@ const dark = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 2,
|
lineWidth: 2,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
achievement: [
|
achievement: [
|
||||||
{
|
{
|
||||||
@@ -400,7 +382,8 @@ const dark = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
defaultColor: '#6495ed',
|
defaultColor: '#6495ed',
|
||||||
defaultStroke: '#f8f8f8',
|
defaultStroke: '#f8f8f8',
|
||||||
defaultLabel: '#eeeeee',
|
defaultLabel: '#eeeeee',
|
||||||
@@ -409,7 +392,8 @@ const dark = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
defaultColor: '#e2a7ff',
|
defaultColor: '#e2a7ff',
|
||||||
defaultStroke: '#f8f8f8',
|
defaultStroke: '#f8f8f8',
|
||||||
defaultLabel: '#eeeeee',
|
defaultLabel: '#eeeeee',
|
||||||
@@ -428,7 +412,7 @@ const dark = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
characterItem: {
|
characterItem: {
|
||||||
name: {
|
name: {
|
||||||
@@ -488,7 +472,7 @@ const dark = {
|
|||||||
},
|
},
|
||||||
font_default: {
|
font_default: {
|
||||||
color: '#eeeeee',
|
color: '#eeeeee',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
pages: {
|
pages: {
|
||||||
[pages.MAIN]: {
|
[pages.MAIN]: {
|
||||||
@@ -512,14 +496,14 @@ const dark = {
|
|||||||
names: {
|
names: {
|
||||||
title: 'title',
|
title: 'title',
|
||||||
btnSmall: 'btn_small',
|
btnSmall: 'btn_small',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.TALENT]: {
|
[pages.TALENT]: {
|
||||||
vars: {
|
vars: {
|
||||||
btnDrawCard: 'btn_main',
|
btnDrawCard: 'btn_main',
|
||||||
btnNext: 'btn_main',
|
btnNext: 'btn_main',
|
||||||
title: 'title',
|
title: 'title',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.PROPERTY]: {
|
[pages.PROPERTY]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -530,9 +514,9 @@ const dark = {
|
|||||||
names: {
|
names: {
|
||||||
font_default: 'font_default',
|
font_default: 'font_default',
|
||||||
property: {
|
property: {
|
||||||
colorFilter: '#eeeeeeff'
|
colorFilter: '#eeeeeeff',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.TRAJECTORY]: {
|
[pages.TRAJECTORY]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -548,8 +532,8 @@ const dark = {
|
|||||||
radius: 4,
|
radius: 4,
|
||||||
},
|
},
|
||||||
boxSpeed: {
|
boxSpeed: {
|
||||||
colorFilter: '#ffffffff'
|
colorFilter: '#ffffffff',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
names: {
|
names: {
|
||||||
propertyBox: {
|
propertyBox: {
|
||||||
@@ -571,8 +555,8 @@ const dark = {
|
|||||||
hoverLabel: '#222831',
|
hoverLabel: '#222831',
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.SUMMARY]: {
|
[pages.SUMMARY]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -581,7 +565,7 @@ const dark = {
|
|||||||
},
|
},
|
||||||
names: {
|
names: {
|
||||||
font_default: 'font_default',
|
font_default: 'font_default',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.ACHIEVEMENT]: {
|
[pages.ACHIEVEMENT]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -591,7 +575,7 @@ const dark = {
|
|||||||
names: {
|
names: {
|
||||||
font_default: 'font_default',
|
font_default: 'font_default',
|
||||||
title: 'title',
|
title: 'title',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.THANKS]: {
|
[pages.THANKS]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -632,7 +616,7 @@ const dark = {
|
|||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
radius: 80,
|
radius: 80,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.SAVELOAD]: {
|
[pages.SAVELOAD]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -669,20 +653,20 @@ const dark = {
|
|||||||
radius: 80,
|
radius: 80,
|
||||||
defaultLabel: '#ffffff',
|
defaultLabel: '#ffffff',
|
||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.MODE]: {
|
[pages.MODE]: {
|
||||||
names: {
|
names: {
|
||||||
font_default: 'font_default',
|
font_default: 'font_default',
|
||||||
btn: 'btn_main',
|
btn: 'btn_main',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.CELEBRITY]: {
|
[pages.CELEBRITY]: {
|
||||||
vars: {
|
vars: {
|
||||||
btnRetry: 'btn_main',
|
btnRetry: 'btn_main',
|
||||||
btnNext: 'btn_main2',
|
btnNext: 'btn_main2',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
popups: {
|
popups: {
|
||||||
@@ -693,31 +677,31 @@ const dark = {
|
|||||||
defaultStroke: '#84ff55',
|
defaultStroke: '#84ff55',
|
||||||
hoverColor: '#292a28',
|
hoverColor: '#292a28',
|
||||||
hoverStroke: '#84ff55',
|
hoverStroke: '#84ff55',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const light = {
|
const light = {
|
||||||
pages: {
|
pages: {
|
||||||
[pages.LOADING]: "loading",
|
[pages.LOADING]: 'loading',
|
||||||
[pages.MAIN]: "default/main",
|
[pages.MAIN]: 'default/main',
|
||||||
[pages.TALENT]: "default/talent",
|
[pages.TALENT]: 'default/talent',
|
||||||
[pages.PROPERTY]: "default/property",
|
[pages.PROPERTY]: 'default/property',
|
||||||
[pages.TRAJECTORY]: "default/trajectory",
|
[pages.TRAJECTORY]: 'default/trajectory',
|
||||||
[pages.SUMMARY]: "default/summary",
|
[pages.SUMMARY]: 'default/summary',
|
||||||
[pages.ACHIEVEMENT]: "default/achievement",
|
[pages.ACHIEVEMENT]: 'default/achievement',
|
||||||
[pages.THANKS]: "default/thanks",
|
[pages.THANKS]: 'default/thanks',
|
||||||
[pages.THEMES]: 'themes',
|
[pages.THEMES]: 'themes',
|
||||||
[pages.SAVELOAD]: 'saveload',
|
[pages.SAVELOAD]: 'saveload',
|
||||||
[pages.MODE]: 'default/mode',
|
[pages.MODE]: 'default/mode',
|
||||||
[pages.CELEBRITY]: 'default/celebrity',
|
[pages.CELEBRITY]: 'default/celebrity',
|
||||||
},
|
},
|
||||||
popups: {
|
popups: {
|
||||||
[popups.ACHIEVEMENT]: "default/popup/achievementPopup",
|
[popups.ACHIEVEMENT]: 'default/popup/achievementPopup',
|
||||||
[popups.MESSAGE]: "message",
|
[popups.MESSAGE]: 'message',
|
||||||
},
|
},
|
||||||
configs: {
|
configs: {
|
||||||
bgColor: '#ffffff',
|
bgColor: '#ffffff',
|
||||||
@@ -757,18 +741,8 @@ const light = {
|
|||||||
hoverColor: '#ffc500',
|
hoverColor: '#ffc500',
|
||||||
hoverStroke: '#ffa500',
|
hoverStroke: '#ffa500',
|
||||||
},
|
},
|
||||||
grade: [
|
grade: ['#000000', '#55fffe', '#b17cff', '#ffce45'],
|
||||||
'#000000',
|
filter: ['#000000ff', '#55fffeff', '#b17cffff', '#ffce45ff'],
|
||||||
'#55fffe',
|
|
||||||
'#b17cff',
|
|
||||||
'#ffce45',
|
|
||||||
],
|
|
||||||
filter: [
|
|
||||||
'#000000ff',
|
|
||||||
'#55fffeff',
|
|
||||||
'#b17cffff',
|
|
||||||
'#ffce45ff',
|
|
||||||
],
|
|
||||||
card: [
|
card: [
|
||||||
{
|
{
|
||||||
normal: {
|
normal: {
|
||||||
@@ -790,7 +764,7 @@ const light = {
|
|||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
normal: {
|
normal: {
|
||||||
@@ -812,7 +786,7 @@ const light = {
|
|||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
normal: {
|
normal: {
|
||||||
@@ -834,7 +808,7 @@ const light = {
|
|||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
normal: {
|
normal: {
|
||||||
@@ -856,8 +830,8 @@ const light = {
|
|||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
summary: [
|
summary: [
|
||||||
{
|
{
|
||||||
@@ -869,7 +843,8 @@ const light = {
|
|||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
defaultColor: '#6495ed',
|
defaultColor: '#6495ed',
|
||||||
defaultStroke: '#f8f8f8',
|
defaultStroke: '#f8f8f8',
|
||||||
defaultLabel: '#ffffff',
|
defaultLabel: '#ffffff',
|
||||||
@@ -878,7 +853,8 @@ const light = {
|
|||||||
hoverLabel: '#666666',
|
hoverLabel: '#666666',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
defaultColor: '#e2a7ff',
|
defaultColor: '#e2a7ff',
|
||||||
defaultStroke: '#f8f8f8',
|
defaultStroke: '#f8f8f8',
|
||||||
defaultLabel: '#ffffff',
|
defaultLabel: '#ffffff',
|
||||||
@@ -887,7 +863,8 @@ const light = {
|
|||||||
hoverLabel: '#666666',
|
hoverLabel: '#666666',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
defaultColor: '#ffa07a',
|
defaultColor: '#ffa07a',
|
||||||
defaultStroke: '#f8f8f8',
|
defaultStroke: '#f8f8f8',
|
||||||
defaultLabel: '#ffffff',
|
defaultLabel: '#ffffff',
|
||||||
@@ -908,7 +885,8 @@ const light = {
|
|||||||
hoverLabel: '#efefef',
|
hoverLabel: '#efefef',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
defaultColor: '#6495ed',
|
defaultColor: '#6495ed',
|
||||||
defaultStroke: '#cccccc',
|
defaultStroke: '#cccccc',
|
||||||
defaultLabel: '#eeeeee',
|
defaultLabel: '#eeeeee',
|
||||||
@@ -917,7 +895,8 @@ const light = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
defaultColor: '#e2a7ff',
|
defaultColor: '#e2a7ff',
|
||||||
defaultStroke: '#cccccc',
|
defaultStroke: '#cccccc',
|
||||||
defaultLabel: '#eeeeee',
|
defaultLabel: '#eeeeee',
|
||||||
@@ -926,7 +905,8 @@ const light = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
defaultColor: '#ffa07a',
|
defaultColor: '#ffa07a',
|
||||||
defaultStroke: '#cccccc',
|
defaultStroke: '#cccccc',
|
||||||
defaultLabel: '#eeeeee',
|
defaultLabel: '#eeeeee',
|
||||||
@@ -935,7 +915,7 @@ const light = {
|
|||||||
hoverLabel: '#3b3b3b',
|
hoverLabel: '#3b3b3b',
|
||||||
lineWidth: 4,
|
lineWidth: 4,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
characterItem: {
|
characterItem: {
|
||||||
name: {
|
name: {
|
||||||
@@ -995,7 +975,7 @@ const light = {
|
|||||||
},
|
},
|
||||||
font_default: {
|
font_default: {
|
||||||
color: '#000000',
|
color: '#000000',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
pages: {
|
pages: {
|
||||||
[pages.MAIN]: {
|
[pages.MAIN]: {
|
||||||
@@ -1019,14 +999,14 @@ const light = {
|
|||||||
names: {
|
names: {
|
||||||
title: 'title',
|
title: 'title',
|
||||||
btnSmall: 'btn_small',
|
btnSmall: 'btn_small',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.TALENT]: {
|
[pages.TALENT]: {
|
||||||
vars: {
|
vars: {
|
||||||
btnDrawCard: 'btn_main',
|
btnDrawCard: 'btn_main',
|
||||||
btnNext: 'btn_main',
|
btnNext: 'btn_main',
|
||||||
title: 'title',
|
title: 'title',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.PROPERTY]: {
|
[pages.PROPERTY]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -1037,9 +1017,9 @@ const light = {
|
|||||||
names: {
|
names: {
|
||||||
font_default: 'font_default',
|
font_default: 'font_default',
|
||||||
property: {
|
property: {
|
||||||
colorFilter: '#000000ff'
|
colorFilter: '#000000ff',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.TRAJECTORY]: {
|
[pages.TRAJECTORY]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -1055,8 +1035,8 @@ const light = {
|
|||||||
radius: 4,
|
radius: 4,
|
||||||
},
|
},
|
||||||
boxSpeed: {
|
boxSpeed: {
|
||||||
colorFilter: '#666666ff'
|
colorFilter: '#666666ff',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
names: {
|
names: {
|
||||||
propertyBox: {
|
propertyBox: {
|
||||||
@@ -1078,8 +1058,8 @@ const light = {
|
|||||||
hoverLabel: '#222831',
|
hoverLabel: '#222831',
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
radius: 4,
|
radius: 4,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.SUMMARY]: {
|
[pages.SUMMARY]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -1088,7 +1068,7 @@ const light = {
|
|||||||
},
|
},
|
||||||
names: {
|
names: {
|
||||||
font_default: 'font_default',
|
font_default: 'font_default',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.ACHIEVEMENT]: {
|
[pages.ACHIEVEMENT]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -1098,7 +1078,7 @@ const light = {
|
|||||||
names: {
|
names: {
|
||||||
font_default: 'font_default',
|
font_default: 'font_default',
|
||||||
title: 'title',
|
title: 'title',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.THANKS]: {
|
[pages.THANKS]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -1120,7 +1100,7 @@ const light = {
|
|||||||
hoverStroke: '#dc76a9',
|
hoverStroke: '#dc76a9',
|
||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
radius: 4,
|
radius: 4,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
[pages.THEMES]: {
|
[pages.THEMES]: {
|
||||||
@@ -1139,7 +1119,7 @@ const light = {
|
|||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
radius: 80,
|
radius: 80,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.SAVELOAD]: {
|
[pages.SAVELOAD]: {
|
||||||
vars: {
|
vars: {
|
||||||
@@ -1176,20 +1156,20 @@ const light = {
|
|||||||
radius: 80,
|
radius: 80,
|
||||||
defaultLabel: '#ffffff',
|
defaultLabel: '#ffffff',
|
||||||
hoverLabel: '#ffffff',
|
hoverLabel: '#ffffff',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.MODE]: {
|
[pages.MODE]: {
|
||||||
names: {
|
names: {
|
||||||
font_default: 'font_default',
|
font_default: 'font_default',
|
||||||
btn: 'btn_main',
|
btn: 'btn_main',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[pages.CELEBRITY]: {
|
[pages.CELEBRITY]: {
|
||||||
vars: {
|
vars: {
|
||||||
btnRetry: 'btn_main',
|
btnRetry: 'btn_main',
|
||||||
btnNext: 'btn_main2',
|
btnNext: 'btn_main2',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
popups: {
|
popups: {
|
||||||
@@ -1201,14 +1181,13 @@ const light = {
|
|||||||
hoverColor: '#ffffff',
|
hoverColor: '#ffffff',
|
||||||
hoverStroke: '#84ff55',
|
hoverStroke: '#84ff55',
|
||||||
lineWidth: 1,
|
lineWidth: 1,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
},
|
||||||
}
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const themes = { default: dark, cyber, dark, light };
|
const themes = { default: dark, cyber, dark, light }
|
||||||
|
|
||||||
export default { themes, pages, popups };
|
export default { themes, pages, popups }
|
||||||
@@ -2,10 +2,7 @@
|
|||||||
<html lang="{{ site.lang | default: "en-US" }}">
|
<html lang="{{ site.lang | default: "en-US" }}">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<script data-ad-client="ca-pub-9857163863537600" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
|
||||||
{% seo %}
|
{% seo %}
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
||||||
<link rel="preload" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap" as="style" type="text/css" crossorigin>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="theme-color" content="#157878">
|
<meta name="theme-color" content="#157878">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
@@ -18,8 +15,7 @@
|
|||||||
<header class="page-header" role="banner">
|
<header class="page-header" role="banner">
|
||||||
<h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1>
|
<h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1>
|
||||||
<h2 class="project-tagline">{{ page.description | default: site.description | default: site.github.project_tagline }}</h2>
|
<h2 class="project-tagline">{{ page.description | default: site.description | default: site.github.project_tagline }}</h2>
|
||||||
<a href="/view/" class="btn">RESTART</a>
|
<a href="/public/" class="btn">RESTART</a>
|
||||||
<a href="/view/test.html" class="btn">Source Version</a>
|
|
||||||
{% if site.github.is_project_page %}
|
{% if site.github.is_project_page %}
|
||||||
<a href="{{ site.github.repository_url }}" class="btn">View on GitHub</a>
|
<a href="{{ site.github.repository_url }}" class="btn">View on GitHub</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -7,10 +7,8 @@
|
|||||||
<meta name="description" content="やり直すんだ。そして、次はうまくやる。"/>
|
<meta name="description" content="やり直すんだ。そして、次はうまくやる。"/>
|
||||||
<meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/>
|
<meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/>
|
||||||
<title>Life Restart</title>
|
<title>Life Restart</title>
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
window.location.href="/public/index.html";
|
window.location.href="/public/index.html";
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</head>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
import { readFile } from 'fs/promises';
|
|
||||||
import Life from '../src/life.js'
|
|
||||||
|
|
||||||
globalThis.json = async fileName => JSON.parse(await readFile(`data/${fileName}.json`));
|
|
||||||
|
|
||||||
globalThis.localStorage = {};
|
|
||||||
localStorage.getItem = key => localStorage[key]===void 0? null: localStorage[key];
|
|
||||||
localStorage.setItem = (key, value) => (localStorage[key] = value);
|
|
||||||
|
|
||||||
|
|
||||||
globalThis.$$eventMap = new Map();
|
|
||||||
globalThis.$$event = (tag, data) => {
|
|
||||||
const listener = $$eventMap.get(tag);
|
|
||||||
if(listener) listener.forEach(fn=>fn(data));
|
|
||||||
}
|
|
||||||
globalThis.$$on = (tag, fn) => {
|
|
||||||
let listener = $$eventMap.get(tag);
|
|
||||||
if(!listener) {
|
|
||||||
listener = new Set();
|
|
||||||
$$eventMap.set(tag, listener);
|
|
||||||
}
|
|
||||||
listener.add(fn);
|
|
||||||
}
|
|
||||||
globalThis.$$off = (tag, fn) => {
|
|
||||||
const listener = $$eventMap.get(tag);
|
|
||||||
if(listener) listener.delete(fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function debug() {
|
|
||||||
|
|
||||||
const life = new Life();
|
|
||||||
await life.initial();
|
|
||||||
|
|
||||||
life.restart({
|
|
||||||
CHR: 5, // 颜值 charm CHR
|
|
||||||
INT: 5, // 智力 intelligence INT
|
|
||||||
STR: 5, // 体质 strength STR
|
|
||||||
MNY: 5, // 家境 money MNY
|
|
||||||
SPR: 5, // 快乐 spirit SPR
|
|
||||||
// AGE: 100,
|
|
||||||
TLT: [1134, 1048, 1114], // 天赋 talent TLT
|
|
||||||
});
|
|
||||||
const lifeTrajectory = [];
|
|
||||||
let trajectory;
|
|
||||||
do{
|
|
||||||
try{
|
|
||||||
trajectory = life.next();
|
|
||||||
} catch(e) {
|
|
||||||
console.error(e);
|
|
||||||
// debugger
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
lifeTrajectory.push(trajectory);
|
|
||||||
const { age, content } = trajectory;
|
|
||||||
console.debug(
|
|
||||||
`---------------------------------`,
|
|
||||||
`\n-- ${age} 岁\n `,
|
|
||||||
content.map(
|
|
||||||
({type, description, rate, name, postEvent}) => {
|
|
||||||
switch(type) {
|
|
||||||
case 'TLT':
|
|
||||||
return `天赋【${name}】发动:${description}`;
|
|
||||||
case 'EVT':
|
|
||||||
return description + (postEvent?`\n ${postEvent}`:'');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
).join('\n ')
|
|
||||||
);
|
|
||||||
if(age == 60) debugger
|
|
||||||
} while(!trajectory.isEnd)
|
|
||||||
// debugger;
|
|
||||||
}
|
|
||||||
|
|
||||||
debug();
|
|
||||||
7
vite.config.js
Normal file
7
vite.config.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/** @type {import('vite').UserConfig} */
|
||||||
|
export default {
|
||||||
|
base: './',
|
||||||
|
build: {
|
||||||
|
outDir: 'template/public',
|
||||||
|
},
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user