修改悬浮按钮的显示

v1.0.0
于肖磊 2024-09-06 11:39:28 +08:00
parent 05684d09fd
commit be268f0aaf
1 changed files with 19 additions and 6 deletions

View File

@ -287,12 +287,25 @@ const model_class = computed(() => {
const model_style = computed(() => {
return (item: { id: string; key: string }) => {
// window.innerHeight() - 60() - 846()
const height = (window.innerHeight - 906) / 2;
let bottom = parseInt(float_bottom[item.id]) + height;
// 60 846-60 = 786
if (parseInt(float_bottom[item.id]) > 786) {
bottom = 786 + height;
// 40 60
const container_height = window.innerHeight - 100;
let bottom = 0;
if (container_height > 844) {
//
const height = (window.innerHeight - 906) / 2;
bottom = parseInt(float_bottom[item.id]) + height;
// 60 846-60 = 786
if (parseInt(float_bottom[item.id]) > 786) {
bottom = 786 + height;
}
} else {
//
const height = 20;
bottom = parseInt(float_bottom[item.id]) + height;
// 60 container_height-60
if (parseInt(float_bottom[item.id]) > container_height - 60) {
bottom = container_height - 60 + height;
}
}
return item.key == 'float-window' ? `bottom: ${((bottom / window.innerHeight) * 100).toFixed(4) + '%'};` : '';
};