scandoc-ai-components 0.0.76 → 0.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +24 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11191,7 +11191,6 @@ class ExtractorVideo {
|
|
|
11191
11191
|
this.scanStartTime = null;
|
|
11192
11192
|
this.unsupportedDocCount = 0;
|
|
11193
11193
|
this.video = null;
|
|
11194
|
-
this.updateOverlayTimeout = null;
|
|
11195
11194
|
}
|
|
11196
11195
|
reset() {
|
|
11197
11196
|
this.stopVideo();
|
|
@@ -11369,6 +11368,7 @@ class ExtractorVideo {
|
|
|
11369
11368
|
this.adjustOverlayPosition();
|
|
11370
11369
|
});
|
|
11371
11370
|
window.addEventListener('resize', () => this.adjustOverlayPosition());
|
|
11371
|
+
setTimeout(() => this.adjustOverlayPosition(), 500);
|
|
11372
11372
|
this.scanStartTime = Date.now(); // Reset timer
|
|
11373
11373
|
setTimeout(() => this.analyzeVideoStream(), ExtractorVideo.FREQUENCY_MS);
|
|
11374
11374
|
this.showMessage("Starting scanning");
|
|
@@ -11403,8 +11403,8 @@ class ExtractorVideo {
|
|
|
11403
11403
|
}
|
|
11404
11404
|
adjustOverlayPosition() {
|
|
11405
11405
|
const video = this.video;
|
|
11406
|
-
const
|
|
11407
|
-
if (!video || !
|
|
11406
|
+
const dot = document.querySelector(".centerGuideDot");
|
|
11407
|
+
if (!video || !dot || video.videoWidth === 0 || video.videoHeight === 0) return;
|
|
11408
11408
|
const videoRatio = video.videoWidth / video.videoHeight;
|
|
11409
11409
|
const container = video.parentElement;
|
|
11410
11410
|
const containerRatio = container.clientWidth / container.clientHeight;
|
|
@@ -11418,10 +11418,11 @@ class ExtractorVideo {
|
|
|
11418
11418
|
}
|
|
11419
11419
|
const offsetX = (container.clientWidth - scaleWidth) / 2;
|
|
11420
11420
|
const offsetY = (container.clientHeight - scaleHeight) / 2;
|
|
11421
|
-
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11421
|
+
const centerX = offsetX + scaleWidth / 2;
|
|
11422
|
+
const centerY = offsetY + scaleHeight / 2;
|
|
11423
|
+
dot.style.display = "block";
|
|
11424
|
+
dot.style.left = `${centerX - 8}px`; // center minus half dot size
|
|
11425
|
+
dot.style.top = `${centerY - 8}px`;
|
|
11425
11426
|
}
|
|
11426
11427
|
getHTML() {
|
|
11427
11428
|
const cfgValues = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getScanDocAIConfigValues)();
|
|
@@ -11433,7 +11434,7 @@ class ExtractorVideo {
|
|
|
11433
11434
|
<div class="desktopVideoHolder">
|
|
11434
11435
|
<video id="ScanDocAIVideoElement" class="desktopVideo" autoPlay muted playsInline></video>
|
|
11435
11436
|
<div class="backgroundOverlay"></div>
|
|
11436
|
-
<div class="
|
|
11437
|
+
<div class="centerGuideDot"></div>
|
|
11437
11438
|
</div>
|
|
11438
11439
|
</div>
|
|
11439
11440
|
|
|
@@ -11463,13 +11464,23 @@ class ExtractorVideo {
|
|
|
11463
11464
|
height: 100%;
|
|
11464
11465
|
object-fit: cover;
|
|
11465
11466
|
}
|
|
11466
|
-
|
|
11467
|
-
|
|
11467
|
+
|
|
11468
|
+
.centerGuideDot {
|
|
11468
11469
|
position: absolute;
|
|
11469
|
-
|
|
11470
|
-
|
|
11470
|
+
width: 16px;
|
|
11471
|
+
height: 16px;
|
|
11472
|
+
background-color: #00ff55;
|
|
11473
|
+
border-radius: 50%;
|
|
11474
|
+
box-shadow: 0 0 8px 2px rgba(0, 255, 100, 0.8);
|
|
11475
|
+
z-index: 4;
|
|
11476
|
+
animation: flicker 1s infinite;
|
|
11471
11477
|
pointer-events: none;
|
|
11472
|
-
|
|
11478
|
+
display: none; /* Hidden until video is ready */
|
|
11479
|
+
}
|
|
11480
|
+
|
|
11481
|
+
@keyframes flicker {
|
|
11482
|
+
0%, 100% { opacity: 1; }
|
|
11483
|
+
50% { opacity: 0.3; }
|
|
11473
11484
|
}
|
|
11474
11485
|
|
|
11475
11486
|
.backgroundOverlay {
|