fix: 调整图文工具栏布局,解决顶部遮挡问题,图片透明度滑块添加百分比

This commit is contained in:
Zhukj
2026-04-18 15:04:04 +08:00
parent 22ba7dd6a3
commit feef470096
4 changed files with 7 additions and 2 deletions

View File

@@ -18,6 +18,7 @@
const textTools = document.getElementById('textTools');
const imageTools = document.getElementById('imageTools');
const opacitySlider = document.getElementById('opacitySlider');
const opacityValue = document.getElementById('opacityValue');
const boldBtn = document.getElementById('boldBtn');
const italicBtn = document.getElementById('italicBtn');
const colorPicker = document.getElementById('colorPicker');
@@ -108,6 +109,7 @@
opacitySlider.addEventListener('input', (e) => {
if (selectedOverlay) {
selectedOverlay.style.opacity = e.target.value / 100;
opacityValue.textContent = e.target.value + '%';
}
});
@@ -525,6 +527,7 @@
// 更新透明度滑块为当前层叠图的透明度
const currentOpacity = overlayEl.style.opacity || '1';
opacitySlider.value = parseFloat(currentOpacity) * 100;
opacityValue.textContent = opacitySlider.value + '%';
}
// 计算图片滑动边界