Spaces:
Sleeping
Sleeping
| <html lang="en"> | |
| <head> | |
| <!-- Include necessary libraries and stylesheets --> | |
| </head> | |
| <body class="bg-gray-900"> | |
| <div class="grid grid-cols-12 gap-4 mx-8 mt-8" style="color: gray; border-radius: 10px;"> | |
| <!-- Controls section --> | |
| <div class="col-span-2 ml-4" style="background-color: lightgrey; border-radius: 10px;"> | |
| <h2 class="border-b border-gray-800 py-4 mb-4 text-3xl font-bold leading-none tracking-tight md:text-4xl lg:text-4xl text-gray-500">التحكم</h2> | |
| <div class="border-b border-gray-800" style="padding: 10px;"> | |
| <button class="text-white focus:ring-4 focus:outline-none mt-1.5 font-medium rounded-lg text-sm w-full py-2.5 text-center bg-gray-700 hover:bg-gray-800 focus:ring-gray-900" id="start-camera" type="button" onclick="startCamera()">بدء الكاميرا</button> | |
| <button class="text-white focus:ring-4 focus:outline-none mt-1.5 font-medium rounded-lg text-sm w-full py-2.5 text-center bg-gray-700 hover:bg-gray-800 focus:ring-gray-900" id="stop-camera" type="button" onclick="stopCamera()">إيقاف الكاميرا</button> | |
| </div> | |
| </div> | |
| <!-- Video section --> | |
| <div class="col-span-8 mx-4 mt-3" style="background-color: lightgrey; border-radius: 10px;"> | |
| <div id="container"> | |
| <img class="center" src="" id="video_feed"> <!-- Updated to have an empty source --> | |
| </div> | |
| </div> | |
| <!-- Terminal section --> | |
| <div class="col-span-2 mr-4" style="background-color: lightgrey; border-radius: 10px;"> | |
| <h2 class="border-b border-gray-800 py-4 mb-4 text-3xl flex justify-end font-bold leading-none tracking-tight md:text-4xl lg:text-4xl text-gray-500">الناتج</h2> | |
| <div id="terminal" class="w-full"></div> | |
| </div> | |
| </div> | |
| <div> | |
| <p id="finalSentencePara" class="text-gray-500 mt-4 text-center"></p> | |
| </div> | |
| <!-- Inline JavaScript --> | |
| <script> | |
| function startCamera() { | |
| fetch('/capture_frame') // Send a request to the Flask app route | |
| .then(response => response.text()) | |
| .then(data => { | |
| document.getElementById("video_feed").src = 'data:image/jpeg;base64,' + data; // Display the processed frame | |
| }); | |
| } | |
| function stopCamera() { | |
| // Add logic to stop the camera feed | |
| } | |
| </script> | |
| </body> | |
| </html> | |