Fixed Ducking. Refined UI.
This commit is contained in:
@@ -203,12 +203,13 @@ class PlaybackCoordinatorModule extends BaseModule {
|
||||
animQueue.schedule(() => {
|
||||
const word = wordElements[i];
|
||||
const duration = Math.max(0, timing.duration || 0);
|
||||
const transitionDuration = `${duration}ms`;
|
||||
|
||||
word.style.transition = `opacity ${transitionDuration} linear, transform ${transitionDuration} ease-out`;
|
||||
word.style.transition = 'none';
|
||||
word.style.animation = 'none';
|
||||
word.style.visibility = 'visible';
|
||||
word.style.opacity = '1';
|
||||
word.style.transform = 'translateY(0)';
|
||||
word.style.clipPath = 'inset(0 100% 0 0)';
|
||||
word.style.animation = `wordReveal ${duration}ms linear forwards`;
|
||||
}, timing.delay);
|
||||
}
|
||||
});
|
||||
@@ -309,8 +310,10 @@ class PlaybackCoordinatorModule extends BaseModule {
|
||||
if (this.currentSentence.element) {
|
||||
const wordElements = this.currentSentence.element.querySelectorAll('.word');
|
||||
wordElements.forEach(word => {
|
||||
word.style.animation = 'none';
|
||||
word.style.opacity = '1';
|
||||
word.style.transform = 'translateY(0)';
|
||||
word.style.clipPath = 'inset(0 0 0 0)';
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -338,6 +341,9 @@ class PlaybackCoordinatorModule extends BaseModule {
|
||||
|
||||
this.isPlaying = false;
|
||||
this.currentSentence = null;
|
||||
document.dispatchEvent(new CustomEvent('tts:playback-end', {
|
||||
detail: { reason: 'playback-coordinator-stop' }
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user