From 142e3a18d9d03d4cdd43df87d9b1754bc7523e08 Mon Sep 17 00:00:00 2001 From: story-x <394890254@qq.com> Date: Tue, 22 Aug 2023 02:26:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20*=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E6=8A=BD=E5=8D=A1=E8=AE=B0=E5=BD=95=20=E5=91=BD=E4=BB=A4=20(#2?= =?UTF-8?q?30)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/apps/gcLog.js | 21 +- plugins/genshin/model/gachaLog.js | 8 +- .../StarRail/html/gachaAllLog/gachaAllLog.css | 397 ++++++++++++++++++ .../html/gachaAllLog/gachaAllLog.html | 78 ++++ .../html/gachaAllLog/gachaAllLog.html | 2 +- 5 files changed, 484 insertions(+), 22 deletions(-) create mode 100644 plugins/genshin/resources/StarRail/html/gachaAllLog/gachaAllLog.css create mode 100644 plugins/genshin/resources/StarRail/html/gachaAllLog/gachaAllLog.html diff --git a/plugins/genshin/apps/gcLog.js b/plugins/genshin/apps/gcLog.js index 9da2d80..9fd4bdb 100644 --- a/plugins/genshin/apps/gcLog.js +++ b/plugins/genshin/apps/gcLog.js @@ -127,14 +127,12 @@ export class gcLog extends plugin { /** #抽卡记录 */ async getLog () { - this.e.isAll = !!(this.e.msg.includes('全部') && !this.e.isSr) + this.e.isAll = !!(this.e.msg.includes('全部')) let data = await new GachaLog(this.e).getLogData() if (!data) return - let name = 'gachaLog' + let name = `${data.srtempFile}gachaLog` if (this.e.isAll) { - name = 'gachaAllLog' - } else { - name = this.srHead('gachaLog', data) + name = `${data.srtempFile}gachaAllLog` } let img = await puppeteer.screenshot(name, data) if (img) await this.reply(img) @@ -206,21 +204,10 @@ export class gcLog extends plugin { } } - srHead = (url, data) => { - let name = url - if (this.e.isSr) { - name = `StarRail/${url}` - data.tplFile = `./plugins/genshin/resources/StarRail/html/${url}/${url}.html` - data.headStyle = `` - } - return name - } - async logCount () { let data = await new LogCount(this.e).count() if (!data) return - let url = this.srHead('logCount', data) - let img = await puppeteer.screenshot(url, data) + let img = await puppeteer.screenshot(`${data.srtempFile}logCount`, data) if (img) await this.reply(img) } } diff --git a/plugins/genshin/model/gachaLog.js b/plugins/genshin/model/gachaLog.js index b263caf..a5f3b9d 100644 --- a/plugins/genshin/model/gachaLog.js +++ b/plugins/genshin/model/gachaLog.js @@ -60,7 +60,7 @@ export default class GachaLog extends base { if (i <= 1) await common.sleep(500) } MakeMsg.push(tmpMsg) - MakeMsg.push(`\n抽卡记录更新完成,您还可回复\n【#${this?.e?.isSr ? '星铁光锥' : '武器'}记录】统计${this?.e?.isSr ? '星铁光锥' : '武器'}池数据\n【#${this?.e?.isSr ? '星铁' : ''}角色统计】按卡池统计数据\n【#导出记录】导出记录数据`) + MakeMsg.push(`\n抽卡记录更新完成,您还可回复\n【${this?.e?.isSr ? '*' : '#'}全部抽卡记录】展示全部抽卡数据\n【${this?.e?.isSr ? '*光锥' : '#武器'}记录】统计${this?.e?.isSr ? '星铁光锥' : '武器'}池数据\n【${this?.e?.isSr ? '*' : '#'}角色统计】按卡池统计数据\n【#导出记录】导出记录数据`) await this.e.reply(MakeMsg) this.isLogUrl = true @@ -371,7 +371,8 @@ export default class GachaLog extends base { } async getAllGcLogData () { - const poolList = ['角色', '武器', '常驻', '新手'] + this.model = 'gachaAllLog' + const poolList = ['角色', this.e?.isSr ? '光锥' : '武器', '常驻'] const logData = [] let fiveMaxNum = 0 const originalMsg = this.e.msg @@ -385,7 +386,7 @@ export default class GachaLog extends base { if (fiveMaxNum <= data.fiveLog.length) { fiveMaxNum = data.fiveLog.length } - data.max = i === '武器' ? 80 : 90 + data.max = i === '武器' || i === '光锥' ? 80 : 90 logData.push(data) } if (logData.length === 0) { @@ -402,7 +403,6 @@ export default class GachaLog extends base { ...logData[0], data: logData } - data.tplFile = './plugins/genshin/resources/html/gachaAllLog/gachaAllLog.html' this.e.msg = originalMsg return data } diff --git a/plugins/genshin/resources/StarRail/html/gachaAllLog/gachaAllLog.css b/plugins/genshin/resources/StarRail/html/gachaAllLog/gachaAllLog.css new file mode 100644 index 0000000..e1449bf --- /dev/null +++ b/plugins/genshin/resources/StarRail/html/gachaAllLog/gachaAllLog.css @@ -0,0 +1,397 @@ +@font-face { + font-family: "tttgbnumber"; + src: url("../../../../../../resources/font/tttgbnumber.ttf"); + font-weight: normal; + font-style: normal; +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; + user-select: none; +} + +body { + font-size: 18px; + color: #1e1f20; + font-family: PingFangSC-Medium, PingFang SC, sans-serif; + transform: scale(1.5); + transform-origin: 0 0; + position: absolute; +} +.container { + width: 1500px; + display: flex; + flex-wrap: wrap; + justify-content: space-between; + padding: 20px 15px 10px 15px; + background-color: #f5f6fb; + height: 100%; /* 设置容器高度,这里假设容器的父元素有固定高度或是占满整个视口 */ +} +.info_box{ + width: 465px; + margin-right: 15px; + margin-left: 15px; + flex: 1; + align-items: center; + justify-content: center; +} + +.head_box { + border-radius: 15px; + font-family: tttgbnumber; + padding: 10px 20px; + position: relative; + box-shadow: 0 5px 10px 0 rgb(0 0 0 / 15%); +} + +.head_box .id_text { + color: #f5e7f4; + padding: 5px 0; + font-size: 26px; +} + +.head_box .day_text { + color: #f5e7f4; + padding: 5px 0; + font-size: 22px; +} + +.head_box .starrail_logo { + position: absolute; + top: 5px; + right: 10px; + width: 115px; +} + +.logo { + width: 100%; + font-size: 12px; + font-family: "tttgbnumber"; + text-align: center; + color: #7994a7; + position: relative; + padding-left: 10px; +} + + +.data_box { + border-radius: 15px; + margin-top: 20px; + margin-bottom: 20px; + padding: 20px 0px 5px 10px; + background: #fff; + box-shadow: 0 5px 10px 0 rgb(0 0 0 / 15%); + position: relative; +} + +.tab_lable { + position: absolute; + top: -10px; + left: -8px; + background: #d4b98c; + color: #fff; + font-size: 14px; + padding: 3px 10px; + border-radius: 15px 0px 15px 15px; + z-index: 20; +} + +.data_line { + display: flex; + justify-content: space-around; + margin-bottom: 14px; + padding-right: 10px; +} + +.data_line_item { + width: 100px; + text-align: center; + /*margin: 0 20px;*/ +} + +.num { + font-family: tttgbnumber; + font-size: 24px; +} + +.num .unit { + font-size: 12px; +} + +.data_box .lable { + font-size: 14px; + color: #7f858a; + line-height: 1; + margin-top: 3px; +} + +/*body {*/ +/* width: 510px;*/ +/*}*/ + +/*.container {*/ +/* width: 510px;*/ +/*}*/ + +.data_box { + margin-bottom: 10px; +} + +.info_box_border{ + border-radius: 15px; + /* margin-top: 20px; */ + margin-bottom: 20px; + padding: 6px 0px 5px 10px; + background: #fff; + box-shadow: 0 5px 10px 0 rgb(0 0 0 / 15%); + position: relative; +} + +.card_list { + display: flex; + flex-wrap: wrap; + justify-content: flex-start; +} + +.card_list .item { + margin: 0px 10px 10px 10px; + border-radius: 7px; + box-shadow: 0 2px 6px 0 rgb(132 93 90 / 30%); + height: 90px; + position: relative; + overflow: hidden; + /*background: #e7e5d9;*/ +} +.card_list .item.isNull { + margin: 0px 10px 10px 10px; + border-radius: 7px; + height: 90px; + position: relative; + overflow: hidden; + box-shadow: none !important; + background: none !important; +} + +.card_list .item img { + width: 70px; + height: 70px; + border-radius: 7px 7px 20px 0; +} +.card_list .item.star5{ + width: 70px; +} + +.card_list .item.star5 img { + background: #885550; + background: linear-gradient(180deg,#885550,#c9a36a 53%); + width: 100%; + height: 70px; +} + +.card_list .item.star4 img { + background: #343659; + background: linear-gradient(180deg,#343659,#8a5fcc 53%); + width: 100%; + height: 70px; +} + +.card_list .item .num { + position: absolute; + top: 0px; + right: 0px; + z-index: 9; + font-size: 18px; + text-align: center; + color: #fff; + border-radius: 3px; + padding: 1px 5px; + border-radius: 3px; + background: rgb(0 0 0 / 50%); + font-family: "tttgbnumber"; +} + +.card_list .item .name, +.card_list .item .num_name { + position: absolute; + top: 71px; + left: 0px; + z-index: 9; + font-size: 12px; + text-align: center; + width: 100%; + height: 16px; + line-height: 18px; +} + +.card_list .item .num_name { + font-family: "tttgbnumber"; + font-size: 16px; +} + +.base_info { + position: relative; + padding-left: 10px; + margin: 5px 10px; +} + +.uid:before { + content: " "; + position: absolute; + width: 5px; + height: 24px; + border-radius: 1px; + left: 0; + top: 0; + background: #d3bc8d; +} + +.label_11 { + background-color: rgb(235 106 75); +} + +.label_12{ + background-color: #E69449; +} + +.label_1 { + background-color: #757CC8; +} + +.label { + color: #fff; + border-radius: 10px; + font-size: 12px; + padding: 2px 7px; + vertical-align: 2px; +} + +.ritem { + display: flex; + font-size: 12px; + margin-bottom: 5px; +} + +.info_role { + display: flex; + flex-wrap: wrap; + padding: 0 0px 5px 9px; +} + +.ritem .role { + width: 20px; + height: 20px; + background-color: #ffb285; + border-radius: 100%; +} + +.ritem .weapon_box { + overflow: hidden; + width: 20px; + height: 20px; + border-radius: 100%; +} + +.ritem .weapon { + width: 20px; + height: 20px; + background-color: #ffb285; + border-radius: 100%; + transform: scale(1.5); + -webkit-transform: scale(1.5); + +} + +.ritem .role_text { + margin: 2px 3px 0 2px; + display: flex; + align-items: baseline; +} + +.ritem .role_name { + width: 24px; + white-space: nowrap; + overflow: hidden; +} + +.ritem .role_num { + width: 24px; +} + +.line_box { + height: 32px; + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + font-size: 12px; + color: #7d7d7d; + padding-bottom: 5px; +} + +.line_box .line { + height: 2px; + flex-grow: 1; + background-color: #ebebeb; + margin: 0px 10px; +} + +.red { + color: #f21000; +} + +.orange { + color: #ff8d00; +} + +.green { + color: #12d88c; +} + +.blue { + color: #4169E1; +} + +.purple { + color: #7500ff; +} +.minimum{ + position: absolute; + top: 0px; + right: 0px; + z-index: 9; + font-size: 12px; + text-align: center; + color: #fff; + border-radius: 3px; + padding: 1px 3px; + background-color: rgb(0 0 0 / 80%); + font-family: "tttgbnumber"; +} +.hasMore{ + font-size: 12px; + margin: 6px 0; + color: #7f858a; +} + + +.gold { + background: #ffeb73; + color: #6f4b00; +} + +.good { + background: #168b2c; + color: #fff; +} + +.normal { + background: #6939b7; + color: #fff; +} + +.bad { + background: #9d3333; + color: #fff; +} diff --git a/plugins/genshin/resources/StarRail/html/gachaAllLog/gachaAllLog.html b/plugins/genshin/resources/StarRail/html/gachaAllLog/gachaAllLog.html new file mode 100644 index 0000000..3df1b01 --- /dev/null +++ b/plugins/genshin/resources/StarRail/html/gachaAllLog/gachaAllLog.html @@ -0,0 +1,78 @@ + + + + + + + + + {{@headStyle}} + + +
+ {{each data log}} +
+
+
+ ID: {{log.uid}} +
+

+ {{log.allNum}}抽 + {{log.typeName}}池 +

+ +
+
+
数据总览
+ {{each log.line val}} +
+ {{each val item}} +
+
{{item.num}}{{item.unit}}
+
{{item.lable}}
+
+ {{/each}} +
+ {{/each}} +
+ + 五星历史 {{firstTime}} ~ {{lastTime}} + +
+
+ {{each log.fiveLog val}} +
+ {{ if val.isUp && typeName == '角色' }} + UP + {{/if}} + {{ if val.isNull }} +
+
{{val.num}}
+ {{/if}} + {{ if !val.isNull }} + + +
{{val.num}}
+ {{/if}} +
+ {{/each}} +
+
+
+ {{/each}} + +
+ + + diff --git a/plugins/genshin/resources/html/gachaAllLog/gachaAllLog.html b/plugins/genshin/resources/html/gachaAllLog/gachaAllLog.html index e18bf92..3a79ea6 100644 --- a/plugins/genshin/resources/html/gachaAllLog/gachaAllLog.html +++ b/plugins/genshin/resources/html/gachaAllLog/gachaAllLog.html @@ -10,7 +10,7 @@ {{@headStyle}} -
+
{{each data log}}