-
${title}
+
@@ -98,11 +102,15 @@ export default class TourNavigator extends DocumentView
const titleDiv = this.getElementsByClassName("sv-title").item(0) as HTMLElement;
if(titleDiv)
{
- titleDiv.innerHTML = this.stepTitle;
+ //titleDiv.innerHTML = this.stepTitle;
if(this.firstRender) {
- setTimeout(() => {titleDiv.innerHTML = `
${this.stepTitle}
`;}, 100);
+ //setTimeout(() => {titleDiv.innerHTML = `
${this.stepTitle}
`;}, 100);
+ setTimeout(() => {titleDiv.innerText = this.stepTitle;}, 100);
this.firstRender = false;
}
+ else {
+ titleDiv.innerText = this.stepTitle;
+ }
}
}
@@ -124,8 +132,9 @@ export default class TourNavigator extends DocumentView
// go to previous tour step
this.tours.ins.previous.set();
- // reset direction of title text
- this.textDirHelper(true);
+ // cancel any existing animations
+ const titleDiv = this.querySelector("#title-inner") as HTMLElement;
+ titleDiv.classList.remove("sv-text-scroll");
}
protected onClickNext()
@@ -133,15 +142,14 @@ export default class TourNavigator extends DocumentView
// go to next tour step
this.tours.ins.next.set();
- // reset direction of title text
- this.textDirHelper(true);
+ // cancel any existing animations
+ const titleDiv = this.querySelector("#title-inner") as HTMLElement;
+ titleDiv.classList.remove("sv-text-scroll");
}
protected onClickTitle()
{
- // change direction of title text
- const titleDiv = this.querySelector("#title-text") as HTMLElement;
- this.textDirHelper(titleDiv.style.direction === "rtl");
+ this.textHelper();
}
/*protected focusActive()
@@ -181,8 +189,33 @@ export default class TourNavigator extends DocumentView
}
}
- protected textDirHelper(lToR: boolean) {
- const titleDiv = this.querySelector("#title-text") as HTMLElement;
- titleDiv.style.direction = lToR ? "ltr" : "rtl";
+ protected textHelper() {
+ const buffer = 12;
+ const titleDiv = this.querySelector("#title-inner") as HTMLElement;
+ const offset = titleDiv.scrollWidth - titleDiv.offsetWidth + buffer;
+
+ if(offset > buffer) {
+ const titleArea = this.querySelector("#title-area") as HTMLElement;
+ const duration = offset/30;
+
+ titleDiv.classList.remove("ff-ellipsis");
+
+ titleDiv.style.setProperty("animation-duration", duration.toString()+"s");
+ titleDiv.style.setProperty("--x-offset", "-" + offset + "px");
+ titleArea.style.setProperty("pointer-events", "none");
+ titleDiv.classList.add("sv-text-scroll");
+
+ titleDiv.addEventListener("animationend",() => {
+ titleDiv.classList.remove("sv-text-scroll");
+ titleDiv.classList.add("ff-ellipsis");
+ titleArea.style.setProperty("pointer-events", "auto");
+ });
+
+ titleDiv.addEventListener("animationcancel",() => {
+ titleDiv.classList.remove("sv-text-scroll");
+ titleDiv.classList.add("ff-ellipsis");
+ titleArea.style.setProperty("pointer-events", "auto");
+ });
+ }
}
}
\ No newline at end of file
diff --git a/source/client/ui/explorer/styles.scss b/source/client/ui/explorer/styles.scss
index 4fc0add0..289522fa 100644
--- a/source/client/ui/explorer/styles.scss
+++ b/source/client/ui/explorer/styles.scss
@@ -1064,12 +1064,18 @@ $tour-entry-indent: 12px;
}
.sv-title {
font-size: 1.1em;
+ @keyframes ticker { 100% { transform:translateX(var(--x-offset)); } }
}
.sv-text {
font-size: 0.9em;
}
}
+.sv-text-scroll {
+ animation:ticker 1s linear 1;
+ text-overflow: clip;
+}
+
////////////////////////////////////////////////////////////////////////////////
// TARGET NAVIGATOR