Add empty timeline support

This commit is contained in:
the1812 2020-02-17 14:29:40 +08:00
parent 54b04f502a
commit 99a3f6ec4c
8 changed files with 28 additions and 9 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@
"auto-continue.min.js": "96CD47C367D7397CE1467A69764409BAEFF16E8F535BC8E15523CD0B8A86687E",
"auto-draw.min.js": "AE72CF2623DF2D15AD4AF82D125FFAF7EF5B1E6B36D9E9AC646AC98AA6AA8698",
"auto-play.min.js": "DC9938AC15DADDC9D88DCA0C9BE64BE142C37D32CB85E42E23DAB2A7378531E5",
"bangumi-timeline.vue.min.js": "196BC0C07AF05A2E26E84D85C7CFB5C3E2620C927572C8C22070A1AEBB5B44B3",
"bangumi-timeline.vue.min.js": "89CF068C400BD7657EFE7BD7F8C80A0DA3E3B7B33606B212C0A8678939B5B303",
"batch-download.min.js": "862A3881DD8C246806FC3E640CF4058EDD3A86EF9C1D64B4E6F06704A7D9BA91",
"biliplus-redirect.min.js": "9882D14DAC5C103212A101A5168883C41B4B3B2737FD5F222DC343D0304FF8AF",
"blackboard.min.js": "8BB9CCDE72302AE7DE39D66F9231EFB82BA27DDA799BA4AAAC06F6DE802661BF",

Binary file not shown.

View File

@ -8,6 +8,7 @@
<div class="date">{{t.date}}</div>
<div class="day-of-week">{{t.dayOfWeekText}}</div>
</div>
<div class="empty-day" :class="{alt: t.isToday}" v-if="Object.entries(t.bangumis).length === 0"></div>
<div
class="time-container"
v-for="[time, bangumis] of Object.entries(t.bangumis)"
@ -102,6 +103,9 @@ export default {
return { time, timestamp: bangumis[0].timestamp, bangumis }
}
)
if (timestamps.length === 0) {
return
}
const recentTimestamps = timestamps.filter(it => it.timestamp < now)
// .pop()
if (recentTimestamps.length === 0) {
@ -126,7 +130,13 @@ export default {
timelineElement.scrollLeft += width
}
console.log(e, dateElement, dayElement, timelineElement)
console.log(width, width * 2, dayElement.offsetLeft, timelineElement.scrollLeft, offset)
console.log(
width,
width * 2,
dayElement.offsetLeft,
timelineElement.scrollLeft,
offset
)
},
async updateTimeline() {
try {
@ -319,6 +329,15 @@ export default {
}
}
}
.empty-day {
margin-top: 26px;
width: 246px;
height: 469px;
background: url('//s1.hdslb.com/bfs/static/bangumi-timeline/asserts/empty-1.png') no-repeat;
&.alt {
background: url('//s1.hdslb.com/bfs/static/bangumi-timeline/asserts/empty-2.png') no-repeat;
}
}
.time-container {
margin-top: 18px;
& > :not(:last-child) {