koishi-plugin-bilibili-notify 3.2.5-alpha.0 → 3.2.5-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.mts +73 -0
- package/lib/index.d.ts +65 -62
- package/lib/index.js +95166 -395
- package/lib/index.mjs +95172 -0
- package/package.json +11 -8
- package/readme.md +19 -1
- package/lib/biliAPI.d.ts +0 -79
- package/lib/biliAPI.js +0 -811
- package/lib/blive.d.ts +0 -16
- package/lib/blive.js +0 -59
- package/lib/comRegister.d.ts +0 -106
- package/lib/comRegister.js +0 -1896
- package/lib/database.d.ts +0 -14
- package/lib/database.js +0 -14
- package/lib/font/HYZhengYuan-75W.ttf +0 -0
- package/lib/generateImg.d.ts +0 -52
- package/lib/generateImg.js +0 -1505
- package/lib/img/arrow.png +0 -0
- package/lib/type/index.d.ts +0 -262
- package/lib/type/index.js +0 -18
- package/lib/utils/index.d.ts +0 -13
- package/lib/utils/index.js +0 -102
package/lib/generateImg.js
DELETED
|
@@ -1,1505 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const koishi_1 = require("koishi");
|
|
4
|
-
const luxon_1 = require("luxon");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
6
|
-
const node_url_1 = require("node:url");
|
|
7
|
-
const utils_1 = require("./utils");
|
|
8
|
-
// 动态类型
|
|
9
|
-
const DYNAMIC_TYPE_NONE = "DYNAMIC_TYPE_NONE";
|
|
10
|
-
const DYNAMIC_TYPE_FORWARD = "DYNAMIC_TYPE_FORWARD";
|
|
11
|
-
const DYNAMIC_TYPE_AV = "DYNAMIC_TYPE_AV";
|
|
12
|
-
const DYNAMIC_TYPE_PGC = "DYNAMIC_TYPE_PGC";
|
|
13
|
-
const DYNAMIC_TYPE_WORD = "DYNAMIC_TYPE_WORD";
|
|
14
|
-
const DYNAMIC_TYPE_DRAW = "DYNAMIC_TYPE_DRAW";
|
|
15
|
-
const DYNAMIC_TYPE_ARTICLE = "DYNAMIC_TYPE_ARTICLE";
|
|
16
|
-
const DYNAMIC_TYPE_MUSIC = "DYNAMIC_TYPE_MUSIC";
|
|
17
|
-
const DYNAMIC_TYPE_COMMON_SQUARE = "DYNAMIC_TYPE_COMMON_SQUARE";
|
|
18
|
-
const DYNAMIC_TYPE_LIVE = "DYNAMIC_TYPE_LIVE";
|
|
19
|
-
const DYNAMIC_TYPE_MEDIALIST = "DYNAMIC_TYPE_MEDIALIST";
|
|
20
|
-
const DYNAMIC_TYPE_COURSES_SEASON = "DYNAMIC_TYPE_COURSES_SEASON";
|
|
21
|
-
const DYNAMIC_TYPE_LIVE_RCMD = "DYNAMIC_TYPE_LIVE_RCMD";
|
|
22
|
-
const DYNAMIC_TYPE_UGC_SEASON = "DYNAMIC_TYPE_UGC_SEASON";
|
|
23
|
-
// 内容卡片类型
|
|
24
|
-
const ADDITIONAL_TYPE_RESERVE = "ADDITIONAL_TYPE_RESERVE";
|
|
25
|
-
class GenerateImg extends koishi_1.Service {
|
|
26
|
-
static inject = ["puppeteer", "ba"];
|
|
27
|
-
giConfig;
|
|
28
|
-
constructor(ctx, config) {
|
|
29
|
-
super(ctx, "gi");
|
|
30
|
-
this.giConfig = config;
|
|
31
|
-
}
|
|
32
|
-
async imgHandler(html) {
|
|
33
|
-
const htmlPath = `file://${__dirname.replaceAll("\\", "/")}/page/0.html`;
|
|
34
|
-
const page = await this.ctx.puppeteer.page();
|
|
35
|
-
await page.goto(htmlPath);
|
|
36
|
-
await page.setContent(html, { waitUntil: "networkidle0" });
|
|
37
|
-
const elementHandle = await page.$("html");
|
|
38
|
-
const boundingBox = await elementHandle.boundingBox();
|
|
39
|
-
const buffer = await page.screenshot({
|
|
40
|
-
type: "jpeg",
|
|
41
|
-
clip: {
|
|
42
|
-
x: boundingBox.x,
|
|
43
|
-
y: boundingBox.y,
|
|
44
|
-
width: boundingBox.width,
|
|
45
|
-
height: boundingBox.height,
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
await elementHandle.dispose();
|
|
49
|
-
await page.close();
|
|
50
|
-
return buffer;
|
|
51
|
-
}
|
|
52
|
-
async generateLiveImg(
|
|
53
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
54
|
-
data, username, userface, followerDisplay, liveStatus /*0未开播 1刚开播 2已开播 3停止直播*/, { cardColorStart = this.giConfig.cardColorStart, cardColorEnd = this.giConfig.cardColorEnd, cardBasePlateColor = this.giConfig.cardBasePlateColor, cardBasePlateBorder = this.giConfig.cardBasePlateBorder, } = {}) {
|
|
55
|
-
const [titleStatus, liveTime, cover] = await this.getLiveStatus(data.live_time, liveStatus);
|
|
56
|
-
// 加载字体
|
|
57
|
-
const fontURL = (0, node_url_1.pathToFileURL)((0, node_path_1.resolve)(__dirname, "font/HYZhengYuan-75W.ttf"));
|
|
58
|
-
// 卡片内容
|
|
59
|
-
const html = /* html */ `
|
|
60
|
-
<!DOCTYPE html>
|
|
61
|
-
<html>
|
|
62
|
-
<head>
|
|
63
|
-
<title>直播通知</title>
|
|
64
|
-
<style>
|
|
65
|
-
@font-face {
|
|
66
|
-
font-family: "Custom Font";
|
|
67
|
-
src: url(${fontURL});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
* {
|
|
71
|
-
margin: 0;
|
|
72
|
-
padding: 0;
|
|
73
|
-
box-sizing: border-box;
|
|
74
|
-
font-family: \"${this.giConfig.font}\", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
html {
|
|
78
|
-
width: 800px;
|
|
79
|
-
height: auto;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.background {
|
|
83
|
-
width: 100%;
|
|
84
|
-
height: auto;
|
|
85
|
-
padding: 15px;
|
|
86
|
-
background: linear-gradient(to right bottom, ${cardColorStart}, ${cardColorEnd});
|
|
87
|
-
overflow: hidden;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.base-plate {
|
|
91
|
-
width: 100%;
|
|
92
|
-
height: auto;
|
|
93
|
-
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
|
|
94
|
-
padding: ${cardBasePlateBorder};
|
|
95
|
-
border-radius: 10px;
|
|
96
|
-
background-color: ${cardBasePlateColor};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.card {
|
|
100
|
-
width: 100%;
|
|
101
|
-
height: auto;
|
|
102
|
-
border-radius: 5px;
|
|
103
|
-
padding: 15px;
|
|
104
|
-
overflow: hidden;
|
|
105
|
-
background-color: #fff;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.card img {
|
|
109
|
-
border-radius: 5px 5px 0 0;
|
|
110
|
-
max-width: 100%;
|
|
111
|
-
/* 设置最大宽度为容器宽度的100% */
|
|
112
|
-
max-height: 80%;
|
|
113
|
-
/* 设置最大高度为容器高度的90% */
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.card-header {
|
|
117
|
-
display: flex;
|
|
118
|
-
justify-content: space-between;
|
|
119
|
-
align-items: center;
|
|
120
|
-
margin-top: 5px;
|
|
121
|
-
margin-bottom: 10px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.card-title {
|
|
125
|
-
line-height: 50px;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.card-body {
|
|
129
|
-
padding: 2px 16px;
|
|
130
|
-
margin-bottom: 10px;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.live-broadcast-info {
|
|
134
|
-
display: flex;
|
|
135
|
-
align-items: center;
|
|
136
|
-
margin-bottom: 10px;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.anchor-avatar {
|
|
140
|
-
width: 50px;
|
|
141
|
-
/* 主播头像大小 */
|
|
142
|
-
height: auto;
|
|
143
|
-
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.broadcast-message {
|
|
147
|
-
display: inline-block;
|
|
148
|
-
margin-left: 10px;
|
|
149
|
-
font-size: 20px;
|
|
150
|
-
color: #333;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.card-text {
|
|
154
|
-
color: grey;
|
|
155
|
-
font-size: 20px;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.card-link {
|
|
159
|
-
display: flex;
|
|
160
|
-
justify-content: space-between;
|
|
161
|
-
text-decoration: none;
|
|
162
|
-
font-size: 20px;
|
|
163
|
-
margin-top: 10px;
|
|
164
|
-
margin-bottom: 10px;
|
|
165
|
-
}
|
|
166
|
-
</style>
|
|
167
|
-
</head>
|
|
168
|
-
<body>
|
|
169
|
-
<div class="background">
|
|
170
|
-
<div ${this.giConfig.removeBorder ? "" : 'class="base-plate"'}>
|
|
171
|
-
<div class="card">
|
|
172
|
-
<img src="${cover ? data.user_cover : data.keyframe}"
|
|
173
|
-
alt="封面">
|
|
174
|
-
<div class="card-body">
|
|
175
|
-
<div class="card-header">
|
|
176
|
-
<h1 class="card-title">${data.title}</h1>
|
|
177
|
-
<div class="live-broadcast-info">
|
|
178
|
-
<!-- 主播头像 -->
|
|
179
|
-
<img style="border-radius: 10px; margin-left: 10px" class="anchor-avatar"
|
|
180
|
-
src="${userface}" alt="主播头像">
|
|
181
|
-
<span class="broadcast-message">${username}${titleStatus}</span>
|
|
182
|
-
</div>
|
|
183
|
-
</div>
|
|
184
|
-
${this.giConfig.hideDesc ? "" : `<p class="card-text">${data.description ? data.description : "这个主播很懒,什么简介都没写"}</p>`}
|
|
185
|
-
<p class="card-link">
|
|
186
|
-
<span>人气:${data.online > 10000 ? `${(data.online / 10000).toFixed(1)}万` : data.online}</span>
|
|
187
|
-
<span>分区名称:${data.area_name}</span>
|
|
188
|
-
</p>
|
|
189
|
-
<p class="card-link">
|
|
190
|
-
<span>${liveTime}</span>
|
|
191
|
-
${this.giConfig.followerDisplay
|
|
192
|
-
? /* html */ `
|
|
193
|
-
<span>
|
|
194
|
-
${liveStatus === 1
|
|
195
|
-
? `当前粉丝数:${followerDisplay}`
|
|
196
|
-
: liveStatus === 2
|
|
197
|
-
? `${followerDisplay !== "API" ? `累计观看人数:${followerDisplay}` : ""}`
|
|
198
|
-
: liveStatus === 3
|
|
199
|
-
? `粉丝数变化:${followerDisplay}`
|
|
200
|
-
: ""}
|
|
201
|
-
</span>`
|
|
202
|
-
: ""}
|
|
203
|
-
</p>
|
|
204
|
-
</div>
|
|
205
|
-
</div>
|
|
206
|
-
</div>
|
|
207
|
-
</div>
|
|
208
|
-
</body>
|
|
209
|
-
</html>
|
|
210
|
-
`;
|
|
211
|
-
// 多次尝试生成图片
|
|
212
|
-
return await (0, utils_1.withRetry)(() => this.imgHandler(html)).catch((e) => {
|
|
213
|
-
// 已尝试三次
|
|
214
|
-
throw new Error(`生成图片失败!错误: ${e.toString()}`);
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
richTextParser(rt, title) {
|
|
218
|
-
const richText = rt.reduce((accumulator, currentValue) => {
|
|
219
|
-
if (currentValue.emoji) {
|
|
220
|
-
return /* html */ `${accumulator}<img style="width:28px; height:28px;" src="${currentValue.emoji.icon_url}"/>`;
|
|
221
|
-
}
|
|
222
|
-
return accumulator + currentValue.text;
|
|
223
|
-
}, "");
|
|
224
|
-
// 关键字和正则屏蔽
|
|
225
|
-
if (this.giConfig.filter.enable) {
|
|
226
|
-
// 开启动态屏蔽功能
|
|
227
|
-
if (this.giConfig.filter.regex) {
|
|
228
|
-
// 正则屏蔽
|
|
229
|
-
const reg = new RegExp(this.giConfig.filter.regex);
|
|
230
|
-
if (reg.test(richText))
|
|
231
|
-
throw new Error("出现关键词,屏蔽该动态");
|
|
232
|
-
}
|
|
233
|
-
if (this.giConfig.filter.keywords.length !== 0 &&
|
|
234
|
-
this.giConfig.filter.keywords.some((keyword) => richText.includes(keyword))) {
|
|
235
|
-
throw new Error("出现关键词,屏蔽该动态");
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
// 查找\n
|
|
239
|
-
const text = richText.replace(/\n/g, "<br>");
|
|
240
|
-
// 拼接字符串
|
|
241
|
-
return /* html */ `
|
|
242
|
-
<div class="card-details">
|
|
243
|
-
${title ? `<h1 class="dyn-title">${title}</h1>` : ""}
|
|
244
|
-
${text}
|
|
245
|
-
</div>
|
|
246
|
-
`;
|
|
247
|
-
}
|
|
248
|
-
async generateDynamicImg(data, { cardColorStart = this.giConfig.cardColorStart, cardColorEnd = this.giConfig.cardColorEnd, cardBasePlateColor = this.giConfig.cardBasePlateColor, cardBasePlateBorder = this.giConfig.cardBasePlateBorder, } = {}) {
|
|
249
|
-
// module_author
|
|
250
|
-
const module_author = data.modules.module_author;
|
|
251
|
-
const avatarUrl = module_author.face;
|
|
252
|
-
const upName = module_author.name;
|
|
253
|
-
let pubTime = this.unixTimestampToString(module_author.pub_ts);
|
|
254
|
-
// dynamicCard
|
|
255
|
-
let dynamicCardUrl;
|
|
256
|
-
let dynamicCardId;
|
|
257
|
-
let dynamicCardColor;
|
|
258
|
-
if (module_author.decorate) {
|
|
259
|
-
dynamicCardUrl = module_author.decorate.card_url;
|
|
260
|
-
dynamicCardId = module_author.decorate.fan.num_str;
|
|
261
|
-
dynamicCardColor = module_author.decorate.fan.color;
|
|
262
|
-
}
|
|
263
|
-
// module_stat
|
|
264
|
-
const module_stat = data.modules.module_stat;
|
|
265
|
-
const comment = module_stat.comment.count;
|
|
266
|
-
const forward = module_stat.forward.count;
|
|
267
|
-
const like = module_stat.like.count;
|
|
268
|
-
// TOPIC
|
|
269
|
-
const topic = data.modules.module_dynamic.topic
|
|
270
|
-
? data.modules.module_dynamic.topic.name
|
|
271
|
-
: "";
|
|
272
|
-
const getDynamicMajor = async (dynamic, forward) => {
|
|
273
|
-
// 定义返回值
|
|
274
|
-
let main = "";
|
|
275
|
-
// 定义forward类型返回值
|
|
276
|
-
let forwardInfo;
|
|
277
|
-
// 最基本的图文处理
|
|
278
|
-
const basicDynamic = () => {
|
|
279
|
-
// 获取动态内容
|
|
280
|
-
const module_dynamic = dynamic.modules.module_dynamic;
|
|
281
|
-
// 判断是否有desc
|
|
282
|
-
if (module_dynamic?.desc?.rich_text_nodes) {
|
|
283
|
-
const content = this.richTextParser(module_dynamic.desc.rich_text_nodes);
|
|
284
|
-
main += content;
|
|
285
|
-
}
|
|
286
|
-
// 判断是否有summary
|
|
287
|
-
if (module_dynamic?.major?.opus?.summary?.rich_text_nodes) {
|
|
288
|
-
const content = this.richTextParser(module_dynamic.major.opus.summary.rich_text_nodes, module_dynamic.major.opus.title);
|
|
289
|
-
main += content;
|
|
290
|
-
}
|
|
291
|
-
// 图片
|
|
292
|
-
let major = "";
|
|
293
|
-
const arrowImg = (0, node_url_1.pathToFileURL)((0, node_path_1.resolve)(__dirname, "img/arrow.png"));
|
|
294
|
-
if (module_dynamic?.major?.opus?.pics) {
|
|
295
|
-
if (module_dynamic.major.opus.pics.length === 1) {
|
|
296
|
-
const height = module_dynamic.major.opus.pics[0].height;
|
|
297
|
-
if (height > 3000) {
|
|
298
|
-
major += /* html */ `
|
|
299
|
-
<div class="single-photo-container">
|
|
300
|
-
<img class="single-photo-item" src="${module_dynamic.major.opus.pics[0].url}"/>
|
|
301
|
-
<div class="single-photo-mask">
|
|
302
|
-
<span class="single-photo-mask-text">点击链接浏览全部</span>
|
|
303
|
-
</div>
|
|
304
|
-
<img class="single-photo-mask-arrow" src="${arrowImg}"/>
|
|
305
|
-
</div>
|
|
306
|
-
`;
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
major += /* html */ `
|
|
310
|
-
<div class="single-photo-container">
|
|
311
|
-
<img class="single-photo-item" src="${module_dynamic.major.opus.pics[0].url}"/>
|
|
312
|
-
</div>
|
|
313
|
-
`;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
else if (module_dynamic.major.opus.pics.length === 4) {
|
|
317
|
-
major += module_dynamic.major.opus.pics.reduce((acc, cV) => {
|
|
318
|
-
return /* html */ `${acc}<img class="four-photo-item" src="${cV.url}"/>`;
|
|
319
|
-
}, "");
|
|
320
|
-
}
|
|
321
|
-
else {
|
|
322
|
-
major += module_dynamic.major.opus.pics.reduce((acc, cV) => {
|
|
323
|
-
return /* html */ `${acc}<img class="photo-item" src="${cV.url}"/>`;
|
|
324
|
-
}, "");
|
|
325
|
-
}
|
|
326
|
-
main += /* html */ `
|
|
327
|
-
<div class="card-major">
|
|
328
|
-
${major}
|
|
329
|
-
</div>
|
|
330
|
-
`;
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
// 判断动态类型
|
|
334
|
-
switch (dynamic.type) {
|
|
335
|
-
case DYNAMIC_TYPE_WORD:
|
|
336
|
-
case DYNAMIC_TYPE_DRAW:
|
|
337
|
-
case DYNAMIC_TYPE_FORWARD: {
|
|
338
|
-
// DYNAMIC_TYPE_DRAW 带图动态 DYNAMIC_TYPE_WORD 文字动态 DYNAMIC_TYPE_FORWARD 转发动态
|
|
339
|
-
basicDynamic();
|
|
340
|
-
// 转发动态
|
|
341
|
-
if (dynamic.type === DYNAMIC_TYPE_FORWARD) {
|
|
342
|
-
//转发动态屏蔽
|
|
343
|
-
if (this.giConfig.filter.enable && this.giConfig.filter.forward) {
|
|
344
|
-
throw new Error("已屏蔽转发动态");
|
|
345
|
-
}
|
|
346
|
-
// User info
|
|
347
|
-
const forward_module_author = dynamic.orig.modules.module_author;
|
|
348
|
-
const forwardUserAvatarUrl = forward_module_author.face;
|
|
349
|
-
const forwardUserName = forward_module_author.name;
|
|
350
|
-
// 获取转发的动态
|
|
351
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
352
|
-
const [forwardMain, forwardInfo] = await getDynamicMajor(dynamic.orig, true);
|
|
353
|
-
// 拼接main
|
|
354
|
-
main += /* html */ `
|
|
355
|
-
<div class="card-forward">
|
|
356
|
-
<div class="forward-userinfo">
|
|
357
|
-
<img class="forward-avatar" src="${forwardUserAvatarUrl}" alt="avatar">
|
|
358
|
-
<span class="forward-username">${forwardUserName} ${forwardInfo ? forwardInfo : ""}</span>
|
|
359
|
-
</div>
|
|
360
|
-
<div class="forward-main">
|
|
361
|
-
${forwardMain}
|
|
362
|
-
</div>
|
|
363
|
-
</div>
|
|
364
|
-
`;
|
|
365
|
-
}
|
|
366
|
-
// 判断是否有附加信息
|
|
367
|
-
if (dynamic.modules.module_dynamic.additional) {
|
|
368
|
-
const additional = dynamic.modules.module_dynamic.additional;
|
|
369
|
-
// 有附加信息,判断类型
|
|
370
|
-
switch (additional.type) {
|
|
371
|
-
case ADDITIONAL_TYPE_RESERVE: {
|
|
372
|
-
// 预约信息
|
|
373
|
-
const reserve = additional.reserve;
|
|
374
|
-
// 定义按钮
|
|
375
|
-
let button;
|
|
376
|
-
// 判断按钮类型
|
|
377
|
-
if (reserve.button.uncheck.text === "已结束") {
|
|
378
|
-
button = /* html */ `
|
|
379
|
-
<button class="reserve-button-end">
|
|
380
|
-
<span>${reserve.button.uncheck.text}</span>
|
|
381
|
-
</button>
|
|
382
|
-
`;
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
button = /* html */ `
|
|
386
|
-
<button class="reserve-button-ing">
|
|
387
|
-
<svg class="bili-dyn-card-reserve__action__icon" style="width: 16px; height: 16px;"
|
|
388
|
-
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
389
|
-
viewBox="0 0 16 16" width="16" height="16">
|
|
390
|
-
<path
|
|
391
|
-
d="M3.0000133333333334 6.999199999999999C3.0000133333333334 4.23776 5.2385866666666665 1.9991866666666667 8 1.9991866666666667C10.761433333333333 1.9991866666666667 13 4.23776 13 6.999199999999999L13 9.860933333333332C13 9.923533333333333 13.024899999999999 9.983633333333334 13.069199999999999 10.027933333333333L13.588366666666666 10.5471C14.389533333333333 11.348299999999998 13.914133333333334 12.734533333333333 12.754199999999999 12.8183C11.535999999999998 12.906233333333333 9.818933333333334 12.999199999999998 8 12.999199999999998C6.181073333333334 12.999199999999998 4.464026666666666 12.906233333333333 3.2458266666666664 12.8183C2.0859066666666664 12.734533333333333 1.61046 11.348299999999998 2.4116466666666665 10.547133333333333L2.93084 10.027933333333333C2.975133333333333 9.983633333333334 3.0000133333333334 9.923533333333333 3.0000133333333334 9.860933333333332L3.0000133333333334 6.999199999999999zM8 2.9991866666666667C5.790873333333334 2.9991866666666667 4.000013333333333 4.790046666666666 4.000013333333333 6.999199999999999L4.000013333333333 9.860933333333332C4.000013333333333 10.1888 3.8697733333333333 10.5032 3.6379466666666667 10.735033333333334L3.1187466666666666 11.254233333333334C2.911966666666667 11.461 3.0317600000000002 11.800199999999998 3.317833333333333 11.820899999999998C4.5211266666666665 11.907766666666667 6.212726666666666 11.999199999999998 8 11.999199999999998C9.787266666666666 11.999199999999998 11.4789 11.907733333333333 12.682199999999998 11.820899999999998C12.968233333333332 11.800199999999998 13.088033333333332 11.461 12.881266666666665 11.254233333333334L12.362066666666665 10.735033333333334C12.130233333333333 10.5032 12 10.1888 12 9.860933333333332L12 6.999199999999999C12 4.790046666666666 10.209166666666667 2.9991866666666667 8 2.9991866666666667z"
|
|
392
|
-
fill="currentColor"></path>
|
|
393
|
-
<path
|
|
394
|
-
d="M8.720066666666666 2.0260466666666668C8.720066666666666 2.42372 8.397666666666666 2.746093333333333 8 2.746093333333333C7.602333333333332 2.746093333333333 7.279933333333333 2.42372 7.279933333333333 2.0260466666666668C7.279933333333333 1.6283666666666667 7.602333333333332 1.3059866666666666 8 1.3059866666666666C8.397666666666666 1.3059866666666666 8.720066666666666 1.6283666666666667 8.720066666666666 2.0260466666666668z"
|
|
395
|
-
fill="currentColor"></path>
|
|
396
|
-
<path
|
|
397
|
-
d="M6.791266666666666 12.499199999999998C6.791266666666666 13.173966666666667 7.335266666666667 13.715866666666665 8 13.715866666666665C8.664766666666665 13.715866666666665 9.208733333333333 13.173966666666667 9.208733333333333 12.499199999999998L10.208733333333333 12.499199999999998C10.208733333333333 13.720566666666667 9.2227 14.715866666666665 8 14.715866666666665C6.777346666666666 14.715866666666665 5.791273333333333 13.720566666666667 5.791273333333333 12.499199999999998L6.791266666666666 12.499199999999998z"
|
|
398
|
-
fill="currentColor"></path>
|
|
399
|
-
</svg>
|
|
400
|
-
<span>${reserve.button.uncheck.text}</span>
|
|
401
|
-
</button>
|
|
402
|
-
`;
|
|
403
|
-
}
|
|
404
|
-
main += /* html */ `
|
|
405
|
-
<div class="card-reserve">
|
|
406
|
-
<div class="reserve-main">
|
|
407
|
-
<div class="reserve-title">
|
|
408
|
-
${reserve.title}
|
|
409
|
-
</div>
|
|
410
|
-
<div class="reserve-desc">
|
|
411
|
-
<div class="reserve-info">
|
|
412
|
-
<span class="reserve-time">${reserve.desc1.text}</span>
|
|
413
|
-
<span class="reserve-num">${reserve.desc2.text}</span>
|
|
414
|
-
</div>
|
|
415
|
-
${reserve.desc3
|
|
416
|
-
? `<div class="reserve-prize">
|
|
417
|
-
<svg class="bili-dyn-card-reserve__lottery__icon"
|
|
418
|
-
style="width: 16px; height: 16px;" xmlns="http://www.w3.org/2000/svg"
|
|
419
|
-
xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" width="16"
|
|
420
|
-
height="16">
|
|
421
|
-
<path
|
|
422
|
-
d="M2.99998 7.785666666666666C3.2761266666666664 7.785666666666666 3.49998 8.0095 3.49998 8.285666666666666L3.49998 12.285666666666666C3.49998 12.719566666666667 3.8517599999999996 13.071333333333332 4.285693333333333 13.071333333333332L11.714266666666667 13.071333333333332C12.1482 13.071333333333332 12.5 12.719566666666667 12.5 12.285666666666666L12.5 8.285666666666666C12.5 8.0095 12.723833333333333 7.785666666666666 13 7.785666666666666C13.276133333333334 7.785666666666666 13.5 8.0095 13.5 8.285666666666666L13.5 12.285666666666666C13.5 13.271866666666668 12.7005 14.071333333333332 11.714266666666667 14.071333333333332L4.285693333333333 14.071333333333332C3.2994733333333333 14.071333333333332 2.49998 13.271866666666668 2.49998 12.285666666666666L2.49998 8.285666666666666C2.49998 8.0095 2.7238399999999996 7.785666666666666 2.99998 7.785666666666666z"
|
|
423
|
-
fill="currentColor"></path>
|
|
424
|
-
<path
|
|
425
|
-
d="M1.9285533333333333 5.857139999999999C1.9285533333333333 5.107613333333333 2.5361666666666665 4.5 3.285693333333333 4.5L12.714266666666667 4.5C13.463799999999999 4.5 14.071399999999999 5.107613333333333 14.071399999999999 5.857139999999999L14.071399999999999 7.134066666666667C14.071399999999999 7.793799999999999 13.590066666666667 8.373766666666667 12.905000000000001 8.4432C12.058933333333332 8.528966666666665 10.470166666666666 8.642866666666666 8 8.642866666666666C5.529819999999999 8.642866666666666 3.9410399999999997 8.528966666666665 3.09498 8.4432C2.4099066666666666 8.373766666666667 1.9285533333333333 7.793799999999999 1.9285533333333333 7.134066666666667L1.9285533333333333 5.857139999999999zM3.285693333333333 5.5C3.088453333333333 5.5 2.9285533333333333 5.6599 2.9285533333333333 5.857139999999999L2.9285533333333333 7.134066666666667C2.9285533333333333 7.3082 3.0432666666666663 7.432833333333333 3.1958066666666665 7.4483C4.00544 7.530366666666667 5.560420000000001 7.6428666666666665 8 7.6428666666666665C10.439566666666666 7.6428666666666665 11.994533333333333 7.530366666666667 12.804133333333333 7.4483C12.9567 7.432833333333333 13.071399999999999 7.3082 13.071399999999999 7.134066666666667L13.071399999999999 5.857139999999999C13.071399999999999 5.6599 12.911499999999998 5.5 12.714266666666667 5.5L3.285693333333333 5.5z"
|
|
426
|
-
fill="currentColor"></path>
|
|
427
|
-
<path
|
|
428
|
-
d="M4.357126666666666 3.5714733333333335C4.357126666666666 2.506353333333333 5.220573333333333 1.6429066666666667 6.285693333333333 1.6429066666666667C7.350833333333332 1.6429066666666667 8.214266666666667 2.506353333333333 8.214266666666667 3.5714733333333335L8.214266666666667 5.500046666666666L6.285693333333333 5.500046666666666C5.220573333333333 5.500046666666666 4.357126666666666 4.636593333333333 4.357126666666666 3.5714733333333335zM6.285693333333333 2.6429066666666667C5.77286 2.6429066666666667 5.357126666666667 3.0586399999999996 5.357126666666667 3.5714733333333335C5.357126666666667 4.084313333333333 5.77286 4.500046666666666 6.285693333333333 4.500046666666666L7.214266666666667 4.500046666666666L7.214266666666667 3.5714733333333335C7.214266666666667 3.0586399999999996 6.798533333333333 2.6429066666666667 6.285693333333333 2.6429066666666667z"
|
|
429
|
-
fill="currentColor"></path>
|
|
430
|
-
<path
|
|
431
|
-
d="M7.785666666666666 3.5714733333333335C7.785666666666666 2.506353333333333 8.649133333333332 1.6429066666666667 9.714266666666667 1.6429066666666667C10.779399999999999 1.6429066666666667 11.642866666666666 2.506353333333333 11.642866666666666 3.5714733333333335C11.642866666666666 4.636593333333333 10.779399999999999 5.500046666666666 9.714266666666667 5.500046666666666L7.785666666666666 5.500046666666666L7.785666666666666 3.5714733333333335zM9.714266666666667 2.6429066666666667C9.201433333333332 2.6429066666666667 8.785666666666666 3.0586399999999996 8.785666666666666 3.5714733333333335L8.785666666666666 4.500046666666666L9.714266666666667 4.500046666666666C10.2271 4.500046666666666 10.642866666666666 4.084313333333333 10.642866666666666 3.5714733333333335C10.642866666666666 3.0586399999999996 10.2271 2.6429066666666667 9.714266666666667 2.6429066666666667z"
|
|
432
|
-
fill="currentColor"></path>
|
|
433
|
-
<path
|
|
434
|
-
d="M8 3.7856466666666666C8.276133333333332 3.7856466666666666 8.5 4.009499999999999 8.5 4.285646666666667L8.5 13.142800000000001C8.5 13.418933333333332 8.276133333333332 13.642800000000001 8 13.642800000000001C7.723833333333333 13.642800000000001 7.5 13.418933333333332 7.5 13.142800000000001L7.5 4.285646666666667C7.5 4.009499999999999 7.723833333333333 3.7856466666666666 8 3.7856466666666666z"
|
|
435
|
-
fill="currentColor"></path>
|
|
436
|
-
</svg>
|
|
437
|
-
<span>${reserve.desc3.text}</span>
|
|
438
|
-
<svg style="width: 12px; height: 12px;" xmlns="http://www.w3.org/2000/svg"
|
|
439
|
-
xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 12 12" width="12"
|
|
440
|
-
height="12">
|
|
441
|
-
<path
|
|
442
|
-
d="M4.359835 1.609835C4.21339 1.756285 4.21339 1.99372 4.359835 2.140165L8.0429 5.823225C8.140525 5.920875 8.140525 6.079125 8.0429 6.176775L4.359835 9.859825C4.21339 10.006275 4.21339 10.243725 4.359835 10.390175C4.506285 10.5366 4.743725 10.5366 4.89017 10.390175L8.573225 6.7071C8.96375 6.316575 8.96375 5.683425 8.573225 5.2929L4.89017 1.609835C4.743725 1.46339 4.506285 1.46339 4.359835 1.609835z"
|
|
443
|
-
fill="currentColor"></path>
|
|
444
|
-
</svg>
|
|
445
|
-
</div>`
|
|
446
|
-
: ""}
|
|
447
|
-
</div>
|
|
448
|
-
</div>
|
|
449
|
-
<div class="reserve-button">
|
|
450
|
-
${button}
|
|
451
|
-
</div>
|
|
452
|
-
</div>
|
|
453
|
-
`;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
break;
|
|
458
|
-
}
|
|
459
|
-
case DYNAMIC_TYPE_AV: {
|
|
460
|
-
// 投稿新视频
|
|
461
|
-
// 处理文字
|
|
462
|
-
basicDynamic();
|
|
463
|
-
const archive = dynamic.modules.module_dynamic.major.archive;
|
|
464
|
-
if (archive.badge.text === "投稿视频") {
|
|
465
|
-
if (forward) {
|
|
466
|
-
forwardInfo = "投稿了视频";
|
|
467
|
-
}
|
|
468
|
-
else {
|
|
469
|
-
pubTime = `${pubTime} · 投稿了视频`;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
main += /* html */ `
|
|
473
|
-
<div class="card-video">
|
|
474
|
-
<div class="video-cover">
|
|
475
|
-
<img src="${archive.cover}"
|
|
476
|
-
alt="">
|
|
477
|
-
<div class="cover-mask"></div>
|
|
478
|
-
<span>${archive.duration_text}</span>
|
|
479
|
-
</div>
|
|
480
|
-
<div class="video-info">
|
|
481
|
-
<div class="video-info-header">
|
|
482
|
-
<div class="video-title">
|
|
483
|
-
${archive.title}
|
|
484
|
-
</div>
|
|
485
|
-
<div class="video-introduction">
|
|
486
|
-
${archive.desc}
|
|
487
|
-
</div>
|
|
488
|
-
</div>
|
|
489
|
-
<div class="video-stat">
|
|
490
|
-
<div class="video-stat-item">
|
|
491
|
-
<svg style="width: 16px; height: 16px;" xmlns="http://www.w3.org/2000/svg"
|
|
492
|
-
xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" width="16"
|
|
493
|
-
height="16">
|
|
494
|
-
<path
|
|
495
|
-
d="M8 3.3320333333333334C6.321186666666667 3.3320333333333334 4.855333333333333 3.4174399999999996 3.820593333333333 3.5013466666666666C3.1014733333333333 3.5596599999999996 2.5440733333333334 4.109013333333333 2.48 4.821693333333333C2.4040466666666664 5.666533333333334 2.333333333333333 6.780666666666666 2.333333333333333 7.998666666666666C2.333333333333333 9.216733333333334 2.4040466666666664 10.330866666666665 2.48 11.175699999999999C2.5440733333333334 11.888366666666666 3.1014733333333333 12.437733333333334 3.820593333333333 12.496066666666666C4.855333333333333 12.579933333333333 6.321186666666667 12.665333333333333 8 12.665333333333333C9.678999999999998 12.665333333333333 11.144933333333334 12.579933333333333 12.179733333333333 12.496033333333333C12.898733333333332 12.4377 13.456 11.888533333333331 13.520066666666667 11.176033333333333C13.595999999999998 10.331533333333333 13.666666666666666 9.217633333333332 13.666666666666666 7.998666666666666C13.666666666666666 6.779766666666667 13.595999999999998 5.665846666666667 13.520066666666667 4.821366666666666C13.456 4.108866666666666 12.898733333333332 3.55968 12.179733333333333 3.5013666666666663C11.144933333333334 3.417453333333333 9.678999999999998 3.3320333333333334 8 3.3320333333333334zM3.7397666666666667 2.50462C4.794879999999999 2.41906 6.288386666666666 2.3320333333333334 8 2.3320333333333334C9.7118 2.3320333333333334 11.2054 2.4190733333333334 12.260533333333331 2.5046399999999998C13.458733333333331 2.6018133333333333 14.407866666666665 3.5285199999999994 14.516066666666667 4.73182C14.593933333333332 5.597933333333334 14.666666666666666 6.7427 14.666666666666666 7.998666666666666C14.666666666666666 9.2547 14.593933333333332 10.399466666666665 14.516066666666667 11.2656C14.407866666666665 12.468866666666665 13.458733333333331 13.395566666666667 12.260533333333331 13.492766666666665C11.2054 13.578333333333333 9.7118 13.665333333333333 8 13.665333333333333C6.288386666666666 13.665333333333333 4.794879999999999 13.578333333333333 3.7397666666666667 13.492799999999999C2.541373333333333 13.395599999999998 1.5922066666666668 12.468633333333333 1.4840200000000001 11.265266666666665C1.4061199999999998 10.3988 1.3333333333333333 9.253866666666667 1.3333333333333333 7.998666666666666C1.3333333333333333 6.743533333333333 1.4061199999999998 5.598579999999999 1.4840200000000001 4.732153333333333C1.5922066666666668 3.5287466666666667 2.541373333333333 2.601793333333333 3.7397666666666667 2.50462z"
|
|
496
|
-
fill="currentColor"></path>
|
|
497
|
-
<path
|
|
498
|
-
d="M9.8092 7.3125C10.338433333333333 7.618066666666666 10.338433333333333 8.382 9.809166666666666 8.687533333333333L7.690799999999999 9.910599999999999C7.161566666666666 10.216133333333332 6.5 9.8342 6.500006666666666 9.223066666666666L6.500006666666666 6.776999999999999C6.500006666666666 6.165873333333334 7.161566666666666 5.783913333333333 7.690799999999999 6.089479999999999L9.8092 7.3125z"
|
|
499
|
-
fill="currentColor"></path>
|
|
500
|
-
</svg>
|
|
501
|
-
<span>${archive.stat.play}</span>
|
|
502
|
-
</div>
|
|
503
|
-
<div class="video-stat-item">
|
|
504
|
-
<svg style="width: 16px; height: 16px;" xmlns="http://www.w3.org/2000/svg"
|
|
505
|
-
xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" width="16"
|
|
506
|
-
height="16">
|
|
507
|
-
<path
|
|
508
|
-
d="M8 3.3320333333333334C6.321186666666667 3.3320333333333334 4.855333333333333 3.4174399999999996 3.820593333333333 3.5013466666666666C3.1014733333333333 3.5596599999999996 2.5440733333333334 4.109013333333333 2.48 4.821693333333333C2.4040466666666664 5.666533333333334 2.333333333333333 6.780666666666666 2.333333333333333 7.998666666666666C2.333333333333333 9.216733333333334 2.4040466666666664 10.330866666666665 2.48 11.175699999999999C2.5440733333333334 11.888366666666666 3.1014733333333333 12.437733333333334 3.820593333333333 12.496066666666666C4.855333333333333 12.579933333333333 6.321186666666667 12.665333333333333 8 12.665333333333333C9.678999999999998 12.665333333333333 11.144933333333334 12.579933333333333 12.179733333333333 12.496033333333333C12.898733333333332 12.4377 13.456 11.888533333333331 13.520066666666667 11.176033333333333C13.595999999999998 10.331533333333333 13.666666666666666 9.217633333333332 13.666666666666666 7.998666666666666C13.666666666666666 6.779766666666667 13.595999999999998 5.665846666666667 13.520066666666667 4.821366666666666C13.456 4.108866666666666 12.898733333333332 3.55968 12.179733333333333 3.5013666666666663C11.144933333333334 3.417453333333333 9.678999999999998 3.3320333333333334 8 3.3320333333333334zM3.7397666666666667 2.50462C4.794879999999999 2.41906 6.288386666666666 2.3320333333333334 8 2.3320333333333334C9.7118 2.3320333333333334 11.2054 2.4190733333333334 12.260533333333331 2.5046399999999998C13.458733333333331 2.6018133333333333 14.407866666666665 3.5285199999999994 14.516066666666667 4.73182C14.593933333333332 5.597933333333334 14.666666666666666 6.7427 14.666666666666666 7.998666666666666C14.666666666666666 9.2547 14.593933333333332 10.399466666666665 14.516066666666667 11.2656C14.407866666666665 12.468866666666665 13.458733333333331 13.395566666666667 12.260533333333331 13.492766666666665C11.2054 13.578333333333333 9.7118 13.665333333333333 8 13.665333333333333C6.288386666666666 13.665333333333333 4.794879999999999 13.578333333333333 3.7397666666666667 13.492799999999999C2.541373333333333 13.395599999999998 1.5922066666666668 12.468633333333333 1.4840200000000001 11.265266666666665C1.4061199999999998 10.3988 1.3333333333333333 9.253866666666667 1.3333333333333333 7.998666666666666C1.3333333333333333 6.743533333333333 1.4061199999999998 5.598579999999999 1.4840200000000001 4.732153333333333C1.5922066666666668 3.5287466666666667 2.541373333333333 2.601793333333333 3.7397666666666667 2.50462z"
|
|
509
|
-
fill="currentColor"></path>
|
|
510
|
-
<path
|
|
511
|
-
d="M10.583333333333332 7.166666666666666L6.583333333333333 7.166666666666666C6.307193333333332 7.166666666666666 6.083333333333333 6.942799999999999 6.083333333333333 6.666666666666666C6.083333333333333 6.390526666666666 6.307193333333332 6.166666666666666 6.583333333333333 6.166666666666666L10.583333333333332 6.166666666666666C10.859466666666666 6.166666666666666 11.083333333333332 6.390526666666666 11.083333333333332 6.666666666666666C11.083333333333332 6.942799999999999 10.859466666666666 7.166666666666666 10.583333333333332 7.166666666666666z"
|
|
512
|
-
fill="currentColor"></path>
|
|
513
|
-
<path
|
|
514
|
-
d="M11.583333333333332 9.833333333333332L7.583333333333333 9.833333333333332C7.3072 9.833333333333332 7.083333333333333 9.609466666666666 7.083333333333333 9.333333333333332C7.083333333333333 9.0572 7.3072 8.833333333333332 7.583333333333333 8.833333333333332L11.583333333333332 8.833333333333332C11.859466666666666 8.833333333333332 12.083333333333332 9.0572 12.083333333333332 9.333333333333332C12.083333333333332 9.609466666666666 11.859466666666666 9.833333333333332 11.583333333333332 9.833333333333332z"
|
|
515
|
-
fill="currentColor"></path>
|
|
516
|
-
<path
|
|
517
|
-
d="M5.25 6.666666666666666C5.25 6.942799999999999 5.02614 7.166666666666666 4.75 7.166666666666666L4.416666666666666 7.166666666666666C4.140526666666666 7.166666666666666 3.9166666666666665 6.942799999999999 3.9166666666666665 6.666666666666666C3.9166666666666665 6.390526666666666 4.140526666666666 6.166666666666666 4.416666666666666 6.166666666666666L4.75 6.166666666666666C5.02614 6.166666666666666 5.25 6.390526666666666 5.25 6.666666666666666z"
|
|
518
|
-
fill="currentColor"></path>
|
|
519
|
-
<path
|
|
520
|
-
d="M6.25 9.333333333333332C6.25 9.609466666666666 6.02614 9.833333333333332 5.75 9.833333333333332L5.416666666666666 9.833333333333332C5.140526666666666 9.833333333333332 4.916666666666666 9.609466666666666 4.916666666666666 9.333333333333332C4.916666666666666 9.0572 5.140526666666666 8.833333333333332 5.416666666666666 8.833333333333332L5.75 8.833333333333332C6.02614 8.833333333333332 6.25 9.0572 6.25 9.333333333333332z"
|
|
521
|
-
fill="currentColor"></path>
|
|
522
|
-
</svg>
|
|
523
|
-
<span>${archive.stat.danmaku}</span>
|
|
524
|
-
</div>
|
|
525
|
-
</div>
|
|
526
|
-
</div>
|
|
527
|
-
</div>
|
|
528
|
-
`;
|
|
529
|
-
break;
|
|
530
|
-
}
|
|
531
|
-
case DYNAMIC_TYPE_LIVE:
|
|
532
|
-
return [`${upName}发起了直播预约,我暂时无法渲染,请自行查看`];
|
|
533
|
-
case DYNAMIC_TYPE_MEDIALIST:
|
|
534
|
-
return [`${upName}分享了收藏夹,我暂时无法渲染,请自行查看`];
|
|
535
|
-
case DYNAMIC_TYPE_PGC:
|
|
536
|
-
return [
|
|
537
|
-
`${upName}发布了剧集(番剧、电影、纪录片),我暂时无法渲染,请自行查看`,
|
|
538
|
-
];
|
|
539
|
-
case DYNAMIC_TYPE_ARTICLE: {
|
|
540
|
-
//转发动态屏蔽
|
|
541
|
-
if (this.giConfig.filter.enable && this.giConfig.filter.article) {
|
|
542
|
-
throw new Error("已屏蔽专栏动态");
|
|
543
|
-
}
|
|
544
|
-
return [`${upName}投稿了新专栏,我暂时无法渲染,请自行查看`];
|
|
545
|
-
}
|
|
546
|
-
case DYNAMIC_TYPE_MUSIC:
|
|
547
|
-
return [`${upName}发行了新歌,我暂时无法渲染,请自行查看`];
|
|
548
|
-
case DYNAMIC_TYPE_COMMON_SQUARE:
|
|
549
|
-
return [
|
|
550
|
-
`${upName}发布了装扮|剧集|点评|普通分享,我暂时无法渲染,请自行查看`,
|
|
551
|
-
];
|
|
552
|
-
case DYNAMIC_TYPE_COURSES_SEASON:
|
|
553
|
-
return [`${upName}发布了新课程,我暂时无法渲染,请自行查看`];
|
|
554
|
-
case DYNAMIC_TYPE_UGC_SEASON:
|
|
555
|
-
return [`${upName}更新了合集,我暂时无法渲染,请自行查看`];
|
|
556
|
-
case DYNAMIC_TYPE_NONE:
|
|
557
|
-
return [`${upName}发布了一条无效动态`];
|
|
558
|
-
// 直播开播,不做处理
|
|
559
|
-
case DYNAMIC_TYPE_LIVE_RCMD:
|
|
560
|
-
throw new Error("直播开播动态,不做处理");
|
|
561
|
-
default:
|
|
562
|
-
return [`${upName}发布了一条我无法识别的动态,请自行查看`];
|
|
563
|
-
}
|
|
564
|
-
return [main, forwardInfo];
|
|
565
|
-
};
|
|
566
|
-
// 获取动态主要内容
|
|
567
|
-
const [main] = await getDynamicMajor(data, false);
|
|
568
|
-
// 加载字体
|
|
569
|
-
const fontURL = (0, node_url_1.pathToFileURL)((0, node_path_1.resolve)(__dirname, "font/HYZhengYuan-75W.ttf"));
|
|
570
|
-
// 判断是否开启大字体模式
|
|
571
|
-
let style;
|
|
572
|
-
if (this.giConfig.enableLargeFont) {
|
|
573
|
-
style = /* css */ `
|
|
574
|
-
@font-face {
|
|
575
|
-
font-family: "Custom Font";
|
|
576
|
-
src: url(${fontURL});
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
* {
|
|
580
|
-
margin: 0;
|
|
581
|
-
padding: 0;
|
|
582
|
-
box-sizing: border-box;
|
|
583
|
-
font-family: \"${this.giConfig.font}\", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
html {
|
|
587
|
-
width: 800px;
|
|
588
|
-
height: auto;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
.background {
|
|
592
|
-
width: 100%;
|
|
593
|
-
height: auto;
|
|
594
|
-
padding: 15px;
|
|
595
|
-
background: linear-gradient(to right bottom, ${cardColorStart}, ${cardColorEnd});
|
|
596
|
-
overflow: hidden;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
.base-plate {
|
|
600
|
-
width: 100%;
|
|
601
|
-
height: auto;
|
|
602
|
-
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
|
|
603
|
-
padding: ${cardBasePlateBorder};
|
|
604
|
-
border-radius: 10px;
|
|
605
|
-
background-color: ${cardBasePlateColor};
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
.card {
|
|
609
|
-
width: 100%;
|
|
610
|
-
height: auto;
|
|
611
|
-
border-radius: 5px;
|
|
612
|
-
padding: 15px;
|
|
613
|
-
overflow: hidden;
|
|
614
|
-
background-color: #fff;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
.card-body {
|
|
618
|
-
display: flex;
|
|
619
|
-
padding: 15px;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
.card .anchor-avatar {
|
|
623
|
-
max-width: 70px;
|
|
624
|
-
/* 设置最大宽度为容器宽度的100% */
|
|
625
|
-
max-height: 70px;
|
|
626
|
-
/* 设置最大高度为容器高度的90% */
|
|
627
|
-
margin-right: 20px;
|
|
628
|
-
border-radius: 10px;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
.card .card-body .card-content {
|
|
632
|
-
width: 100%;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
.card .card-body .card-content .card-header {
|
|
636
|
-
width: 100%;
|
|
637
|
-
display: flex;
|
|
638
|
-
justify-content: space-between;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
.card .up-info {
|
|
642
|
-
display: flex;
|
|
643
|
-
flex-direction: column;
|
|
644
|
-
justify-content: space-between;
|
|
645
|
-
height: 70px;
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
.card .up-info .up-name {
|
|
649
|
-
font-size: 27px;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
.card .pub-time {
|
|
653
|
-
font-size: 20px;
|
|
654
|
-
color: grey;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
.card .card-header img {
|
|
658
|
-
height: 50px;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
.card .dress-up {
|
|
662
|
-
position: relative;
|
|
663
|
-
/* background-image: url('${dynamicCardUrl}');
|
|
664
|
-
background-size: cover; */
|
|
665
|
-
font-size: 17px;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
.card .dress-up img {
|
|
669
|
-
max-width: 100%;
|
|
670
|
-
max-height: 100%;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
.card .dress-up span {
|
|
674
|
-
position: absolute;
|
|
675
|
-
color: ${dynamicCardColor};
|
|
676
|
-
right: 67px;
|
|
677
|
-
top: 24px;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
.card .dyn-title {
|
|
681
|
-
font-size: 20px;
|
|
682
|
-
margin-bottom: 10px;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
.card .card-topic {
|
|
686
|
-
display: flex;
|
|
687
|
-
align-items: center;
|
|
688
|
-
margin-top: 10px;
|
|
689
|
-
font-size: 20px;
|
|
690
|
-
color: #008AC5;
|
|
691
|
-
gap: 3px;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
.card .card-details {
|
|
695
|
-
margin-top: 5px;
|
|
696
|
-
margin-bottom: 15px;
|
|
697
|
-
font-size: 22px;
|
|
698
|
-
width: 90%;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
.card .card-major {
|
|
702
|
-
display: flex;
|
|
703
|
-
flex-wrap: wrap;
|
|
704
|
-
gap: 5px;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
.card .card-major .photo-item {
|
|
708
|
-
border-radius: 10px;
|
|
709
|
-
overflow: hidden;
|
|
710
|
-
width: 170px;
|
|
711
|
-
height: 170px;
|
|
712
|
-
object-fit: cover;
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
.card .card-major .single-photo-mask {
|
|
716
|
-
position: absolute;
|
|
717
|
-
text-align: center;
|
|
718
|
-
width: 100%;
|
|
719
|
-
height: 100%;
|
|
720
|
-
top: 0;
|
|
721
|
-
left: 0;
|
|
722
|
-
background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 30%);
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
.card .card-major .single-photo-mask-text {
|
|
726
|
-
position: absolute;
|
|
727
|
-
color: #fff;
|
|
728
|
-
font-size: 24px;
|
|
729
|
-
right: 0;
|
|
730
|
-
bottom: 66px;
|
|
731
|
-
left: 0;
|
|
732
|
-
text-align: center;
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
.card .card-major .single-photo-mask-arrow {
|
|
736
|
-
position: absolute;
|
|
737
|
-
width: 70px;
|
|
738
|
-
height: 70px;
|
|
739
|
-
bottom: 7px;
|
|
740
|
-
left: 50%;
|
|
741
|
-
transform: translateX(-50%);
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
.card .card-major .single-photo-container {
|
|
745
|
-
position: relative;
|
|
746
|
-
max-width: 500px;
|
|
747
|
-
max-height: 1000px;
|
|
748
|
-
border-radius: 10px;
|
|
749
|
-
overflow: hidden;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
.card .card-major .single-photo-item {
|
|
753
|
-
max-width: 500px;
|
|
754
|
-
border-radius: 10px;
|
|
755
|
-
overflow: hidden;
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
.card .card-major .four-photo-item {
|
|
759
|
-
width: 170px;
|
|
760
|
-
height: 170px;
|
|
761
|
-
object-fit: cover;
|
|
762
|
-
border-radius: 10px;
|
|
763
|
-
overflow: hidden;
|
|
764
|
-
flex-basis: 20%; /* or any value less than 50% */
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
.card .card-stat {
|
|
768
|
-
display: flex;
|
|
769
|
-
justify-content: space-between;
|
|
770
|
-
width: 90%;
|
|
771
|
-
margin-top: 15px;
|
|
772
|
-
color: gray;
|
|
773
|
-
font-size: 14px;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
.card .card-stat .stat-item {
|
|
777
|
-
display: flex;
|
|
778
|
-
align-items: center;
|
|
779
|
-
gap: 3px;
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
.card .card-video {
|
|
783
|
-
display: flex;
|
|
784
|
-
overflow: hidden;
|
|
785
|
-
border-radius: 5px 0 0 5px;
|
|
786
|
-
margin-top: 10px;
|
|
787
|
-
height: 147px;
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
.card .video-cover {
|
|
791
|
-
position: relative;
|
|
792
|
-
flex: 2;
|
|
793
|
-
overflow: hidden;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
.card .video-cover img {
|
|
797
|
-
width: 236px;
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
.card .cover-mask {
|
|
801
|
-
position: absolute;
|
|
802
|
-
width: 100%;
|
|
803
|
-
height: 100%;
|
|
804
|
-
top: 0;
|
|
805
|
-
left: 0;
|
|
806
|
-
background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 30%);
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
.card .video-cover span {
|
|
810
|
-
position: absolute;
|
|
811
|
-
color: #fff;
|
|
812
|
-
font-size: 14px;
|
|
813
|
-
right: 10px;
|
|
814
|
-
bottom: 8px;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
.card .video-info {
|
|
818
|
-
display: flex;
|
|
819
|
-
justify-content: space-between;
|
|
820
|
-
flex-direction: column;
|
|
821
|
-
flex: 3;
|
|
822
|
-
border: #e5e7e9 1px solid;
|
|
823
|
-
border-left: none;
|
|
824
|
-
border-radius: 0 5px 5px 0;
|
|
825
|
-
padding: 12px 16px 10px;
|
|
826
|
-
background-color: #fff;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
.card .video-info-header .video-title {
|
|
830
|
-
font-size: 16px;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
.card .video-info-header .video-introduction {
|
|
834
|
-
margin-top: 5px;
|
|
835
|
-
font-size: 12px;
|
|
836
|
-
color: #AAA;
|
|
837
|
-
display: -webkit-box;
|
|
838
|
-
/* 必须设置为 -webkit-box 或 -webkit-inline-box */
|
|
839
|
-
-webkit-box-orient: vertical;
|
|
840
|
-
/* 必须设置为 vertical */
|
|
841
|
-
-webkit-line-clamp: 2;
|
|
842
|
-
/* 显示的文本行数 */
|
|
843
|
-
overflow: hidden;
|
|
844
|
-
/* 必须设置为 hidden */
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
.card .video-stat {
|
|
848
|
-
font-size: 12px;
|
|
849
|
-
color: #AAA;
|
|
850
|
-
display: flex;
|
|
851
|
-
gap: 35px
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
.card .video-stat .video-stat-item {
|
|
855
|
-
display: flex;
|
|
856
|
-
align-items: center;
|
|
857
|
-
gap: 3px;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
.card .card-forward {
|
|
861
|
-
border-radius: 5px;
|
|
862
|
-
padding: 12px 10px 14px 10px;
|
|
863
|
-
background-color: #F6F7F8;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
.card-forward .forward-userinfo {
|
|
867
|
-
display: flex;
|
|
868
|
-
align-items: center;
|
|
869
|
-
gap: 5px;
|
|
870
|
-
height: 35px;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
.forward-userinfo img {
|
|
874
|
-
width: 25px;
|
|
875
|
-
height: 25px;
|
|
876
|
-
border-radius: 50%;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
.forward-userinfo span {
|
|
880
|
-
color: #61666D;
|
|
881
|
-
font-size: 20px;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
.card .card-reserve {
|
|
885
|
-
display: flex;
|
|
886
|
-
justify-content: space-between;
|
|
887
|
-
align-items: center;
|
|
888
|
-
padding: 10px 20px 10px 20px;
|
|
889
|
-
margin-top: 10px;
|
|
890
|
-
border-radius: 10px;
|
|
891
|
-
background-color: #F6F7F8;
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
.card-reserve .reserve-title {
|
|
895
|
-
font-size: 14px;
|
|
896
|
-
color: #18191C;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
.card-reserve .reserve-desc {
|
|
900
|
-
margin-top: 7px;
|
|
901
|
-
font-size: 12px;
|
|
902
|
-
color: #9499A0;
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
.reserve-info .reserve-time {
|
|
906
|
-
margin-right: 7px;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
.card-reserve .reserve-prize {
|
|
910
|
-
display: flex;
|
|
911
|
-
align-items: center;
|
|
912
|
-
margin-top: 3px;
|
|
913
|
-
gap: 3px;
|
|
914
|
-
color: #00AEEC;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
.card .card-reserve .reserve-button button {
|
|
918
|
-
border: none;
|
|
919
|
-
height: 30px;
|
|
920
|
-
width: 72px;
|
|
921
|
-
font-size: 13px;
|
|
922
|
-
border-radius: 7px;
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
.card .card-reserve .reserve-button .reserve-button-end {
|
|
926
|
-
display: flex;
|
|
927
|
-
align-items: center;
|
|
928
|
-
justify-content: center;
|
|
929
|
-
color: #9499A0;
|
|
930
|
-
background-color: #E3E5E7;
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
.card .card-reserve .reserve-button .reserve-button-ing {
|
|
934
|
-
display: flex;
|
|
935
|
-
align-items: center;
|
|
936
|
-
justify-content: center;
|
|
937
|
-
color: #FFF;
|
|
938
|
-
background-color: #00A0D8;
|
|
939
|
-
}
|
|
940
|
-
`;
|
|
941
|
-
}
|
|
942
|
-
else {
|
|
943
|
-
style = /* css */ `
|
|
944
|
-
@font-face {
|
|
945
|
-
font-family: "Custom Font";
|
|
946
|
-
src: url(${fontURL});
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
* {
|
|
950
|
-
margin: 0;
|
|
951
|
-
padding: 0;
|
|
952
|
-
box-sizing: border-box;
|
|
953
|
-
font-family: \"${this.giConfig.font}\", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
html {
|
|
957
|
-
width: 800px;
|
|
958
|
-
height: auto;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
.background {
|
|
962
|
-
width: 100%;
|
|
963
|
-
height: auto;
|
|
964
|
-
padding: 15px;
|
|
965
|
-
background: linear-gradient(to right bottom, ${cardColorStart}, ${cardColorEnd});
|
|
966
|
-
overflow: hidden;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
.base-plate {
|
|
970
|
-
width: 100%;
|
|
971
|
-
height: auto;
|
|
972
|
-
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
|
|
973
|
-
padding: ${cardBasePlateBorder};
|
|
974
|
-
border-radius: 10px;
|
|
975
|
-
background-color: ${cardBasePlateColor};
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
.card {
|
|
979
|
-
width: 100%;
|
|
980
|
-
height: auto;
|
|
981
|
-
border-radius: 5px;
|
|
982
|
-
padding: 15px;
|
|
983
|
-
overflow: hidden;
|
|
984
|
-
background-color: #fff;
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
.card-body {
|
|
988
|
-
display: flex;
|
|
989
|
-
padding: 15px;
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
.card .anchor-avatar {
|
|
993
|
-
border-radius: 5px 5px 0 0;
|
|
994
|
-
max-width: 50px;
|
|
995
|
-
/* 设置最大宽度为容器宽度的100% */
|
|
996
|
-
max-height: 50px;
|
|
997
|
-
/* 设置最大高度为容器高度的90% */
|
|
998
|
-
margin-right: 20px;
|
|
999
|
-
border-radius: 10px;
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
.card .card-body .card-content {
|
|
1003
|
-
width: 100%;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
.card .card-body .card-content .card-header {
|
|
1007
|
-
width: 100%;
|
|
1008
|
-
display: flex;
|
|
1009
|
-
justify-content: space-between;
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
.card .up-info {
|
|
1013
|
-
display: flex;
|
|
1014
|
-
flex-direction: column;
|
|
1015
|
-
justify-content: space-between;
|
|
1016
|
-
height: 50px;
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
.card .up-info .up-name {
|
|
1020
|
-
font-size: 20px;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
.card .pub-time {
|
|
1024
|
-
font-size: 12px;
|
|
1025
|
-
color: grey;
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
.card .card-header img {
|
|
1029
|
-
height: 50px;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
.card .dress-up {
|
|
1033
|
-
position: relative;
|
|
1034
|
-
max-width: 110px;
|
|
1035
|
-
max-height: 34px;
|
|
1036
|
-
/* background-image: url('${dynamicCardUrl}');
|
|
1037
|
-
background-size: cover; */
|
|
1038
|
-
font-size: 12px;
|
|
1039
|
-
line-height: 33px;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
.card .dress-up img {
|
|
1043
|
-
max-width: 100%;
|
|
1044
|
-
max-height: 100%;
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
.card .dress-up span {
|
|
1048
|
-
position: absolute;
|
|
1049
|
-
color: ${dynamicCardColor};
|
|
1050
|
-
right: 37px;
|
|
1051
|
-
top: 5px;
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
.card .dyn-title {
|
|
1055
|
-
font-size: 20px;
|
|
1056
|
-
margin-bottom: 10px;
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
.card .card-topic {
|
|
1060
|
-
display: flex;
|
|
1061
|
-
align-items: center;
|
|
1062
|
-
margin-top: 10px;
|
|
1063
|
-
color: #008AC5;
|
|
1064
|
-
gap: 3px;
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
.card .card-details {
|
|
1068
|
-
margin-bottom: 15px;
|
|
1069
|
-
width: 90%;
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
.card .card-major {
|
|
1073
|
-
display: flex;
|
|
1074
|
-
flex-wrap: wrap;
|
|
1075
|
-
gap: 5px;
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
.card .card-major .photo-item {
|
|
1079
|
-
border-radius: 10px;
|
|
1080
|
-
overflow: hidden;
|
|
1081
|
-
width: 170px;
|
|
1082
|
-
height: 170px;
|
|
1083
|
-
object-fit: cover;
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
.card .card-major .single-photo-mask {
|
|
1087
|
-
position: absolute;
|
|
1088
|
-
text-align: center;
|
|
1089
|
-
width: 100%;
|
|
1090
|
-
height: 100%;
|
|
1091
|
-
top: 0;
|
|
1092
|
-
left: 0;
|
|
1093
|
-
background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 30%);
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
|
-
.card .card-major .single-photo-mask-text {
|
|
1097
|
-
position: absolute;
|
|
1098
|
-
color: #fff;
|
|
1099
|
-
font-size: 24px;
|
|
1100
|
-
right: 0;
|
|
1101
|
-
bottom: 66px;
|
|
1102
|
-
left: 0;
|
|
1103
|
-
text-align: center;
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
.card .card-major .single-photo-mask-arrow {
|
|
1107
|
-
position: absolute;
|
|
1108
|
-
width: 70px;
|
|
1109
|
-
height: 70px;
|
|
1110
|
-
bottom: 7px;
|
|
1111
|
-
left: 50%;
|
|
1112
|
-
transform: translateX(-50%);
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
|
-
.card .card-major .single-photo-container {
|
|
1116
|
-
position: relative;
|
|
1117
|
-
max-width: 500px;
|
|
1118
|
-
max-height: 1000px;
|
|
1119
|
-
border-radius: 10px;
|
|
1120
|
-
overflow: hidden;
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
.card .card-major .single-photo-item {
|
|
1124
|
-
max-width: 500px;
|
|
1125
|
-
border-radius: 10px;
|
|
1126
|
-
overflow: hidden;
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
.card .card-major .four-photo-item {
|
|
1130
|
-
width: 170px;
|
|
1131
|
-
height: 170px;
|
|
1132
|
-
object-fit: cover;
|
|
1133
|
-
border-radius: 10px;
|
|
1134
|
-
overflow: hidden;
|
|
1135
|
-
flex-basis: 20%; /* or any value less than 50% */
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
.card .card-stat {
|
|
1139
|
-
display: flex;
|
|
1140
|
-
justify-content: space-between;
|
|
1141
|
-
width: 90%;
|
|
1142
|
-
margin-top: 15px;
|
|
1143
|
-
color: gray;
|
|
1144
|
-
font-size: 14px;
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
.card .card-stat .stat-item {
|
|
1148
|
-
display: flex;
|
|
1149
|
-
align-items: center;
|
|
1150
|
-
gap: 3px;
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
.card .card-video {
|
|
1154
|
-
display: flex;
|
|
1155
|
-
overflow: hidden;
|
|
1156
|
-
border-radius: 5px 0 0 5px;
|
|
1157
|
-
margin-top: 10px;
|
|
1158
|
-
height: 132px;
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
.card .video-cover {
|
|
1162
|
-
position: relative;
|
|
1163
|
-
flex: 2;
|
|
1164
|
-
overflow: hidden;
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
.card .video-cover img {
|
|
1168
|
-
width: 236px;
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
.card .cover-mask {
|
|
1172
|
-
position: absolute;
|
|
1173
|
-
width: 100%;
|
|
1174
|
-
height: 100%;
|
|
1175
|
-
top: 0;
|
|
1176
|
-
left: 0;
|
|
1177
|
-
background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 30%);
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
.card .video-cover span {
|
|
1181
|
-
position: absolute;
|
|
1182
|
-
color: #fff;
|
|
1183
|
-
font-size: 14px;
|
|
1184
|
-
right: 10px;
|
|
1185
|
-
bottom: 8px;
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
.card .video-info {
|
|
1189
|
-
display: flex;
|
|
1190
|
-
justify-content: space-between;
|
|
1191
|
-
flex-direction: column;
|
|
1192
|
-
flex: 3;
|
|
1193
|
-
border: #e5e7e9 1px solid;
|
|
1194
|
-
border-left: none;
|
|
1195
|
-
border-radius: 0 5px 5px 0;
|
|
1196
|
-
padding: 12px 16px 10px;
|
|
1197
|
-
background-color: #fff;
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
.card .video-info-header .video-title {
|
|
1201
|
-
font-size: 16px;
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
.card .video-info-header .video-introduction {
|
|
1205
|
-
margin-top: 5px;
|
|
1206
|
-
font-size: 12px;
|
|
1207
|
-
color: #AAA;
|
|
1208
|
-
display: -webkit-box;
|
|
1209
|
-
/* 必须设置为 -webkit-box 或 -webkit-inline-box */
|
|
1210
|
-
-webkit-box-orient: vertical;
|
|
1211
|
-
/* 必须设置为 vertical */
|
|
1212
|
-
-webkit-line-clamp: 2;
|
|
1213
|
-
/* 显示的文本行数 */
|
|
1214
|
-
overflow: hidden;
|
|
1215
|
-
/* 必须设置为 hidden */
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
.card .video-stat {
|
|
1219
|
-
font-size: 12px;
|
|
1220
|
-
color: #AAA;
|
|
1221
|
-
display: flex;
|
|
1222
|
-
gap: 35px
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
.card .video-stat .video-stat-item {
|
|
1226
|
-
display: flex;
|
|
1227
|
-
align-items: center;
|
|
1228
|
-
gap: 3px;
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
.card .card-forward {
|
|
1232
|
-
border-radius: 5px;
|
|
1233
|
-
padding: 12px 10px 14px 10px;
|
|
1234
|
-
background-color: #F6F7F8;
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
.card-forward .forward-userinfo {
|
|
1238
|
-
display: flex;
|
|
1239
|
-
align-items: center;
|
|
1240
|
-
gap: 5px;
|
|
1241
|
-
height: 30px;
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
.forward-userinfo img {
|
|
1245
|
-
width: 20px;
|
|
1246
|
-
height: 20px;
|
|
1247
|
-
border-radius: 50%;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
.forward-userinfo span {
|
|
1251
|
-
color: #61666D;
|
|
1252
|
-
font-size: 15px;
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
.card .card-reserve {
|
|
1256
|
-
display: flex;
|
|
1257
|
-
justify-content: space-between;
|
|
1258
|
-
align-items: center;
|
|
1259
|
-
padding: 10px 20px 10px 20px;
|
|
1260
|
-
margin-top: 10px;
|
|
1261
|
-
border-radius: 10px;
|
|
1262
|
-
background-color: #F6F7F8;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
.card-reserve .reserve-title {
|
|
1266
|
-
font-size: 14px;
|
|
1267
|
-
color: #18191C;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
.card-reserve .reserve-desc {
|
|
1271
|
-
margin-top: 7px;
|
|
1272
|
-
font-size: 12px;
|
|
1273
|
-
color: #9499A0;
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
.reserve-info .reserve-time {
|
|
1277
|
-
margin-right: 7px;
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
.card-reserve .reserve-prize {
|
|
1281
|
-
display: flex;
|
|
1282
|
-
align-items: center;
|
|
1283
|
-
margin-top: 3px;
|
|
1284
|
-
gap: 3px;
|
|
1285
|
-
color: #00AEEC;
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
|
-
.card .card-reserve .reserve-button button {
|
|
1289
|
-
border: none;
|
|
1290
|
-
height: 30px;
|
|
1291
|
-
width: 72px;
|
|
1292
|
-
font-size: 13px;
|
|
1293
|
-
border-radius: 7px;
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
.card .card-reserve .reserve-button .reserve-button-end {
|
|
1297
|
-
display: flex;
|
|
1298
|
-
align-items: center;
|
|
1299
|
-
justify-content: center;
|
|
1300
|
-
color: #9499A0;
|
|
1301
|
-
background-color: #E3E5E7;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
.card .card-reserve .reserve-button .reserve-button-ing {
|
|
1305
|
-
display: flex;
|
|
1306
|
-
align-items: center;
|
|
1307
|
-
justify-content: center;
|
|
1308
|
-
color: #FFF;
|
|
1309
|
-
background-color: #00A0D8;
|
|
1310
|
-
}
|
|
1311
|
-
`;
|
|
1312
|
-
}
|
|
1313
|
-
// 定义卡片内容
|
|
1314
|
-
const html = /* html */ `
|
|
1315
|
-
<!DOCTYPE html>
|
|
1316
|
-
<html>
|
|
1317
|
-
<head>
|
|
1318
|
-
<title>动态通知</title>
|
|
1319
|
-
<style>
|
|
1320
|
-
${style}
|
|
1321
|
-
</style>
|
|
1322
|
-
</head>
|
|
1323
|
-
<body>
|
|
1324
|
-
<div class="background">
|
|
1325
|
-
<div ${this.giConfig.removeBorder ? "" : 'class="base-plate"'}>
|
|
1326
|
-
<div class="card">
|
|
1327
|
-
<div class="card-body">
|
|
1328
|
-
<!-- 主播头像 -->
|
|
1329
|
-
<img class="anchor-avatar"
|
|
1330
|
-
src="${avatarUrl}"
|
|
1331
|
-
alt="主播头像">
|
|
1332
|
-
<div class="card-content">
|
|
1333
|
-
<div class="card-header">
|
|
1334
|
-
<div class="up-info">
|
|
1335
|
-
<div class="up-name" style="${module_author.vip.type !== 0 ? "color: #FB7299" : ""}">${upName}</div>
|
|
1336
|
-
<div class="pub-time">${pubTime}</div>
|
|
1337
|
-
</div>
|
|
1338
|
-
${module_author.decorate
|
|
1339
|
-
? `
|
|
1340
|
-
<div class="dress-up">
|
|
1341
|
-
<img src="${dynamicCardUrl}" />
|
|
1342
|
-
<span>${dynamicCardId}</span>
|
|
1343
|
-
</div>
|
|
1344
|
-
`
|
|
1345
|
-
: ""}
|
|
1346
|
-
</div>
|
|
1347
|
-
<div class="card-topic">
|
|
1348
|
-
${topic
|
|
1349
|
-
? `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"
|
|
1350
|
-
class="bili-dyn-topic__icon">
|
|
1351
|
-
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
1352
|
-
d="M11.4302 2.57458C11.4416 2.51023 11.4439 2.43974 11.4218 2.3528C11.3281 1.98196 10.9517 1.72037 10.5284 1.7527C10.432 1.76018 10.3599 1.78383 10.297 1.81376C10.2347 1.84398 10.1832 1.88155 10.1401 1.92465C10.1195 1.94485 10.1017 1.96692 10.0839 1.98897L10.0808 1.99289L10.0237 2.06277L9.91103 2.2033C9.76177 2.39141 9.61593 2.58191 9.47513 2.77556C9.33433 2.96936 9.19744 3.16585 9.06672 3.36638C9.00275 3.46491 8.93968 3.56401 8.87883 3.66461L8.56966 3.6613C8.00282 3.6574 7.43605 3.65952 6.86935 3.67034C6.80747 3.56778 6.74325 3.46677 6.67818 3.3664C6.54732 3.16585 6.41045 2.96934 6.26968 2.77568C6.12891 2.58186 5.98309 2.39134 5.83387 2.20322L5.72122 2.06268L5.66416 1.99279L5.6622 1.99036C5.64401 1.96783 5.62586 1.94535 5.60483 1.92454C5.56192 1.88144 5.51022 1.84388 5.44797 1.81364C5.38522 1.78386 5.31305 1.76006 5.21665 1.75273C4.80555 1.72085 4.4203 1.97094 4.32341 2.35273C4.30147 2.43968 4.30358 2.51018 4.31512 2.57453C4.32715 2.63859 4.34975 2.69546 4.38112 2.74649C4.39567 2.77075 4.41283 2.79315 4.42999 2.81557C4.43104 2.81694 4.43209 2.81831 4.43314 2.81968L4.48759 2.89122L4.59781 3.03355C4.74589 3.22242 4.89739 3.40905 5.05377 3.59254C5.09243 3.63788 5.13136 3.68306 5.17057 3.72785C4.99083 3.73681 4.81112 3.7467 4.63143 3.75756C4.41278 3.771 4.19397 3.78537 3.97547 3.80206L3.64757 3.82786L3.48362 3.84177L3.39157 3.85181C3.36984 3.8543 3.34834 3.8577 3.32679 3.86111C3.31761 3.86257 3.30843 3.86402 3.29921 3.86541C3.05406 3.90681 2.81526 3.98901 2.59645 4.10752C2.37765 4.22603 2.17867 4.38039 2.00992 4.56302C1.84117 4.74565 1.70247 4.95593 1.60144 5.18337C1.50025 5.4105 1.43687 5.65447 1.41362 5.90153C1.33103 6.77513 1.27663 7.6515 1.25742 8.5302C1.23758 9.40951 1.25835 10.2891 1.3098 11.1655C1.32266 11.3846 1.33738 11.6035 1.35396 11.8223L1.38046 12.1505L1.39472 12.3144L1.39658 12.335L1.39906 12.3583L1.40417 12.4048C1.40671 12.4305 1.41072 12.4558 1.41473 12.4811C1.41561 12.4866 1.41648 12.4922 1.41734 12.4977C1.45717 12.7449 1.53806 12.9859 1.65567 13.2074C1.77314 13.4289 1.92779 13.6304 2.11049 13.8022C2.29319 13.974 2.50441 14.1159 2.73329 14.2197C2.96201 14.3235 3.2084 14.3901 3.45836 14.4135C3.47066 14.415 3.48114 14.4159 3.49135 14.4167C3.49477 14.417 3.49817 14.4173 3.50159 14.4176L3.5425 14.4212L3.62448 14.4283L3.78843 14.4417L4.11633 14.4674C4.33514 14.4831 4.55379 14.4983 4.7726 14.5111C6.52291 14.6145 8.27492 14.6346 10.0263 14.5706C10.4642 14.5547 10.9019 14.5332 11.3396 14.5062C11.5584 14.4923 11.7772 14.4776 11.9959 14.4604L12.3239 14.434L12.4881 14.4196L12.5813 14.4093C12.6035 14.4065 12.6255 14.403 12.6474 14.3995C12.6565 14.3981 12.6655 14.3966 12.6746 14.3952C12.9226 14.3527 13.1635 14.2691 13.3844 14.1486C13.6052 14.0284 13.8059 13.8716 13.9759 13.6868C14.1463 13.5022 14.2861 13.2892 14.3874 13.0593C14.4381 12.9444 14.4793 12.8253 14.5108 12.7037C14.519 12.6734 14.5257 12.6428 14.5322 12.612L14.5421 12.566L14.55 12.5196C14.5556 12.4887 14.5607 12.4578 14.5641 12.4266C14.5681 12.3959 14.5723 12.363 14.5746 12.3373C14.6642 11.4637 14.7237 10.5864 14.7435 9.70617C14.764 8.825 14.7347 7.94337 14.6719 7.06715C14.6561 6.8479 14.6385 6.62896 14.6183 6.41033L14.5867 6.08246L14.5697 5.91853L14.5655 5.87758C14.5641 5.86445 14.5618 5.8473 14.5599 5.83231C14.5588 5.8242 14.5578 5.81609 14.5567 5.80797C14.5538 5.78514 14.5509 5.76229 14.5466 5.7396C14.5064 5.49301 14.4252 5.25275 14.3067 5.03242C14.1886 4.81208 14.0343 4.61153 13.8519 4.44095C13.6695 4.27038 13.4589 4.12993 13.2311 4.02733C13.0033 3.92458 12.7583 3.85907 12.5099 3.83636C12.4974 3.83492 12.4865 3.83394 12.4759 3.833C12.4729 3.83273 12.4698 3.83246 12.4668 3.83219L12.4258 3.82879L12.3438 3.82199L12.1798 3.80886L11.8516 3.78413C11.633 3.76915 11.4143 3.75478 11.1955 3.74288C10.993 3.73147 10.7904 3.72134 10.5878 3.71243L10.6914 3.59236C10.8479 3.40903 10.9992 3.22242 11.1473 3.03341L11.2576 2.89124L11.312 2.81971C11.3136 2.81773 11.3151 2.81575 11.3166 2.81377C11.3333 2.79197 11.3501 2.77013 11.3641 2.74653C11.3954 2.6955 11.418 2.63863 11.4302 2.57458ZM9.33039 5.49268C9.38381 5.16945 9.67705 4.95281 9.98536 5.00882L9.98871 5.00944C10.2991 5.06783 10.5063 5.37802 10.4524 5.70377L10.2398 6.99039L11.3846 6.9904C11.7245 6.9904 12 7.27925 12 7.63557C12 7.99188 11.7245 8.28073 11.3846 8.28073L10.0266 8.28059L9.7707 9.82911L11.0154 9.82913C11.3553 9.82913 11.6308 10.118 11.6308 10.4743C11.6308 10.8306 11.3553 11.1195 11.0154 11.1195L9.55737 11.1195L9.32807 12.5073C9.27465 12.8306 8.98141 13.0472 8.6731 12.9912L8.66975 12.9906C8.35937 12.9322 8.1522 12.622 8.20604 12.2962L8.40041 11.1195H6.89891L6.66961 12.5073C6.61619 12.8306 6.32295 13.0472 6.01464 12.9912L6.01129 12.9906C5.7009 12.9322 5.49374 12.622 5.54758 12.2962L5.74196 11.1195L4.61538 11.1195C4.27552 11.1195 4 10.8306 4 10.4743C4 10.118 4.27552 9.82913 4.61538 9.82913L5.95514 9.82911L6.21103 8.28059L4.98462 8.28073C4.64475 8.28073 4.36923 7.99188 4.36923 7.63557C4.36923 7.27925 4.64475 6.9904 4.98462 6.9904L6.42421 6.99039L6.67193 5.49268C6.72535 5.16945 7.01859 4.95281 7.3269 5.00882L7.33025 5.00944C7.64063 5.06783 7.8478 5.37802 7.79396 5.70377L7.58132 6.99039H9.08281L9.33039 5.49268ZM8.61374 9.82911L8.86963 8.28059H7.36813L7.11225 9.82911H8.61374Z"
|
|
1353
|
-
fill="currentColor"></path>
|
|
1354
|
-
</svg>
|
|
1355
|
-
${topic}`
|
|
1356
|
-
: ""}
|
|
1357
|
-
</div>
|
|
1358
|
-
${main}
|
|
1359
|
-
<div class="card-stat">
|
|
1360
|
-
<div class="stat-item">
|
|
1361
|
-
<svg style="width: 18px; height: 18px;" xmlns="http://www.w3.org/2000/svg"
|
|
1362
|
-
xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 18 18" width="18"
|
|
1363
|
-
height="18">
|
|
1364
|
-
<path
|
|
1365
|
-
d="M9.789075 2.2956175C8.97235 1.6308450000000003 7.74999 2.212005 7.74999 3.26506L7.74999 5.3915500000000005C6.642015000000001 5.5780325 5.3073725 6.040405 4.141735000000001 7.11143C2.809155 8.335825 1.751515 10.3041 1.45716 13.404099999999998C1.409905 13.9018 1.7595399999999999 14.22505 2.105415 14.317499999999999C2.442215 14.40755 2.8807175 14.314625 3.127745 13.92915C3.9664525 12.620249999999999 4.89282 11.894575 5.765827499999999 11.50585C6.4628049999999995 11.19545 7.14528 11.093125 7.74999 11.0959L7.74999 13.235025C7.74999 14.2881 8.97235 14.869250000000001 9.789075 14.2045L15.556199999999999 9.510425000000001C16.355075 8.860149999999999 16.355075 7.640124999999999 15.556199999999999 6.989840000000001L9.789075 2.2956175zM9.165099999999999 3.0768275000000003L14.895025 7.739050000000001C15.227975 7.980475 15.235775 8.468875 14.943874999999998 8.7142L9.17615 13.416800000000002C8.979474999999999 13.562024999999998 8.75 13.4269 8.75 13.227375000000002L8.75 10.638175C8.75 10.326975000000001 8.542125 10.134725 8.2544 10.1118C7.186765 10.02955 6.1563175 10.2037 5.150895 10.69295C4.14982 11.186925 3.2102250000000003 12.096525 2.573625 13.00995C2.54981 13.046975 2.52013 13.046025 2.5211725 12.986C2.8971525 10.0573 3.9373475 8.652125 4.807025 7.85305C5.87747 6.8694775 7.213197500000001 6.444867500000001 8.2272 6.33056C8.606525 6.287802500000001 8.74805 6.0849325 8.74805 5.7032275L8.74805 3.2615475C8.74805 3.0764875000000007 8.993175 2.9321925 9.165099999999999 3.0768275000000003z"
|
|
1366
|
-
fill="currentColor"></path>
|
|
1367
|
-
</svg>
|
|
1368
|
-
<span>${forward}</span>
|
|
1369
|
-
</div>
|
|
1370
|
-
<div class="stat-item">
|
|
1371
|
-
<svg style="width: 18px; height: 18px;" xmlns="http://www.w3.org/2000/svg"
|
|
1372
|
-
xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 18 18" width="18"
|
|
1373
|
-
height="18">
|
|
1374
|
-
<path
|
|
1375
|
-
d="M1.5625 7.875C1.5625 4.595807499999999 4.220807499999999 1.9375 7.5 1.9375L10.5 1.9375C13.779175 1.9375 16.4375 4.595807499999999 16.4375 7.875C16.4375 11.0504 13.944675 13.6435 10.809275 13.80405C10.097025 14.722974999999998 8.920875 15.880675 7.267095 16.331325C6.9735075 16.4113 6.704762499999999 16.286224999999998 6.55411 16.092325C6.40789 15.904149999999998 6.3561 15.634350000000001 6.4652449999999995 15.383025C6.72879 14.776249999999997 6.776465 14.221025000000001 6.7340175 13.761800000000001C3.8167675 13.387125 1.5625 10.894475 1.5625 7.875zM7.5 2.9375C4.773095 2.9375 2.5625 5.148095 2.5625 7.875C2.5625 10.502575 4.61524 12.651075000000002 7.2041924999999996 12.8038C7.4305875 12.817174999999999 7.619625000000001 12.981200000000001 7.664724999999999 13.203475C7.772575 13.734575000000001 7.8012 14.405425000000001 7.5884275 15.148399999999999C8.748325 14.6682 9.606 13.759825 10.151275 13.016475C10.24445 12.889475 10.392050000000001 12.8138 10.54955 12.812275C13.253575 12.785725 15.4375 10.58535 15.4375 7.875C15.4375 5.148095 13.226899999999999 2.9375 10.5 2.9375L7.5 2.9375z"
|
|
1376
|
-
fill="currentColor"></path>
|
|
1377
|
-
</svg>
|
|
1378
|
-
<span>${comment}</span>
|
|
1379
|
-
</div>
|
|
1380
|
-
<div class="stat-item">
|
|
1381
|
-
<svg style="width: 18px; height: 18px;" xmlns="http://www.w3.org/2000/svg"
|
|
1382
|
-
xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 18 18" width="18"
|
|
1383
|
-
height="18">
|
|
1384
|
-
<path
|
|
1385
|
-
d="M10.4511 2.2220125C10.218425 2.194885 10.002175 2.2953725 9.884175 2.433395C9.4264 2.9688525 9.321875 3.7501399999999996 8.978575 4.3581725C8.533574999999999 5.146395 8.1198 5.6213375 7.609775000000001 6.068507499999999C7.1751375 6.449565 6.738407499999999 6.697442499999999 6.3125 6.8050575L6.3125 14.854575C6.9198900000000005 14.868174999999999 7.572900000000001 14.876875 8.25 14.876875C9.936425 14.876875 11.367025 14.823325 12.33115 14.773699999999998C13.03235 14.737575 13.646025000000002 14.390075 13.966750000000001 13.81945C14.401900000000001 13.04535 14.9387 11.909650000000001 15.264174999999998 10.571200000000001C15.56665 9.327275 15.704699999999999 8.304325 15.766675 7.582224999999999C15.7988 7.208262500000001 15.50165 6.875019999999999 15.059999999999999 6.875019999999999L11.323274999999999 6.875019999999999C11.156575 6.875019999999999 11.000800000000002 6.791952499999999 10.907975 6.653499999999999C10.783725 6.468192500000001 10.82855 6.2670175 10.9037 6.07485C11.059 5.675084999999999 11.29355 4.9974475 11.382425000000001 4.4018275C11.470875000000001 3.80917 11.450999999999999 3.32219 11.212050000000001 2.86913C10.9571 2.3857825 10.66065 2.2464475 10.4511 2.2220125zM12.034300000000002 5.87502L15.059999999999999 5.87502C16.02035 5.87502 16.850875 6.64489 16.763 7.667825C16.697100000000002 8.435525 16.55155 9.5092 16.235825000000002 10.807500000000001C15.882625 12.259950000000002 15.3035 13.482225 14.838450000000002 14.309474999999999C14.32695 15.2194 13.377475 15.721150000000002 12.38255 15.772375C11.405125 15.822725 9.956949999999999 15.876875000000002 8.25 15.876875000000002C6.5961925 15.876875000000002 5.0846825 15.826025000000001 4.0136674999999995 15.77715C2.8370825 15.723474999999999 1.8519999999999999 14.850000000000001 1.725645 13.654824999999999C1.6404649999999998 12.849274999999999 1.5625 11.80725 1.5625 10.689375C1.5625 9.665175000000001 1.6279400000000002 8.736175 1.7045524999999997 7.998975C1.8351224999999998 6.7427075 2.9137075 5.87502 4.130655 5.87502L5.8125 5.87502C6.072015 5.87502 6.457235 5.7490675 6.9505175 5.316582499999999C7.377705000000001 4.942045 7.7193000000000005 4.5546075 8.107775 3.8665374999999997C8.492075 3.18585 8.605825 2.389785 9.124075 1.783595C9.452975 1.3988800000000001 9.99475 1.162025 10.5669 1.228745C11.16225 1.29816 11.717425 1.683875 12.09655 2.4025825000000003C12.478275 3.1262375000000002 12.474075 3.8618225 12.371500000000001 4.54938C12.302149999999997 5.0139949999999995 12.155425000000001 5.510059999999999 12.034300000000002 5.87502zM5.3125 14.82705L5.3125 6.875019999999999L4.130655 6.875019999999999C3.3792199999999997 6.875019999999999 2.77211 7.400795 2.6991975000000004 8.10235C2.6253525 8.812875 2.5625 9.70665 2.5625 10.689375C2.5625 11.762875 2.6374975 12.768475 2.7200975 13.549700000000001C2.7919925 14.229675 3.3521950000000005 14.74595 4.05924 14.778224999999999C4.4278775 14.795 4.849985 14.812050000000001 5.3125 14.82705z"
|
|
1386
|
-
fill="currentColor"></path>
|
|
1387
|
-
</svg>
|
|
1388
|
-
<span>${like}</span>
|
|
1389
|
-
</div>
|
|
1390
|
-
</div>
|
|
1391
|
-
</div>
|
|
1392
|
-
</div>
|
|
1393
|
-
</div>
|
|
1394
|
-
</div>
|
|
1395
|
-
</div>
|
|
1396
|
-
</body>
|
|
1397
|
-
</html>
|
|
1398
|
-
`;
|
|
1399
|
-
// 多次尝试生成图片
|
|
1400
|
-
return await (0, utils_1.withRetry)(() => this.imgHandler(html)).catch((e) => {
|
|
1401
|
-
// 已尝试三次
|
|
1402
|
-
throw new Error(`生成图片失败!错误: ${e.toString()}`);
|
|
1403
|
-
});
|
|
1404
|
-
}
|
|
1405
|
-
async getLiveStatus(time, liveStatus) {
|
|
1406
|
-
let titleStatus;
|
|
1407
|
-
let liveTime;
|
|
1408
|
-
let cover;
|
|
1409
|
-
switch (liveStatus) {
|
|
1410
|
-
case 0: {
|
|
1411
|
-
titleStatus = "未直播";
|
|
1412
|
-
liveTime = "未开播";
|
|
1413
|
-
cover = true;
|
|
1414
|
-
break;
|
|
1415
|
-
}
|
|
1416
|
-
case 1: {
|
|
1417
|
-
titleStatus = "开播啦";
|
|
1418
|
-
liveTime = `开播时间:${time}`;
|
|
1419
|
-
cover = true;
|
|
1420
|
-
break;
|
|
1421
|
-
}
|
|
1422
|
-
case 2: {
|
|
1423
|
-
titleStatus = "正在直播";
|
|
1424
|
-
liveTime = `直播时长:${await this.getTimeDifference(time)}`;
|
|
1425
|
-
cover = false;
|
|
1426
|
-
break;
|
|
1427
|
-
}
|
|
1428
|
-
case 3: {
|
|
1429
|
-
titleStatus = "下播啦";
|
|
1430
|
-
liveTime = `开播时间:${time}`;
|
|
1431
|
-
cover = true;
|
|
1432
|
-
break;
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
return [titleStatus, liveTime, cover];
|
|
1436
|
-
}
|
|
1437
|
-
async getTimeDifference(dateString) {
|
|
1438
|
-
// 将日期字符串转换为Date对象
|
|
1439
|
-
const apiDateTime = luxon_1.DateTime.fromFormat(dateString, "yyyy-MM-dd HH:mm:ss", {
|
|
1440
|
-
zone: "UTC+8",
|
|
1441
|
-
});
|
|
1442
|
-
// 获取当前时间
|
|
1443
|
-
const currentDateTime = luxon_1.DateTime.now();
|
|
1444
|
-
// 计算时间差
|
|
1445
|
-
const diff = currentDateTime.diff(apiDateTime, [
|
|
1446
|
-
"years",
|
|
1447
|
-
"months",
|
|
1448
|
-
"days",
|
|
1449
|
-
"hours",
|
|
1450
|
-
"minutes",
|
|
1451
|
-
"seconds",
|
|
1452
|
-
]);
|
|
1453
|
-
const { years, months, days, hours, minutes, seconds } = diff.toObject();
|
|
1454
|
-
// 按单位生成可读字符串(过滤零值)
|
|
1455
|
-
const parts = [];
|
|
1456
|
-
if (years !== 0)
|
|
1457
|
-
parts.push(`${Math.abs(years)}年`);
|
|
1458
|
-
if (months !== 0)
|
|
1459
|
-
parts.push(`${Math.abs(months)}个月`);
|
|
1460
|
-
if (days !== 0)
|
|
1461
|
-
parts.push(`${Math.abs(days)}天`);
|
|
1462
|
-
if (hours !== 0)
|
|
1463
|
-
parts.push(`${Math.abs(hours)}小时`);
|
|
1464
|
-
if (minutes !== 0)
|
|
1465
|
-
parts.push(`${Math.abs(minutes)}分`);
|
|
1466
|
-
if (seconds !== 0)
|
|
1467
|
-
parts.push(`${Math.round(Math.abs(seconds))}秒`);
|
|
1468
|
-
// 处理负值
|
|
1469
|
-
const sign = diff.as("seconds") < 0 ? "-" : "";
|
|
1470
|
-
// 组合结果(如果无差值返回"0秒")
|
|
1471
|
-
return parts.length > 0 ? `${sign}${parts.join("")}` : "0秒";
|
|
1472
|
-
}
|
|
1473
|
-
unixTimestampToString(timestamp) {
|
|
1474
|
-
const date = new Date(timestamp * 1000);
|
|
1475
|
-
const year = date.getFullYear();
|
|
1476
|
-
const month = `0${date.getMonth() + 1}`.slice(-2);
|
|
1477
|
-
const day = `0${date.getDate()}`.slice(-2);
|
|
1478
|
-
const hours = `0${date.getHours()}`.slice(-2);
|
|
1479
|
-
const minutes = `0${date.getMinutes()}`.slice(-2);
|
|
1480
|
-
const seconds = `0${date.getSeconds()}`.slice(-2);
|
|
1481
|
-
return `${year}年${month}月${day}日 ${hours}:${minutes}:${seconds}`;
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
(function (GenerateImg) {
|
|
1485
|
-
GenerateImg.Config = koishi_1.Schema.object({
|
|
1486
|
-
filter: koishi_1.Schema.object({
|
|
1487
|
-
enable: koishi_1.Schema.boolean(),
|
|
1488
|
-
notify: koishi_1.Schema.boolean(),
|
|
1489
|
-
regex: koishi_1.Schema.string(),
|
|
1490
|
-
keywords: koishi_1.Schema.array(String),
|
|
1491
|
-
forward: koishi_1.Schema.boolean(),
|
|
1492
|
-
article: koishi_1.Schema.boolean(),
|
|
1493
|
-
}),
|
|
1494
|
-
removeBorder: koishi_1.Schema.boolean(),
|
|
1495
|
-
cardColorStart: koishi_1.Schema.string(),
|
|
1496
|
-
cardColorEnd: koishi_1.Schema.string(),
|
|
1497
|
-
cardBasePlateColor: koishi_1.Schema.string(),
|
|
1498
|
-
cardBasePlateBorder: koishi_1.Schema.string(),
|
|
1499
|
-
enableLargeFont: koishi_1.Schema.boolean(),
|
|
1500
|
-
font: koishi_1.Schema.string(),
|
|
1501
|
-
hideDesc: koishi_1.Schema.boolean(),
|
|
1502
|
-
followerDisplay: koishi_1.Schema.boolean(),
|
|
1503
|
-
});
|
|
1504
|
-
})(GenerateImg || (GenerateImg = {}));
|
|
1505
|
-
exports.default = GenerateImg;
|