|
@@ -321,6 +321,7 @@ export const addSubtitle = (data: AnimationModelSubtitle) => {
|
|
|
const show = ref(false);
|
|
|
const pixel = ref<Pos>();
|
|
|
const modelShow = ref(true)
|
|
|
+ const textShow = ref(true)
|
|
|
const stopLoad = watch(
|
|
|
() => {
|
|
|
const exists = am.subtitles.some(({ id }) => id === data.id);
|
|
@@ -344,6 +345,7 @@ export const addSubtitle = (data: AnimationModelSubtitle) => {
|
|
|
const cleanups = [
|
|
|
watchEffect(() => {
|
|
|
layer.innerHTML = data.content;
|
|
|
+ textShow.value = !!layer.textContent?.trim()?.length
|
|
|
size.value = {
|
|
|
width: layer.offsetWidth,
|
|
|
height: layer.offsetHeight,
|
|
@@ -362,7 +364,7 @@ export const addSubtitle = (data: AnimationModelSubtitle) => {
|
|
|
}),
|
|
|
watchEffect(() => {
|
|
|
layer.style.visibility =
|
|
|
- pixel.value && show.value && modelShow.value ? "visible" : "hidden";
|
|
|
+ pixel.value && show.value && modelShow.value && textShow.value ? "visible" : "hidden";
|
|
|
}),
|
|
|
watchEffect(() => {
|
|
|
if (pixel.value) {
|
|
@@ -393,6 +395,7 @@ export const addSubtitle = (data: AnimationModelSubtitle) => {
|
|
|
const stopAttrib = mergeFuns(
|
|
|
watch(
|
|
|
[
|
|
|
+ () => router.currentRoute.value.name,
|
|
|
currentTime,
|
|
|
() => amMap[getAMKey(am)]?.am,
|
|
|
size,
|
|
@@ -448,14 +451,13 @@ export const addSubtitle = (data: AnimationModelSubtitle) => {
|
|
|
export const endTime = computed(() => {
|
|
|
const amsEndTime = ams.value.map((am) => {
|
|
|
const endPoints = [
|
|
|
- ...am.frames,
|
|
|
+ ...am.frames.map(item => ({...item, duration: 0})),
|
|
|
...am.actions,
|
|
|
...am.subtitles,
|
|
|
...am.paths,
|
|
|
].map((item) => item.time + (item.duration || 0));
|
|
|
return Math.max(...endPoints);
|
|
|
});
|
|
|
- console.log("amsEndTime", amsEndTime, ams.value);
|
|
|
return (
|
|
|
Math.max(...amsEndTime) +
|
|
|
((animationGroup.delayEndTime && animationGroup.delayEndTime()) || 0)
|