mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 18:41:20 -08:00
更新弹幕demo
This commit is contained in:
1 parent
e8d721f92f
commit
c3f092dc2a
5 files changed
+218
-95
No files matched your search
@@ -85,12 +85,12 @@ export default class Danmuku {
|
||||
const { clientHeight } = this.$player;
|
||||
|
||||
if (typeof value === 'number') {
|
||||
return clamp(value, 10, clientHeight);
|
||||
return clamp(value, 0, clientHeight);
|
||||
}
|
||||
|
||||
if (typeof value === 'string' && value.endsWith('%')) {
|
||||
const ratio = parseFloat(value) / 100;
|
||||
return clamp(clientHeight * ratio, 10, clientHeight);
|
||||
return clamp(clientHeight * ratio, 0, clientHeight);
|
||||
}
|
||||
|
||||
return Danmuku.option.margin[0];
|
||||
@@ -102,12 +102,12 @@ export default class Danmuku {
|
||||
const { clientHeight } = this.$player;
|
||||
|
||||
if (typeof value === 'number') {
|
||||
return clamp(value, 10, clientHeight);
|
||||
return clamp(value, 0, clientHeight);
|
||||
}
|
||||
|
||||
if (typeof value === 'string' && value.endsWith('%')) {
|
||||
const ratio = parseFloat(value) / 100;
|
||||
return clamp(clientHeight * ratio, 10, clientHeight);
|
||||
return clamp(clientHeight * ratio, 0, clientHeight);
|
||||
}
|
||||
|
||||
return Danmuku.option.margin[1];
|
||||
|
||||
Reference in new issue
Block a user