feat(qr): 添加二维码工具栏并优化交互体验

添加二维码编辑工具栏,支持透明度和缩放调整
优化选中状态和拖拽交互,增强用户体验
重构代码结构,提高可维护性
This commit is contained in:
Zhukj
2026-04-25 16:51:27 +08:00
parent 37aaec1e42
commit c7963cec6e
4 changed files with 363 additions and 99 deletions

View File

@@ -1,6 +1,6 @@
/* 二维码功能样式 */
/* 悬浮按钮 */
/* ========== 悬浮按钮 ========== */
#qr-btn {
position: fixed;
bottom: 100px;
@@ -29,7 +29,7 @@
background: #3a7bc8;
}
/* 弹窗 */
/* ========== 弹窗 ========== */
#qr-modal {
display: none;
position: fixed;
@@ -128,9 +128,32 @@
color: #fff;
}
/* 画布上的二维码 */
/* ========== 画布上的二维码 ========== */
.qr-item {
position: absolute;
cursor: move;
user-select: none;
touch-action: none;
}
/* 选中状态 */
.qr-item.qr-selected {
outline: 2px solid #4a90e2;
outline-offset: 2px;
}
/* ========== 二维码工具栏 - 与背景图工具栏保持一致 ========== */
.qr-tools {
display: none;
}
.qr-tools.active {
display: flex;
}
/* 数值显示固定宽度,单独占位 */
#qrOpacityValue, #qrScaleValue {
display: inline-block;
min-width: 40px;
text-align: center;
}