Compare commits
84 Commits
v1.0.0-bet
...
32d7d4b824
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32d7d4b824 | ||
|
|
3b83c7b9e3 | ||
|
|
e3f93818d6 | ||
|
|
598601cbf2 | ||
|
|
7766ceb607 | ||
|
|
3b20e05769 | ||
|
|
b6bbdde260 | ||
|
|
824a4a229f | ||
|
|
2a3d811187 | ||
|
|
403621be40 | ||
|
|
84785f3e40 | ||
|
|
1b7ae5f1ff | ||
|
|
4a5127fecf | ||
|
|
1c8628bb3d | ||
|
|
160aab5bc2 | ||
|
|
eff286199f | ||
|
|
175f9f869f | ||
|
|
43d621324a | ||
|
|
d60d8bab51 | ||
|
|
b849b6bf7e | ||
|
|
1cf073bc51 | ||
|
|
d86f2330d5 | ||
|
|
ee461384b2 | ||
|
|
6928367884 | ||
|
|
caf08695d1 | ||
|
|
2ec9fc5412 | ||
|
|
156ef662f4 | ||
|
|
16bda15111 | ||
|
|
6789db0997 | ||
|
|
cea157765e | ||
|
|
bcdb452aa3 | ||
|
|
2346935149 | ||
|
|
f730eaa0e6 | ||
|
|
7e808e1bde | ||
|
|
22794d3f71 | ||
|
|
0195c857d5 | ||
|
|
f105be1882 | ||
|
|
313dc29a9a | ||
|
|
ac78231a78 | ||
|
|
b73e547732 | ||
|
|
94781e78b0 | ||
|
|
86126e7444 | ||
|
|
c758f13a10 | ||
|
|
d866dc6d7b | ||
|
|
c358af923a | ||
|
|
666862a6b2 | ||
|
|
325146e161 | ||
|
|
48c1b9a6cc | ||
|
|
2c4b276686 | ||
|
|
dbac251c76 | ||
|
|
0cee643697 | ||
|
|
d3eddf16d3 | ||
|
|
a90f88049b | ||
|
|
af4fca2e71 | ||
|
|
e2fe7ef955 | ||
|
|
59678748a8 | ||
|
|
d719f2fcbf | ||
|
|
f1f8172f4e | ||
|
|
cbe51784ba | ||
|
|
c27bac4ea1 | ||
|
|
da874adcad | ||
|
|
4b1433f22a | ||
|
|
4d22567ad4 | ||
|
|
3c42cfb546 | ||
|
|
b0ef08c0c2 | ||
|
|
a839eb18cd | ||
|
|
dcba35d5ae | ||
|
|
5778ddc0b9 | ||
|
|
bc4244c99a | ||
|
|
5191569e3e | ||
|
|
bb830fa313 | ||
|
|
e7427f564c | ||
|
|
0350ec09c4 | ||
|
|
99d445638f | ||
|
|
6cb60663b6 | ||
|
|
fe761241b3 | ||
|
|
549d9de5ca | ||
|
|
36d8f30fe2 | ||
|
|
a0974704c3 | ||
|
|
177cd4c34e | ||
|
|
b3dd499e17 | ||
|
|
ee5842bb1f | ||
|
|
62acdc845f | ||
|
|
1583a631a5 |
31
.github/workflows/node.js.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# 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
|
||||||
6
.gitignore
vendored
@@ -103,4 +103,8 @@ dist
|
|||||||
# TernJS port file
|
# TernJS port file
|
||||||
.tern-port
|
.tern-port
|
||||||
|
|
||||||
utils/xlsxTransform-*
|
utils/xlsxTransform-*
|
||||||
|
|
||||||
|
/.idea
|
||||||
|
|
||||||
|
__localStorage.json
|
||||||
11
.vscode/launch.json
vendored
@@ -22,6 +22,15 @@
|
|||||||
"skipFiles": [
|
"skipFiles": [
|
||||||
"<node_internals>/**"
|
"<node_internals>/**"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"name": "Attach by Process ID",
|
||||||
|
"processId": "${command:PickProcess}",
|
||||||
|
"request": "attach",
|
||||||
|
"skipFiles": [
|
||||||
|
"<node_internals>/**"
|
||||||
|
],
|
||||||
|
"type": "node"
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
54
README-zh_CN.md
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
# lifeRestart
|
||||||
|
|
||||||
|
<a href="https://discord.gg/U3qrf49NMQ"><img src="https://img.shields.io/discord/883382868427014255?color=%23FEE75C&label=Discord&logo=discord&logoColor=white&style=for-the-badge" /></a>
|
||||||
|
|
||||||
|
[English](./README.md) | 简体中文
|
||||||
|
|
||||||
|
## 简介
|
||||||
|
|
||||||
|
- Game Life Restart
|
||||||
|
|
||||||
|
## 使用
|
||||||
|
|
||||||
|
### 网页版
|
||||||
|
|
||||||
|
1. 下载项目代码。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/VickScarlet/lifeRestart.git my-project
|
||||||
|
cd my-project
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 进入目录安装依赖。
|
||||||
|
|
||||||
|
```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)。
|
||||||
|
|
||||||
|
### 控制台版本
|
||||||
|
|
||||||
|
```bash
|
||||||
|
node repl
|
||||||
|
```
|
||||||
|
|
||||||
|
> 更多信息请参考 [官网文档](https://liferestart.syaro.io/)。
|
||||||
54
README.md
@@ -1,2 +1,54 @@
|
|||||||
# lifeRestart
|
# lifeRestart
|
||||||
Game Life Restart
|
|
||||||
|
<a href="https://discord.gg/U3qrf49NMQ"><img src="https://img.shields.io/discord/883382868427014255?color=%23FEE75C&label=Discord&logo=discord&logoColor=white&style=for-the-badge" /></a>
|
||||||
|
|
||||||
|
English | [简体中文](./README-zh_CN.md)
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
- Game Life Restart
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Web Version
|
||||||
|
|
||||||
|
1. Clone project code.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone git@github.com:VickScarlet/lifeRestart.git my-project
|
||||||
|
cd my-project
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Installation dependence.
|
||||||
|
|
||||||
|
```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).
|
||||||
|
|
||||||
|
### Command Line Version
|
||||||
|
|
||||||
|
```bash
|
||||||
|
node repl
|
||||||
|
```
|
||||||
|
|
||||||
|
> More instructions at [documentation](https://liferestart.syaro.io/)。
|
||||||
|
|||||||
@@ -2,7 +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="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>
|
<link rel="preload" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap" as="style" type="text/css" crossorigin>
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
<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="/view/" 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 %}
|
||||||
|
|||||||
504
data/age.csv
Normal file
2592
data/age.json
BIN
data/age.xlsx
1572
data/events.csv
Normal file
486
data/events.json
BIN
data/events.xlsx
133
data/talents.csv
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
$id,name,description,condition,grade,status,effect:SPR,effect:MNY,effect:CHR,effect:STR,effect:INT,exclusive[],exclusive[],exclusive[],exclusive[],exclusive[],exclusive[]
|
||||||
|
序号,天赋名,括号中的内容,触发条件,稀有度,初始可用属性点,额外快乐,额外家境,额外颜值,额外体质,额外智力,互斥天赋,互斥天赋,互斥天赋,互斥天赋,互斥天赋,互斥天赋
|
||||||
|
1001,随身玉佩,或许有护佑作用,,0,,,,,,,,,,,,
|
||||||
|
1002,红肚兜,小时候死亡率降低,,0,,,,,,,,,,,,
|
||||||
|
1003,生而为男,性别一定为男,,1,,,,,,,1004,1025,1024,1113,,
|
||||||
|
1004,生而为女,性别一定为女,,1,,,,,,,1003,1024,1025,,,
|
||||||
|
1005,动漫高手,入宅的可能性翻6倍,,2,,,,,,,,,,,,
|
||||||
|
1006,乐天派,快乐+1,,0,,1,,,,,,,,,,
|
||||||
|
1007,天赋异禀,初始可用属性点+2,,1,2,,,,,,,,,,,
|
||||||
|
1008,天生抑郁,快乐-3,,0,,-3,,,,,,,,,,
|
||||||
|
1009,网络巨魔,快乐+2,,1,,2,,,,,,,,,,
|
||||||
|
1010,天龙人,你拥有北京户口,,2,,,,,,,1012,1013,1014,,,
|
||||||
|
1011,独生子女,你没有兄弟姐妹,,0,,,,,,,,,,,,
|
||||||
|
1012,乡间微风,你出生在农村,,0,,,,,,,1010,1013,1014,,,
|
||||||
|
1013,城中高楼,你出生在城市,,0,,,,,,,1010,1012,1014,,,
|
||||||
|
1014,美籍华人,你有美国国籍,,2,,,3,,,,1010,1012,1013,,,
|
||||||
|
1015,家中老大,你最受父母宠爱,,1,,,,,,,,,,,,
|
||||||
|
1016,水性良好,不会被淹死,,0,,,,,,,,,,,,
|
||||||
|
1017,先天免疫,你不会得艾滋病,,0,,,,,,,,,,,,
|
||||||
|
1018,人类进化,所有属性+1,,2,,1,1,1,1,1,,,,,,
|
||||||
|
1019,超凡,初始可用属性点+4,,2,4,,,,,,,,,,,
|
||||||
|
1020,父母美貌,颜值+2,,1,,,,2,,,,,,,,
|
||||||
|
1021,红颜薄命,颜值+2,体质-2,,0,,,,2,-2,,,,,,,
|
||||||
|
1022,属蛇,不会被蛇咬死,,0,,,,,,,,,,,,
|
||||||
|
1023,半神,所有属性+2,,3,,2,2,2,2,2,,,,,,
|
||||||
|
1024,人中龙凤,天生双重性别,,2,,,,,,,1003,1004,1025,,,
|
||||||
|
1025,阴阳之外,天生无性别,,2,,,,,,,1003,1024,1004,1113,,
|
||||||
|
1026,彩虹之下,可能和同性交往,,0,,,,,,,1113,,,,,
|
||||||
|
1027,斩情证道,终生不恋爱结婚,,1,,,,,,,1113,,,,,
|
||||||
|
1028,桃花连连,恋爱机会提升,,0,,,,,,,,,,,,
|
||||||
|
1029,平安童年,12岁前父母都健在,,1,,,,,,,,,,,,
|
||||||
|
1030,宠物大师,宠物不会意外死亡,,0,,,,,,,,,,,,
|
||||||
|
1031,天生残疾,体质-2,,0,,,,,-2,,,,,,,
|
||||||
|
1032,早产儿,所有属性-1,,0,,-1,-1,-1,-1,-1,,,,,,
|
||||||
|
1033,十死无生,体质-10,,0,,,,,-10,,,,,,,
|
||||||
|
1034,家运不顺,家境-2,,0,,,-2,,,,,,,,,
|
||||||
|
1035,头着地,智力-2,,0,,,,,,-2,,,,,,
|
||||||
|
1036,胎教,智力+1,,0,,,,,,1,,,,,,
|
||||||
|
1037,班中红人,和同学容易处好关系,,0,,,,,,,,,,,,
|
||||||
|
1038,骑士,能轻松学会骑车,,0,,,,,,,,,,,,
|
||||||
|
1039,永远的神,电竞天才,,1,,,,,,,,,,,,
|
||||||
|
1040,戒律,赌毒不沾,,0,,,,,,,,,,,,
|
||||||
|
1041,丁克,不生孩子,,1,,,,,,,1113,,,,,
|
||||||
|
1042,少数民族,高考+5分,,0,,,,,,,,,,,,
|
||||||
|
1043,老司机,你和家人不会发生车祸,,0,,,,,,,,,,,,
|
||||||
|
1044,低压,你的家人不会心脏病,,0,,,,,,,,,,,,
|
||||||
|
1045,战功,你退伍后会当官,,0,,,,,,,,,,,,
|
||||||
|
1046,不孕不育,你生不出孩子,,1,,,,,,,1113,,,,,
|
||||||
|
1047,白头偕老,爱人至少能活到70岁,,1,,,,,,,,,,,,
|
||||||
|
1048,神秘的小盒子,100岁时才能开启,,3,,,,,,,,,,,,
|
||||||
|
1049,三十而立,30岁时家境+2,AGE?[30],0,,,2,,,,,,,,,
|
||||||
|
1050,四十不惑,40岁时智力+2,AGE?[40],0,,,,,,2,,,,,,
|
||||||
|
1051,知天命,50岁时智力、快乐+1,AGE?[50],0,,1,,,,1,,,,,,
|
||||||
|
1052,耳顺,60岁时快乐+2,AGE?[60],0,,2,,,,,,,,,,
|
||||||
|
1053,从心所欲,70岁时快乐+3,AGE?[70],0,,3,,,,,,,,,,
|
||||||
|
1054,老当益壮,60岁时体质+2,AGE?[60],1,,,,,2,,,,,,,
|
||||||
|
1055,鹤发童颜,70岁时颜值+3,AGE?[70],0,,,,3,,,,,,,,
|
||||||
|
1056,学前启蒙,5岁时智力+2,AGE?[5],1,,,,,,2,,,,,,
|
||||||
|
1057,十八变,18岁时颜值+2,AGE?[18],1,,,,2,,,,,,,,
|
||||||
|
1058,迟来之财,90岁时家境+4,AGE?[90],0,,,4,,,,,,,,,
|
||||||
|
1059,理财达人,30、40、50岁时家境+1,"AGE?[30,40,50]",0,,,1,,,,,,,,,
|
||||||
|
1060,成熟,12、18岁时智力+1,"AGE?[12,18]",1,,,,,,1,,,,,,
|
||||||
|
1061,形象管理,16、24岁时颜值+1,"AGE?[16,24]",1,,,,1,,,,,,,,
|
||||||
|
1062,成年礼,18岁时快乐+1,AGE?[18],0,,1,,,,,,,,,,
|
||||||
|
1063,开光之胎,初始可用属性点+1,,0,1,,,,,,,,,,,
|
||||||
|
1064,天命,初始可用属性点+8,,3,8,,,,,,,,,,,
|
||||||
|
1065,祖传药丸,功能不明,,1,,,,,,,,,,,,
|
||||||
|
1066,精准扶贫,家境为0时家境+1,(MNY<1)&(MNY>-1),0,,,1,,,,,,,,,
|
||||||
|
1067,乐天派,快乐为0时快乐+1,(SPR<1)&(SPR>-1),1,,1,,,,,,,,,,
|
||||||
|
1068,命悬一线,体质为0时体质+1,(STR<1)&(STR>-1),0,,,,,1,,,,,,,
|
||||||
|
1069,智可生财,若20岁时智力>8,家境+2,(AGE?[20])&(INT>8),0,,,2,,,,,,,,,
|
||||||
|
1070,舔狗甚多,若20岁时颜值>8,快乐+2,(AGE?[20])&(CHR>8),0,,2,,,,,,,,,,
|
||||||
|
1071,保胎丸,你不会胎死腹中,,0,,,,,,,,,,,,
|
||||||
|
1072,白化病,你不会遭遇枪击,,0,,,,,,,,,,,,
|
||||||
|
1073,佛宗,考上哈佛大学的几率提高,,0,,,,,,,,,,,,
|
||||||
|
1074,悟道,智力>10时快乐+3,INT>10,1,,3,,,,,,,,,,
|
||||||
|
1075,驻颜,体质>10时颜值+3,STR>10,0,,,,3,,,,,,,,
|
||||||
|
1076,界限突破,体质>10时快乐+3,STR>10,1,,3,,,,,,,,,,
|
||||||
|
1077,倾城,颜值>10时快乐+3,CHR>10,1,,3,,,,,,,,,,
|
||||||
|
1078,训练有方,智力>10时体质+3,INT>10,0,,,,,3,,,,,,,
|
||||||
|
1079,相由心生,智力>10时颜值+3,INT>10,0,,,,3,,,,,,,,
|
||||||
|
1080,智多鑫,智力>10时家境+3,INT>10,0,,,3,,,,,,,,,
|
||||||
|
1081,灵光,快乐>10时其他属性+1,SPR>10,0,,,1,1,1,1,,,,,,
|
||||||
|
1082,天启,快乐>10时其他属性+2,SPR>10,1,,,2,2,2,2,,,,,,
|
||||||
|
1083,神谕,快乐>10时其他属性+3,SPR>10,2,,,3,3,3,3,,,,,,
|
||||||
|
1084,献祭,初始可用属性点-2,快乐+2,,0,-2,2,,,,,1122,,,,,
|
||||||
|
1085,幸运儿,初始可用属性点-3,快乐+5,,1,-3,5,,,,,1122,,,,,
|
||||||
|
1086,挑战者,初始可用点-10,,0,-10,,,,,,1122,,,,,
|
||||||
|
1087,你不懂,家境>10时快乐+3,MNY>10,1,,3,,,,,,,,,,
|
||||||
|
1088,整容,家境>10时颜值+3,MNY>10,0,,,,3,,,,,,,,
|
||||||
|
1089,钻石健身卡,家境>10时体质+3,MNY>10,0,,,,,3,,,,,,,
|
||||||
|
1090,身残志坚,体质<0时其他属性+1,STR<0,0,,1,1,1,,1,,,,,,
|
||||||
|
1091,活死人,体质<-1时其他属性+2,STR<0,1,,2,2,2,,2,,,,,,
|
||||||
|
1092,开一扇窗,颜值<0时其他属性+1,CHR<0,0,,1,1,,1,1,,,,,,
|
||||||
|
1093,大额头,颜值-2,智力+2,,0,,,,-2,,2,,,,,,
|
||||||
|
1094,痘痘脸,颜值-1,,0,,,,-1,,,,,,,,
|
||||||
|
1095,潜能,家境<0时其他属性+1,MNY<0,0,,1,,1,1,1,,,,,,
|
||||||
|
1096,哀兵,快乐<0时其他属性+1,SPR<0,0,,,1,1,1,1,,,,,,
|
||||||
|
1097,苦痛侍僧,快乐<-1时其他属性+2,SPR<-1,1,,,2,2,2,2,,,,,,
|
||||||
|
1098,觉醒,家境<-1时其他属性+2,MNY<-1,1,,2,,2,2,2,,,,,,
|
||||||
|
1099,抖M,家境-2,快乐+2,,0,,2,-2,,,,,,,,,
|
||||||
|
1100,海的女儿,颜值-2,初始可用属性点+1,,0,1,,,-2,,,,,,,,
|
||||||
|
1101,进阶,所有属性>5时,所有属性+1,(SPR>5)&(MNY>5)&(CHR>5)&(STR>5)&(INT>5),0,,1,1,1,1,1,,,,,,
|
||||||
|
1102,超进化,所有属性>5时,所有属性+2,(SPR>5)&(MNY>5)&(CHR>5)&(STR>5)&(INT>5),1,,2,2,2,2,2,,,,,,
|
||||||
|
1103,白色胶囊,你10岁时无事发生,AGE?[10],0,,,,,,,,,,,,
|
||||||
|
1104,紫色胶囊,跳过你的40~50岁,"AGE?[40,41,42,43,44,45,46,47,48,49,50]",2,,,,,,,,,,,,
|
||||||
|
1105,蓝色胶囊,你20、30岁时无事发生,"AGE?[20,30]",1,,,,,,,,,,,,
|
||||||
|
1106,健康饮食,你不吃洋快餐,,0,,,,,,,,,,,,
|
||||||
|
1107,不想罢了,你不会上清华大学,,0,,,,,,,,,,,,
|
||||||
|
1108,挑衅,你喜欢没事找事,,0,,,,,,,,,,,,
|
||||||
|
1109,旅行者,你喜欢旅游,,0,,,,,,,,,,,,
|
||||||
|
1110,水仙,你比较自恋,,0,,,,,,,,,,,,
|
||||||
|
1111,缺一门,无效果,,0,,,,,,,,,,,,
|
||||||
|
1112,异界来客,你可能听到一些绝密消息,,2,,,,,,,,,,,,
|
||||||
|
1113,三胎人生,你尽可能生三胎,,1,,,,,,,1003,1025,1026,1027,1041,1046
|
||||||
|
1114,橙色胶囊,跳过你的60~90岁,"AGE?[60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]",3,,,,,,,,,,,,
|
||||||
|
1115,宙斯,参加奥赛的几率提高,,0,,,,,,,,,,,,
|
||||||
|
1116,为人民服务,考公务员时一定能考上,,0,,,,,,,,,,,,
|
||||||
|
1117,表现良好,入狱会减刑,,0,,,,,,,,,,,,
|
||||||
|
1118,小吉,运气稍微提升,,0,,,,,,,,,,,,
|
||||||
|
1119,天秤座,据说做事很公平,,0,,,,,,,,,,,,
|
||||||
|
1120,万里挑一,你很攻,,0,,,,,,,,,,,,
|
||||||
|
1121,把握不住,你有强迫症,,0,,,,,,,,,,,,
|
||||||
|
1122,急了急了,赶着投胎,不要初始属性了,,1,-20,,,,,,1084,1085,1086,,,
|
||||||
|
1123,不离不弃,你不会离婚,,0,,,,,,,,,,,,
|
||||||
|
1124,足量,身高不矮,,0,,,,,,,,,,,,
|
||||||
|
1125,易胖体质,颜值更容易降低,,0,,,,,,,,,,,,
|
||||||
|
1126,黄帝,种族主义者,,0,,,,,,,,,,,,
|
||||||
|
1127,左撇子,习惯使用左手,,0,,,,,,,,,,,,
|
||||||
|
1128,克苏鲁,&▓▓▓◆▓▓▓¥#▓@■.◆,,2,,,,,,,,,,,,
|
||||||
|
1129,不连续存在,你还拥有其他人格,,2,,,,,,,,,,,,
|
||||||
|
1130,占位符,少一个可选天赋,,0,,,,,,,,,,,,
|
||||||
|
1131,魔法棒,不知道有什么用……,,2,,,,,,,,,,,,
|
||||||
|
@@ -1151,5 +1151,23 @@
|
|||||||
"name": "魔法棒",
|
"name": "魔法棒",
|
||||||
"description": "不知道有什么用……",
|
"description": "不知道有什么用……",
|
||||||
"grade": 2
|
"grade": 2
|
||||||
|
},
|
||||||
|
"1132": {
|
||||||
|
"id": 1132,
|
||||||
|
"name": "返老还童",
|
||||||
|
"description": "可能会回到年轻的时候",
|
||||||
|
"grade": 1
|
||||||
|
},
|
||||||
|
"1133": {
|
||||||
|
"id": 1133,
|
||||||
|
"name": "时光倒流",
|
||||||
|
"description": "或许时间会倒流",
|
||||||
|
"grade": 0
|
||||||
|
},
|
||||||
|
"1134": {
|
||||||
|
"id": 1134,
|
||||||
|
"name": "转世重修",
|
||||||
|
"description": "渡劫失败重生",
|
||||||
|
"grade": 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
2
index.md
@@ -1,3 +1,5 @@
|
|||||||
# Life Restart
|
# Life Restart
|
||||||
|
|
||||||
やり直すんだ。そして、次はうまくやる。[RESTART](view/index.html)
|
やり直すんだ。そして、次はうまくやる。[RESTART](view/index.html)
|
||||||
|
|
||||||
|
<iframe src="https://discord.com/widget?id=883382868427014255&theme=dark" width="350" height="500" allowtransparency="true" frameborder="0" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"></iframe>
|
||||||
13
package.json
@@ -4,9 +4,20 @@
|
|||||||
"bin": "test/index.js",
|
"bin": "test/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node test",
|
"test": "node test",
|
||||||
"xlsxTransform": "node utils/xlsxTransform.js data"
|
"xlsxTransform": "node utils/xlsxTransform.js data",
|
||||||
|
"dev": "webpack serve --open /view/index.html",
|
||||||
|
"build": "webpack --mode production"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/core": "^7.15.4",
|
||||||
|
"@babel/preset-env": "^7.15.4",
|
||||||
|
"babel-loader": "^8.2.2",
|
||||||
|
"core-js": "^3.17.2",
|
||||||
|
"webpack": "^5.51.2",
|
||||||
|
"webpack-dev-server": "^4.1.0",
|
||||||
"xlsx": "^0.17.0"
|
"xlsx": "^0.17.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"webpack-cli": "^4.8.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
public/bundle.js
Normal file
584
repl/app.js
Normal file
@@ -0,0 +1,584 @@
|
|||||||
|
import { max, sum } from '../src/functions/util.js';
|
||||||
|
import { summary } from '../src/functions/summary.js'
|
||||||
|
import { readFile } from 'fs/promises';
|
||||||
|
import Life from '../src/life.js';
|
||||||
|
|
||||||
|
global.json = async fileName => JSON.parse(await readFile(`data/${fileName}.json`));
|
||||||
|
|
||||||
|
class App {
|
||||||
|
constructor() {
|
||||||
|
this.#life = new Life();
|
||||||
|
}
|
||||||
|
|
||||||
|
Steps= {
|
||||||
|
TALENT: 'talent',
|
||||||
|
PROPERTY: 'property',
|
||||||
|
TRAJECTORY: 'trajectory',
|
||||||
|
SUMMARY: 'summary',
|
||||||
|
};
|
||||||
|
|
||||||
|
#step = this.Steps.SUMMARY;
|
||||||
|
#life;
|
||||||
|
#talentSelected = new Set();
|
||||||
|
#talentExtend = new Set();
|
||||||
|
#input;
|
||||||
|
#auto;
|
||||||
|
#isEnd;
|
||||||
|
#propertyAllocation;
|
||||||
|
#output;
|
||||||
|
#exit;
|
||||||
|
#interval;
|
||||||
|
#style = {
|
||||||
|
warn: ['\x1B[93m', '\x1B[39m'], // Bright Yellow
|
||||||
|
grade1: ['\x1B[94m', '\x1B[39m'], // Bright Blue
|
||||||
|
grade2: ['\x1B[95m', '\x1B[39m'], // Bright Magenta
|
||||||
|
grade3: ['\x1B[93m', '\x1B[39m'], // Bright Yellow
|
||||||
|
grade1b: ['\x1B[104m', '\x1B[49m'], // Bright Blue BG
|
||||||
|
grade2b: ['\x1B[105m', '\x1B[49m'], // Bright Magenta BG
|
||||||
|
grade3b: ['\x1B[103m', '\x1B[49m'], // Bright Yellow BG
|
||||||
|
};
|
||||||
|
#randomTalents;
|
||||||
|
|
||||||
|
style(type, str) {
|
||||||
|
const style = this.#style[type];
|
||||||
|
if(!style) return str;
|
||||||
|
return `${style[0]}${str}${style[1]}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
async initial() {
|
||||||
|
this.output('Now Loading...');
|
||||||
|
this.#talentExtend = global.localStorage.talentExtend;
|
||||||
|
await this.#life.initial();
|
||||||
|
this.output(`\rLoading Complete.
|
||||||
|
人生重开模拟器
|
||||||
|
这垃圾人生一秒也不想待了
|
||||||
|
\n🎉键入 \x1B[4m/remake\x1B[24m 开始游戏`,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
io(input, output, exit) {
|
||||||
|
this.#input = input;
|
||||||
|
this.#output = output;
|
||||||
|
this.#exit = exit;
|
||||||
|
input(command=>{
|
||||||
|
const ret = this.repl(command);
|
||||||
|
if(!ret) return;
|
||||||
|
if(typeof ret == 'string') return this.output(ret, true);
|
||||||
|
if(Array.isArray(ret)) return this.output(...ret);
|
||||||
|
const { message, isRepl } = ret;
|
||||||
|
return this.output(message, isRepl);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
output(data, isRepl) {
|
||||||
|
if(!this.#output) return;
|
||||||
|
this.#output(data, isRepl);
|
||||||
|
}
|
||||||
|
|
||||||
|
exit(code) {
|
||||||
|
if(this.#exit) this.#exit(code);
|
||||||
|
process.exit(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
repl(command) {
|
||||||
|
command = command.split(/\s+/);
|
||||||
|
switch(command.shift()) {
|
||||||
|
|
||||||
|
case 'r':
|
||||||
|
case 'remake':
|
||||||
|
case '/remake':return this.remake();
|
||||||
|
|
||||||
|
case 's':
|
||||||
|
case 'select':
|
||||||
|
case '/select': return this.select(...command);
|
||||||
|
|
||||||
|
case 'u':
|
||||||
|
case 'unselect':
|
||||||
|
case '/unselect': return this.unselect(...command);
|
||||||
|
|
||||||
|
case 'n':
|
||||||
|
case 'next':
|
||||||
|
case '/next': return this.next(true);
|
||||||
|
|
||||||
|
case 'a':
|
||||||
|
case 'alloc':
|
||||||
|
case 'allocation':
|
||||||
|
case '/alloc':
|
||||||
|
case '/allocation': return this.alloc(...command);
|
||||||
|
|
||||||
|
case 'rd':
|
||||||
|
case 'random':
|
||||||
|
case '/random': return this.random();
|
||||||
|
|
||||||
|
case 'at':
|
||||||
|
case 'auto':
|
||||||
|
case '/auto': return this.auto(...command);
|
||||||
|
|
||||||
|
case 'x':
|
||||||
|
case 'exit':
|
||||||
|
case '/exit': return this.exit(0);
|
||||||
|
|
||||||
|
case '?':
|
||||||
|
case 'h':
|
||||||
|
case 'help':
|
||||||
|
case '/?':
|
||||||
|
case '/h':
|
||||||
|
case '/help':
|
||||||
|
default: return this.help(...command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
help(key) {
|
||||||
|
|
||||||
|
switch(key) {
|
||||||
|
case 'x':
|
||||||
|
case 'exit':
|
||||||
|
case '/exit': return `退出
|
||||||
|
x, exit, /exit 命令同等效果`;
|
||||||
|
|
||||||
|
case 'r':
|
||||||
|
case 'remake':
|
||||||
|
case '/remake': return `重开
|
||||||
|
r, remake, /remake 命令同等效果`;
|
||||||
|
|
||||||
|
case 's':
|
||||||
|
case 'select':
|
||||||
|
case '/select': return `选择
|
||||||
|
s, select, /select 命令同等效果
|
||||||
|
|
||||||
|
Example: /select 1 2 3 意味着选择 1 2 3 三个天赋
|
||||||
|
|
||||||
|
/select <id1> [id2] [id3]
|
||||||
|
|
||||||
|
参数解释 <id1> 通常来说要指定至少一个id
|
||||||
|
虽然不指定也可以
|
||||||
|
[id2]
|
||||||
|
[id3] 可以不指定`;
|
||||||
|
|
||||||
|
case 'u':
|
||||||
|
case 'unselect':
|
||||||
|
case '/unselect': return `取消选择
|
||||||
|
u, unselect,
|
||||||
|
/unselect 命令同等效果
|
||||||
|
|
||||||
|
Example: /unselect 1 2 3
|
||||||
|
意味着取消选择 1 2 3 三个天赋
|
||||||
|
|
||||||
|
参数解释 /unselect <id1> [id2] [id3]
|
||||||
|
|
||||||
|
<id1> 通常来说要指定至少一个id
|
||||||
|
虽然不指定也可以
|
||||||
|
[id2]
|
||||||
|
[id3] 可以不指定`;
|
||||||
|
|
||||||
|
|
||||||
|
case 'a':
|
||||||
|
case 'alloc':
|
||||||
|
case 'allocation':
|
||||||
|
case '/alloc':
|
||||||
|
case '/allocation': return `分配属性点
|
||||||
|
a, alloc, allocation
|
||||||
|
/alloc, /allocation 命令同等效果
|
||||||
|
|
||||||
|
Example: /allocation STR 1
|
||||||
|
/allocation INT -3
|
||||||
|
/allocation CHR +5
|
||||||
|
|
||||||
|
参数解释 /allocation <TAG> <[+/-]value>
|
||||||
|
|
||||||
|
<TAG> 表示要分配的属性标签
|
||||||
|
可选有
|
||||||
|
CHR, chr, c, C 表示颜值
|
||||||
|
INT, int, i, I 表示智力
|
||||||
|
STR, str, s, S 表示体质
|
||||||
|
MNY, mny, m, M 表示家境
|
||||||
|
必填
|
||||||
|
|
||||||
|
<[+/-]value>
|
||||||
|
表示属性的调整
|
||||||
|
其中
|
||||||
|
+ 表示在当前基础上增加
|
||||||
|
- 表示在当前基础上减少
|
||||||
|
无符号表示直接设置为此值
|
||||||
|
必填`;
|
||||||
|
|
||||||
|
case 'n':
|
||||||
|
case 'next':
|
||||||
|
case '/next': return `继续
|
||||||
|
n, next, /next 命令同等效果
|
||||||
|
|
||||||
|
效果 通常用于各步骤结束后
|
||||||
|
例如: 选择天赋后
|
||||||
|
分配属性后
|
||||||
|
每个年龄事件后
|
||||||
|
总评后
|
||||||
|
继承天赋后`;
|
||||||
|
|
||||||
|
case 'at':
|
||||||
|
case 'auto':
|
||||||
|
case '/auto': return `自动播放
|
||||||
|
at, auto, /auto 命令同等效果
|
||||||
|
|
||||||
|
效果 用于人生的过程中
|
||||||
|
每个年龄会自动下一年
|
||||||
|
播放速度 1 秒 1 年`;
|
||||||
|
|
||||||
|
case '?':
|
||||||
|
case 'h':
|
||||||
|
case 'help':
|
||||||
|
case '/?':
|
||||||
|
case '/h':
|
||||||
|
case '/help': return `显示帮助
|
||||||
|
?, h, help
|
||||||
|
/?, /h, /help 命令同等效果
|
||||||
|
|
||||||
|
Example: /help
|
||||||
|
/help /select
|
||||||
|
|
||||||
|
参数解释 /help [command]
|
||||||
|
|
||||||
|
[command] 要详细显示帮助的命令
|
||||||
|
可以不填`;
|
||||||
|
}
|
||||||
|
return `Help ---
|
||||||
|
命令 说明 示例
|
||||||
|
x
|
||||||
|
exit
|
||||||
|
/exit 退出 /exit
|
||||||
|
|
||||||
|
r
|
||||||
|
remake
|
||||||
|
/remake 重开 /remake
|
||||||
|
|
||||||
|
s
|
||||||
|
select
|
||||||
|
/select 选择天赋 /select <id1> [id2] [id3]
|
||||||
|
|
||||||
|
u
|
||||||
|
unselect
|
||||||
|
/unselect 取消选择 /unselect <id1> [id2] [id3]
|
||||||
|
|
||||||
|
a
|
||||||
|
alloc
|
||||||
|
allocation
|
||||||
|
/alloc
|
||||||
|
/allocation 分配属性点 /allocation <TAG> <[+/-]value>
|
||||||
|
|
||||||
|
n
|
||||||
|
next
|
||||||
|
/next 继续 /next
|
||||||
|
|
||||||
|
at
|
||||||
|
auto
|
||||||
|
/auto 自动播放 /auto
|
||||||
|
|
||||||
|
?
|
||||||
|
h
|
||||||
|
help
|
||||||
|
/?
|
||||||
|
/h
|
||||||
|
/help 显示帮助 /help [command]`;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto(arg) {
|
||||||
|
this.#auto = arg != 'off';
|
||||||
|
return this.next(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
remake() {
|
||||||
|
if(this.#talentExtend) {
|
||||||
|
this.#life.talentExtend(this.#talentExtend)
|
||||||
|
global.dumpLocalStorage();
|
||||||
|
this.#talentExtend = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.#isEnd = false;
|
||||||
|
this.#talentSelected.clear();
|
||||||
|
this.#propertyAllocation = {CHR:0,INT:0,STR:0,MNY:0,SPR:5};
|
||||||
|
this.#step = this.Steps.TALENT;
|
||||||
|
this.#randomTalents = this.#life.talentRandom();
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
select(...select) {
|
||||||
|
switch(this.#step) {
|
||||||
|
case this.Steps.TALENT: return this.talentSelect(...select);
|
||||||
|
case this.Steps.SUMMARY: return this.talentExtend(...select);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unselect(...select) {
|
||||||
|
switch(this.#step) {
|
||||||
|
case this.Steps.TALENT: return this.talentUnSelect(...select);
|
||||||
|
case this.Steps.SUMMARY: return this.talentExtendCancle(...select);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
talentSelect(...select) {
|
||||||
|
const warn = str => `${this.list()}\n${this.style('warn', str)}`;
|
||||||
|
for(const number of select) {
|
||||||
|
const s = this.#randomTalents[number];
|
||||||
|
if(!s) return warn(`${number} 为未知天赋`);
|
||||||
|
if(this.#talentSelected.has(s)) continue;
|
||||||
|
if(this.#talentSelected.size == 3)
|
||||||
|
return warn('⚠只能选3个天赋');
|
||||||
|
|
||||||
|
const exclusive = this.#life.exclusive(
|
||||||
|
Array.from(this.#talentSelected).map(({id})=>id),
|
||||||
|
s.id
|
||||||
|
);
|
||||||
|
|
||||||
|
if(exclusive != null)
|
||||||
|
for(const { name, id } of this.#talentSelected)
|
||||||
|
if(id == exclusive)
|
||||||
|
return warn(`天赋【${s.name}】与已选择的天赋【${name}】冲突`);
|
||||||
|
|
||||||
|
this.#talentSelected.add(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
talentUnSelect(...select) {
|
||||||
|
for(const number of select) {
|
||||||
|
const s = this.#randomTalents[number];
|
||||||
|
if(this.#talentSelected.has(s))
|
||||||
|
this.#talentSelected.delete(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
talentExtend(select) {
|
||||||
|
const warn = str => `${this.list()}\n${this.style('warn', str)}`;
|
||||||
|
const list = Array.from(this.#talentSelected);
|
||||||
|
const s = list[select];
|
||||||
|
if(!s) return warn(`${select} 为未知天赋`);
|
||||||
|
this.#talentExtend = s.id;
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
talentExtendCancle() {
|
||||||
|
this.#talentExtend = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
list() {
|
||||||
|
let description, list, check;
|
||||||
|
switch(this.#step) {
|
||||||
|
case this.Steps.TALENT:
|
||||||
|
description = '🎉 请选择3个天赋';
|
||||||
|
list = this.#randomTalents;
|
||||||
|
check = talent=>this.#talentSelected.has(talent);
|
||||||
|
break;
|
||||||
|
case this.Steps.SUMMARY:
|
||||||
|
description = '🎉 你可以选一个天赋继承';
|
||||||
|
list = Array.from(this.#talentSelected);
|
||||||
|
check = ({id})=>this.#talentExtend == id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(!list) return '';
|
||||||
|
|
||||||
|
return [description, list.map(
|
||||||
|
(talent, i) =>
|
||||||
|
this.style(
|
||||||
|
`grade${talent.grade}b`,
|
||||||
|
`${check(talent)?'√':' '} ${i} ${talent.name}(${talent.description})`
|
||||||
|
)
|
||||||
|
)]
|
||||||
|
.flat()
|
||||||
|
.join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
next(enter) {
|
||||||
|
const warn = (a, b) => `${a}\n${this.style('warn', this.style('warn', b))}`;
|
||||||
|
switch(this.#step) {
|
||||||
|
case this.Steps.TALENT:
|
||||||
|
if(this.#talentSelected.size != 3) return warn(this.list(), `⚠请选择3个天赋`);
|
||||||
|
this.#step = this.Steps.PROPERTY;
|
||||||
|
this.#propertyAllocation.total = 20 + this.#life.getTalentAllocationAddition(
|
||||||
|
Array.from(this.#talentSelected).map(({id})=>id)
|
||||||
|
);
|
||||||
|
this.#propertyAllocation.TLT = Array.from(this.#talentSelected).map(({id})=>id);
|
||||||
|
return this.prop();
|
||||||
|
case this.Steps.PROPERTY:
|
||||||
|
const less = this.less();
|
||||||
|
if(less > 0) return warn(this.prop(), `你还有${less}属性点没有分配完`);
|
||||||
|
this.#step = this.Steps.TRAJECTORY;
|
||||||
|
delete this.#propertyAllocation.total;
|
||||||
|
this.#life.restart(this.#propertyAllocation);
|
||||||
|
return this.trajectory(enter);
|
||||||
|
case this.Steps.TRAJECTORY:
|
||||||
|
if(!this.#isEnd) return this.trajectory(enter);
|
||||||
|
this.#step = this.Steps.SUMMARY;
|
||||||
|
return `${
|
||||||
|
this.summary()
|
||||||
|
}\n\n${
|
||||||
|
this.list()
|
||||||
|
}`;
|
||||||
|
case this.Steps.SUMMARY:
|
||||||
|
return this.remake();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trajectory(enter) {
|
||||||
|
if(enter) {
|
||||||
|
if(this.#interval) {
|
||||||
|
clearInterval(this.#interval);
|
||||||
|
this.#interval = null;
|
||||||
|
this.#auto = false;
|
||||||
|
} else if(this.#auto) {
|
||||||
|
this.#interval = setInterval(
|
||||||
|
()=>{
|
||||||
|
const trajectory = this.next();
|
||||||
|
if(this.#isEnd && this.#interval) {
|
||||||
|
clearInterval(this.#interval);
|
||||||
|
this.#interval = null;
|
||||||
|
}
|
||||||
|
if(!this.#isEnd) return this.output(`${trajectory}\n`);
|
||||||
|
return this.output(trajectory, true);
|
||||||
|
}
|
||||||
|
, 1000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const trajectory = this.#life.next();
|
||||||
|
const { age, content, isEnd } = trajectory;
|
||||||
|
if(isEnd) this.#isEnd = true;
|
||||||
|
return `${age}岁:\t${
|
||||||
|
content.map(
|
||||||
|
({type, description, grade, name, postEvent}) => {
|
||||||
|
switch(type) {
|
||||||
|
case 'TLT':
|
||||||
|
return `天赋【${name}】发动:${description}`;
|
||||||
|
case 'EVT':
|
||||||
|
return description + (postEvent?`\n\t${postEvent}`:'');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).join('\n\t')
|
||||||
|
}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
prop() {
|
||||||
|
const { CHR, INT, STR, MNY } = this.#propertyAllocation;
|
||||||
|
return `🎉属性分配
|
||||||
|
剩余点数 ${this.less()}
|
||||||
|
|
||||||
|
属性(TAG) 当前值
|
||||||
|
颜值(CHR) ${CHR}
|
||||||
|
智力(INT) ${INT}
|
||||||
|
体质(STR) ${STR}
|
||||||
|
家境(MNY) ${MNY}
|
||||||
|
`
|
||||||
|
}
|
||||||
|
|
||||||
|
less() {
|
||||||
|
const { total, CHR, INT, STR, MNY } = this.#propertyAllocation;
|
||||||
|
return total - CHR - INT - STR - MNY;
|
||||||
|
}
|
||||||
|
|
||||||
|
alloc(tag, value) {
|
||||||
|
const warn = str => `${this.prop()}\n${this.style('warn', str)}`
|
||||||
|
if(!value) return warn('⚠ 分配的数值没有给定');
|
||||||
|
const isSet = !(value[0] == '-'|| value[0] == '+');
|
||||||
|
|
||||||
|
value = Number(value);
|
||||||
|
if(isNaN(value)) return warn('⚠ 分配的数值不正确');
|
||||||
|
|
||||||
|
switch(tag) {
|
||||||
|
case 'c':
|
||||||
|
case 'chr':
|
||||||
|
case 'C': tag = 'CHR'; break;
|
||||||
|
case 'i':
|
||||||
|
case 'int':
|
||||||
|
case 'I': tag = 'INT'; break;
|
||||||
|
case 's':
|
||||||
|
case 'S':
|
||||||
|
case 'str': tag = 'STR'; break;
|
||||||
|
case 'm':
|
||||||
|
case 'M':
|
||||||
|
case 'mny': tag = 'MNY'; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
switch(tag) {
|
||||||
|
case 'CHR':
|
||||||
|
case 'INT':
|
||||||
|
case 'STR':
|
||||||
|
case 'MNY':
|
||||||
|
if(isSet) value = value - this.#propertyAllocation[tag];
|
||||||
|
|
||||||
|
const tempLess = this.less() - value;
|
||||||
|
const tempSet = this.#propertyAllocation[tag] + value;
|
||||||
|
|
||||||
|
if(tempLess<0) return warn('⚠ 你没有更多的点数可以分配了');
|
||||||
|
if(
|
||||||
|
tempLess>this.#propertyAllocation.total
|
||||||
|
|| tempSet < 0
|
||||||
|
) return warn('⚠ 不能分配负数属性');
|
||||||
|
if(tempSet>10) return warn('⚠ 单项属性最高分配10点');
|
||||||
|
|
||||||
|
this.#propertyAllocation[tag] += value;
|
||||||
|
|
||||||
|
return this.prop();
|
||||||
|
|
||||||
|
default:
|
||||||
|
return warn('⚠ 未知的tag');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
random() {
|
||||||
|
let t = this.#propertyAllocation.total;
|
||||||
|
const arr = [10, 10, 10, 10];
|
||||||
|
while(t>0) {
|
||||||
|
const sub = Math.round(Math.random() * (Math.min(t, 10) - 1)) + 1;
|
||||||
|
while(true) {
|
||||||
|
const select = Math.floor(Math.random() * 4) % 4;
|
||||||
|
if(arr[select] - sub <0) continue;
|
||||||
|
arr[select] -= sub;
|
||||||
|
t -= sub;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.#propertyAllocation.CHR = 10 - arr[0];
|
||||||
|
this.#propertyAllocation.INT = 10 - arr[1];
|
||||||
|
this.#propertyAllocation.STR = 10 - arr[2];
|
||||||
|
this.#propertyAllocation.MNY = 10 - arr[3];
|
||||||
|
return this.prop();
|
||||||
|
}
|
||||||
|
|
||||||
|
summary() {
|
||||||
|
|
||||||
|
const records = this.#life.getRecord();
|
||||||
|
const s = (type, func)=>{
|
||||||
|
const value = func(records.map(({[type]:v})=>v));
|
||||||
|
const { judge, grade } = summary(type, value);
|
||||||
|
return { judge, grade, value };
|
||||||
|
};
|
||||||
|
|
||||||
|
const style = (name, grade, judge, value) => this.style(`grade${grade}b`, `${name}:${value} ${judge}`);
|
||||||
|
const judge = (name, type, func) => {
|
||||||
|
const { judge, grade, value } = s(type, func);
|
||||||
|
return style(name, grade, judge, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'🎉 总评',
|
||||||
|
judge('颜值', 'CHR', max),
|
||||||
|
judge('智力', 'INT', max),
|
||||||
|
judge('体质', 'STR', max),
|
||||||
|
judge('家境', 'MNY', max),
|
||||||
|
judge('快乐', 'SPR', max),
|
||||||
|
judge('享年', 'AGE', max),
|
||||||
|
(()=>{
|
||||||
|
const m = type=>max(records.map(({[type]: value})=>value));
|
||||||
|
const value = Math.floor(sum(m('CHR'), m('INT'), m('STR'), m('MNY'), m('SPR'))*2 + m('AGE')/2);
|
||||||
|
const { judge, grade } = summary('SUM', value);
|
||||||
|
return style('总评', grade, judge, value );
|
||||||
|
})(),
|
||||||
|
].join('\n');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
30
repl/index.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import App from './app.js';
|
||||||
|
import { readFile, writeFile } from 'fs/promises';
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
|
||||||
|
try {
|
||||||
|
global.localStorage = JSON.parse(await readFile('__localStorage.json'));
|
||||||
|
} catch (e) {
|
||||||
|
global.localStorage = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
global.dumpLocalStorage = async ()=>await writeFile('__localStorage.json', JSON.stringify( global.localStorage))
|
||||||
|
|
||||||
|
const app = new App();
|
||||||
|
app.io(
|
||||||
|
repl => process.stdin.on('data', data=>repl(data.toString().trim())),
|
||||||
|
(data, isRepl) => process.stdout.write(`${data}${isRepl?'\n>':''}`),
|
||||||
|
code=>process.exit(code)
|
||||||
|
)
|
||||||
|
await app.initial();
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
|
|
||||||
|
// process.stdin.setRawMode(true);
|
||||||
|
|
||||||
|
// process.openStdin().on('keypress', function (chunk, key) {
|
||||||
|
// process.stdout.write('Get Chunk: ' + chunk + '\n');
|
||||||
|
// if (key && key.ctrl && key.name == 'c') process.exit();
|
||||||
|
// });
|
||||||
85
src/app.js
@@ -1,6 +1,7 @@
|
|||||||
import { max, sum } from './functions/util.js';
|
import { max, sum } from './functions/util.js';
|
||||||
import { summary } from './functions/summary.js'
|
import { summary } from './functions/summary.js'
|
||||||
import Life from './life.js'
|
import Life from './life.js'
|
||||||
|
|
||||||
class App{
|
class App{
|
||||||
constructor(){
|
constructor(){
|
||||||
this.#life = new Life();
|
this.#life = new Life();
|
||||||
@@ -41,6 +42,7 @@ class App{
|
|||||||
<div id="main">
|
<div id="main">
|
||||||
<div id="cnt" class="head">已重开1次</div>
|
<div id="cnt" class="head">已重开1次</div>
|
||||||
<button id="rank">排行榜</button>
|
<button id="rank">排行榜</button>
|
||||||
|
<button id="themeToggleBtn">黑</button>
|
||||||
<div id="title">
|
<div id="title">
|
||||||
人生重开模拟器<br>
|
人生重开模拟器<br>
|
||||||
<div style="font-size:1.5rem; font-weight:normal;">这垃圾人生一秒也不想呆了</div>
|
<div style="font-size:1.5rem; font-weight:normal;">这垃圾人生一秒也不想呆了</div>
|
||||||
@@ -49,6 +51,9 @@ class App{
|
|||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
// Init theme
|
||||||
|
this.setTheme(localStorage.getItem('theme'))
|
||||||
|
|
||||||
indexPage
|
indexPage
|
||||||
.find('#restart')
|
.find('#restart')
|
||||||
.click(()=>this.switch('talent'));
|
.click(()=>this.switch('talent'));
|
||||||
@@ -57,6 +62,18 @@ class App{
|
|||||||
.find('#rank')
|
.find('#rank')
|
||||||
.click(()=>this.hint('别卷了!没有排行榜'));
|
.click(()=>this.hint('别卷了!没有排行榜'));
|
||||||
|
|
||||||
|
indexPage
|
||||||
|
.find("#themeToggleBtn")
|
||||||
|
.click(() => {
|
||||||
|
if(localStorage.getItem('theme') == 'light') {
|
||||||
|
localStorage.setItem('theme', 'dark');
|
||||||
|
} else {
|
||||||
|
localStorage.setItem('theme', 'light');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setTheme(localStorage.getItem('theme'))
|
||||||
|
});
|
||||||
|
|
||||||
// Talent
|
// Talent
|
||||||
const talentPage = $(`
|
const talentPage = $(`
|
||||||
<div id="main">
|
<div id="main">
|
||||||
@@ -84,6 +101,9 @@ class App{
|
|||||||
if(li.hasClass('selected')) {
|
if(li.hasClass('selected')) {
|
||||||
li.removeClass('selected')
|
li.removeClass('selected')
|
||||||
this.#talentSelected.delete(talent);
|
this.#talentSelected.delete(talent);
|
||||||
|
if(this.#talentSelected.size<3) {
|
||||||
|
talentPage.find('#next').text('请选择3个')
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if(this.#talentSelected.size==3) {
|
if(this.#talentSelected.size==3) {
|
||||||
this.hint('只能选3个天赋');
|
this.hint('只能选3个天赋');
|
||||||
@@ -105,6 +125,9 @@ class App{
|
|||||||
}
|
}
|
||||||
li.addClass('selected');
|
li.addClass('selected');
|
||||||
this.#talentSelected.add(talent);
|
this.#talentSelected.add(talent);
|
||||||
|
if(this.#talentSelected.size==3) {
|
||||||
|
talentPage.find('#next').text('开始新人生')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -122,18 +145,28 @@ class App{
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Property
|
// Property
|
||||||
const propertyPage = $(`
|
// hint of extension tobermory.es6-string-html
|
||||||
|
const propertyPage = $(/*html*/`
|
||||||
<div id="main">
|
<div id="main">
|
||||||
<div class="head" style="font-size: 1.6rem">
|
<div class="head" style="font-size: 1.6rem">
|
||||||
调整初始属性<br>
|
调整初始属性<br>
|
||||||
<div id="total" style="font-size:1rem; font-weight:normal;">可用属性点:0</div>
|
<div id="total" style="font-size:1rem; font-weight:normal;">可用属性点:0</div>
|
||||||
</div>
|
</div>
|
||||||
<ul id="propertyAllocation" class="propinitial"></ul>
|
<ul id="propertyAllocation" class="propinitial"></ul>
|
||||||
<button id="random" class="mainbtn" style="top:auto; bottom:7rem">随机分配</button>
|
<ul class="selectlist" id="talentSelectedView" style="top:calc(100% - 17rem); bottom:7rem"></ul>
|
||||||
<button id="start" class="mainbtn" style="top:auto; bottom:0.1rem">开始新人生</button>
|
<button id="random" class="mainbtn" style="top:auto; bottom:0.1rem; left:auto; right:50%; transform: translate(-2rem,-50%);">随机分配</button>
|
||||||
|
<button id="start" class="mainbtn" style="top:auto; bottom:0.1rem; left:50%; right:auto; transform: translate(2rem,-50%);">开始新人生</button>
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
propertyPage.mounted = ()=>{
|
||||||
|
propertyPage
|
||||||
|
.find('#talentSelectedView').append(
|
||||||
|
`<li>已选天赋</li>` +
|
||||||
|
Array.from(this.#talentSelected)
|
||||||
|
.map(({name,description})=>`<li class="grade0b">${name}(${description})</li>`)
|
||||||
|
.join('')
|
||||||
|
)
|
||||||
|
}
|
||||||
const groups = {};
|
const groups = {};
|
||||||
const total = ()=>{
|
const total = ()=>{
|
||||||
let t = 0;
|
let t = 0;
|
||||||
@@ -166,8 +199,8 @@ class App{
|
|||||||
freshTotal();
|
freshTotal();
|
||||||
}
|
}
|
||||||
btnAdd.click(()=>{
|
btnAdd.click(()=>{
|
||||||
if(total() == this.#totalMax) {
|
if(total() >= this.#totalMax) {
|
||||||
this.hint('没用可分配的点数了');
|
this.hint('没有可分配的点数了');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
set(get()+1);
|
set(get()+1);
|
||||||
@@ -223,9 +256,12 @@ class App{
|
|||||||
propertyPage
|
propertyPage
|
||||||
.find('#start')
|
.find('#start')
|
||||||
.click(()=>{
|
.click(()=>{
|
||||||
if(total()!=this.#totalMax) {
|
if(total() < this.#totalMax) {
|
||||||
this.hint(`你还有${this.#totalMax-total()}属性点没有分配完`);
|
this.hint(`你还有${this.#totalMax-total()}属性点没有分配完`);
|
||||||
return;
|
return;
|
||||||
|
} else if (total() > this.#totalMax) {
|
||||||
|
this.hint(`你多使用了${total() - this.#totalMax}属性点`);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
this.#life.restart({
|
this.#life.restart({
|
||||||
CHR: groups.CHR.get(),
|
CHR: groups.CHR.get(),
|
||||||
@@ -237,11 +273,17 @@ class App{
|
|||||||
});
|
});
|
||||||
this.switch('trajectory');
|
this.switch('trajectory');
|
||||||
this.#pages.trajectory.born();
|
this.#pages.trajectory.born();
|
||||||
|
$(document).keydown(function(event){
|
||||||
|
if(event.which == 32 || event.which == 13){
|
||||||
|
$('#lifeTrajectory').click();
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
// Trajectory
|
// Trajectory
|
||||||
const trajectoryPage = $(`
|
const trajectoryPage = $(`
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
<ul id="lifeProperty" class="lifeProperty"></ul>
|
||||||
<ul id="lifeTrajectory" class="lifeTrajectory"></ul>
|
<ul id="lifeTrajectory" class="lifeTrajectory"></ul>
|
||||||
<button id="summary" class="mainbtn" style="top:auto; bottom:0.1rem">人生总结</button>
|
<button id="summary" class="mainbtn" style="top:auto; bottom:0.1rem">人生总结</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -269,8 +311,19 @@ class App{
|
|||||||
li.appendTo('#lifeTrajectory');
|
li.appendTo('#lifeTrajectory');
|
||||||
$("#lifeTrajectory").scrollTop($("#lifeTrajectory")[0].scrollHeight);
|
$("#lifeTrajectory").scrollTop($("#lifeTrajectory")[0].scrollHeight);
|
||||||
if(isEnd) {
|
if(isEnd) {
|
||||||
|
$(document).unbind("keydown");
|
||||||
this.#isEnd = true;
|
this.#isEnd = true;
|
||||||
trajectoryPage.find('#summary').show();
|
trajectoryPage.find('#summary').show();
|
||||||
|
} else {
|
||||||
|
// 如未死亡,更新数值
|
||||||
|
// Update properties if not die yet
|
||||||
|
const property = this.#life.getLastRecord();
|
||||||
|
$("#lifeProperty").html(`
|
||||||
|
<li>颜值:${property.CHR} </li>
|
||||||
|
<li>智力:${property.INT} </li>
|
||||||
|
<li>体质:${property.STR} </li>
|
||||||
|
<li>家境:${property.MNY} </li>
|
||||||
|
<li>快乐:${property.SPR} </li>`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -352,6 +405,9 @@ class App{
|
|||||||
page: propertyPage,
|
page: propertyPage,
|
||||||
clear: ()=>{
|
clear: ()=>{
|
||||||
freshTotal();
|
freshTotal();
|
||||||
|
propertyPage
|
||||||
|
.find('#talentSelectedView')
|
||||||
|
.empty();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
trajectory: {
|
trajectory: {
|
||||||
@@ -441,6 +497,9 @@ class App{
|
|||||||
$('#main').detach();
|
$('#main').detach();
|
||||||
p.clear();
|
p.clear();
|
||||||
p.page.appendTo('body');
|
p.page.appendTo('body');
|
||||||
|
if(typeof p.page.mounted === 'function'){
|
||||||
|
p.page.mounted()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hint(message, type='info') {
|
hint(message, type='info') {
|
||||||
@@ -459,9 +518,19 @@ class App{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTheme(theme) {
|
||||||
|
const themeLink = $(document).find('#themeLink');
|
||||||
|
|
||||||
|
if(theme == 'light') {
|
||||||
|
themeLink.attr('href', 'light.css');
|
||||||
|
} else {
|
||||||
|
themeLink.attr('href', 'dark.css');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get times() {return JSON.parse(localStorage.times||'0') || 0;}
|
get times() {return JSON.parse(localStorage.times||'0') || 0;}
|
||||||
set times(v) {localStorage.times = JSON.stringify(parseInt(v) || 0)};
|
set times(v) {localStorage.times = JSON.stringify(parseInt(v) || 0)};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|||||||
@@ -113,4 +113,17 @@ function checkProp(property, condition) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { checkCondition };
|
function extractMaxTriggers(condition) {
|
||||||
|
// Assuming only age related talents can be triggered multiple times.
|
||||||
|
const RE_AGE_CONDITION = /AGE\?\[([0-9\,]+)\]/;
|
||||||
|
const match_object = RE_AGE_CONDITION.exec(condition);
|
||||||
|
if (match_object == null) {
|
||||||
|
// Not age related, single trigger.
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const age_list = match_object[1].split(",");
|
||||||
|
return age_list.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
export { checkCondition, extractMaxTriggers };
|
||||||
14
src/index.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import App from '../src/app.js';
|
||||||
|
|
||||||
|
|
||||||
|
window.json = async fileName => await (await fetch(`../data/${fileName}.json`)).json();
|
||||||
|
|
||||||
|
// Pssst, I've created a github package - https://github.com/brookesb91/dismissible
|
||||||
|
window.hideBanners = (e) => {
|
||||||
|
document
|
||||||
|
.querySelectorAll(".banner.visible")
|
||||||
|
.forEach((b) => b.classList.remove("visible"));
|
||||||
|
};
|
||||||
|
|
||||||
|
const app = new App();
|
||||||
|
app.initial();
|
||||||
23
src/life.js
@@ -15,17 +15,18 @@ class Life {
|
|||||||
#triggerTalents;
|
#triggerTalents;
|
||||||
|
|
||||||
async initial() {
|
async initial() {
|
||||||
const age = await json('age');
|
const [age, talents, events] = await Promise.all([
|
||||||
const talents = await json('talents');
|
json('age'),
|
||||||
const events = await json('events');
|
json('talents'),
|
||||||
|
json('events'),
|
||||||
|
])
|
||||||
this.#property.initial({age});
|
this.#property.initial({age});
|
||||||
this.#talent.initial({talents});
|
this.#talent.initial({talents});
|
||||||
this.#event.initial({events});
|
this.#event.initial({events});
|
||||||
}
|
}
|
||||||
|
|
||||||
restart(allocation) {
|
restart(allocation) {
|
||||||
this.#triggerTalents = new Set();
|
this.#triggerTalents = {};
|
||||||
this.#property.restart(allocation);
|
this.#property.restart(allocation);
|
||||||
this.doTalent();
|
this.doTalent();
|
||||||
this.#property.record();
|
this.#property.record();
|
||||||
@@ -35,6 +36,10 @@ class Life {
|
|||||||
return this.#talent.allocationAddition(talents);
|
return this.#talent.allocationAddition(talents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getTalentCurrentTriggerCount(talentId) {
|
||||||
|
return this.#triggerTalents[talentId] || 0;
|
||||||
|
}
|
||||||
|
|
||||||
next() {
|
next() {
|
||||||
const {age, event, talent} = this.#property.ageNext();
|
const {age, event, talent} = this.#property.ageNext();
|
||||||
|
|
||||||
@@ -51,13 +56,13 @@ class Life {
|
|||||||
doTalent(talents) {
|
doTalent(talents) {
|
||||||
if(talents) this.#property.change(this.#property.TYPES.TLT, talents);
|
if(talents) this.#property.change(this.#property.TYPES.TLT, talents);
|
||||||
talents = this.#property.get(this.#property.TYPES.TLT)
|
talents = this.#property.get(this.#property.TYPES.TLT)
|
||||||
.filter(talentId=>!this.#triggerTalents.has(talentId));
|
.filter(talentId => this.getTalentCurrentTriggerCount(talentId) < this.#talent.get(talentId).max_triggers);
|
||||||
|
|
||||||
const contents = [];
|
const contents = [];
|
||||||
for(const talentId of talents) {
|
for(const talentId of talents) {
|
||||||
const result = this.#talent.do(talentId, this.#property);
|
const result = this.#talent.do(talentId, this.#property);
|
||||||
if(!result) continue;
|
if(!result) continue;
|
||||||
this.#triggerTalents.add(talentId);
|
this.#triggerTalents[talentId] = this.getTalentCurrentTriggerCount(talentId) + 1;
|
||||||
const { effect, name, description, grade } = result;
|
const { effect, name, description, grade } = result;
|
||||||
contents.push({
|
contents.push({
|
||||||
type: this.#property.TYPES.TLT,
|
type: this.#property.TYPES.TLT,
|
||||||
@@ -110,6 +115,10 @@ class Life {
|
|||||||
return this.#property.getRecord();
|
return this.#property.getRecord();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getLastRecord() {
|
||||||
|
return this.#property.getLastRecord();
|
||||||
|
}
|
||||||
|
|
||||||
exclusive(talents, exclusive) {
|
exclusive(talents, exclusive) {
|
||||||
return this.#talent.exclusive(talents, exclusive);
|
return this.#talent.exclusive(talents, exclusive);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,6 +107,10 @@ class Property {
|
|||||||
return clone(this.#record);
|
return clone(this.#record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getLastRecord() {
|
||||||
|
return clone(this.#record[this.#record.length - 1]);
|
||||||
|
}
|
||||||
|
|
||||||
change(prop, value) {
|
change(prop, value) {
|
||||||
if(Array.isArray(value)) {
|
if(Array.isArray(value)) {
|
||||||
for(const v of value)
|
for(const v of value)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { clone } from './functions/util.js';
|
import { clone } from './functions/util.js';
|
||||||
import { checkCondition } from './functions/condition.js';
|
import { checkCondition, extractMaxTriggers } from './functions/condition.js';
|
||||||
|
|
||||||
class Talent {
|
class Talent {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
@@ -12,6 +12,7 @@ class Talent {
|
|||||||
const talent = talents[id];
|
const talent = talents[id];
|
||||||
talent.id= Number(id);
|
talent.id= Number(id);
|
||||||
talent.grade = Number(talent.grade);
|
talent.grade = Number(talent.grade);
|
||||||
|
talent.max_triggers = extractMaxTriggers(talent.condition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
572
view/dark.css
Normal file
@@ -0,0 +1,572 @@
|
|||||||
|
@media (min-width:640px){html{font-size:24px;}}
|
||||||
|
@media (min-width:631px) and (max-width:639px){html{font-size:23.66px;}}
|
||||||
|
@media (min-width:622px) and (max-width:630px){html{font-size:23.33px;}}
|
||||||
|
@media (min-width:613px) and (max-width:621px){html{font-size:23px;}}
|
||||||
|
@media (min-width:604px) and (max-width:612px){html{font-size:22.66px;}}
|
||||||
|
@media (min-width:595px) and (max-width:603px){html{font-size:22.33px;}}
|
||||||
|
@media (min-width:586px) and (max-width:594px){html{font-size:22px;}}
|
||||||
|
@media (min-width:577px) and (max-width:585px){html{font-size:21.66px;}}
|
||||||
|
@media (min-width:568px) and (max-width:576px){html{font-size:21.33px;}}
|
||||||
|
@media (min-width:559px) and (max-width:567px){html{font-size:21px;}}
|
||||||
|
@media (min-width:550px) and (max-width:558px){html{font-size:20.66px;}}
|
||||||
|
@media (min-width:541px) and (max-width:549px){html{font-size:20.33px;}}
|
||||||
|
@media (min-width:533px) and (max-width:540px){html{font-size:20px;}}
|
||||||
|
@media (min-width:524px) and (max-width:532px){html{font-size:19.66px;}}
|
||||||
|
@media (min-width:515px) and (max-width:523px){html{font-size:19.33px;}}
|
||||||
|
@media (min-width:506px) and (max-width:514px){html{font-size:19px;}}
|
||||||
|
@media (min-width:497px) and (max-width:505px){html{font-size:18.66px;}}
|
||||||
|
@media (min-width:488px) and (max-width:496px){html{font-size:18.33px;}}
|
||||||
|
@media (min-width:480px) and (max-width:487px){html{font-size:18px;}}
|
||||||
|
@media (min-width:471px) and (max-width:479px){html{font-size:17.66px;}}
|
||||||
|
@media (min-width:462px) and (max-width:470px){html{font-size:17.33px;}}
|
||||||
|
@media (min-width:453px) and (max-width:461px){html{font-size:17px;}}
|
||||||
|
@media (min-width:444px) and (max-width:452px){html{font-size:17.12px;}}
|
||||||
|
@media (min-width:435px) and (max-width:443px){html{font-size:16.33px;}}
|
||||||
|
@media (min-width:426px) and (max-width:434px){html{font-size:16px;}}
|
||||||
|
@media (min-width:417px) and (max-width:425px){html{font-size:15.66px;}}
|
||||||
|
@media (min-width:408px) and (max-width:416px){html{font-size:15.33px;}}
|
||||||
|
@media (min-width:400px) and (max-width:407px){html{font-size:15px;}}
|
||||||
|
@media (min-width:391px) and (max-width:399px){html{font-size:14.66px;}}
|
||||||
|
@media (min-width:382px) and (max-width:390px){html{font-size:14.33px;}}
|
||||||
|
@media (min-width:374px) and (max-width:381px){html{font-size:14px;}}
|
||||||
|
@media (min-width:365px) and (max-width:373px){html{font-size:13.66px;}}
|
||||||
|
@media (min-width:356px) and (max-width:364px){html{font-size:13.33px;}}
|
||||||
|
@media (min-width:347px) and (max-width:355px){html{font-size:13px;}}
|
||||||
|
@media (min-width:338px) and (max-width:346px){html{font-size:12.66px;}}
|
||||||
|
@media (min-width:329px) and (max-width:337px){html{font-size:12.44px;}}
|
||||||
|
@media (max-width:328px){html{font-size:12px;}}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'iconfont';
|
||||||
|
src: url('iconfont.woff2?t=1628944689555') format('woff2'),
|
||||||
|
url('iconfont.woff?t=1628944689555') format('woff'),
|
||||||
|
url('iconfont.ttf?t=1628944689555') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
background-color: #222831;
|
||||||
|
font-family: PingFangSC, 'Noto Sans CJK SC', 'MS Yahei';
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main {
|
||||||
|
align-content: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
#title {
|
||||||
|
position: fixed;
|
||||||
|
font-size: 3rem;
|
||||||
|
font-weight: 700;
|
||||||
|
top: 35%;
|
||||||
|
left: 50%;
|
||||||
|
white-space: nowrap;
|
||||||
|
transform: translate(-50%,-50%);
|
||||||
|
text-align: center;
|
||||||
|
color: #EEEEEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mainbtn {
|
||||||
|
position: fixed;
|
||||||
|
top: 65%;
|
||||||
|
left: 50%;
|
||||||
|
padding: 0.5rem 1.5rem;
|
||||||
|
border: 1px #EEEEEE solid;
|
||||||
|
border-radius: 0.2rem;
|
||||||
|
background-color:#393E46;
|
||||||
|
font-size: 1.6rem;
|
||||||
|
white-space: nowrap;
|
||||||
|
transform: translate(-50%,-50%);
|
||||||
|
cursor: pointer;
|
||||||
|
z-index:2;
|
||||||
|
color: #EEEEEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mainbtn:hover {
|
||||||
|
background: #ff7878;
|
||||||
|
color: #fff;
|
||||||
|
transition: all .4s ease 0s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-family: "iconfont" !important;
|
||||||
|
font-style: normal;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
#rank {
|
||||||
|
position: fixed;
|
||||||
|
top: 1rem;
|
||||||
|
right: 1rem;
|
||||||
|
padding: 0.1rem 1rem;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.2rem;
|
||||||
|
background-color:lightsteelblue;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
color: #EEEEEE;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index:2;
|
||||||
|
}
|
||||||
|
|
||||||
|
#themeToggleBtn {
|
||||||
|
position: fixed;
|
||||||
|
right: 1rem;
|
||||||
|
bottom: 1rem;
|
||||||
|
padding: 0.1rem 1rem;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.2rem;
|
||||||
|
background-color:#EEEEEE;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
color: #222831;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index:2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head {
|
||||||
|
position: fixed;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
top: 1.1rem;
|
||||||
|
left: 50%;
|
||||||
|
white-space: nowrap;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
text-align: center;
|
||||||
|
color: #EEEEEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.judge,
|
||||||
|
.lifeTrajectory,
|
||||||
|
.propinitial,
|
||||||
|
.selectlist {
|
||||||
|
position: fixed;
|
||||||
|
list-style-type: none;
|
||||||
|
left: 50%;
|
||||||
|
top: 5rem;
|
||||||
|
bottom: 8.5rem;
|
||||||
|
width: 30rem;
|
||||||
|
max-width: calc(100% - 2rem);
|
||||||
|
margin: auto;
|
||||||
|
padding: 0;
|
||||||
|
overflow: auto;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lifeProperty{
|
||||||
|
position: fixed;
|
||||||
|
list-style-type: none;
|
||||||
|
left: 50%;
|
||||||
|
top: 2rem;
|
||||||
|
width: 30rem;
|
||||||
|
max-width: calc(100% - 2rem);
|
||||||
|
padding: 0;
|
||||||
|
overflow: auto;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
display: flex;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lifeProperty > li {
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
border: 1px #ccc solid;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0.1rem 2px;
|
||||||
|
font-size: 1rem;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 0.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectlist > li {
|
||||||
|
position: relative;
|
||||||
|
border: 1px #EEEEEE solid;
|
||||||
|
display: inline-block;
|
||||||
|
width: 95%;
|
||||||
|
margin: 0.1rem auto;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 0.2rem;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #EEEEEE;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade0b {
|
||||||
|
background-color: #464646;
|
||||||
|
border: #f8f8f8 2px solid !important;
|
||||||
|
}
|
||||||
|
.grade1b {
|
||||||
|
background-color: #6495ed;
|
||||||
|
border: #f8f8f8 2px solid !important;
|
||||||
|
}
|
||||||
|
.grade2b {
|
||||||
|
background-color: #e2a7ff;
|
||||||
|
border: #f8f8f8 2px solid !important;
|
||||||
|
}
|
||||||
|
.grade3b {
|
||||||
|
background-color: #ffa07a;
|
||||||
|
border: #f8f8f8 2px solid !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width:1080px) {
|
||||||
|
.grade0b:hover {
|
||||||
|
background-color: #c0c0c0;
|
||||||
|
color: #3b3b3b;
|
||||||
|
transition: all .3s ease 0s;
|
||||||
|
}
|
||||||
|
.grade1b:hover {
|
||||||
|
background-color: #87cefa;
|
||||||
|
color: #3b3b3b;
|
||||||
|
transition: all .3s ease 0s;
|
||||||
|
}
|
||||||
|
.grade2b:hover {
|
||||||
|
background-color: #e7beff;
|
||||||
|
color: #3b3b3b;
|
||||||
|
transition: all .3s ease 0s;
|
||||||
|
}
|
||||||
|
.grade3b:hover {
|
||||||
|
background-color: #f7a989;
|
||||||
|
color: #3b3b3b;
|
||||||
|
transition: all .3s ease 0s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.grade0b.selected {
|
||||||
|
background-color: #c0c0c0 !important;
|
||||||
|
box-shadow: #ccc 0px 0px 10px;
|
||||||
|
color: #3b3b3b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade1b.selected {
|
||||||
|
background-color: #87cefa !important;
|
||||||
|
box-shadow: #ccc 0px 0px 10px;
|
||||||
|
color: #3b3b3b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade2b.selected {
|
||||||
|
background-color: #e7beff !important;
|
||||||
|
box-shadow: #ccc 0px 0px 10px;
|
||||||
|
color: #3b3b3b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade3b.selected {
|
||||||
|
background-color: #f1bfac !important;
|
||||||
|
box-shadow: #ccc 0px 0px 10px;
|
||||||
|
color: #3b3b3b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.judge > li.grade1 span,
|
||||||
|
.judge > li.grade1{
|
||||||
|
background-color: #87cefa;
|
||||||
|
}
|
||||||
|
.judge > li.grade2 span,
|
||||||
|
.judge > li.grade2{
|
||||||
|
background-color: #e7beff;
|
||||||
|
}
|
||||||
|
.judge > li.grade3 span,
|
||||||
|
.judge > li.grade3{
|
||||||
|
background-color: #f7a989;
|
||||||
|
}
|
||||||
|
|
||||||
|
.propinitial {
|
||||||
|
top: 5rem;
|
||||||
|
bottom: 17rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.propbtn:hover{
|
||||||
|
color: #5c5c5c;
|
||||||
|
transition: all .2s ease 0s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.propinitial > li {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 95%;
|
||||||
|
margin: 0.1rem auto;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 0.2rem;
|
||||||
|
padding: 0.2rem;
|
||||||
|
color: #EEEEEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.propinitial > li > input {
|
||||||
|
height: 2.2rem;
|
||||||
|
width: 2.2rem;
|
||||||
|
margin: 0 0.5rem;
|
||||||
|
padding: 0;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 2rem;
|
||||||
|
border: 0.1rem #EEEEEE solid;
|
||||||
|
background-color: #393E46;
|
||||||
|
color: #EEEEEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.propbtn {
|
||||||
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 2rem;
|
||||||
|
color: #EEEEEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lifeTrajectory {
|
||||||
|
border: 1px #9b9b9b solid;
|
||||||
|
background-color: #393E46;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.judge > li,
|
||||||
|
.lifeTrajectory > li {
|
||||||
|
position: relative;
|
||||||
|
width: calc(100% - 7rem);
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
padding: 0.5rem 1rem 0.5rem 6rem;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
background-color: #4a5361;
|
||||||
|
box-shadow: #EEEEEE 0 0 0.4rem;
|
||||||
|
color: #EEEEEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.judge > li > span,
|
||||||
|
.lifeTrajectory > li > span {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
width: 6rem;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.judge > li {
|
||||||
|
box-shadow: #EEEEEE 0 0 0.4rem;
|
||||||
|
width: calc(100% - 9rem);
|
||||||
|
margin: 0.5rem;
|
||||||
|
padding: 0.5rem 1rem 0.5rem 7rem;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.judge > li > span {
|
||||||
|
height: calc(100% - 1rem);
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
top: 0;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@import url("https://fonts.googleapis.com/css?family=Montserrat:400,400i,700");
|
||||||
|
:root {
|
||||||
|
font-family: "Montserrat";
|
||||||
|
}
|
||||||
|
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.banners-container {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner {
|
||||||
|
color: white;
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 2rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.banner .banner-message {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0 2rem;
|
||||||
|
word-break: break-word;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.banner .banner-close {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 0.1rem;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner .iconfont {
|
||||||
|
font-size: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner .banner-close:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner.success {
|
||||||
|
background: lightgreen;
|
||||||
|
}
|
||||||
|
.banner.success::after {
|
||||||
|
background: lightgreen;
|
||||||
|
}
|
||||||
|
.banner.error {
|
||||||
|
background: #ed1c24;
|
||||||
|
}
|
||||||
|
.banner.error::after {
|
||||||
|
background: #ed1c24;
|
||||||
|
}
|
||||||
|
.banner.info {
|
||||||
|
background: skyblue;
|
||||||
|
}
|
||||||
|
.banner.info::after {
|
||||||
|
background: skyblue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
height: 10%;
|
||||||
|
width: 100%;
|
||||||
|
bottom: 100%;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner:not(.visible) {
|
||||||
|
display: none;
|
||||||
|
transform: translateY(-100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner.visible {
|
||||||
|
box-shadow: 0 2px 2px 2px rgba(0, 0, 0, 0.12);
|
||||||
|
animation-name: banner-in;
|
||||||
|
animation-direction: forwards;
|
||||||
|
animation-duration: 0.6s;
|
||||||
|
animation-timing-function: ease-in-out;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
animation-iteration-count: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes banner-in {
|
||||||
|
0% {
|
||||||
|
transform: translateY(-100%);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: translateY(10%);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.show-banner {
|
||||||
|
appearance: none;
|
||||||
|
background: #ededed;
|
||||||
|
border: 0;
|
||||||
|
padding: 1rem 2rem;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
text-transform: uppercase;
|
||||||
|
margin: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Copyright Akveo. All Rights Reserved.
|
||||||
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
*/
|
||||||
|
.eva-animation {
|
||||||
|
animation-duration: 1s;
|
||||||
|
animation-fill-mode: both; }
|
||||||
|
|
||||||
|
.eva-infinite {
|
||||||
|
animation-iteration-count: infinite; }
|
||||||
|
|
||||||
|
.eva-icon-shake {
|
||||||
|
animation-name: eva-shake; }
|
||||||
|
|
||||||
|
.eva-icon-zoom {
|
||||||
|
animation-name: eva-zoomIn; }
|
||||||
|
|
||||||
|
.eva-icon-pulse {
|
||||||
|
animation-name: eva-pulse; }
|
||||||
|
|
||||||
|
.eva-icon-flip {
|
||||||
|
animation-name: eva-flipInY; }
|
||||||
|
|
||||||
|
.eva-hover {
|
||||||
|
display: inline-block; }
|
||||||
|
|
||||||
|
.eva-hover:hover .eva-icon-hover-shake, .eva-parent-hover:hover .eva-icon-hover-shake {
|
||||||
|
animation-name: eva-shake; }
|
||||||
|
|
||||||
|
.eva-hover:hover .eva-icon-hover-zoom, .eva-parent-hover:hover .eva-icon-hover-zoom {
|
||||||
|
animation-name: eva-zoomIn; }
|
||||||
|
|
||||||
|
.eva-hover:hover .eva-icon-hover-pulse, .eva-parent-hover:hover .eva-icon-hover-pulse {
|
||||||
|
animation-name: eva-pulse; }
|
||||||
|
|
||||||
|
.eva-hover:hover .eva-icon-hover-flip, .eva-parent-hover:hover .eva-icon-hover-flip {
|
||||||
|
animation-name: eva-flipInY; }
|
||||||
|
|
||||||
|
@keyframes eva-flipInY {
|
||||||
|
from {
|
||||||
|
transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
|
||||||
|
animation-timing-function: ease-in;
|
||||||
|
opacity: 0; }
|
||||||
|
40% {
|
||||||
|
transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
|
||||||
|
animation-timing-function: ease-in; }
|
||||||
|
60% {
|
||||||
|
transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
|
||||||
|
opacity: 1; }
|
||||||
|
80% {
|
||||||
|
transform: perspective(400px) rotate3d(0, 1, 0, -5deg); }
|
||||||
|
to {
|
||||||
|
transform: perspective(400px); } }
|
||||||
|
|
||||||
|
@keyframes eva-shake {
|
||||||
|
from,
|
||||||
|
to {
|
||||||
|
transform: translate3d(0, 0, 0); }
|
||||||
|
10%,
|
||||||
|
30%,
|
||||||
|
50%,
|
||||||
|
70%,
|
||||||
|
90% {
|
||||||
|
transform: translate3d(-3px, 0, 0); }
|
||||||
|
20%,
|
||||||
|
40%,
|
||||||
|
60%,
|
||||||
|
80% {
|
||||||
|
transform: translate3d(3px, 0, 0); } }
|
||||||
|
|
||||||
|
@keyframes eva-pulse {
|
||||||
|
from {
|
||||||
|
transform: scale3d(1, 1, 1); }
|
||||||
|
50% {
|
||||||
|
transform: scale3d(1.2, 1.2, 1.2); }
|
||||||
|
to {
|
||||||
|
transform: scale3d(1, 1, 1); } }
|
||||||
|
|
||||||
|
@keyframes eva-zoomIn {
|
||||||
|
from {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale3d(0.5, 0.5, 0.5); }
|
||||||
|
50% {
|
||||||
|
opacity: 1; } }
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 0 !important
|
||||||
|
}
|
||||||
BIN
view/images/icons/icon-128x128.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
view/images/icons/icon-144x144.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
view/images/icons/icon-152x152.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
view/images/icons/icon-192x192.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
view/images/icons/icon-384x384.png
Normal file
|
After Width: | Height: | Size: 71 KiB |
BIN
view/images/icons/icon-512x512.png
Normal file
|
After Width: | Height: | Size: 114 KiB |
BIN
view/images/icons/icon-72x72.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
view/images/icons/icon-96x96.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
@@ -4,11 +4,13 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" href="style.css">
|
<meta name="description" content="やり直すんだ。そして、次はうまくやる。"/>
|
||||||
|
<meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/>
|
||||||
|
<link id="themeLink" rel="stylesheet" href="light.css">
|
||||||
|
<link rel="manifest" href="./manifest.json">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
<script src="../public/bundle.js"></script>
|
||||||
<script>window.json = async fileName=>(await axios(`../data/${fileName}.json`)).data;</script>
|
<title>Life Restart</title>
|
||||||
<title>Document</title>
|
|
||||||
</head>
|
</head>
|
||||||
<body style="margin: 0; height: 100%">
|
<body style="margin: 0; height: 100%">
|
||||||
<div class="banners-container">
|
<div class="banners-container">
|
||||||
@@ -30,18 +32,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<a href="https://github.com/VickScarlet/lifeRestart" class="github-corner" style="z-index: 9999;" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; left: 0; transform: scale(-1, 1);" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style></a>
|
||||||
|
<a href="https://discord.gg/U3qrf49NMQ" style="z-index: 9999;" aria-label="Chat on Discord"><button class="discord-btn"><svg width="50%" height="55" viewBox="0 0 71 55" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0)"><path d="M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z" fill="#ffffff"/></g><defs><clipPath id="clip0"><rect width="71" height="55" fill="white"/></clipPath></defs></svg>CHAT</button><style>.discord-btn {position: fixed;bottom: 0.5rem;left: 0.5rem;background-color: #5865F2;padding: 0.7rem;height: auto;color: white;text-align: right;vertical-align: middle;border: none;width: 6.5rem;font-size: 1rem;border-radius: 4px;}.discord-btn svg {height: 1.5rem;position: absolute;top: 50%;left: 0;transform: translateY(-50%);}.discord-btn:hover svg{animation:discord-wave 560ms ease-in-out;}@keyframes discord-wave{0%,100%{transform:translateY(-50%) rotate(0)}20%,60%{transform:translateY(-50%) rotate(-25deg)}40%,80%{transform:translateY(-50%) rotate(10deg)}}@media (max-width:500px){.discord-btn:hover svg{animation:none}.discord-btn svg{animation:discord-wave 560ms ease-in-out}}</style></a>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
// Pssst, I've created a github package - https://github.com/brookesb91/dismissible
|
if ('serviceWorker' in navigator) {
|
||||||
const hideBanners = (e) => {
|
window.addEventListener('load', function () {
|
||||||
document
|
navigator.serviceWorker.register('./sw.js', {scope: '.'})
|
||||||
.querySelectorAll(".banner.visible")
|
.then(function (registration) {
|
||||||
.forEach((b) => b.classList.remove("visible"));
|
console.log('ServiceWorker registration successful');
|
||||||
};
|
})
|
||||||
</script>
|
.catch(function (err) {
|
||||||
<script type="module">
|
console.log('ServiceWorker registration failed');
|
||||||
import App from '../src/app.js';
|
});
|
||||||
const app = new App();
|
});
|
||||||
app.initial();
|
}
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
@@ -47,6 +47,10 @@ html {
|
|||||||
font-family: PingFangSC, 'Noto Sans CJK SC', 'MS Yahei';
|
font-family: PingFangSC, 'Noto Sans CJK SC', 'MS Yahei';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
#main {
|
#main {
|
||||||
align-content: center;
|
align-content: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -69,7 +73,7 @@ html {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
top: 65%;
|
top: 65%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
padding: 0.8rem 1rem;
|
padding: 0.5rem 1.5rem;
|
||||||
border: 1px #ccc solid;
|
border: 1px #ccc solid;
|
||||||
border-radius: 0.2rem;
|
border-radius: 0.2rem;
|
||||||
background-color:white;
|
background-color:white;
|
||||||
@@ -80,6 +84,12 @@ html {
|
|||||||
z-index:2;
|
z-index:2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mainbtn:hover {
|
||||||
|
background: #ff7878;
|
||||||
|
color: #fff;
|
||||||
|
transition: all .4s ease 0s;
|
||||||
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
font-family: "iconfont" !important;
|
font-family: "iconfont" !important;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -101,6 +111,20 @@ html {
|
|||||||
z-index:2;
|
z-index:2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#themeToggleBtn {
|
||||||
|
position: fixed;
|
||||||
|
right: 1rem;
|
||||||
|
bottom: 1rem;
|
||||||
|
padding: 0.1rem 1rem;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.2rem;
|
||||||
|
background-color:#222831;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
color: #EEEEEE;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index:2;
|
||||||
|
}
|
||||||
|
|
||||||
.head {
|
.head {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
@@ -126,6 +150,32 @@ html {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lifeProperty{
|
||||||
|
position: fixed;
|
||||||
|
list-style-type: none;
|
||||||
|
left: 50%;
|
||||||
|
top: 2rem;
|
||||||
|
width: 30rem;
|
||||||
|
max-width: calc(100% - 2rem);
|
||||||
|
padding: 0;
|
||||||
|
overflow: auto;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
display: flex;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lifeProperty > li {
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
border: 1px #ccc solid;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0.1rem 2px;
|
||||||
|
font-size: 1rem;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selectlist > li {
|
.selectlist > li {
|
||||||
@@ -140,42 +190,87 @@ html {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selectlist > li::before {
|
.grade0b {
|
||||||
position: absolute;
|
background-color: #ededed;
|
||||||
display: inline-block;
|
border: #c5c5c5 2px solid !important;
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
border-radius: 0.2rem 0 0 0.2rem;
|
|
||||||
margin: -1px;
|
|
||||||
padding: 1px;
|
|
||||||
height: 100%;
|
|
||||||
width: 1.5rem;
|
|
||||||
content: " ";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.grade1,
|
.grade1b {
|
||||||
.grade1b::before {
|
background-color: #7ea5ec;
|
||||||
background-color: rgb(116, 191, 255) !important;
|
border: #c5c5c5 2px solid !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grade2,
|
.grade2b {
|
||||||
.grade2b::before {
|
background-color: #e2a7ff;
|
||||||
background-color: rgb(226, 167, 255) !important;
|
border: #c5c5c5 2px solid !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grade3,
|
.grade3b {
|
||||||
.grade3b::before {
|
background-color: #ffa07a;
|
||||||
background-color: lightsalmon !important;
|
border: #c5c5c5 2px solid !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selected {
|
@media (min-width:1080px) {
|
||||||
background-color: gray;
|
.grade0b:hover {
|
||||||
color: white;
|
background-color: #868686;
|
||||||
|
transition: all .3s ease 0s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade1b:hover {
|
||||||
|
background-color: #5d90ff;
|
||||||
|
transition: all .3s ease 0s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade2b:hover {
|
||||||
|
background-color: #bc72ec;
|
||||||
|
transition: all .3s ease 0s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade3b:hover {
|
||||||
|
background-color: #e09074;
|
||||||
|
transition: all .3s ease 0s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.grade0b.selected {
|
||||||
|
background-color: #444;
|
||||||
|
box-shadow: #bbb 0px 0px 10px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade1b.selected {
|
||||||
|
background-color: #407dec;
|
||||||
|
box-shadow: #bbb 0px 0px 10px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade2b.selected {
|
||||||
|
background-color: #b362e7;
|
||||||
|
box-shadow: #bbb 0px 0px 10px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade3b.selected {
|
||||||
|
background-color: #ff7f4d;
|
||||||
|
box-shadow: #bbb 0px 0px 10px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.judge > li.grade1 span,
|
||||||
|
.judge > li.grade1{
|
||||||
|
background-color: #7ea5ec;
|
||||||
|
}
|
||||||
|
.judge > li.grade2 span,
|
||||||
|
.judge > li.grade2{
|
||||||
|
background-color: #e2a7ff;
|
||||||
|
}
|
||||||
|
.judge > li.grade3 span,
|
||||||
|
.judge > li.grade3{
|
||||||
|
background-color: #ffa07a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.propinitial {
|
.propinitial {
|
||||||
top: 6rem;
|
top: 5rem;
|
||||||
bottom: 14rem;
|
bottom: 17rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.propinitial > li {
|
.propinitial > li {
|
||||||
@@ -203,11 +298,18 @@ html {
|
|||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.propbtn:hover{
|
||||||
|
color: #5c5c5c;
|
||||||
|
transition: all .2s ease 0s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lifeTrajectory {
|
.lifeTrajectory {
|
||||||
border: 1px lightblue solid;
|
border: 1px #a7a7a7 solid;
|
||||||
background-color: aliceblue;
|
border-radius: 10px;
|
||||||
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.judge > li,
|
.judge > li,
|
||||||
@@ -217,8 +319,9 @@ html {
|
|||||||
margin: 0.5rem 0;
|
margin: 0.5rem 0;
|
||||||
padding: 0.5rem 1rem 0.5rem 6rem;
|
padding: 0.5rem 1rem 0.5rem 6rem;
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
background-color: white;
|
background-color: #fff;
|
||||||
box-shadow: lightblue 0 0 0.4rem;
|
box-shadow: #a7a7a7 0 0 0.4rem;
|
||||||
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.judge > li > span,
|
.judge > li > span,
|
||||||
@@ -234,13 +337,14 @@ html {
|
|||||||
width: calc(100% - 9rem);
|
width: calc(100% - 9rem);
|
||||||
margin: 0.5rem;
|
margin: 0.5rem;
|
||||||
padding: 0.5rem 1rem 0.5rem 7rem;
|
padding: 0.5rem 1rem 0.5rem 7rem;
|
||||||
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.judge > li > span {
|
.judge > li > span {
|
||||||
background-color: white;
|
|
||||||
height: calc(100% - 1rem);
|
height: calc(100% - 1rem);
|
||||||
padding: 0.5rem 0;
|
padding: 0.5rem 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -375,7 +479,7 @@ i {
|
|||||||
* Copyright Akveo. All Rights Reserved.
|
* Copyright Akveo. All Rights Reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*/
|
*/
|
||||||
.eva-animation {
|
.eva-animation {
|
||||||
animation-duration: 1s;
|
animation-duration: 1s;
|
||||||
animation-fill-mode: both; }
|
animation-fill-mode: both; }
|
||||||
|
|
||||||
@@ -454,4 +558,8 @@ i {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: scale3d(0.5, 0.5, 0.5); }
|
transform: scale3d(0.5, 0.5, 0.5); }
|
||||||
50% {
|
50% {
|
||||||
opacity: 1; } }
|
opacity: 1; } }
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 0 !important
|
||||||
|
}
|
||||||
51
view/manifest.json
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "./images/icons/icon-72x72.png",
|
||||||
|
"sizes": "72x72",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "./images/icons/icon-96x96.png",
|
||||||
|
"sizes": "96x96",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "./images/icons/icon-128x128.png",
|
||||||
|
"sizes": "128x128",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "./images/icons/icon-144x144.png",
|
||||||
|
"sizes": "144x144",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "./images/icons/icon-152x152.png",
|
||||||
|
"sizes": "152x152",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "./images/icons/icon-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "./images/icons/icon-384x384.png",
|
||||||
|
"sizes": "384x384",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "./images/icons/icon-512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "人生重开模拟器",
|
||||||
|
"short_name": "LifeRestart",
|
||||||
|
"orientation": "portrait",
|
||||||
|
"display": "standalone",
|
||||||
|
"start_url": "/view/index.html",
|
||||||
|
"description": "人生重开模拟器",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
||||||
27
view/sw.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
var CACHE_VERSION = 'sw_v1';
|
||||||
|
|
||||||
|
var CACHE_FILES = [
|
||||||
|
'/',
|
||||||
|
];
|
||||||
|
|
||||||
|
self.addEventListener('install', function (event) {
|
||||||
|
event.waitUntil(
|
||||||
|
caches.open(CACHE_VERSION)
|
||||||
|
.then(cache => cache.addAll(CACHE_FILES)
|
||||||
|
.then(() => self.skipWaiting())
|
||||||
|
));
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener('activate', function (event) {
|
||||||
|
event.waitUntil(
|
||||||
|
caches.keys().then(function (keys) {
|
||||||
|
return Promise.all(keys.map(function (key, i) {
|
||||||
|
if (key !== CACHE_VERSION) {
|
||||||
|
return caches.delete(keys[i]);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener('fetch', function(event) {});
|
||||||
@@ -4,36 +4,35 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" href="style.css">
|
<meta name="description" content="やり直すんだ。そして、次はうまくやる。"/>
|
||||||
|
<meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/>
|
||||||
|
<link id="themeLink" rel="stylesheet" href="light.css">
|
||||||
|
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9857163863537600" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
<script type="module" src="../src/index.js"></script>
|
||||||
<script>window.json = async fileName=>(await axios(`../data/${fileName}.json`)).data;</script>
|
<title>Life Restart</title>
|
||||||
<title>Document</title>
|
|
||||||
</head>
|
</head>
|
||||||
<body style="margin: 0; height: 100%">
|
<body style="margin: 0; height: 100%">
|
||||||
<div id="main">
|
<div class="banners-container">
|
||||||
<div class="head">人生总结</div>
|
<div class="banners">
|
||||||
<ul id="judge" class="judge" style="bottom: calc(35% + 2.5rem)">
|
<div class="banner error">
|
||||||
<li class="grade2"><span>颜值:</span>9级 美若天仙</li>
|
<div class="banner-icon"><span class="iconfont"></span></div>
|
||||||
<li><span>智力:</span>4级 智力一般</li>
|
<pre class="banner-message">Oops! Something went wrong!</pre>
|
||||||
<li><span>体质:</span>1级 极度虚弱</li>
|
<div class="banner-close" onclick="hideBanners()"><span class="iconfont"></span></div>
|
||||||
<li><span>家境:</span>6级 小康之家</li>
|
</div>
|
||||||
<li><span>享年:</span>3岁 早夭</li>
|
<div class="banner success">
|
||||||
<li><span>快乐:</span>3级 不太幸福的人生</li>
|
<div class="banner-icon"><span class="iconfont"></span></div>
|
||||||
<li><span>快乐:</span>3级 不太幸福的人生</li>
|
<pre class="banner-message">Everything was fine!</pre>
|
||||||
<li><span>快乐:</span>3级 不太幸福的人生</li>
|
<div class="banner-close" onclick="hideBanners()"><span class="iconfont"></span></div>
|
||||||
<li><span>快乐:</span>3级 不太幸福的人生</li>
|
</div>
|
||||||
<li><span>快乐:</span>3级 不太幸福的人生</li>
|
<div class="banner info">
|
||||||
<li><span>快乐:</span>3级 不太幸福的人生</li>
|
<div class="banner-icon"><span class="iconfont"></span></div>
|
||||||
<li><span>快乐:</span>3级 不太幸福的人生</li>
|
<pre class="banner-message">Here is some useful information</pre>
|
||||||
<li><span>快乐:</span>3级 不太幸福的人生</li>
|
<div class="banner-close" onclick="hideBanners()"><span class="iconfont"></span></div>
|
||||||
<li><span>快乐:</span>3级 不太幸福的人生</li>
|
</div>
|
||||||
</ul>
|
|
||||||
<div class="head" style="top:auto; bottom:35%">天赋,你可以选一个,下辈子还能抽到</div>
|
|
||||||
<ul id="talents" class="selectlist" style="top:calc(65% + 0.5rem); bottom:8rem">
|
|
||||||
<li class="grade2b">黑幕(面试一定成功)</li>
|
|
||||||
</ul>
|
|
||||||
<button id="again" class="mainbtn" style="top:auto; bottom:0.1em"><span class="iconfont"></span>再次重开</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<a href="https://github.com/VickScarlet/lifeRestart" class="github-corner" style="z-index: 9999;" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; left: 0; transform: scale(-1, 1);" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style></a>
|
||||||
|
<a href="https://discord.gg/U3qrf49NMQ" style="z-index: 9999;" aria-label="Chat on Discord"><button class="discord-btn"><svg width="50%" height="55" viewBox="0 0 71 55" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0)"><path d="M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z" fill="#ffffff"/></g><defs><clipPath id="clip0"><rect width="71" height="55" fill="white"/></clipPath></defs></svg>CHAT</button><style>.discord-btn {position: fixed;bottom: 0.5rem;left: 0.5rem;background-color: #5865F2;padding: 0.7rem;height: auto;color: white;text-align: right;vertical-align: middle;border: none;width: 6.5rem;font-size: 1rem;border-radius: 4px;}.discord-btn svg {height: 1.5rem;position: absolute;top: 50%;left: 0;transform: translateY(-50%);}.discord-btn:hover svg{animation:discord-wave 560ms ease-in-out;}@keyframes discord-wave{0%,100%{transform:translateY(-50%) rotate(0)}20%,60%{transform:translateY(-50%) rotate(-25deg)}40%,80%{transform:translateY(-50%) rotate(10deg)}}@media (max-width:500px){.discord-btn:hover svg{animation:none}.discord-btn svg{animation:discord-wave 560ms ease-in-out}}</style></a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
56
webpack.config.cjs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
mode: 'production',
|
||||||
|
entry: './src/index.js',
|
||||||
|
devtool: 'eval-cheap-module-source-map',
|
||||||
|
devServer: {
|
||||||
|
static: [
|
||||||
|
{
|
||||||
|
directory: path.join(__dirname, 'data'),
|
||||||
|
publicPath: '/data',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
directory: path.join(__dirname, 'public'),
|
||||||
|
publicPath: '/public',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
directory: path.join(__dirname, 'view'),
|
||||||
|
publicPath: '/view',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
directory: path.join(__dirname, 'src'),
|
||||||
|
publicPath: '/src',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__dirname, 'public'),
|
||||||
|
filename: 'bundle.js',
|
||||||
|
clean: true,
|
||||||
|
},
|
||||||
|
// resolve: {
|
||||||
|
// extensions: ['.js'],
|
||||||
|
// },
|
||||||
|
module: {
|
||||||
|
rules: [{
|
||||||
|
test: /\.js$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: {
|
||||||
|
loader: 'babel-loader',
|
||||||
|
options: {
|
||||||
|
presets: [
|
||||||
|
[
|
||||||
|
'@babel/preset-env',
|
||||||
|
{
|
||||||
|
"targets": "> 0.25%, not dead",
|
||||||
|
"useBuiltIns": "usage",
|
||||||
|
"corejs": "3.8.3",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
};
|
||||||