tweak(wish-tree): 弹幕改为自然首尾相接,不再一行一条
Publish Mini Program Dev Version / publish (push) Successful in 1m3s

- 顶部行 12%→14%,树桩3行 68/73/78→70/73/76(间隔3%)
- 核心:从'一行同一时刻只一条'改为'前一条完全进入屏幕后就出下一条'
  同一时刻屏上可有多条,但首尾相接不重叠,更接近真实弹幕
- 每行发射定时器间隔=duration*0.35(完全进入屏幕约需飘总路程35%)
- 弹幕播完后从列表移除,stop时清空屏上弹幕避免残留
This commit is contained in:
gouki
2026-08-10 21:28:47 +00:00
parent f468cf4b94
commit a45004bfb2
2 changed files with 52 additions and 35 deletions
+7 -7
View File
@@ -45,14 +45,14 @@
</swiper-item>
</swiper>
<!-- 弹幕层(超出30条的心愿缓缓飘过,每行一条完毕再出下一条) -->
<!-- 弹幕层(超出30条的心愿缓缓飘过,一条完全进入后出下一条) -->
<view class="danmaku-layer">
<block wx:for="{{currentDanmaku}}" wx:key="key" wx:if="{{item}}">
<view
class="danmaku-item {{item.type === 'paid' ? 'paid' : ''}}"
style="top: {{item.top}}%; animation-duration: {{item.duration}}s;"
>{{item.content}} · {{item.author}}</view>
</block>
<view
wx:for="{{currentDanmaku}}"
wx:key="key"
class="danmaku-item {{item.type === 'paid' ? 'paid' : ''}}"
style="top: {{item.top}}%; animation-duration: {{item.duration}}s;"
>{{item.content}} · {{item.author}}</view>
</view>
<!-- 边缘暗角 -->