星铁日历适配虚构叙事

This commit is contained in:
Aluxes 2024-01-28 02:12:02 +08:00
parent 3b42f79222
commit 3cf75563a1
8 changed files with 122 additions and 46 deletions

View File

@ -14,7 +14,7 @@ const ignoreIds = [
171 // 《崩坏:星穹铁道》社区专属工具一览 171 // 《崩坏:星穹铁道》社区专属工具一览
] ]
const ignoreReg = /(更新概览|游戏优化|优化说明|内容专题页|版本更新说明|循星归程|调研|防沉迷|米游社|专项意见|更新修复与优化|问卷调查|版本更新通知|更新时间说明|预下载功能|周边限时|周边上新|角色演示|角色PV|版本PV|动画短片|bilibili|激励计划|调整说明|攻略征集)/ const ignoreReg = /(更新概览|游戏优化|优化说明|内容专题页|专题展示页|版本更新说明|循星归程|调研|防沉迷|米游社|专项意见|更新修复与优化|问卷调查|版本更新通知|更新时间说明|预下载功能|周边限时|周边上新|角色演示|角色PV|版本PV|动画短片|bilibili|激励计划|调整说明|攻略征集|测试招募)/
let CalSr = { let CalSr = {
async reqCalData () { async reqCalData () {
@ -113,28 +113,53 @@ let CalSr = {
getAbyssCal (s1, e1, versionStartTime) { getAbyssCal (s1, e1, versionStartTime) {
let check = [] let check = []
let f = 'YYYY-MM-DD HH:mm:ss' 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 abyss1Start = moment(versionStartTime, 'YYYY-MM-DD HH:mm:ss').subtract(2, 'days').hours(4).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)
check.push([moment(abyss0Start), moment(abyss0End)]) if (newAbyssStart.diff(abyss1Start, 'days') % 14 !== 0) {
check.push([moment(abyss1Start), moment(abyss1End)]) abyss1Start = moment(abyss1Start).subtract(7, 'days').format(f)
check.push([moment(abyss2Start), moment(abyss2End)]) }
check.push([moment(abyss3Start), moment(abyss3End)])
check.push([moment(abyss4Start), moment(abyss4End)]) 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 = [] let ret = []
lodash.forEach(check, (ds) => { lodash.forEach(check, (ds) => {
let [s2, e2] = 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) ret.push(ds)
} }
}) })
@ -142,14 +167,14 @@ let CalSr = {
}, },
getList (ds, target, { startTime, endTime, totalRange, now, timeMap = {}, gachaImgs = [] }) { 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 id = ds.ann_id
let title = ds.title let title = ds.title
let banner = ds.banner let banner = ds.banner
let extra = { sort: 5 } let extra = { sort: 5 }
let detail = timeMap[id] || {} let detail = timeMap[id] || {}
if (ignoreIds.includes(id) || ignoreReg.test(title)) { if (!title || ignoreIds.includes(id) || ignoreReg.test(title)) {
return true return true
} }
if (/流光定影/.test(title)) { if (/流光定影/.test(title)) {
@ -235,9 +260,10 @@ let CalSr = {
let abyssCal = CalSr.getAbyssCal(dateList.startTime, dateList.endTime, versionStartTime) let abyssCal = CalSr.getAbyssCal(dateList.startTime, dateList.endTime, versionStartTime)
lodash.forEach(abyssCal, (t) => { lodash.forEach(abyssCal, (t) => {
CalSr.getList({ CalSr.getList({
title: '「混沌回忆」', title: t[2],
start_time: t[0].format('YYYY-MM-DD HH:mm'), 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 }) }, abyss, { ...dateList, now })
}) })

View File

@ -290,16 +290,34 @@ body {
height: 80px; height: 80px;
position: relative; position: relative;
} }
.cal-abyss-cont .cal-item { .cal-abyss-cont .type-abyss {
border-radius: 0; background: url("imgs/abyss.jpg") #333465 top right no-repeat;
background: url("./imgs/abyss.jpg") #333465 top right no-repeat;
position: absolute;
} }
.cal-abyss-cont .cal-item .info { .cal-abyss-cont .type-abyss .info {
background: none; background: none;
color: #d3bc8d; color: #d3bc8d;
background-image: linear-gradient(to right, #333465, #333465 80%, rgba(51, 52, 101, 0) 100%); 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 { .cal-abyss-cont .cal-item:before {
content: ""; content: "";
display: block; display: block;
@ -450,4 +468,3 @@ body {
.daily-talent .card .banner.city-5 .line { .daily-talent .card .banner.city-5 .line {
background: #557dd6; background: #557dd6;
} }
/*# sourceMappingURL=calendar.css.map */

View File

@ -26,14 +26,14 @@
{{each dateList d}}{{each d.date dn}} {{each dateList d}}{{each d.date dn}}
<td class="line {{dn === nowDate ? 'current-date':''}}"> <td class="line {{dn === nowDate ? 'current-date':''}}">
{{if game === 'gs'}} {{if game === 'gs'}}
{{each charBirth[`${d.month}-${dn}`] char}} {{each charBirth[`${d.month}-${dn}`] char}}
<div class="card"> <div class="card">
<div class="item-icon star{{char.star}}"> <div class="item-icon star{{char.star}}">
<div class="img" style="background-image:url({{_res_path}}{{char.face}})"></div> <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> <span class="char-name">{{char.name.length>=4?char.name:`${char.name}生日`}}</span>
</div>
</div> </div>
</div> {{/each}}
{{/each}}
{{/if}} {{/if}}
</td> </td>
{{/each}} {{/each}} {{/each}} {{/each}}
@ -51,17 +51,31 @@
</table> </table>
</div> </div>
<div class="cal-list {{charMode}} char-num-{{charNum}}"> <div class="cal-list {{charMode}} char-num-{{charNum}}">
{{if game === 'gs'}}
<div class="cal-abyss-cont"> <div class="cal-abyss-cont">
{{each abyss li}} {{each abyss li}}
<div class="cal-item type-abyss" style="{{`left:${li.left}%;width:${li.width}%`}}"> <div class="cal-item type-abyss" style="{{`left:${li.left}%;width:${li.width}%;`}}">
<div class="info"> <div class="info">
<img src="{{_res_path}}/wiki/imgs/abyss-icon.png" class="cal-icon"/> <img src="{{_res_path}}/wiki/imgs/abyss-icon.png" class="cal-icon"/>
<strong>{{li.title}}</strong> <strong>{{li.title}}</strong>
<span>{{li.label}}</span> <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>
</div> </div>
{{/each}} {{/each}}
</div> {{/if}}
{{each list lis}} {{each list lis}}
{{each lis li idx}} {{each lis li idx}}
<div <div

View File

@ -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) { .linear-bg(@color) {
background-image: linear-gradient(to right, @color, @color 80%, fade(@color, 0) 100%); background-image: linear-gradient(to right, @color, @color 80%, fade(@color, 0) 100%);
@ -380,16 +380,36 @@ body {
height: 80px; height: 80px;
position: relative; position: relative;
.cal-item { .type-abyss {
border-radius: 0;
background: url("./imgs/abyss.jpg") #333465 top right no-repeat; background: url("./imgs/abyss.jpg") #333465 top right no-repeat;
position: absolute;
.info { .info {
background: none; background: none;
color: rgba(211, 188, 141, 1); color: rgba(211, 188, 141, 1);
.linear-bg(#333465); .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 { &:before {
content: ""; content: "";
@ -401,7 +421,6 @@ body {
position: absolute; position: absolute;
background: #d3bc8d; background: #d3bc8d;
z-index: 8; z-index: 8;
} }
&:after { &:after {

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB