Spaces:
Running
Running
LogicalTrue commited on
Commit ·
9adc2d0
1
Parent(s): 40e40c1
feat: add native mobile camera capture option to dropzone
Browse files- .agents/AGENTS.md +18 -0
- frontend/viewer.html +52 -10
.agents/AGENTS.md
CHANGED
|
@@ -44,3 +44,21 @@ El usuario cuenta con **Blender** instalado y realiza el siguiente tratamiento a
|
|
| 44 |
3. Reducción de polígonos usando el modificador `Decimate`.
|
| 45 |
4. Re-topología (Voxel/QuadriFlow Remesh) para conseguir bucles de animación limpios.
|
| 46 |
5. Esculpido y suavizado de ruido en Sculpt Mode con el pincel `Smooth`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
3. Reducción de polígonos usando el modificador `Decimate`.
|
| 45 |
4. Re-topología (Voxel/QuadriFlow Remesh) para conseguir bucles de animación limpios.
|
| 46 |
5. Esculpido y suavizado de ruido en Sculpt Mode con el pincel `Smooth`.
|
| 47 |
+
|
| 48 |
+
## ⚙️ PROTOCOLO DE EJECUCIÓN, TESTING Y ARQUITECTURA
|
| 49 |
+
|
| 50 |
+
### 1. MAPEO Y ARQUITECTURA:
|
| 51 |
+
- Mapeá la estructura del proyecto antes de proponer cambios.
|
| 52 |
+
- Respetá las convenciones existentes (ej: módulos en `/backend` o scripts en `/scripts`).
|
| 53 |
+
- Prohibido crear archivos temporales, duplicados o respaldos (`.bak`, `_old`, `temp_`).
|
| 54 |
+
|
| 55 |
+
### 2. BUCLE AUTO-QA (OBLIGATORIO):
|
| 56 |
+
- No des por terminada la tarea sin probar el código en la terminal integrada.
|
| 57 |
+
- Corre los scripts de test pertinentes (ej: pytest, unittest o scripts de prueba local).
|
| 58 |
+
- Si la terminal devuelve un error o stack trace, leelo, corregilo y re-ejecutá la prueba en silencio.
|
| 59 |
+
- Iterá de forma autónoma hasta obtener 0 errores.
|
| 60 |
+
|
| 61 |
+
### 3. ENTREGABLE CON EVIDENCIA:
|
| 62 |
+
- Presentá la solución únicamente cuando los tests corran en verde (exit code 0).
|
| 63 |
+
- Adjuntá en la respuesta el log de la terminal o evidencia de la validación.
|
| 64 |
+
|
frontend/viewer.html
CHANGED
|
@@ -399,10 +399,23 @@
|
|
| 399 |
<div id="creator-contents" style="background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 20px;">
|
| 400 |
<!-- Upload Tab Panel -->
|
| 401 |
<div id="panelUpload" style="display: flex; flex-direction: column; gap: 16px; text-align: center;">
|
| 402 |
-
<div id="dropzone" style="border: 2px dashed rgba(124,58,237,0.3); border-radius: 12px; padding:
|
| 403 |
-
<div style="font-size: 2.
|
| 404 |
-
<div style="font-size: 0.9rem; font-weight: 600; color: #fff;
|
| 405 |
-
<div style="font-size: 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 406 |
<input type="file" id="fileInputMobile" accept="image/*" style="display: none;">
|
| 407 |
</div>
|
| 408 |
<div id="imagePreviewContainer" style="display: none; position: relative;">
|
|
@@ -1374,11 +1387,34 @@
|
|
| 1374 |
});
|
| 1375 |
}
|
| 1376 |
|
| 1377 |
-
// Upload handlers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1378 |
if (dropzone && fileInputMobile) {
|
| 1379 |
-
dropzone.addEventListener('click', () =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1380 |
|
| 1381 |
-
|
| 1382 |
const file = e.target.files[0];
|
| 1383 |
if (!file) return;
|
| 1384 |
|
|
@@ -1391,15 +1427,21 @@
|
|
| 1391 |
btnCreate3DMobile.style.display = 'flex';
|
| 1392 |
};
|
| 1393 |
reader.readAsDataURL(file);
|
| 1394 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1395 |
}
|
| 1396 |
|
| 1397 |
if (btnRemoveImageMobile) {
|
| 1398 |
btnRemoveImageMobile.addEventListener('click', () => {
|
| 1399 |
base64Image = null;
|
| 1400 |
-
fileInputMobile.value = '';
|
|
|
|
| 1401 |
imagePreviewContainer.style.display = 'none';
|
| 1402 |
-
dropzone.style.display = '
|
| 1403 |
btnCreate3DMobile.style.display = 'none';
|
| 1404 |
});
|
| 1405 |
}
|
|
|
|
| 399 |
<div id="creator-contents" style="background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 20px;">
|
| 400 |
<!-- Upload Tab Panel -->
|
| 401 |
<div id="panelUpload" style="display: flex; flex-direction: column; gap: 16px; text-align: center;">
|
| 402 |
+
<div id="dropzone" style="border: 2px dashed rgba(124,58,237,0.3); border-radius: 12px; padding: 24px 16px; background: rgba(124,58,237,0.02); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;">
|
| 403 |
+
<div style="font-size: 2.2rem; margin-bottom: 2px;">📷</div>
|
| 404 |
+
<div style="font-size: 0.9rem; font-weight: 600; color: #fff;">Toma una foto o sube un archivo</div>
|
| 405 |
+
<div style="font-size: 0.78rem; color: #a1a1aa; max-width: 240px; margin-bottom: 4px;">Selecciona tu cámara para fotografiar directamente tu sujeto</div>
|
| 406 |
+
|
| 407 |
+
<div style="display: flex; gap: 10px; width: 100%; max-width: 320px; justify-content: center;">
|
| 408 |
+
<button type="button" id="btnTriggerCameraMobile" style="flex: 1; background: #7c3aed; color: #ffffff; border: none; padding: 10px 12px; border-radius: 8px; font-weight: 700; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);">
|
| 409 |
+
📸 Tomar Foto
|
| 410 |
+
</button>
|
| 411 |
+
<button type="button" id="btnTriggerFileMobile" style="flex: 1; background: rgba(255,255,255,0.08); color: #ffffff; border: 1px solid rgba(255,255,255,0.15); padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;">
|
| 412 |
+
📁 Explorar
|
| 413 |
+
</button>
|
| 414 |
+
</div>
|
| 415 |
+
|
| 416 |
+
<!-- Input para Tomar Foto (Cámara directa en Android/iOS) -->
|
| 417 |
+
<input type="file" id="cameraInputMobile" accept="image/*" capture="environment" style="display: none;">
|
| 418 |
+
<!-- Input para Subir desde Galería / Archivos -->
|
| 419 |
<input type="file" id="fileInputMobile" accept="image/*" style="display: none;">
|
| 420 |
</div>
|
| 421 |
<div id="imagePreviewContainer" style="display: none; position: relative;">
|
|
|
|
| 1387 |
});
|
| 1388 |
}
|
| 1389 |
|
| 1390 |
+
// Upload & Camera handlers
|
| 1391 |
+
const cameraInputMobile = document.getElementById('cameraInputMobile');
|
| 1392 |
+
const btnTriggerCameraMobile = document.getElementById('btnTriggerCameraMobile');
|
| 1393 |
+
const btnTriggerFileMobile = document.getElementById('btnTriggerFileMobile');
|
| 1394 |
+
|
| 1395 |
+
if (btnTriggerCameraMobile && cameraInputMobile) {
|
| 1396 |
+
btnTriggerCameraMobile.addEventListener('click', (e) => {
|
| 1397 |
+
e.stopPropagation();
|
| 1398 |
+
cameraInputMobile.click();
|
| 1399 |
+
});
|
| 1400 |
+
}
|
| 1401 |
+
|
| 1402 |
+
if (btnTriggerFileMobile && fileInputMobile) {
|
| 1403 |
+
btnTriggerFileMobile.addEventListener('click', (e) => {
|
| 1404 |
+
e.stopPropagation();
|
| 1405 |
+
fileInputMobile.click();
|
| 1406 |
+
});
|
| 1407 |
+
}
|
| 1408 |
+
|
| 1409 |
if (dropzone && fileInputMobile) {
|
| 1410 |
+
dropzone.addEventListener('click', (e) => {
|
| 1411 |
+
// Si hizo clic directamente en el área vacía del dropzone, abrir el selector general
|
| 1412 |
+
if (e.target === dropzone || e.target.parentElement === dropzone) {
|
| 1413 |
+
fileInputMobile.click();
|
| 1414 |
+
}
|
| 1415 |
+
});
|
| 1416 |
|
| 1417 |
+
const handleSelectedFile = (e) => {
|
| 1418 |
const file = e.target.files[0];
|
| 1419 |
if (!file) return;
|
| 1420 |
|
|
|
|
| 1427 |
btnCreate3DMobile.style.display = 'flex';
|
| 1428 |
};
|
| 1429 |
reader.readAsDataURL(file);
|
| 1430 |
+
};
|
| 1431 |
+
|
| 1432 |
+
fileInputMobile.addEventListener('change', handleSelectedFile);
|
| 1433 |
+
if (cameraInputMobile) {
|
| 1434 |
+
cameraInputMobile.addEventListener('change', handleSelectedFile);
|
| 1435 |
+
}
|
| 1436 |
}
|
| 1437 |
|
| 1438 |
if (btnRemoveImageMobile) {
|
| 1439 |
btnRemoveImageMobile.addEventListener('click', () => {
|
| 1440 |
base64Image = null;
|
| 1441 |
+
if (fileInputMobile) fileInputMobile.value = '';
|
| 1442 |
+
if (cameraInputMobile) cameraInputMobile.value = '';
|
| 1443 |
imagePreviewContainer.style.display = 'none';
|
| 1444 |
+
dropzone.style.display = 'flex';
|
| 1445 |
btnCreate3DMobile.style.display = 'none';
|
| 1446 |
});
|
| 1447 |
}
|