chore(弹幕组件): 调整速度计算
This commit is contained in:
parent
1d33741249
commit
2431cd6eae
@ -178,7 +178,7 @@ const getBarrageStyle = (item) => {
|
||||
const generateBarrageProps = (item) => {
|
||||
const textLength = item.content.length
|
||||
return {
|
||||
duration: Math.max(8 - textLength * 0.1, 5) * (100 / props.speed), // 弹幕项持续时间(每字符减少0.2秒,持续时间不低于5秒)
|
||||
duration: Math.min(5 + textLength * 0.1, 8) * (100 / props.speed), // 弹幕项持续时间(每字符增加0.2秒,持续时间不低于8秒)
|
||||
startPos: 0, // 弹幕项起始位置
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user