From 3cf75563a1484a577553d6cd8ebf5903746483ae Mon Sep 17 00:00:00 2001 From: Aluxes <39981645+AshenAshes@users.noreply.github.com> Date: Sun, 28 Jan 2024 02:12:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=9F=E9=93=81=E6=97=A5=E5=8E=86=E9=80=82?= =?UTF-8?q?=E9=85=8D=E8=99=9A=E6=9E=84=E5=8F=99=E4=BA=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wiki/CalendarSr.js | 68 ++++++++++++++++++--------- resources/wiki/calendar.css | 29 +++++++++--- resources/wiki/calendar.html | 40 +++++++++++----- resources/wiki/calendar.less | 31 +++++++++--- resources/wiki/imgs/abyss-1-icon.png | Bin 0 -> 6905 bytes resources/wiki/imgs/abyss-1.jpg | Bin 0 -> 25719 bytes resources/wiki/imgs/abyss-2-icon.png | Bin 0 -> 6546 bytes resources/wiki/imgs/abyss-2.jpg | Bin 0 -> 40590 bytes 8 files changed, 122 insertions(+), 46 deletions(-) create mode 100644 resources/wiki/imgs/abyss-1-icon.png create mode 100644 resources/wiki/imgs/abyss-1.jpg create mode 100644 resources/wiki/imgs/abyss-2-icon.png create mode 100644 resources/wiki/imgs/abyss-2.jpg diff --git a/apps/wiki/CalendarSr.js b/apps/wiki/CalendarSr.js index e2274b2d..adbfd338 100644 --- a/apps/wiki/CalendarSr.js +++ b/apps/wiki/CalendarSr.js @@ -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 }) }) diff --git a/resources/wiki/calendar.css b/resources/wiki/calendar.css index 9332e394..f7381fd9 100644 --- a/resources/wiki/calendar.css +++ b/resources/wiki/calendar.css @@ -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 */ \ No newline at end of file diff --git a/resources/wiki/calendar.html b/resources/wiki/calendar.html index 98c9a2eb..9330a19f 100644 --- a/resources/wiki/calendar.html +++ b/resources/wiki/calendar.html @@ -26,14 +26,14 @@ {{each dateList d}}{{each d.date dn}}
q3Z|MJAIVzka6t4Ilp} iKcAH-d4U!E&1`ck;?
zCLfXzsy)2eitnx^mc41;;<=7n@48I=(kXwlRigF7n#kqq@=z4_^W?;
zw{u6?5c@iMyhY1uac=%lHq)%ICanXy++euu4Numw
Bp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