219 lines
7.5 KiB
PHP
219 lines
7.5 KiB
PHP
<!-- Modal per la gestione delle annotazioni -->
|
|
<div class="modal fade" id="annotationsModal" tabindex="-1" aria-labelledby="annotationsModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-xl" style="max-width: 80% !important; width: 80% !important;">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="annotationsModalLabel">Annotazioni per TRF: <span id="trfHeaderAnnotations"></span></h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
|
|
<h6 style="margin: 0;">Elenco Parti</h6>
|
|
<div style="display: flex; align-items: center;">
|
|
<input type="checkbox" id="showMixPartsAnnotations" name="showMixPartsAnnotations" style="margin-right: 5px;">
|
|
<label for="showMixPartsAnnotations" style="font-size: 0.9rem;">Mix</label>
|
|
</div>
|
|
</div>
|
|
<ul id="partsListAnnotations" class="list-group"></ul>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h6>Foto del Campione</h6>
|
|
<div style="display: flex; align-items: center; margin-bottom: 10px;">
|
|
<button type="button" class="btn btn-primary btn-sm" id="downloadPhotoBtnAnnotations" style="padding: 0.1rem 0.5rem; font-size: 0.8rem; margin-right: 10px;"><i class="fas fa-download"></i></button>
|
|
<div id="photoSelectorContainerAnnotations" style="display: none;"></div>
|
|
</div>
|
|
<div style="position: relative; width: 100%; min-height: 400px;">
|
|
<img id="samplePhotoAnnotations" src="" alt="Foto del campione" style="max-width: 100%; max-height: 100%; object-fit: contain; position: absolute; top: 0; left: 0;">
|
|
<canvas id="photoCanvasAnnotations" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></canvas>
|
|
<canvas id="overlayCanvasAnnotations" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;"></canvas>
|
|
<div id="descriptionListAnnotations" class="draggable-description" style="display: none;"></div>
|
|
<div id="markerContainerAnnotations"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary btn-sm" id="addDescriptionsBtnAnnotations" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Aggiungi Lista Descrizioni</button>
|
|
<button type="button" class="btn btn-danger btn-sm" id="removeAnnotationsBtnAnnotations" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Rimuovi Descrizioni</button>
|
|
<button type="button" class="btn btn-warning btn-sm" id="undoMarkerBtnAnnotations" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Undo Marker</button>
|
|
<button type="button" class="btn btn-success btn-sm" id="savePhotoBtnAnnotations" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Salva Foto con Nome</button>
|
|
<button type="button" class="btn btn-primary btn-sm" id="backToPartsBtnAnnotations" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Torna alle Parti</button>
|
|
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Chiudi</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
#annotationsModal {
|
|
z-index: 1070 !important;
|
|
}
|
|
|
|
#annotationsModal .modal-backdrop {
|
|
z-index: 1065 !important;
|
|
}
|
|
|
|
#annotationsModal .modal-content {
|
|
width: 100% !important;
|
|
max-width: 100% !important;
|
|
}
|
|
|
|
#partsListAnnotations .list-group-item {
|
|
cursor: pointer;
|
|
transition: background-color 0.2s;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 5px 10px;
|
|
}
|
|
|
|
#partsListAnnotations .list-group-item:hover {
|
|
background-color: #f5f5f5;
|
|
}
|
|
|
|
#partsListAnnotations .list-group-item.active {
|
|
background-color: #e9ecef;
|
|
border-color: #dee2e6;
|
|
}
|
|
|
|
.draggable-description {
|
|
position: absolute;
|
|
background: rgba(255, 255, 255, 0.8);
|
|
padding: 5px;
|
|
font-family: Arial, sans-serif;
|
|
color: #000000;
|
|
cursor: move;
|
|
user-select: none;
|
|
z-index: 1000;
|
|
min-width: 100px;
|
|
min-height: 50px;
|
|
overflow: visible;
|
|
border: 1px solid #ccc;
|
|
}
|
|
|
|
.draggable-description.active-interaction {
|
|
border: 2px dashed #000;
|
|
}
|
|
|
|
.draggable-description div {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.resize-handle {
|
|
position: absolute;
|
|
bottom: 0;
|
|
right: 0;
|
|
width: 10px;
|
|
height: 10px;
|
|
background: #888;
|
|
cursor: se-resize;
|
|
}
|
|
|
|
.draggable-marker {
|
|
position: absolute;
|
|
width: 24px;
|
|
height: 24px;
|
|
border-radius: 50%;
|
|
color: #ffffff;
|
|
text-align: center;
|
|
line-height: 24px;
|
|
font-size: 12px;
|
|
cursor: move;
|
|
user-select: none;
|
|
z-index: 1000;
|
|
}
|
|
|
|
#markerContainerAnnotations {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
#savePhotoBtnAnnotations {
|
|
transition: all 0.3s ease-in-out;
|
|
}
|
|
|
|
#savePhotoBtnAnnotations.unsaved {
|
|
background-color: #dc3545 !important;
|
|
border-color: #dc3545 !important;
|
|
color: white !important;
|
|
animation: pulse 1.2s infinite;
|
|
}
|
|
|
|
@keyframes pulse {
|
|
0% {
|
|
box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
|
|
}
|
|
|
|
70% {
|
|
box-shadow: 0 0 10px 15px rgba(220, 53, 69, 0);
|
|
}
|
|
|
|
100% {
|
|
box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
|
|
}
|
|
}
|
|
|
|
.color-picker-container {
|
|
position: relative;
|
|
display: inline-block;
|
|
overflow: visible;
|
|
z-index: 2000;
|
|
}
|
|
|
|
.color-picker {
|
|
display: none;
|
|
position: absolute;
|
|
right: 0;
|
|
top: 25px;
|
|
background: #fff;
|
|
border: 1px solid #ccc;
|
|
padding: 5px;
|
|
z-index: 2000;
|
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
|
flex-wrap: wrap;
|
|
width: 120px;
|
|
}
|
|
|
|
.color-option {
|
|
width: 24px;
|
|
height: 24px;
|
|
margin: 3px;
|
|
border: 1px solid #000;
|
|
cursor: pointer;
|
|
display: inline-block;
|
|
pointer-events: auto;
|
|
}
|
|
|
|
.color-option:hover {
|
|
border: 2px solid #000;
|
|
margin: 2px;
|
|
}
|
|
|
|
.selected-color {
|
|
width: 24px;
|
|
height: 24px;
|
|
margin-left: 5px;
|
|
border: 1px solid #000;
|
|
cursor: pointer;
|
|
display: inline-block;
|
|
pointer-events: auto;
|
|
}
|
|
|
|
.selected-color:hover {
|
|
border: 2px solid #000;
|
|
margin-left: 4px;
|
|
}
|
|
|
|
.temp-alert {
|
|
position: absolute;
|
|
top: 10px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
z-index: 3000;
|
|
}
|
|
</style> |