Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -582,3 +582,67 @@ function WebXRTab() {
|
|||||||
</group>
|
</group>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function CaptureTab() {
|
||||||
|
const rec = useCanvasRecorder();
|
||||||
|
const addScreenshot = useModelStore((s) => s.addScreenshot);
|
||||||
|
|
||||||
|
const onPhoto = () => {
|
||||||
|
const dataUrl = captureScreenshot();
|
||||||
|
if (dataUrl) addScreenshot(dataUrl);
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusColor =
|
||||||
|
rec.status === 'recording' ? '#dc2626' :
|
||||||
|
rec.status === 'paused' ? '#f59e0b' : '#94a3b8';
|
||||||
|
const statusLabel =
|
||||||
|
rec.status === 'recording' ? `● REC ${formatElapsed(rec.elapsedMs)}` :
|
||||||
|
rec.status === 'paused' ? `❚❚ PAUSADO ${formatElapsed(rec.elapsedMs)}` :
|
||||||
|
'○ Pronto para gravar';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<group>
|
||||||
|
<Text position={[-0.24, 0.115, 0]} fontSize={0.0085} color="#94a3b8" anchorX="left" maxWidth={0.48}>
|
||||||
|
Capture fotos ou grave a sessão AR (vídeo .webm baixado ao parar).
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Text position={[0, 0.075, 0]} fontSize={0.014} color={statusColor}
|
||||||
|
anchorX="center" anchorY="middle">
|
||||||
|
{statusLabel}
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
{/* Foto */}
|
||||||
|
<XR3DButton position={[-0.13, 0.02, 0]} size={[0.18, 0.038]}
|
||||||
|
label="📸 Tirar Foto" color="#3b82f6"
|
||||||
|
onClick={onPhoto} fontSize={0.011} />
|
||||||
|
|
||||||
|
{/* Iniciar / Parar gravação */}
|
||||||
|
{rec.status === 'idle' ? (
|
||||||
|
<XR3DButton position={[0.09, 0.02, 0]} size={[0.18, 0.038]}
|
||||||
|
label="● Iniciar Gravação" color="#dc2626"
|
||||||
|
onClick={startRecording} fontSize={0.011} />
|
||||||
|
) : (
|
||||||
|
<XR3DButton position={[0.09, 0.02, 0]} size={[0.18, 0.038]}
|
||||||
|
label="■ Parar e Salvar" color="#dc2626" active
|
||||||
|
onClick={stopRecording} fontSize={0.011} />
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Pause / Resume */}
|
||||||
|
{rec.status === 'recording' && (
|
||||||
|
<XR3DButton position={[0, -0.045, 0]} size={[0.2, 0.034]}
|
||||||
|
label="❚❚ Pausar" color="#f59e0b"
|
||||||
|
onClick={pauseRecording} fontSize={0.011} />
|
||||||
|
)}
|
||||||
|
{rec.status === 'paused' && (
|
||||||
|
<XR3DButton position={[0, -0.045, 0]} size={[0.2, 0.034]}
|
||||||
|
label="▶ Retomar" color="#22c55e" active
|
||||||
|
onClick={resumeRecording} fontSize={0.011} />
|
||||||
|
)}
|
||||||
|
|
||||||
|
<Text position={[-0.24, -0.105, 0]} fontSize={0.0075} color="#64748b"
|
||||||
|
anchorX="left" maxWidth={0.48}>
|
||||||
|
Foto → .png | Vídeo → .webm | Arquivos vão para a pasta Downloads do navegador.
|
||||||
|
</Text>
|
||||||
|
</group>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user