Spaces:
Runtime error
Runtime error
Create static/js/script.js
Browse files- static/js/script.js +46 -0
static/js/script.js
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Camera Capture App</title>
|
7 |
+
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
8 |
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
9 |
+
</head>
|
10 |
+
<body>
|
11 |
+
<div class="container">
|
12 |
+
<h1>Camera Capture App</h1>
|
13 |
+
{% with messages = get_flashed_messages() %}
|
14 |
+
{% if messages %}
|
15 |
+
<div class="flash-messages">
|
16 |
+
{% for message in messages %}
|
17 |
+
<p>{{ message }}</p>
|
18 |
+
{% endfor %}
|
19 |
+
</div>
|
20 |
+
{% endif %}
|
21 |
+
{% endwith %}
|
22 |
+
|
23 |
+
<div id="camera-section">
|
24 |
+
<div id="camera-icon" class="camera-icon">📷</div>
|
25 |
+
<div id="camera-container" style="display: none;">
|
26 |
+
<select id="camera-select">
|
27 |
+
<option value="user">Front Camera</option>
|
28 |
+
<option value="environment">Back Camera</option>
|
29 |
+
</select>
|
30 |
+
<video id="video" autoplay playsinline></video>
|
31 |
+
<button id="capture-btn">Capture</button>
|
32 |
+
</div>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<div id="preview-section" style="display: none;">
|
36 |
+
<canvas id="canvas" style="display: none;"></canvas>
|
37 |
+
<img id="preview-img" src="" alt="Captured Image">
|
38 |
+
<div class="button-group">
|
39 |
+
<button id="retake-btn">Retake</button>
|
40 |
+
<button id="upload-btn">Upload to Instagram</button>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
<script src="{{ url_for('static', filename='js/script.js') }}"></script>
|
45 |
+
</body>
|
46 |
+
</html>
|