mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
星铁日历适配虚构叙事
This commit is contained in:
parent
3b42f79222
commit
3cf75563a1
@ -14,7 +14,7 @@ const ignoreIds = [
|
||||
171 // 《崩坏:星穹铁道》社区专属工具一览
|
||||
]
|
||||
|
||||
const ignoreReg = /(更新概览|游戏优化|优化说明|内容专题页|版本更新说明|循星归程|调研|防沉迷|米游社|专项意见|更新修复与优化|问卷调查|版本更新通知|更新时间说明|预下载功能|周边限时|周边上新|角色演示|角色PV|版本PV|动画短片|bilibili|激励计划|调整说明|攻略征集)/
|
||||
const ignoreReg = /(更新概览|游戏优化|优化说明|内容专题页|专题展示页|版本更新说明|循星归程|调研|防沉迷|米游社|专项意见|更新修复与优化|问卷调查|版本更新通知|更新时间说明|预下载功能|周边限时|周边上新|角色演示|角色PV|版本PV|动画短片|bilibili|激励计划|调整说明|攻略征集|测试招募)/
|
||||
|
||||
let CalSr = {
|
||||
async reqCalData () {
|
||||
@ -113,28 +113,53 @@ let CalSr = {
|
||||
getAbyssCal (s1, e1, versionStartTime) {
|
||||
let check = []
|
||||
let f = 'YYYY-MM-DD HH:mm:ss'
|
||||
let newAbyssStart = moment('2023-12-25 04:00:00')
|
||||
|
||||
let abyss1Start = moment(versionStartTime, 'YYYY-MM-DD HH:mm:ss').subtract(2, 'days').add(4, 'hours').format(f)
|
||||
let abyss1End = moment(abyss1Start).add(14, 'days').format(f)
|
||||
let abyss2Start = abyss1End
|
||||
let abyss2End = moment(abyss2Start).add(14, 'days').format(f)
|
||||
let abyss3Start = abyss2End
|
||||
let abyss3End = moment(abyss3Start).add(14, 'days').format(f)
|
||||
let abyss4Start = abyss3End
|
||||
let abyss4End = moment(abyss4Start).add(14, 'days').format(f)
|
||||
let abyss0End = abyss1Start
|
||||
let abyss0Start = moment(abyss0End).subtract(14, 'days').format(f)
|
||||
let abyss1Start = moment(versionStartTime, 'YYYY-MM-DD HH:mm:ss').subtract(2, 'days').hours(4).format(f)
|
||||
|
||||
check.push([moment(abyss0Start), moment(abyss0End)])
|
||||
check.push([moment(abyss1Start), moment(abyss1End)])
|
||||
check.push([moment(abyss2Start), moment(abyss2End)])
|
||||
check.push([moment(abyss3Start), moment(abyss3End)])
|
||||
check.push([moment(abyss4Start), moment(abyss4End)])
|
||||
if (newAbyssStart.diff(abyss1Start, 'days') % 14 !== 0) {
|
||||
abyss1Start = moment(abyss1Start).subtract(7, 'days').format(f)
|
||||
}
|
||||
|
||||
let abyss1End = moment(abyss1Start).add(42, 'days').format(f)
|
||||
let abyss2Start = moment(abyss1Start).add(14, 'days').format(f)
|
||||
let abyss2End = moment(abyss2Start).add(42, 'days').format(f)
|
||||
let abyss3Start = moment(abyss2Start).add(14, 'days').format(f)
|
||||
let abyss3End = moment(abyss3Start).add(42, 'days').format(f)
|
||||
let abyss4Start = moment(abyss3Start).add(14, 'days').format(f)
|
||||
let abyss4End = moment(abyss4Start).add(42, 'days').format(f)
|
||||
let abyss5Start = moment(abyss4Start).add(14, 'days').format(f)
|
||||
let abyss5End = moment(abyss5Start).add(42, 'days').format(f)
|
||||
|
||||
let abyss0Start = moment(abyss1Start).subtract(14, 'days').format(f)
|
||||
let abyss0End = moment(abyss0Start).add(42, 'days').format(f)
|
||||
let abyssB1Start = moment(abyss0Start).subtract(14, 'days').format(f)
|
||||
let abyssB1End = moment(abyssB1Start).add(42, 'days').format(f)
|
||||
|
||||
let title1 = '「混沌回忆」'
|
||||
let title2 = '「虚构叙事」'
|
||||
let exchange = true
|
||||
let diff = newAbyssStart.diff(abyss0Start, 'days')
|
||||
if (diff >= 0 && diff % 14 === 0) {
|
||||
exchange = false
|
||||
}
|
||||
if (exchange) {
|
||||
[title1, title2] = [title2, title1]
|
||||
}
|
||||
|
||||
check.push([moment(abyssB1Start), moment(abyssB1End), title1])
|
||||
check.push([moment(abyss0Start), moment(abyss0End), title2])
|
||||
check.push([moment(abyss1Start), moment(abyss1End), title1])
|
||||
check.push([moment(abyss2Start), moment(abyss2End), title2])
|
||||
check.push([moment(abyss3Start), moment(abyss3End), title1])
|
||||
check.push([moment(abyss4Start), moment(abyss4End), title2])
|
||||
check.push([moment(abyss5Start), moment(abyss5End), title1])
|
||||
|
||||
let ret = []
|
||||
lodash.forEach(check, (ds) => {
|
||||
let [s2, e2] = ds
|
||||
if ((s2 <= s1 && s1 <= e2) || (s2 <= e1 && e1 <= e2)) {
|
||||
let now = moment()
|
||||
if ((s2 <= now && now <= e2) || (now <= s2 && s2 <= e1)) {
|
||||
ret.push(ds)
|
||||
}
|
||||
})
|
||||
@ -142,14 +167,14 @@ let CalSr = {
|
||||
},
|
||||
|
||||
getList (ds, target, { startTime, endTime, totalRange, now, timeMap = {}, gachaImgs = [] }) {
|
||||
let type = 'activity'
|
||||
let type = ds.abyssType ? ds.abyssType : 'activity'
|
||||
let id = ds.ann_id
|
||||
let title = ds.title
|
||||
let banner = ds.banner
|
||||
let extra = { sort: 5 }
|
||||
let detail = timeMap[id] || {}
|
||||
|
||||
if (ignoreIds.includes(id) || ignoreReg.test(title)) {
|
||||
if (!title || ignoreIds.includes(id) || ignoreReg.test(title)) {
|
||||
return true
|
||||
}
|
||||
if (/流光定影/.test(title)) {
|
||||
@ -235,9 +260,10 @@ let CalSr = {
|
||||
let abyssCal = CalSr.getAbyssCal(dateList.startTime, dateList.endTime, versionStartTime)
|
||||
lodash.forEach(abyssCal, (t) => {
|
||||
CalSr.getList({
|
||||
title: '「混沌回忆」',
|
||||
title: t[2],
|
||||
start_time: t[0].format('YYYY-MM-DD HH:mm'),
|
||||
end_time: t[1].format('YYYY-MM-DD HH:mm')
|
||||
end_time: t[1].format('YYYY-MM-DD HH:mm'),
|
||||
abyssType: t[2] === '「混沌回忆」' ? 'abyss-1' : 'abyss-2'
|
||||
}, abyss, { ...dateList, now })
|
||||
})
|
||||
|
||||
|
@ -290,16 +290,34 @@ body {
|
||||
height: 80px;
|
||||
position: relative;
|
||||
}
|
||||
.cal-abyss-cont .cal-item {
|
||||
border-radius: 0;
|
||||
background: url("./imgs/abyss.jpg") #333465 top right no-repeat;
|
||||
position: absolute;
|
||||
.cal-abyss-cont .type-abyss {
|
||||
background: url("imgs/abyss.jpg") #333465 top right no-repeat;
|
||||
}
|
||||
.cal-abyss-cont .cal-item .info {
|
||||
.cal-abyss-cont .type-abyss .info {
|
||||
background: none;
|
||||
color: #d3bc8d;
|
||||
background-image: linear-gradient(to right, #333465, #333465 80%, rgba(51, 52, 101, 0) 100%);
|
||||
}
|
||||
.cal-abyss-cont .type-abyss-1 {
|
||||
background: url("imgs/abyss-1.jpg") #0f0829 top right no-repeat;
|
||||
}
|
||||
.cal-abyss-cont .type-abyss-1 .info {
|
||||
background: none;
|
||||
color: #d3bc8d;
|
||||
background-image: linear-gradient(to right, #0f0829, #0f0829 80%, rgba(15, 8, 41, 0) 100%);
|
||||
}
|
||||
.cal-abyss-cont .type-abyss-2 {
|
||||
background: url("imgs/abyss-2.jpg") #16202a top right no-repeat;
|
||||
}
|
||||
.cal-abyss-cont .type-abyss-2 .info {
|
||||
background: none;
|
||||
color: #d3bc8d;
|
||||
background-image: linear-gradient(to right, #16202a, #16202a 80%, rgba(22, 32, 42, 0) 100%);
|
||||
}
|
||||
.cal-abyss-cont .cal-item {
|
||||
border-radius: 0;
|
||||
position: absolute;
|
||||
}
|
||||
.cal-abyss-cont .cal-item:before {
|
||||
content: "";
|
||||
display: block;
|
||||
@ -450,4 +468,3 @@ body {
|
||||
.daily-talent .card .banner.city-5 .line {
|
||||
background: #557dd6;
|
||||
}
|
||||
/*# sourceMappingURL=calendar.css.map */
|
@ -26,14 +26,14 @@
|
||||
{{each dateList d}}{{each d.date dn}}
|
||||
<td class="line {{dn === nowDate ? 'current-date':''}}">
|
||||
{{if game === 'gs'}}
|
||||
{{each charBirth[`${d.month}-${dn}`] char}}
|
||||
<div class="card">
|
||||
<div class="item-icon star{{char.star}}">
|
||||
<div class="img" style="background-image:url({{_res_path}}{{char.face}})"></div>
|
||||
<span class="char-name">{{char.name.length>=4?char.name:`${char.name}生日`}}</span>
|
||||
{{each charBirth[`${d.month}-${dn}`] char}}
|
||||
<div class="card">
|
||||
<div class="item-icon star{{char.star}}">
|
||||
<div class="img" style="background-image:url({{_res_path}}{{char.face}})"></div>
|
||||
<span class="char-name">{{char.name.length>=4?char.name:`${char.name}生日`}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</td>
|
||||
{{/each}} {{/each}}
|
||||
@ -51,17 +51,31 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="cal-list {{charMode}} char-num-{{charNum}}">
|
||||
{{if game === 'gs'}}
|
||||
<div class="cal-abyss-cont">
|
||||
{{each abyss li}}
|
||||
<div class="cal-item type-abyss" style="{{`left:${li.left}%;width:${li.width}%`}}">
|
||||
<div class="info">
|
||||
<img src="{{_res_path}}/wiki/imgs/abyss-icon.png" class="cal-icon"/>
|
||||
<strong>{{li.title}}</strong>
|
||||
<span>{{li.label}}</span>
|
||||
<div class="cal-item type-abyss" style="{{`left:${li.left}%;width:${li.width}%;`}}">
|
||||
<div class="info">
|
||||
<img src="{{_res_path}}/wiki/imgs/abyss-icon.png" class="cal-icon"/>
|
||||
<strong>{{li.title}}</strong>
|
||||
<span>{{li.label}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{each abyss li}}
|
||||
<div class="cal-abyss-cont">
|
||||
<div class="cal-item type-{{li.type}}" style="{{`left:${li.left}%;width:${li.width}%;`}}">
|
||||
<div class="info">
|
||||
<img src="{{_res_path}}/wiki/imgs/{{li.type}}-icon.png" class="cal-icon" />
|
||||
<strong>{{li.title}}</strong>
|
||||
<span>{{li.label}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{each list lis}}
|
||||
{{each lis li idx}}
|
||||
<div
|
||||
|
@ -1,4 +1,4 @@
|
||||
//linear-gradient(to right, rgba(232, 226, 216, 1), rgba(232, 226, 216, 1) 80%, rgba(232, 226, 216, 0) 100%);
|
||||
// linear-gradient(to right, rgba(232, 226, 216, 1), rgba(232, 226, 216, 1) 80%, rgba(232, 226, 216, 0) 100%);
|
||||
|
||||
.linear-bg(@color) {
|
||||
background-image: linear-gradient(to right, @color, @color 80%, fade(@color, 0) 100%);
|
||||
@ -380,16 +380,36 @@ body {
|
||||
height: 80px;
|
||||
position: relative;
|
||||
|
||||
.cal-item {
|
||||
border-radius: 0;
|
||||
.type-abyss {
|
||||
background: url("./imgs/abyss.jpg") #333465 top right no-repeat;
|
||||
position: absolute;
|
||||
|
||||
.info {
|
||||
background: none;
|
||||
color: rgba(211, 188, 141, 1);
|
||||
.linear-bg(#333465);
|
||||
}
|
||||
}
|
||||
|
||||
.type-abyss-1 {
|
||||
background: url("./imgs/abyss-1.jpg") #0f0829 top right no-repeat;
|
||||
.info {
|
||||
background: none;
|
||||
color: rgba(211, 188, 141, 1);
|
||||
.linear-bg(#0f0829);
|
||||
}
|
||||
}
|
||||
|
||||
.type-abyss-2 {
|
||||
background: url("./imgs/abyss-2.jpg") #16202a top right no-repeat;
|
||||
.info {
|
||||
background: none;
|
||||
color: rgba(211, 188, 141, 1);
|
||||
.linear-bg(#16202a);
|
||||
}
|
||||
}
|
||||
|
||||
.cal-item {
|
||||
border-radius: 0;
|
||||
position: absolute;
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
@ -401,7 +421,6 @@ body {
|
||||
position: absolute;
|
||||
background: #d3bc8d;
|
||||
z-index: 8;
|
||||
|
||||
}
|
||||
|
||||
&:after {
|
||||
|
BIN
resources/wiki/imgs/abyss-1-icon.png
Normal file
BIN
resources/wiki/imgs/abyss-1-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
BIN
resources/wiki/imgs/abyss-1.jpg
Normal file
BIN
resources/wiki/imgs/abyss-1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
BIN
resources/wiki/imgs/abyss-2-icon.png
Normal file
BIN
resources/wiki/imgs/abyss-2-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.4 KiB |
BIN
resources/wiki/imgs/abyss-2.jpg
Normal file
BIN
resources/wiki/imgs/abyss-2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
Loading…
Reference in New Issue
Block a user