Image3 / templates /index.html
nagasurendra's picture
Update templates/index.html
b7b7d35 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flask Camera App</title>
<link href="{{ url_for('static', filename='css/tailwind.css') }}" rel="stylesheet">
</head>
<body class="bg-gray-100 flex items-center justify-center min-h-screen">
<div class="bg-white p-6 rounded-lg shadow-lg w-full max-w-lg">
<h1 class="text-2xl font-bold mb-4 text-center">Capture & Upload</h1>
<div class="relative">
<video id="video" class="w-full rounded" autoplay></video>
<canvas id="canvas" class="hidden"></canvas>
<img id="capturedImage" class="w-full rounded hidden" src="">
</div>
<div class="flex justify-center space-x-4 mt-4">
<button id="cameraBtn" class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">
<svg class="w-6 h-6 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 9a2 2 0 012-2h2l2-2h6l2 2h2a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"/>
<circle cx="12" cy="13" r="4"/>
</svg>
Open Camera
</button>
</div>
<div id="cameraControls" class="hidden mt-4">
<div class="flex justify-center space-x-4 mb-4">
<button id="frontCam" class="bg-gray-300 text-black px-4 py-2 rounded hover:bg-gray-400">Front Camera</button>
<button id="backCam" class="bg-gray-300 text-black px-4 py-2 rounded hover:bg-gray-400">Back Camera</button>
</div>
<button id="captureBtn" class="bg-green-500 text-white w-full py-2 rounded hover:bg-green-600">Capture</button>
</div>
<div id="postCapture" class="hidden mt-4">
<div class="flex justify-center space-x-4">
<button id="retakeBtn" class="bg-red-500 text-white px-4 py-2 rounded hover:bg-red-600">Retake</button>
<button id="uploadBtn" class="bg-purple-500 text-white px-4 py-2 rounded hover:bg-purple-600">Upload to Instagram</button>
</div>
</div>
</div>
<script src="{{ url_for('static', filename='js/camera.js') }}"></script>
</body>
</html>