0.0.59
This commit is contained in:
parent
00c1797e5d
commit
f4938d2e59
@ -2060,7 +2060,7 @@ smPopup.innerHTML = `
|
|||||||
<div class="handle"></div>
|
<div class="handle"></div>
|
||||||
<slot name="header"></slot>
|
<slot name="header"></slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="popup-body">
|
<div part="popup-body" class="popup-body">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
10
css/main.css
10
css/main.css
@ -460,6 +460,9 @@ sm-popup h5:not(.tag) {
|
|||||||
#qr_code_popup::part(popup) {
|
#qr_code_popup::part(popup) {
|
||||||
height: 80vh;
|
height: 80vh;
|
||||||
}
|
}
|
||||||
|
#qr_code_popup::part(popup-body) {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
#qr_code_popup sm-tab-header {
|
#qr_code_popup sm-tab-header {
|
||||||
width: max-content;
|
width: max-content;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
@ -469,7 +472,12 @@ sm-popup h5:not(.tag) {
|
|||||||
display: flex;
|
display: flex;
|
||||||
height: max-content;
|
height: max-content;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#qr_code_popup p {
|
||||||
|
margin-top: 1rem;
|
||||||
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-header {
|
.popup-header {
|
||||||
|
|||||||
2
css/main.min.css
vendored
2
css/main.min.css
vendored
File diff suppressed because one or more lines are too long
@ -476,6 +476,9 @@ sm-popup{
|
|||||||
&::part(popup){
|
&::part(popup){
|
||||||
height: 80vh;
|
height: 80vh;
|
||||||
}
|
}
|
||||||
|
&::part(popup-body){
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
sm-tab-header{
|
sm-tab-header{
|
||||||
width: max-content;
|
width: max-content;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
@ -485,7 +488,12 @@ sm-popup{
|
|||||||
display: flex;
|
display: flex;
|
||||||
height: max-content;
|
height: max-content;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
p{
|
||||||
|
margin-top: 1rem;
|
||||||
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
index.html
11
index.html
@ -69,7 +69,7 @@
|
|||||||
<sm-tab-panels id="qr_selector">
|
<sm-tab-panels id="qr_selector">
|
||||||
<sm-panel>
|
<sm-panel>
|
||||||
<div id="reader"></div>
|
<div id="reader"></div>
|
||||||
<sm-select id="select_camera"></sm-select>
|
<p>Point your camera towards QR Code</p>
|
||||||
</sm-panel>
|
</sm-panel>
|
||||||
<sm-panel>
|
<sm-panel>
|
||||||
<div id="my_qr_code"></div>
|
<div id="my_qr_code"></div>
|
||||||
@ -1644,11 +1644,6 @@
|
|||||||
case 'qr_code_popup':
|
case 'qr_code_popup':
|
||||||
Html5Qrcode.getCameras().then(devices => {
|
Html5Qrcode.getCameras().then(devices => {
|
||||||
if (devices && devices.length) {
|
if (devices && devices.length) {
|
||||||
let cameras = ``
|
|
||||||
for(device of devices){
|
|
||||||
cameras += `<sm-option value="${device.id}">${device.label}</sm-option>`
|
|
||||||
}
|
|
||||||
selectCamera.innerHTML = cameras
|
|
||||||
startScanning(devices[devices.length-1].id)
|
startScanning(devices[devices.length-1].id)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@ -1658,10 +1653,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
selectCamera.addEventListener('change', e => {
|
|
||||||
startScanning(selectCamera.value)
|
|
||||||
})
|
|
||||||
|
|
||||||
function startScanning(cameraId){
|
function startScanning(cameraId){
|
||||||
qrScannerInstance.start(
|
qrScannerInstance.start(
|
||||||
cameraId,
|
cameraId,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user