feat(弹幕组件): 优化弹幕循环逻辑并添加预加载功能
重构弹幕组件实现无缝循环播放,避免弹幕突然消失 添加预加载功能使弹幕在页面加载时就开始滚动 优化弹幕间距控制和淡出效果
Showing
3 changed files
with
4 additions
and
4 deletions
This diff is collapsed. Click to expand it.
| ... | @@ -124,8 +124,8 @@ | ... | @@ -124,8 +124,8 @@ |
| 124 | </view> | 124 | </view> |
| 125 | </view> | 125 | </view> |
| 126 | 126 | ||
| 127 | - <!-- 弹幕显示助力榜内容 --> | 127 | + <!-- 隐藏的弹幕组件,在页面加载时就开始滚动 --> |
| 128 | - <view v-if="activeTab === 'support'" class="danmu-section"> | 128 | + <view class="danmu-section" :style="{ visibility: activeTab === 'support' ? 'visible' : 'hidden', position: activeTab === 'support' ? 'static' : 'absolute', top: activeTab === 'support' ? 'auto' : '-9999px' }"> |
| 129 | <NativeDanmuComponent | 129 | <NativeDanmuComponent |
| 130 | :container-height="700" | 130 | :container-height="700" |
| 131 | :show-controls="true" | 131 | :show-controls="true" | ... | ... |
| ... | @@ -156,8 +156,8 @@ | ... | @@ -156,8 +156,8 @@ |
| 156 | 156 | ||
| 157 | </view> | 157 | </view> |
| 158 | 158 | ||
| 159 | - <!-- 弹幕显示助力榜内容 --> | 159 | + <!-- 隐藏的弹幕组件,在页面加载时就开始滚动 --> |
| 160 | - <view v-if="activeTab === 'support'" class="danmu-section mt-8"> | 160 | + <view class="danmu-section mt-8" :style="{ visibility: activeTab === 'support' ? 'visible' : 'hidden', position: activeTab === 'support' ? 'static' : 'absolute', top: activeTab === 'support' ? 'auto' : '-9999px' }"> |
| 161 | <NativeDanmuComponent | 161 | <NativeDanmuComponent |
| 162 | :container-height="1200" | 162 | :container-height="1200" |
| 163 | :show-controls="true" | 163 | :show-controls="true" | ... | ... |
-
Please register or login to post a comment