Spaces:
Runtime error
Runtime error
Create templates/math.html
Browse files- templates/math.html +62 -0
templates/math.html
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<title>Résolution de problème mathématique</title>
|
5 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"></script>
|
6 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/plotly.js/2.24.2/plotly.min.js"></script>
|
7 |
+
<style>
|
8 |
+
.container {
|
9 |
+
max-width: 800px;
|
10 |
+
margin: 0 auto;
|
11 |
+
padding: 20px;
|
12 |
+
}
|
13 |
+
.upload-form {
|
14 |
+
border: 2px dashed #ccc;
|
15 |
+
padding: 20px;
|
16 |
+
text-align: center;
|
17 |
+
margin-bottom: 20px;
|
18 |
+
}
|
19 |
+
#preview {
|
20 |
+
max-width: 300px;
|
21 |
+
margin: 10px auto;
|
22 |
+
}
|
23 |
+
.result {
|
24 |
+
margin-top: 20px;
|
25 |
+
padding: 20px;
|
26 |
+
border: 1px solid #eee;
|
27 |
+
}
|
28 |
+
</style>
|
29 |
+
</head>
|
30 |
+
<body>
|
31 |
+
<div class="container">
|
32 |
+
<h1>Résolution de problème mathématique</h1>
|
33 |
+
<div class="upload-form">
|
34 |
+
<form id="uploadForm" action="/upload" method="POST" enctype="multipart/form-data">
|
35 |
+
<input type="file" id="imageInput" name="image" accept="image/*" onchange="previewImage(event)">
|
36 |
+
<br><br>
|
37 |
+
<img id="preview" style="display: none;">
|
38 |
+
<br>
|
39 |
+
<button type="submit">Analyser l'image</button>
|
40 |
+
</form>
|
41 |
+
</div>
|
42 |
+
<div id="result" class="result"></div>
|
43 |
+
</div>
|
44 |
+
|
45 |
+
<script>
|
46 |
+
function previewImage(event) {
|
47 |
+
const preview = document.getElementById('preview');
|
48 |
+
const file = event.target.files[0];
|
49 |
+
const reader = new FileReader();
|
50 |
+
|
51 |
+
reader.onload = function() {
|
52 |
+
preview.src = reader.result;
|
53 |
+
preview.style.display = 'block';
|
54 |
+
}
|
55 |
+
|
56 |
+
if (file) {
|
57 |
+
reader.readAsDataURL(file);
|
58 |
+
}
|
59 |
+
}
|
60 |
+
</script>
|
61 |
+
</body>
|
62 |
+
</html>
|