koishi-plugin-bilibili-notify 1.0.11 → 1.0.13
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/HYZhengYuan-55W.ttf +0 -0
- package/lib/comRegister.d.ts +1 -0
- package/lib/comRegister.js +29 -39
- package/lib/generateImg.d.ts +1 -0
- package/lib/generateImg.js +662 -327
- package/lib/index.d.ts +1 -0
- package/lib/index.js +20 -3
- package/package.json +1 -1
- package/readme.md +2 -0
package/lib/HYZhengYuan-55W.ttf
CHANGED
|
Binary file
|
package/lib/comRegister.d.ts
CHANGED
package/lib/comRegister.js
CHANGED
|
@@ -17,6 +17,7 @@ class ComRegister {
|
|
|
17
17
|
static inject = ['biliAPI', 'gimg', 'wbi', 'database'];
|
|
18
18
|
logger;
|
|
19
19
|
config;
|
|
20
|
+
loginTimer;
|
|
20
21
|
num = 0;
|
|
21
22
|
subNotifier;
|
|
22
23
|
subManager = [];
|
|
@@ -136,7 +137,7 @@ class ComRegister {
|
|
|
136
137
|
}
|
|
137
138
|
// 判断是否出问题
|
|
138
139
|
if (content.code !== 0)
|
|
139
|
-
return await session.send('
|
|
140
|
+
return await session.send('出问题咯,请联系管理员解决');
|
|
140
141
|
// 生成二维码
|
|
141
142
|
qrcode_1.default.toBuffer(content.data.url, {
|
|
142
143
|
errorCorrectionLevel: 'H', // 错误更正水平
|
|
@@ -148,13 +149,13 @@ class ComRegister {
|
|
|
148
149
|
}
|
|
149
150
|
}, async (err, buffer) => {
|
|
150
151
|
if (err)
|
|
151
|
-
return await session.send('
|
|
152
|
+
return await session.send('二维码生成出错,请重新尝试');
|
|
152
153
|
await session.send(koishi_1.h.image(buffer, 'image/png'));
|
|
153
154
|
});
|
|
154
|
-
//
|
|
155
|
-
|
|
155
|
+
// 检查之前是否存在登录定时器
|
|
156
|
+
this.loginTimer && this.loginTimer();
|
|
156
157
|
// 发起登录请求检查登录状态
|
|
157
|
-
|
|
158
|
+
this.loginTimer = ctx.setInterval(async () => {
|
|
158
159
|
let loginContent;
|
|
159
160
|
try {
|
|
160
161
|
loginContent = await ctx.biliAPI.getLoginStatus(content.data.qrcode_key);
|
|
@@ -164,12 +165,12 @@ class ComRegister {
|
|
|
164
165
|
return;
|
|
165
166
|
}
|
|
166
167
|
if (loginContent.code !== 0) {
|
|
167
|
-
|
|
168
|
-
return await session.send('
|
|
168
|
+
this.loginTimer();
|
|
169
|
+
return await session.send('登录失败请联系管理员解决');
|
|
169
170
|
}
|
|
170
171
|
if (loginContent.data.code === 86038) {
|
|
171
|
-
|
|
172
|
-
return await session.send('
|
|
172
|
+
this.loginTimer();
|
|
173
|
+
return await session.send('二维码已失效,请重新登录');
|
|
173
174
|
}
|
|
174
175
|
if (loginContent.data.code === 0) { // 登录成功
|
|
175
176
|
const encryptedCookies = ctx.wbi.encrypt(ctx.biliAPI.getCookies());
|
|
@@ -180,13 +181,13 @@ class ComRegister {
|
|
|
180
181
|
bili_refresh_token: encryptedRefreshToken
|
|
181
182
|
}]);
|
|
182
183
|
// 销毁定时器
|
|
183
|
-
|
|
184
|
+
this.loginTimer();
|
|
184
185
|
// 订阅之前的订阅
|
|
185
186
|
await this.getSubFromDatabase(ctx);
|
|
186
187
|
// 清除控制台通知
|
|
187
188
|
ctx.biliAPI.disposeNotifier();
|
|
188
189
|
// 发送成功登录推送
|
|
189
|
-
await session.send('
|
|
190
|
+
await session.send('登录成功');
|
|
190
191
|
// bili show
|
|
191
192
|
await session.execute('bili show');
|
|
192
193
|
return;
|
|
@@ -328,7 +329,7 @@ class ComRegister {
|
|
|
328
329
|
}
|
|
329
330
|
}
|
|
330
331
|
else {
|
|
331
|
-
return '
|
|
332
|
+
return '暂不支持群号发送';
|
|
332
333
|
}
|
|
333
334
|
// 保存到数据库中
|
|
334
335
|
const sub = await ctx.database.create('bilibili', {
|
|
@@ -484,10 +485,10 @@ class ComRegister {
|
|
|
484
485
|
// B站出问题了
|
|
485
486
|
if (content.code !== 0) {
|
|
486
487
|
if (content.msg === '未找到该房间') {
|
|
487
|
-
session.send('
|
|
488
|
+
session.send('未找到该房间');
|
|
488
489
|
}
|
|
489
490
|
else {
|
|
490
|
-
session.send('
|
|
491
|
+
session.send('未知错误,请呼叫管理员检查问题');
|
|
491
492
|
}
|
|
492
493
|
return;
|
|
493
494
|
}
|
|
@@ -554,14 +555,6 @@ class ComRegister {
|
|
|
554
555
|
this.logger.info(`items[${num}].modules.module_author.pub_ts: ${ctx.gimg.unixTimestampToString(items[num].modules.module_author.pub_ts)}`) */
|
|
555
556
|
// 寻找发布时间比时间点更晚的动态
|
|
556
557
|
if (items[num].modules.module_author.pub_ts > timePoint) {
|
|
557
|
-
// 更新时间点为当前动态的发布时间
|
|
558
|
-
/* if (num === 1) { // 寻找倒数第二条动态
|
|
559
|
-
if (items[0].modules.module_tag) { // 存在置顶动态
|
|
560
|
-
timePoint = items[num].modules.module_author.pub_ts
|
|
561
|
-
} else {
|
|
562
|
-
timePoint = items[0].modules.module_author.pub_ts
|
|
563
|
-
}
|
|
564
|
-
} */
|
|
565
558
|
// 推送该条动态
|
|
566
559
|
let attempts = 3;
|
|
567
560
|
for (let i = 0; i < attempts; i++) {
|
|
@@ -571,6 +564,7 @@ class ComRegister {
|
|
|
571
564
|
let buffer;
|
|
572
565
|
// 获取动态推送图片
|
|
573
566
|
try {
|
|
567
|
+
// 渲染图片
|
|
574
568
|
const { pic: gimgPic, buffer: gimgBuffer } = await ctx.gimg.generateDynamicImg(items[num]);
|
|
575
569
|
pic = gimgPic;
|
|
576
570
|
buffer = gimgBuffer;
|
|
@@ -612,22 +606,6 @@ class ComRegister {
|
|
|
612
606
|
}
|
|
613
607
|
case 0: timePoint = items[num].modules.module_author.pub_ts;
|
|
614
608
|
}
|
|
615
|
-
// 如果这是遍历的最后一条,将时间点设置为这条动态的发布时间
|
|
616
|
-
/* if (num === 1) timePoint = items[num].modules.module_author.pub_ts
|
|
617
|
-
if (num === 0) {
|
|
618
|
-
timePoint = items[num].modules.module_author.pub_ts
|
|
619
|
-
} */
|
|
620
|
-
// 检查最一条动态是否是置顶动态 (ver 1.0.4 不用考虑置顶动态的问题)
|
|
621
|
-
// 如果是新发布的置顶动态,直接推送即可。如果是旧的置顶动态,则无法进入这个判断
|
|
622
|
-
/* if (num === 0) {
|
|
623
|
-
// 如果是置顶动态,则跳过
|
|
624
|
-
if (items[num].modules.module_tag) {
|
|
625
|
-
// 将上一条动态的发布时间设为时间点
|
|
626
|
-
timePoint = items[num + 1].modules.module_author.pub_ts
|
|
627
|
-
continue
|
|
628
|
-
}
|
|
629
|
-
timePoint = items[num].modules.module_author.pub_ts
|
|
630
|
-
} */
|
|
631
609
|
}
|
|
632
610
|
}
|
|
633
611
|
};
|
|
@@ -652,6 +630,8 @@ class ComRegister {
|
|
|
652
630
|
return bot.sendMessage(guildId, pic);
|
|
653
631
|
// pic不存在,说明使用的是page模式
|
|
654
632
|
await bot.sendMessage(guildId, koishi_1.h.image(buffer, 'image/png'));
|
|
633
|
+
// 成功则跳出循环
|
|
634
|
+
break;
|
|
655
635
|
}
|
|
656
636
|
catch (e) {
|
|
657
637
|
this.logger.error('liveDetect generateLiveImg() 推送卡片发送失败');
|
|
@@ -672,7 +652,10 @@ class ComRegister {
|
|
|
672
652
|
let attempts = 3;
|
|
673
653
|
for (let i = 0; i < attempts; i++) {
|
|
674
654
|
try {
|
|
655
|
+
// 发送请求获取room信息
|
|
675
656
|
content = await ctx.biliAPI.getLiveRoomInfo(roomId);
|
|
657
|
+
// 成功则跳出循环
|
|
658
|
+
break;
|
|
676
659
|
}
|
|
677
660
|
catch (e) {
|
|
678
661
|
this.logger.error('liveDetect getLiveRoomInfo 网络请求失败');
|
|
@@ -701,8 +684,11 @@ class ComRegister {
|
|
|
701
684
|
let attempts = 3;
|
|
702
685
|
for (let i = 0; i < attempts; i++) {
|
|
703
686
|
try {
|
|
687
|
+
// 发送请求获取主播信息
|
|
704
688
|
const { data: userInfo } = await ctx.biliAPI.getMasterInfo(data.uid);
|
|
705
689
|
userData = userInfo;
|
|
690
|
+
// 成功则跳出循环
|
|
691
|
+
break;
|
|
706
692
|
}
|
|
707
693
|
catch (e) {
|
|
708
694
|
this.logger.error('liveDetect getMasterInfo() 本次网络请求失败');
|
|
@@ -750,8 +736,11 @@ class ComRegister {
|
|
|
750
736
|
let attempts = 3;
|
|
751
737
|
for (let i = 0; i < attempts; i++) {
|
|
752
738
|
try {
|
|
739
|
+
// 获取主播信息
|
|
753
740
|
const { data: userInfo } = await ctx.biliAPI.getMasterInfo(data.uid);
|
|
754
741
|
userData = userInfo;
|
|
742
|
+
// 成功则跳出循环
|
|
743
|
+
break;
|
|
755
744
|
}
|
|
756
745
|
catch (e) {
|
|
757
746
|
this.logger.error('liveDetect open getMasterInfo() 网络请求错误');
|
|
@@ -809,7 +798,7 @@ class ComRegister {
|
|
|
809
798
|
session.send(`是否需要订阅${subType}?需要输入 y 不需要输入 n `);
|
|
810
799
|
input = await session.prompt();
|
|
811
800
|
if (!input) {
|
|
812
|
-
await session.send('
|
|
801
|
+
await session.send('输入超时请重新订阅');
|
|
813
802
|
continue;
|
|
814
803
|
}
|
|
815
804
|
switch (input) {
|
|
@@ -906,6 +895,7 @@ class ComRegister {
|
|
|
906
895
|
for (let i = 0; i < attempts; i++) {
|
|
907
896
|
try {
|
|
908
897
|
content = await ctx.biliAPI.getUserInfo(sub.uid);
|
|
898
|
+
// 成功则跳出循环
|
|
909
899
|
break;
|
|
910
900
|
}
|
|
911
901
|
catch (e) {
|
package/lib/generateImg.d.ts
CHANGED
package/lib/generateImg.js
CHANGED
|
@@ -515,6 +515,666 @@ class GenerateImg extends koishi_1.Service {
|
|
|
515
515
|
const [main, link] = await getDynamicMajor(data, false);
|
|
516
516
|
// 加载字体
|
|
517
517
|
const fontURL = (0, url_1.pathToFileURL)((0, path_1.resolve)(__dirname, './HYZhengYuan-55W.ttf'));
|
|
518
|
+
// 判断是否开启大字体模式
|
|
519
|
+
let style;
|
|
520
|
+
if (this.config.enableLargeFont) {
|
|
521
|
+
style = `
|
|
522
|
+
@font-face {
|
|
523
|
+
font-family: "Custom Font";
|
|
524
|
+
src: url(${fontURL});
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
* {
|
|
528
|
+
margin: 0;
|
|
529
|
+
padding: 0;
|
|
530
|
+
box-sizing: border-box;
|
|
531
|
+
font-family: "${this.config.font}", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
html {
|
|
535
|
+
width: 770px;
|
|
536
|
+
height: auto;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.background {
|
|
540
|
+
width: 770px;
|
|
541
|
+
height: auto;
|
|
542
|
+
background: linear-gradient(to right bottom, ${this.config.cardColorStart}, ${this.config.cardColorEnd});
|
|
543
|
+
overflow: hidden;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.card {
|
|
547
|
+
width: 740px;
|
|
548
|
+
height: auto;
|
|
549
|
+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
|
|
550
|
+
border-radius: 5px;
|
|
551
|
+
margin: 15px auto;
|
|
552
|
+
overflow: hidden;
|
|
553
|
+
background-color: #FFF5EE;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.base-plate {
|
|
557
|
+
${this.config.removeBorder ? `
|
|
558
|
+
width: 740px;
|
|
559
|
+
` : `
|
|
560
|
+
width: 704px;
|
|
561
|
+
margin: 20px auto;
|
|
562
|
+
`}
|
|
563
|
+
height: auto;
|
|
564
|
+
border-radius: 10px;
|
|
565
|
+
background-color: #fff;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
.card-body {
|
|
569
|
+
display: flex;
|
|
570
|
+
padding: 15px;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.card .anchor-avatar {
|
|
574
|
+
max-width: 70px;
|
|
575
|
+
/* 设置最大宽度为容器宽度的100% */
|
|
576
|
+
max-height: 70px;
|
|
577
|
+
/* 设置最大高度为容器高度的90% */
|
|
578
|
+
margin-right: 20px;
|
|
579
|
+
border-radius: 10px;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.card .card-body .card-content {
|
|
583
|
+
width: 100%;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.card .card-body .card-content .card-header {
|
|
587
|
+
width: 100%;
|
|
588
|
+
display: flex;
|
|
589
|
+
justify-content: space-between;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.card .up-info {
|
|
593
|
+
display: flex;
|
|
594
|
+
flex-direction: column;
|
|
595
|
+
justify-content: space-between;
|
|
596
|
+
height: 70px;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.card .up-info .up-name {
|
|
600
|
+
font-size: 27px;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.card .pub-time {
|
|
604
|
+
font-size: 20px;
|
|
605
|
+
color: grey;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.card .card-header img {
|
|
609
|
+
height: 50px;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.card .dress-up {
|
|
613
|
+
position: relative;
|
|
614
|
+
/* background-image: url('${dynamicCardUrl}');
|
|
615
|
+
background-size: cover; */
|
|
616
|
+
font-size: 17px;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.card .dress-up img {
|
|
620
|
+
max-width: 100%;
|
|
621
|
+
max-height: 100%;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.card .dress-up span {
|
|
625
|
+
position: absolute;
|
|
626
|
+
color: ${dynamicCardColor};
|
|
627
|
+
right: 67px;
|
|
628
|
+
top: 24px;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
.card .card-topic {
|
|
632
|
+
display: flex;
|
|
633
|
+
align-items: center;
|
|
634
|
+
margin-top: 10px;
|
|
635
|
+
font-size: 20px;
|
|
636
|
+
color: #008AC5;
|
|
637
|
+
gap: 3px;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.card .card-details {
|
|
641
|
+
margin-top: 5px;
|
|
642
|
+
margin-bottom: 15px;
|
|
643
|
+
font-size: 22px;
|
|
644
|
+
width: 90%;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.card .card-major {
|
|
648
|
+
display: flex;
|
|
649
|
+
flex-wrap: wrap;
|
|
650
|
+
gap: 5px;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.card .card-major .photo-item {
|
|
654
|
+
border-radius: 10px;
|
|
655
|
+
overflow: hidden;
|
|
656
|
+
width: 170px;
|
|
657
|
+
height: 170px;
|
|
658
|
+
object-fit: cover;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
.card .card-major .single-photo-item {
|
|
662
|
+
max-width: 500px;
|
|
663
|
+
border-radius: 10px;
|
|
664
|
+
overflow: hidden;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.card .card-major .four-photo-item {
|
|
668
|
+
width: 170px;
|
|
669
|
+
height: 170px;
|
|
670
|
+
object-fit: cover;
|
|
671
|
+
border-radius: 10px;
|
|
672
|
+
overflow: hidden;
|
|
673
|
+
flex-basis: 20%; /* or any value less than 50% */
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.card .card-stat {
|
|
677
|
+
display: flex;
|
|
678
|
+
justify-content: space-between;
|
|
679
|
+
width: 90%;
|
|
680
|
+
margin-top: 15px;
|
|
681
|
+
color: gray;
|
|
682
|
+
font-size: 14px;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.card .card-stat .stat-item {
|
|
686
|
+
display: flex;
|
|
687
|
+
align-items: center;
|
|
688
|
+
gap: 3px;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.card .card-video {
|
|
692
|
+
display: flex;
|
|
693
|
+
overflow: hidden;
|
|
694
|
+
border-radius: 5px 0 0 5px;
|
|
695
|
+
margin-top: 10px;
|
|
696
|
+
height: 147px;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
.card .video-cover {
|
|
700
|
+
position: relative;
|
|
701
|
+
flex: 2;
|
|
702
|
+
overflow: hidden;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.card .video-cover img {
|
|
706
|
+
width: 236px;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.card .cover-mask {
|
|
710
|
+
position: absolute;
|
|
711
|
+
width: 100%;
|
|
712
|
+
height: 100%;
|
|
713
|
+
top: 0;
|
|
714
|
+
left: 0;
|
|
715
|
+
background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 30%);
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
.card .video-cover span {
|
|
719
|
+
position: absolute;
|
|
720
|
+
color: #fff;
|
|
721
|
+
font-size: 14px;
|
|
722
|
+
right: 10px;
|
|
723
|
+
bottom: 8px;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.card .video-info {
|
|
727
|
+
display: flex;
|
|
728
|
+
justify-content: space-between;
|
|
729
|
+
flex-direction: column;
|
|
730
|
+
flex: 3;
|
|
731
|
+
border: #e5e7e9 1px solid;
|
|
732
|
+
border-left: none;
|
|
733
|
+
border-radius: 0 5px 5px 0;
|
|
734
|
+
padding: 12px 16px 10px;
|
|
735
|
+
background-color: #fff;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.card .video-info-header .video-title {
|
|
739
|
+
font-size: 16px;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.card .video-info-header .video-introduction {
|
|
743
|
+
margin-top: 5px;
|
|
744
|
+
font-size: 12px;
|
|
745
|
+
color: #AAA;
|
|
746
|
+
display: -webkit-box;
|
|
747
|
+
/* 必须设置为 -webkit-box 或 -webkit-inline-box */
|
|
748
|
+
-webkit-box-orient: vertical;
|
|
749
|
+
/* 必须设置为 vertical */
|
|
750
|
+
-webkit-line-clamp: 2;
|
|
751
|
+
/* 显示的文本行数 */
|
|
752
|
+
overflow: hidden;
|
|
753
|
+
/* 必须设置为 hidden */
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.card .video-stat {
|
|
757
|
+
font-size: 12px;
|
|
758
|
+
color: #AAA;
|
|
759
|
+
display: flex;
|
|
760
|
+
gap: 35px
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
.card .video-stat .video-stat-item {
|
|
764
|
+
display: flex;
|
|
765
|
+
align-items: center;
|
|
766
|
+
gap: 3px;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.card .card-forward {
|
|
770
|
+
margin: 0 -15px 0 -105px;
|
|
771
|
+
padding: 12px 15px 14px 105px;
|
|
772
|
+
background-color: #F6F7F8;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.card-forward .forward-userinfo {
|
|
776
|
+
display: flex;
|
|
777
|
+
align-items: center;
|
|
778
|
+
gap: 5px;
|
|
779
|
+
height: 35px;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
.forward-userinfo img {
|
|
783
|
+
width: 25px;
|
|
784
|
+
height: 25px;
|
|
785
|
+
border-radius: 50%;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.forward-userinfo span {
|
|
789
|
+
color: #61666D;
|
|
790
|
+
font-size: 20px;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.card .card-reserve {
|
|
794
|
+
display: flex;
|
|
795
|
+
justify-content: space-between;
|
|
796
|
+
align-items: center;
|
|
797
|
+
padding: 10px 20px 10px 20px;
|
|
798
|
+
margin-top: 10px;
|
|
799
|
+
border-radius: 10px;
|
|
800
|
+
background-color: #F6F7F8;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
.card-reserve .reserve-title {
|
|
804
|
+
font-size: 14px;
|
|
805
|
+
color: #18191C;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
.card-reserve .reserve-desc {
|
|
809
|
+
margin-top: 7px;
|
|
810
|
+
font-size: 12px;
|
|
811
|
+
color: #9499A0;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
.reserve-info .reserve-time {
|
|
815
|
+
margin-right: 7px;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
.card-reserve .reserve-prize {
|
|
819
|
+
display: flex;
|
|
820
|
+
align-items: center;
|
|
821
|
+
margin-top: 3px;
|
|
822
|
+
gap: 3px;
|
|
823
|
+
color: #00AEEC;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
.card .card-reserve .reserve-button button {
|
|
827
|
+
border: none;
|
|
828
|
+
height: 30px;
|
|
829
|
+
width: 72px;
|
|
830
|
+
font-size: 13px;
|
|
831
|
+
border-radius: 7px;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
.card .card-reserve .reserve-button .reserve-button-end {
|
|
835
|
+
display: flex;
|
|
836
|
+
align-items: center;
|
|
837
|
+
justify-content: center;
|
|
838
|
+
color: #9499A0;
|
|
839
|
+
background-color: #E3E5E7;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.card .card-reserve .reserve-button .reserve-button-ing {
|
|
843
|
+
display: flex;
|
|
844
|
+
align-items: center;
|
|
845
|
+
justify-content: center;
|
|
846
|
+
color: #FFF;
|
|
847
|
+
background-color: #00A0D8;
|
|
848
|
+
}
|
|
849
|
+
`;
|
|
850
|
+
}
|
|
851
|
+
else {
|
|
852
|
+
style = `
|
|
853
|
+
@font-face {
|
|
854
|
+
font-family: "Custom Font";
|
|
855
|
+
src: url(${fontURL});
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
* {
|
|
859
|
+
margin: 0;
|
|
860
|
+
padding: 0;
|
|
861
|
+
font-family: "${this.config.font}", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
html {
|
|
865
|
+
width: 770px;
|
|
866
|
+
height: auto;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
.background {
|
|
870
|
+
width: 770px;
|
|
871
|
+
height: auto;
|
|
872
|
+
background: linear-gradient(to right bottom, ${this.config.cardColorStart}, ${this.config.cardColorEnd});
|
|
873
|
+
overflow: hidden;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
.card {
|
|
877
|
+
width: 740px;
|
|
878
|
+
height: auto;
|
|
879
|
+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
|
|
880
|
+
border-radius: 5px;
|
|
881
|
+
margin: 15px auto;
|
|
882
|
+
overflow: hidden;
|
|
883
|
+
background-color: #FFF5EE;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
.base-plate {
|
|
887
|
+
width: 704px;
|
|
888
|
+
height: auto;
|
|
889
|
+
margin: 20px auto;
|
|
890
|
+
border-radius: 10px;
|
|
891
|
+
background-color: #fff;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.card-body {
|
|
895
|
+
display: flex;
|
|
896
|
+
padding: 15px;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.card .anchor-avatar {
|
|
900
|
+
border-radius: 5px 5px 0 0;
|
|
901
|
+
max-width: 50px;
|
|
902
|
+
/* 设置最大宽度为容器宽度的100% */
|
|
903
|
+
max-height: 50px;
|
|
904
|
+
/* 设置最大高度为容器高度的90% */
|
|
905
|
+
margin-right: 20px;
|
|
906
|
+
border-radius: 10px;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
.card .card-body .card-content {
|
|
910
|
+
width: 100%;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
.card .card-body .card-content .card-header {
|
|
914
|
+
width: 100%;
|
|
915
|
+
display: flex;
|
|
916
|
+
justify-content: space-between;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
.card .up-info {
|
|
920
|
+
display: flex;
|
|
921
|
+
flex-direction: column;
|
|
922
|
+
justify-content: space-between;
|
|
923
|
+
height: 50px;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
.card .up-info .up-name {
|
|
927
|
+
font-size: 20px;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.card .pub-time {
|
|
931
|
+
font-size: 12px;
|
|
932
|
+
color: grey;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
.card .card-header img {
|
|
936
|
+
height: 50px;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.card .dress-up {
|
|
940
|
+
position: relative;
|
|
941
|
+
max-width: 110px;
|
|
942
|
+
max-height: 34px;
|
|
943
|
+
/* background-image: url('${dynamicCardUrl}');
|
|
944
|
+
background-size: cover; */
|
|
945
|
+
font-size: 12px;
|
|
946
|
+
line-height: 33px;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
.card .dress-up img {
|
|
950
|
+
max-width: 100%;
|
|
951
|
+
max-height: 100%;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
.card .dress-up span {
|
|
955
|
+
position: absolute;
|
|
956
|
+
color: ${dynamicCardColor};
|
|
957
|
+
right: 37px;
|
|
958
|
+
top: 5px;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
.card .card-topic {
|
|
962
|
+
display: flex;
|
|
963
|
+
align-items: center;
|
|
964
|
+
margin-top: 10px;
|
|
965
|
+
color: #008AC5;
|
|
966
|
+
gap: 3px;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
.card .card-details {
|
|
970
|
+
margin-bottom: 15px;
|
|
971
|
+
width: 90%;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
.card .card-major {
|
|
975
|
+
display: flex;
|
|
976
|
+
flex-wrap: wrap;
|
|
977
|
+
gap: 5px;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
.card .card-major .photo-item {
|
|
981
|
+
border-radius: 10px;
|
|
982
|
+
overflow: hidden;
|
|
983
|
+
width: 170px;
|
|
984
|
+
height: 170px;
|
|
985
|
+
object-fit: cover;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
.card .card-major .single-photo-item {
|
|
989
|
+
max-width: 500px;
|
|
990
|
+
border-radius: 10px;
|
|
991
|
+
overflow: hidden;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
.card .card-major .four-photo-item {
|
|
995
|
+
width: 170px;
|
|
996
|
+
height: 170px;
|
|
997
|
+
object-fit: cover;
|
|
998
|
+
border-radius: 10px;
|
|
999
|
+
overflow: hidden;
|
|
1000
|
+
flex-basis: 20%; /* or any value less than 50% */
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
.card .card-stat {
|
|
1004
|
+
display: flex;
|
|
1005
|
+
justify-content: space-between;
|
|
1006
|
+
width: 90%;
|
|
1007
|
+
margin-top: 15px;
|
|
1008
|
+
color: gray;
|
|
1009
|
+
font-size: 14px;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
.card .card-stat .stat-item {
|
|
1013
|
+
display: flex;
|
|
1014
|
+
align-items: center;
|
|
1015
|
+
gap: 3px;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.card .card-video {
|
|
1019
|
+
display: flex;
|
|
1020
|
+
overflow: hidden;
|
|
1021
|
+
border-radius: 5px 0 0 5px;
|
|
1022
|
+
margin-top: 10px;
|
|
1023
|
+
height: 132px;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
.card .video-cover {
|
|
1027
|
+
position: relative;
|
|
1028
|
+
flex: 2;
|
|
1029
|
+
overflow: hidden;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
.card .video-cover img {
|
|
1033
|
+
width: 236px;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
.card .cover-mask {
|
|
1037
|
+
position: absolute;
|
|
1038
|
+
width: 100%;
|
|
1039
|
+
height: 100%;
|
|
1040
|
+
top: 0;
|
|
1041
|
+
left: 0;
|
|
1042
|
+
background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 30%);
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.card .video-cover span {
|
|
1046
|
+
position: absolute;
|
|
1047
|
+
color: #fff;
|
|
1048
|
+
font-size: 14px;
|
|
1049
|
+
right: 10px;
|
|
1050
|
+
bottom: 8px;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
.card .video-info {
|
|
1054
|
+
display: flex;
|
|
1055
|
+
justify-content: space-between;
|
|
1056
|
+
flex-direction: column;
|
|
1057
|
+
flex: 3;
|
|
1058
|
+
border: #e5e7e9 1px solid;
|
|
1059
|
+
border-left: none;
|
|
1060
|
+
border-radius: 0 5px 5px 0;
|
|
1061
|
+
padding: 12px 16px 10px;
|
|
1062
|
+
background-color: #fff;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
.card .video-info-header .video-title {
|
|
1066
|
+
font-size: 16px;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
.card .video-info-header .video-introduction {
|
|
1070
|
+
margin-top: 5px;
|
|
1071
|
+
font-size: 12px;
|
|
1072
|
+
color: #AAA;
|
|
1073
|
+
display: -webkit-box;
|
|
1074
|
+
/* 必须设置为 -webkit-box 或 -webkit-inline-box */
|
|
1075
|
+
-webkit-box-orient: vertical;
|
|
1076
|
+
/* 必须设置为 vertical */
|
|
1077
|
+
-webkit-line-clamp: 2;
|
|
1078
|
+
/* 显示的文本行数 */
|
|
1079
|
+
overflow: hidden;
|
|
1080
|
+
/* 必须设置为 hidden */
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
.card .video-stat {
|
|
1084
|
+
font-size: 12px;
|
|
1085
|
+
color: #AAA;
|
|
1086
|
+
display: flex;
|
|
1087
|
+
gap: 35px
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
.card .video-stat .video-stat-item {
|
|
1091
|
+
display: flex;
|
|
1092
|
+
align-items: center;
|
|
1093
|
+
gap: 3px;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
.card .card-forward {
|
|
1097
|
+
margin: 0 -15px 0 -85px;
|
|
1098
|
+
padding: 12px 15px 14px 85px;
|
|
1099
|
+
background-color: #F6F7F8;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
.card-forward .forward-userinfo {
|
|
1103
|
+
display: flex;
|
|
1104
|
+
align-items: center;
|
|
1105
|
+
gap: 5px;
|
|
1106
|
+
height: 30px;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
.forward-userinfo img {
|
|
1110
|
+
width: 20px;
|
|
1111
|
+
height: 20px;
|
|
1112
|
+
border-radius: 50%;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
.forward-userinfo span {
|
|
1116
|
+
color: #61666D;
|
|
1117
|
+
font-size: 15px;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
.card .card-reserve {
|
|
1121
|
+
display: flex;
|
|
1122
|
+
justify-content: space-between;
|
|
1123
|
+
align-items: center;
|
|
1124
|
+
padding: 10px 20px 10px 20px;
|
|
1125
|
+
margin-top: 10px;
|
|
1126
|
+
border-radius: 10px;
|
|
1127
|
+
background-color: #F6F7F8;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
.card-reserve .reserve-title {
|
|
1131
|
+
font-size: 14px;
|
|
1132
|
+
color: #18191C;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
.card-reserve .reserve-desc {
|
|
1136
|
+
margin-top: 7px;
|
|
1137
|
+
font-size: 12px;
|
|
1138
|
+
color: #9499A0;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
.reserve-info .reserve-time {
|
|
1142
|
+
margin-right: 7px;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
.card-reserve .reserve-prize {
|
|
1146
|
+
display: flex;
|
|
1147
|
+
align-items: center;
|
|
1148
|
+
margin-top: 3px;
|
|
1149
|
+
gap: 3px;
|
|
1150
|
+
color: #00AEEC;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
.card .card-reserve .reserve-button button {
|
|
1154
|
+
border: none;
|
|
1155
|
+
height: 30px;
|
|
1156
|
+
width: 72px;
|
|
1157
|
+
font-size: 13px;
|
|
1158
|
+
border-radius: 7px;
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
.card .card-reserve .reserve-button .reserve-button-end {
|
|
1162
|
+
display: flex;
|
|
1163
|
+
align-items: center;
|
|
1164
|
+
justify-content: center;
|
|
1165
|
+
color: #9499A0;
|
|
1166
|
+
background-color: #E3E5E7;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
.card .card-reserve .reserve-button .reserve-button-ing {
|
|
1170
|
+
display: flex;
|
|
1171
|
+
align-items: center;
|
|
1172
|
+
justify-content: center;
|
|
1173
|
+
color: #FFF;
|
|
1174
|
+
background-color: #00A0D8;
|
|
1175
|
+
}
|
|
1176
|
+
`;
|
|
1177
|
+
}
|
|
518
1178
|
// 定义卡片内容
|
|
519
1179
|
const html = `
|
|
520
1180
|
<!DOCTYPE html>
|
|
@@ -522,333 +1182,7 @@ class GenerateImg extends koishi_1.Service {
|
|
|
522
1182
|
<head>
|
|
523
1183
|
<title>动态通知</title>
|
|
524
1184
|
<style>
|
|
525
|
-
|
|
526
|
-
font-family: "Custom Font";
|
|
527
|
-
src: url(${fontURL});
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
* {
|
|
531
|
-
margin: 0;
|
|
532
|
-
padding: 0;
|
|
533
|
-
box-sizing: border-box;
|
|
534
|
-
font-family: "${this.config.font}", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
html {
|
|
538
|
-
width: 770px;
|
|
539
|
-
height: auto;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
.background {
|
|
543
|
-
width: 770px;
|
|
544
|
-
height: auto;
|
|
545
|
-
background: linear-gradient(to right bottom, ${this.config.cardColorStart}, ${this.config.cardColorEnd});
|
|
546
|
-
overflow: hidden;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
.card {
|
|
550
|
-
width: 740px;
|
|
551
|
-
height: auto;
|
|
552
|
-
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
|
|
553
|
-
border-radius: 5px;
|
|
554
|
-
margin: 15px auto;
|
|
555
|
-
overflow: hidden;
|
|
556
|
-
background-color: #FFF5EE;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
.base-plate {
|
|
560
|
-
${this.config.removeBorder ? `
|
|
561
|
-
width: 740px;
|
|
562
|
-
` : `
|
|
563
|
-
width: 704px;
|
|
564
|
-
margin: 20px auto;
|
|
565
|
-
`}
|
|
566
|
-
height: auto;
|
|
567
|
-
border-radius: 10px;
|
|
568
|
-
background-color: #fff;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
.card-body {
|
|
572
|
-
display: flex;
|
|
573
|
-
padding: 15px;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
.card .anchor-avatar {
|
|
577
|
-
max-width: 70px;
|
|
578
|
-
/* 设置最大宽度为容器宽度的100% */
|
|
579
|
-
max-height: 70px;
|
|
580
|
-
/* 设置最大高度为容器高度的90% */
|
|
581
|
-
margin-right: 20px;
|
|
582
|
-
border-radius: 10px;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
.card .card-body .card-content {
|
|
586
|
-
width: 100%;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
.card .card-body .card-content .card-header {
|
|
590
|
-
width: 100%;
|
|
591
|
-
display: flex;
|
|
592
|
-
justify-content: space-between;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
.card .up-info {
|
|
596
|
-
display: flex;
|
|
597
|
-
flex-direction: column;
|
|
598
|
-
justify-content: space-between;
|
|
599
|
-
height: 70px;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
.card .up-info .up-name {
|
|
603
|
-
font-size: 27px;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
.card .pub-time {
|
|
607
|
-
font-size: 20px;
|
|
608
|
-
color: grey;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
.card .card-header img {
|
|
612
|
-
height: 50px;
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
.card .dress-up {
|
|
616
|
-
position: relative;
|
|
617
|
-
/* background-image: url('${dynamicCardUrl}');
|
|
618
|
-
background-size: cover; */
|
|
619
|
-
font-size: 17px;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
.card .dress-up img {
|
|
623
|
-
max-width: 100%;
|
|
624
|
-
max-height: 100%;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
.card .dress-up span {
|
|
628
|
-
position: absolute;
|
|
629
|
-
color: ${dynamicCardColor};
|
|
630
|
-
right: 67px;
|
|
631
|
-
top: 24px;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
.card .card-topic {
|
|
635
|
-
display: flex;
|
|
636
|
-
align-items: center;
|
|
637
|
-
margin-top: 10px;
|
|
638
|
-
font-size: 20px;
|
|
639
|
-
color: #008AC5;
|
|
640
|
-
gap: 3px;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
.card .card-details {
|
|
644
|
-
margin-top: 5px;
|
|
645
|
-
margin-bottom: 15px;
|
|
646
|
-
font-size: 22px;
|
|
647
|
-
width: 90%;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
.card .card-major {
|
|
651
|
-
display: flex;
|
|
652
|
-
flex-wrap: wrap;
|
|
653
|
-
gap: 5px;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
.card .card-major .photo-item {
|
|
657
|
-
border-radius: 10px;
|
|
658
|
-
overflow: hidden;
|
|
659
|
-
width: 170px;
|
|
660
|
-
height: 170px;
|
|
661
|
-
object-fit: cover;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
.card .card-major .single-photo-item {
|
|
665
|
-
max-width: 500px;
|
|
666
|
-
border-radius: 10px;
|
|
667
|
-
overflow: hidden;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
.card .card-major .four-photo-item {
|
|
671
|
-
width: 170px;
|
|
672
|
-
height: 170px;
|
|
673
|
-
object-fit: cover;
|
|
674
|
-
border-radius: 10px;
|
|
675
|
-
overflow: hidden;
|
|
676
|
-
flex-basis: 20%; /* or any value less than 50% */
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
.card .card-stat {
|
|
680
|
-
display: flex;
|
|
681
|
-
justify-content: space-between;
|
|
682
|
-
width: 90%;
|
|
683
|
-
margin-top: 15px;
|
|
684
|
-
color: gray;
|
|
685
|
-
font-size: 14px;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
.card .card-stat .stat-item {
|
|
689
|
-
display: flex;
|
|
690
|
-
align-items: center;
|
|
691
|
-
gap: 3px;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
.card .card-video {
|
|
695
|
-
display: flex;
|
|
696
|
-
overflow: hidden;
|
|
697
|
-
border-radius: 5px 0 0 5px;
|
|
698
|
-
margin-top: 10px;
|
|
699
|
-
height: 147px;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
.card .video-cover {
|
|
703
|
-
position: relative;
|
|
704
|
-
flex: 2;
|
|
705
|
-
overflow: hidden;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
.card .video-cover img {
|
|
709
|
-
width: 236px;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
.card .cover-mask {
|
|
713
|
-
position: absolute;
|
|
714
|
-
width: 100%;
|
|
715
|
-
height: 100%;
|
|
716
|
-
top: 0;
|
|
717
|
-
left: 0;
|
|
718
|
-
background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 30%);
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
.card .video-cover span {
|
|
722
|
-
position: absolute;
|
|
723
|
-
color: #fff;
|
|
724
|
-
font-size: 14px;
|
|
725
|
-
right: 10px;
|
|
726
|
-
bottom: 8px;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
.card .video-info {
|
|
730
|
-
display: flex;
|
|
731
|
-
justify-content: space-between;
|
|
732
|
-
flex-direction: column;
|
|
733
|
-
flex: 3;
|
|
734
|
-
border: #e5e7e9 1px solid;
|
|
735
|
-
border-left: none;
|
|
736
|
-
border-radius: 0 5px 5px 0;
|
|
737
|
-
padding: 12px 16px 10px;
|
|
738
|
-
background-color: #fff;
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
.card .video-info-header .video-title {
|
|
742
|
-
font-size: 16px;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
.card .video-info-header .video-introduction {
|
|
746
|
-
margin-top: 5px;
|
|
747
|
-
font-size: 12px;
|
|
748
|
-
color: #AAA;
|
|
749
|
-
display: -webkit-box;
|
|
750
|
-
/* 必须设置为 -webkit-box 或 -webkit-inline-box */
|
|
751
|
-
-webkit-box-orient: vertical;
|
|
752
|
-
/* 必须设置为 vertical */
|
|
753
|
-
-webkit-line-clamp: 2;
|
|
754
|
-
/* 显示的文本行数 */
|
|
755
|
-
overflow: hidden;
|
|
756
|
-
/* 必须设置为 hidden */
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
.card .video-stat {
|
|
760
|
-
font-size: 12px;
|
|
761
|
-
color: #AAA;
|
|
762
|
-
display: flex;
|
|
763
|
-
gap: 35px
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
.card .video-stat .video-stat-item {
|
|
767
|
-
display: flex;
|
|
768
|
-
align-items: center;
|
|
769
|
-
gap: 3px;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
.card .card-forward {
|
|
773
|
-
margin: 0 -15px 0 -105px;
|
|
774
|
-
padding: 12px 15px 14px 105px;
|
|
775
|
-
background-color: #F6F7F8;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
.card-forward .forward-userinfo {
|
|
779
|
-
display: flex;
|
|
780
|
-
align-items: center;
|
|
781
|
-
gap: 5px;
|
|
782
|
-
height: 35px;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
.forward-userinfo img {
|
|
786
|
-
width: 25px;
|
|
787
|
-
height: 25px;
|
|
788
|
-
border-radius: 50%;
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
.forward-userinfo span {
|
|
792
|
-
color: #61666D;
|
|
793
|
-
font-size: 20px;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
.card .card-reserve {
|
|
797
|
-
display: flex;
|
|
798
|
-
justify-content: space-between;
|
|
799
|
-
align-items: center;
|
|
800
|
-
padding: 10px 20px 10px 20px;
|
|
801
|
-
margin-top: 10px;
|
|
802
|
-
border-radius: 10px;
|
|
803
|
-
background-color: #F6F7F8;
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
.card-reserve .reserve-title {
|
|
807
|
-
font-size: 14px;
|
|
808
|
-
color: #18191C;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
.card-reserve .reserve-desc {
|
|
812
|
-
margin-top: 7px;
|
|
813
|
-
font-size: 12px;
|
|
814
|
-
color: #9499A0;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
.reserve-info .reserve-time {
|
|
818
|
-
margin-right: 7px;
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
.card-reserve .reserve-prize {
|
|
822
|
-
display: flex;
|
|
823
|
-
align-items: center;
|
|
824
|
-
margin-top: 3px;
|
|
825
|
-
gap: 3px;
|
|
826
|
-
color: #00AEEC;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
.card .card-reserve .reserve-button button {
|
|
830
|
-
border: none;
|
|
831
|
-
height: 30px;
|
|
832
|
-
width: 72px;
|
|
833
|
-
font-size: 13px;
|
|
834
|
-
border-radius: 7px;
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
.card .card-reserve .reserve-button .reserve-button-end {
|
|
838
|
-
display: flex;
|
|
839
|
-
align-items: center;
|
|
840
|
-
justify-content: center;
|
|
841
|
-
color: #9499A0;
|
|
842
|
-
background-color: #E3E5E7;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
.card .card-reserve .reserve-button .reserve-button-ing {
|
|
846
|
-
display: flex;
|
|
847
|
-
align-items: center;
|
|
848
|
-
justify-content: center;
|
|
849
|
-
color: #FFF;
|
|
850
|
-
background-color: #00A0D8;
|
|
851
|
-
}
|
|
1185
|
+
${style}
|
|
852
1186
|
</style>
|
|
853
1187
|
</head>
|
|
854
1188
|
<body>
|
|
@@ -1016,6 +1350,7 @@ class GenerateImg extends koishi_1.Service {
|
|
|
1016
1350
|
removeBorder: koishi_1.Schema.boolean(),
|
|
1017
1351
|
cardColorStart: koishi_1.Schema.string(),
|
|
1018
1352
|
cardColorEnd: koishi_1.Schema.string(),
|
|
1353
|
+
enableLargeFont: koishi_1.Schema.boolean(),
|
|
1019
1354
|
font: koishi_1.Schema.string()
|
|
1020
1355
|
});
|
|
1021
1356
|
})(GenerateImg || (GenerateImg = {}));
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -75,10 +75,11 @@ exports.Config = koishi_1.Schema.object({
|
|
|
75
75
|
enable: koishi_1.Schema.boolean()
|
|
76
76
|
.default(false)
|
|
77
77
|
.description('是否开启动态关键字屏蔽功能')
|
|
78
|
+
.experimental()
|
|
78
79
|
}).description('屏蔽设置'),
|
|
79
80
|
koishi_1.Schema.union([
|
|
80
81
|
koishi_1.Schema.object({
|
|
81
|
-
enable: koishi_1.Schema.const(true).required(),
|
|
82
|
+
enable: koishi_1.Schema.const(true).required().experimental(),
|
|
82
83
|
regex: koishi_1.Schema.string()
|
|
83
84
|
.description('正则表达式屏蔽'),
|
|
84
85
|
keywords: koishi_1.Schema.array(String)
|
|
@@ -99,6 +100,9 @@ exports.Config = koishi_1.Schema.object({
|
|
|
99
100
|
.pattern(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
|
|
100
101
|
.default('#F9CCDF')
|
|
101
102
|
.description('推送卡片的结束渐变背景色,请填入16进制颜色代码,参考网站:https://colorate.azurewebsites.net/'),
|
|
103
|
+
enableLargeFont: koishi_1.Schema.boolean()
|
|
104
|
+
.default(false)
|
|
105
|
+
.description('是否开启动态推送卡片大字体模式,默认为小字体。小字体更漂亮,但阅读比较吃力,大字体更易阅读,但相对没这么好看'),
|
|
102
106
|
font: koishi_1.Schema.string()
|
|
103
107
|
.description('推送卡片的字体样式,如果你想用你自己的字体可以在此填写,例如:Microsoft YaHei')
|
|
104
108
|
});
|
|
@@ -145,11 +149,24 @@ function apply(ctx, config) {
|
|
|
145
149
|
ctx.plugin(Database);
|
|
146
150
|
// Regist server
|
|
147
151
|
ctx.plugin(wbi_1.default, { key: config.key });
|
|
148
|
-
ctx.plugin(generateImg_1.default, {
|
|
152
|
+
ctx.plugin(generateImg_1.default, {
|
|
153
|
+
renderType,
|
|
154
|
+
filter: config.filter,
|
|
155
|
+
removeBorder: config.removeBorder,
|
|
156
|
+
cardColorStart: config.cardColorStart,
|
|
157
|
+
cardColorEnd: config.cardColorEnd,
|
|
158
|
+
enableLargeFont: config.enableLargeFont,
|
|
159
|
+
font: config.font
|
|
160
|
+
});
|
|
149
161
|
ctx.plugin(biliAPI_1.default);
|
|
150
162
|
// load plugin
|
|
151
163
|
// ctx.plugin(Authority)
|
|
152
|
-
ctx.plugin(comRegister_1.default, {
|
|
164
|
+
ctx.plugin(comRegister_1.default, {
|
|
165
|
+
unlockSubLimits: config.unlockSubLimits,
|
|
166
|
+
pushTime: config.pushTime,
|
|
167
|
+
dynamicCheckNumber: config.dynamicCheckNumber,
|
|
168
|
+
dynamicLoopTime
|
|
169
|
+
});
|
|
153
170
|
// 当用户输入“恶魔兔,启动!”时,执行 help 指令
|
|
154
171
|
ctx.middleware((session, next) => {
|
|
155
172
|
if (session.content === '恶魔兔,启动!') {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -87,6 +87,8 @@
|
|
|
87
87
|
- ver 1.0.9 更新请求客户端header信息。优化了动态推送卡片的页面布局,增加了字体大小。提供用户开放订阅数量限制的选项,提供用户移除推送卡片边框的选项。在控制台页面增加订阅信息提示
|
|
88
88
|
- ver 1.0.10 增加对onebot的支持,添加动态关键字屏蔽功能
|
|
89
89
|
- ver 1.0.11 修复了render渲染模式下,动态重复推送的问题,修复了没有订阅时,控制台空白提示的问题。优化了视频动态缩略图显示不全的问题,优化了部分逻辑。增强容错和增加错误提示
|
|
90
|
+
- ver 1.0.12 提供用户选择动态推送卡片字体增大的选项
|
|
91
|
+
- ver 1.0.13 修复了直播通知卡片连续发三次的bug,修复了多次调用指令 `bili login` 产生的bug
|
|
90
92
|
|
|
91
93
|
## 感谢
|
|
92
94
|
|