forked from Arondight/Adachi-BOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genshin-info.html
224 lines (211 loc) · 7.49 KB
/
genshin-info.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8" />
<title>genshin-card</title>
<script src="../../data/js/vue.min.js"></script>
<script src="./component/card/card.js"></script>
<link rel="stylesheet" href="./component/card/card.css" />
</head>
<body>
<div id="app">
<upper
:uid="uid"
:nickname="nickname"
:level="level"
:stats="stats"
:exploration="explorations"
:profile="profile"
:homeslevel="homeslevel"
:maxcomfort="maxcomfort"
:maps="homes"
></upper>
<div class="avatars-box" v-for="avatars in avatarsData">
<middle :avatars="avatars"></middle>
</div>
<bottom></bottom>
</div>
<template id="upper">
<div>
<div class="background">
<img src="http://localhost:9934/resources/Version2/module/uid-upper-v2-2.png" alt="ERROR" />
</div>
<img :src="Picture" alt="ERROR" class="profile" />
<div class="base-info">
<p class="nickname">{{nickname}}</p>
<p class="uid">UID: {{uid}}</p>
</div>
<div class="detail detail-left">
<p class="stats">{{stats.active_day_number}}</p>
<p class="stats">{{stats.achievement_number}}</p>
<p class="stats">{{stats.avatar_number}}</p>
<p class="stats">{{stats.spiral_abyss}}</p>
<p class="stats">{{stats.domain_number}}</p>
</div>
<div class="detail detail-middle">
<p class="stats">{{stats.common_chest_number}}</p>
<p class="stats">{{stats.exquisite_chest_number}}</p>
<p class="stats">{{stats.precious_chest_number}}</p>
<p class="stats">{{stats.luxurious_chest_number}}</p>
<p class="stats">{{stats.magic_chest_number}}</p>
</div>
<div class="detail detail-right">
<p class="stats">{{stats.anemoculus_number}}</p>
<p class="stats">{{stats.geoculus_number}}</p>
<p class="stats">{{stats.electroculus_number}}</p>
</div>
<div class="exploration">
<div class="mondstadt">
<div class="exp">{{percentage(1)}}</div>
<div class="level">{{expLevel(1)}}</div>
</div>
<div class="dragonspine">
<div class="exp">{{percentage(3)}}</div>
<div class="level">{{expLevel(3)}}</div>
</div>
<div class="liyue">
<div class="exp">{{percentage(2)}}</div>
<div class="level">{{expLevel(2)}}</div>
</div>
<div class="inazuma">
<div class="exp">{{percentage(4)}}</div>
<div class="level">{{expLevel(4)}}</div>
<div class="sakura">{{sakura()}}</div>
</div>
</div>
<div class="home">
<p class="title-and-level">尘歌壶 Lv.{{ homeslevel }}</p>
<div class="map">
<div class="home-box" v-for="data in homedata">
<img
class="home-background"
:src="'http://localhost:9934/resources/item/'+data.name+'.png'"
alt="ERROR"
/>
<div class="unlock" v-if="data.level !== -1">
<div class="box-block unlock-block"></div>
<div class="box-block unlock-content-block">
<p class="box-content name">{{ data.name }}</p>
<p class="box-content level">洞天等级</p>
<p class="box-content comfort">{{ data.comfort_level_name }}</p>
</div>
</div>
<div class="locked" v-else>
<div class="box-block locked-block"></div>
<img class="lock-icon" src="http://localhost:9934/resources/item/lock.png" alt="ERROR" />
</div>
</div>
</div>
<p class="comfort-num">仙力: {{ maxcomfort }}</p>
</div>
<img src="http://localhost:9934/resources/module/card-new-package.png" alt="ERROR" />
</div>
</template>
<template id="avatar-element">
<div>
<div class="element">
<div class="con num" v-if="avatar.actived_constellation_num!=0&&avatar.actived_constellation_num<=5">
{{avatar.actived_constellation_num}}
</div>
<div class="con num6" v-else-if="avatar.actived_constellation_num==6">
{{avatar.actived_constellation_num}}
</div>
<div class="element-border" :class="avatar.element"></div>
<img class="profile" :src="avatar.icon" alt="ERROR" />
<div class="avatar-info">
<p class="name">{{avatar.name}}</p>
<div>
<p class="level">Lv.{{avatar.level}}</p>
<p class="fetter" v-show="avatar.name!=='旅行者'">❤{{avatar.fetter}}</p>
<br />
<p class="weapon-name">{{avatar.weapon.name}}</p>
<p class="weapon-affix">★{{avatar.weapon.affix_level}}</p>
</div>
</div>
</div>
</div>
</template>
<template id="middle">
<div>
<div class="box">
<div class="avatar" v-for="avatar in avatars">
<avatar-element :avatar="avatar"></avatar-element>
</div>
<img class="backdrop" src="http://localhost:9934/resources/module/card-new-middle.png" alt="ERROR" />
</div>
</div>
</template>
<template id="bottom">
<div>
<div class="background">
<img src="http://localhost:9934/resources/module/card-new-bottom.png" alt="ERROR" />
</div>
</div>
</template>
<script>
new Vue({
el: "#app",
data: {
retcode: 1,
nickname: "",
uid: 0,
level: 0,
profile: 0,
stats: {},
avatarsData: [],
explorations: [],
avatar_number: 0,
homes: [],
homeslevel: 0,
maxcomfort: 0,
},
components: {
upper,
middle,
bottom,
},
methods: {
cutArray(array, step) {
let newArray = [];
let index = 0,
len = array.length;
while (index < len) {
newArray.push(array.slice(index, (index += step)));
}
return newArray;
},
readJSON(file, callback) {
fetch(file).then((res) => {
return res.json().then((data) => {
callback(data);
});
});
},
},
mounted() {
this.readJSON("../../data/record/genshin-info.json", (res) => {
this.nickname = res.nickname;
this.uid = res.uid;
this.level = res.level;
let avatarsList = res.avatars;
this.stats = res.stats;
this.homes = res.homes;
this.avatar_number = avatarsList.length;
this.explorations = res.explorations;
this.profile = avatarsList[Math.floor(Math.random() * this.avatar_number)].id;
avatarsList.sort((x, y) => {
if (x.level === y.level) {
return y.fetter - x.fetter;
} else {
return y.level - x.level;
}
});
this.avatarsData = this.cutArray(avatarsList, 7);
this.homeslevel = res.homes[0].level !== 0 ? res.homes[0].level : 0;
this.maxcomfort = res.homes[0].comfort_num !== 0 ? res.homes[0].comfort_num : 0;
});
},
});
</script>
</body>
</html>