wip
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
soraefir
2025-03-04 01:45:28 +01:00
parent 82aed417e6
commit 974d0354b4
8 changed files with 170 additions and 21 deletions

View File

@ -22,7 +22,7 @@ const app = new Vue({
query: {
type: "", res: [], load: false, sub: false, note: false, drawer: false,
},
leg_nav: {
nav: {
scrollInterval: null,
scrollDir: null
},
@ -215,9 +215,9 @@ const app = new Vue({
sideScroll: function (element, direction, speed, step) {
this.leg_nav.scrollDir = direction
this.nav.scrollDir = direction
if (direction == 'none') return;
this.leg_nav.scrollInterval = setInterval(() => {
this.nav.scrollInterval = setInterval(() => {
element.scrollLeft += (direction == 'left') ? -step : step;
}, speed);
},
@ -228,27 +228,33 @@ const app = new Vue({
},
focus_leg(idx) {
const c = document.querySelector('.scroll-content')
const c = document.querySelector('.scroll-content.nav-leg')
const item = c.children[(idx != undefined ? idx : this.journey.sel_leg) + 1];
c.scrollLeft = item.offsetLeft + (item.offsetWidth / 2) - c.offsetWidth / 2
},
focus_day(idx) {
const c = document.querySelector('.scroll-content.nav-day')
const item = c.children[(idx != undefined ? idx : this.journey.sel_day) + 1];
c.scrollLeft = item.offsetLeft + (item.offsetWidth / 2) - c.offsetWidth / 2;
this.focus_leg()
},
nav_mousemove(e) {
if (e.pointerType != 'mouse') return;
const c = document.querySelector('.scroll-content')
const c = e.target.closest('.scroll-content') || e.target.firstChild;
const left = e.pageX - c.getBoundingClientRect().left;
const newDir =
left < c.offsetWidth * 0.1 ? 'left' :
(left > c.offsetWidth * 0.9 ? 'right' : 'none')
if (!this.leg_nav.scrollInterval || this.leg_nav.scrollDir != newDir) {
if (this.leg_nav.scrollInterval) clearInterval(this.leg_nav.scrollInterval)
if (!this.nav.scrollInterval || this.nav.scrollDir != newDir) {
if (this.nav.scrollInterval) clearInterval(this.nav.scrollInterval)
this.sideScroll(c, newDir, 25, 10);
}
},
nav_mouseleave(e) {
clearInterval(this.leg_nav.scrollInterval);
this.leg_nav.scrollDir = 'none'
this.leg_nav.scrollInterval = null
clearInterval(this.nav.scrollInterval);
this.nav.scrollDir = 'none'
this.nav.scrollInterval = null
},
refreshTextAreaHeight(event) {

View File

@ -8,6 +8,7 @@ function migrate_A_to_0(e: journey): journey {
v.day_title = v.day_title || (v as any).step_title;
v.places.activities = v.places.activities || (v as any).places.places;
v.travel = v.travel || [];
v.day_title = typeof (v.day_title) == "string" ? [v.day_title] : []
})
console.log(e)
return e;

View File

@ -56,6 +56,10 @@ class journey_wrapper {
this.sel_leg = Math.max(this.sel_leg - 1, 0);
this.sel_day = 0;
}
day_sel(idx: number): void {
this.sel_day = idx;
}
day_next() {
this.sel_day += 1
if (this.sel_day > this.leg_len() - 1) {