Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.

Commit 9b3f846

Browse files
发布 0.1.0 版本
1 parent a5f5cf2 commit 9b3f846

28 files changed

+3631
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,7 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
# Moe
107+
data/
108+
config.yml

assets/YuanShen/UserInfo.pug

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
-
2+
//- 重复字符串
3+
function repeatString(str, n) {
4+
let result = ''
5+
for (let i = 0; i < n; i++) {
6+
result += str
7+
}
8+
return result
9+
}
10+
11+
//- 替换来源
12+
function replaceSource(url) {
13+
const cn = 'upload-bbs.mihoyo.com'
14+
const os = 'upload-os-bbs.mihoyo.com'
15+
switch (assets_source) {
16+
case 'cn':
17+
return url.replace(os, cn)
18+
case 'os':
19+
return url.replace(cn, os)
20+
default:
21+
return url
22+
}
23+
}
24+
25+
//- 项目
26+
mixin item(title, box)
27+
section.item(id=title)
28+
h2.title= title
29+
.content(class={box: box})
30+
block
31+
32+
//- 统计卡
33+
mixin statCard(key, val)
34+
-
35+
const descs = {
36+
active_day_number: '活跃天数',
37+
achievement_number: '成就达成数',
38+
anemoculus_number: '风神瞳',
39+
geoculus_number: '岩神瞳',
40+
avatar_number: '获得角色数',
41+
way_point_number: '解锁传送点',
42+
domain_number: '解锁秘境',
43+
spiral_abyss: '深境螺旋',
44+
precious_chest_number: '珍贵宝箱数',
45+
luxurious_chest_number: '华丽宝箱数',
46+
exquisite_chest_number: '精致宝箱数',
47+
common_chest_number: '普通宝箱数',
48+
electroculus_number: '雷神瞳'
49+
}
50+
.stat
51+
.val= val
52+
.desc= descs[key] || key
53+
54+
//- 角色卡
55+
mixin charCard(char)
56+
.char
57+
.main.box
58+
img.avatar(src=replaceSource(char.image), alt=char.name)
59+
p.title
60+
span.level= char.level
61+
if char.fetter
62+
span.fetter= char.fetter
63+
p.star= repeatString('', char.rarity)
64+
img.element(src=`img/element/${char.element}.png`, alt=char.element)
65+
if char.actived_constellation_num
66+
p.constellation= char.actived_constellation_num
67+
p.name= char.name
68+
69+
doctype html
70+
html(lang='zh-cn')
71+
head
72+
link(rel='stylesheet', href='css/Common.css')
73+
title 原神玩家信息
74+
body
75+
header
76+
h1#title UID #{uid}
77+
img#logo(src='img/Genshin.png', alt="原神")
78+
img#mascot(src='img/Paimon.png', alt="派蒙")
79+
article
80+
+item('数据总览', true)
81+
each val, key in stats
82+
+statCard(key, val)
83+
+item('角色总览')
84+
each char in avatars
85+
+charCard(char)
86+
footer
87+
p 页面生成于 #{date}
88+
p 相关图片由米哈游版权所有

assets/YuanShen/css/Common.css

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
/* 整体 */
2+
:root {
3+
font-family: 'HarmonyOS Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Lato, Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
4+
font-size: 16px;
5+
line-height: 1.35;
6+
}
7+
8+
body {
9+
margin: 0;
10+
background-color: #FEFEFE;
11+
}
12+
13+
/* 页眉 */
14+
header {
15+
position: relative;
16+
min-height: 200px;
17+
background-image: url('../img/Mengde.jpg');
18+
background-position: center center;
19+
background-size: cover;
20+
background-repeat: no-repeat;
21+
overflow: hidden;
22+
}
23+
24+
header:before {
25+
content: '';
26+
position: absolute;
27+
width: 100%;
28+
height: 100%;
29+
background-color: rgba(0, 0, 0, 0.35);
30+
}
31+
32+
header #title {
33+
position: absolute;
34+
bottom: 0;
35+
left: 0.5em;
36+
color: #FEFEFE;
37+
}
38+
39+
header #logo {
40+
position: absolute;
41+
top: 0.4em;
42+
left: 0.4em;
43+
max-height: 130px;
44+
}
45+
46+
header #mascot {
47+
position: absolute;
48+
top: 0.8em;
49+
right: 0.8em;
50+
max-height: 450px;
51+
}
52+
53+
/* 正文 */
54+
article {
55+
margin: auto 35px;
56+
text-align: center;
57+
}
58+
59+
/* 项目 */
60+
.item {
61+
margin: 0.5em auto;
62+
}
63+
64+
.item > .title {
65+
display: inline-block;
66+
margin: 0.5em auto;
67+
font-weight: normal;
68+
color: #FEFEFE;
69+
background-color: burlywood;
70+
padding: 4px 16px;
71+
border: 5px double #FEFEFE;
72+
border-radius: 22px;
73+
}
74+
75+
.item > .content {
76+
display: flex;
77+
flex-wrap: wrap;
78+
}
79+
80+
.item > .content > * {
81+
flex-basis: 20%;
82+
margin: 0.5em 0;
83+
}
84+
85+
.box {
86+
border: 1px solid burlywood;
87+
border-radius: 10px;
88+
background-color: #F8F8F8;
89+
}
90+
91+
.item > .content.box {
92+
padding: 0.5em 0;
93+
}
94+
95+
/* 统计卡 */
96+
.stat .val {
97+
font-weight: bold;
98+
font-size: 1.8em;
99+
}
100+
101+
.stat .desc {
102+
color: gray;
103+
margin-top: 0.2em;
104+
font-size: 0.9em;
105+
}
106+
107+
/* 角色卡 */
108+
.char {
109+
position: relative;
110+
}
111+
112+
.char p {
113+
margin: 0.1em auto;
114+
}
115+
116+
.char .main {
117+
position: relative;
118+
display: inline-block;
119+
max-width: 90%;
120+
background-color: burlywood;
121+
overflow: hidden;
122+
}
123+
124+
.char .avatar {
125+
display: block;
126+
max-width: 100%;
127+
background-color: #FEFEFE;
128+
border-bottom-right-radius: 25px;
129+
}
130+
131+
.char .title {
132+
color: #F8F8F8;
133+
font-weight: bold;
134+
}
135+
136+
.char .title span {
137+
margin: auto 0.3em;
138+
}
139+
140+
.char .level:before {
141+
content: 'Lv.';
142+
}
143+
144+
.char .fetter:before {
145+
content: '❤';
146+
margin-right: 0.2em;
147+
}
148+
149+
.char .star {
150+
position: absolute;
151+
bottom: 1em;
152+
min-width: 100%;
153+
color: gold;
154+
font-size: 1.3em;
155+
text-shadow: 0 0 5px black;
156+
letter-spacing: -0.15em;
157+
}
158+
159+
.char .element {
160+
position: absolute;
161+
top: 0.1em;
162+
left: 0.1em;
163+
max-width: 30px;
164+
filter: saturate(1.3);
165+
}
166+
167+
.char .constellation {
168+
position: absolute;
169+
top: 0;
170+
right: 0;
171+
margin: 0;
172+
padding: 0.2em 0.3em;
173+
border-bottom-left-radius: 5px;
174+
color: #F8F8F8;
175+
background-color: rgba(0, 0, 0, 0.5);
176+
font-weight: bold;
177+
}
178+
179+
/* 页脚 */
180+
footer {
181+
text-align: center;
182+
color: gray;
183+
}

assets/YuanShen/img/Genshin.png

42.7 KB
Loading

assets/YuanShen/img/Mengde.jpg

226 KB
Loading

assets/YuanShen/img/Paimon.png

97.1 KB
Loading
13.6 KB
Loading
13.7 KB
Loading
14.3 KB
Loading
11.6 KB
Loading

0 commit comments

Comments
 (0)