diff --git a/css/qr.css b/css/qr.css new file mode 100644 index 0000000..fe0dc40 --- /dev/null +++ b/css/qr.css @@ -0,0 +1,136 @@ +/* 二维码功能样式 */ + +/* 悬浮按钮 */ +#qr-btn { + position: fixed; + bottom: 100px; + left: 20px; + width: 44px; + height: 44px; + padding: 0; + border-radius: 50%; + background: #4a90e2; + color: #fff; + border: none; + font-size: 12px; + font-weight: bold; + cursor: pointer; + box-shadow: 0 2px 8px rgba(0,0,0,0.3); + z-index: 1000; + display: none; + white-space: nowrap; +} + +#qr-btn.show { + display: block; +} + +#qr-btn:hover { + background: #3a7bc8; +} + +/* 弹窗 */ +#qr-modal { + display: none; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0,0,0,0.5); + z-index: 10000; + justify-content: center; + align-items: center; +} + +#qr-modal.active { + display: flex; +} + +.qr-box { + background: #fff; + border-radius: 8px; + width: 320px; + max-width: 90%; +} + +.qr-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px 20px; + border-bottom: 1px solid #eee; +} + +.qr-header h3 { + margin: 0; + font-size: 16px; +} + +.qr-close { + background: none; + border: none; + font-size: 24px; + color: #999; + cursor: pointer; +} + +.qr-body { + padding: 20px; +} + +#qr-input { + width: 100%; + padding: 10px; + border: 1px solid #ddd; + border-radius: 4px; + font-size: 14px; + box-sizing: border-box; +} + +#qr-preview { + margin-top: 15px; + min-height: 128px; + display: flex; + justify-content: center; + align-items: center; + background: #f5f5f5; + border-radius: 4px; +} + +#qr-preview canvas { + display: block; +} + +.qr-footer { + display: flex; + justify-content: flex-end; + gap: 10px; + padding: 15px 20px; + border-top: 1px solid #eee; +} + +.qr-btn { + padding: 8px 16px; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 14px; +} + +.qr-cancel { + background: #f0f0f0; + color: #333; +} + +.qr-ok { + background: #4a90e2; + color: #fff; +} + +/* 画布上的二维码 */ +.qr-item { + position: absolute; + cursor: move; + user-select: none; +} diff --git a/index.html b/index.html index 6da74b6..b6d58ce 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@