Docfile commited on
Commit
6ab076c
·
verified ·
1 Parent(s): 6eb5857

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +43 -211
templates/index.html CHANGED
@@ -1,237 +1,69 @@
1
  <!DOCTYPE html>
2
- <html lang="fr">
3
  <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Mariam AI - Résolution d'exercices</title>
7
- <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
8
- <script>
9
- MathJax = {
10
- tex: {
11
- inlineMath: [['$', '$'], ['\\(', '\\)']],
12
- displayMath: [['$$', '$$'], ['\\[', '\\]']],
13
- processEscapes: true,
14
- packages: {'[+]': ['ams', 'noerrors']}
15
- },
16
- loader: {load: ['[tex]/ams', '[tex]/noerrors']}
17
- };
18
- </script>
19
  <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
20
  <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
21
  <style>
22
- * {
23
- margin: 0;
24
- padding: 0;
25
- box-sizing: border-box;
26
- font-family: 'Poppins', sans-serif;
27
- }
28
-
29
- body {
30
- background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
31
- min-height: 100vh;
32
- display: flex;
33
- flex-direction: column;
34
- align-items: center;
35
- padding: 2rem;
36
- }
37
-
38
- .container {
39
- max-width: 800px;
40
- width: 100%;
41
- background: rgba(255, 255, 255, 0.95);
42
- padding: 2rem;
43
- border-radius: 20px;
44
- box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
45
- backdrop-filter: blur(4px);
46
- }
47
-
48
- .header {
49
- text-align: center;
50
- margin-bottom: 2rem;
51
- }
52
-
53
- .header h1 {
54
- color: #1a1a1a;
55
- font-size: 2.5rem;
56
- margin-bottom: 0.5rem;
57
- background: linear-gradient(45deg, #2193b0, #6dd5ed);
58
- -webkit-background-clip: text;
59
- -webkit-text-fill-color: transparent;
60
- }
61
-
62
- .header p {
63
- color: #666;
64
- font-size: 1.1rem;
65
- }
66
-
67
- .upload-section {
68
- display: flex;
69
- flex-direction: column;
70
- align-items: center;
71
- gap: 1.5rem;
72
- margin-bottom: 2rem;
73
- }
74
-
75
- .file-upload {
76
- position: relative;
77
- display: inline-block;
78
- }
79
-
80
- .file-upload input[type="file"] {
81
- display: none;
82
- }
83
-
84
- .upload-btn {
85
- padding: 1rem 2rem;
86
- background: linear-gradient(45deg, #2193b0, #6dd5ed);
87
- color: white;
88
- border-radius: 50px;
89
- cursor: pointer;
90
- transition: all 0.3s ease;
91
- font-weight: 500;
92
- display: inline-flex;
93
- align-items: center;
94
- gap: 0.5rem;
95
- }
96
-
97
- .upload-btn:hover {
98
- transform: translateY(-2px);
99
- box-shadow: 0 5px 15px rgba(33, 147, 176, 0.3);
100
- }
101
-
102
- .submit-btn {
103
- padding: 1rem 3rem;
104
- background: linear-gradient(45deg, #2193b0, #6dd5ed);
105
- color: white;
106
- border: none;
107
- border-radius: 50px;
108
- cursor: pointer;
109
- font-weight: 500;
110
- transition: all 0.3s ease;
111
- }
112
-
113
- .submit-btn:hover {
114
- transform: translateY(-2px);
115
- box-shadow: 0 5px 15px rgba(33, 147, 176, 0.3);
116
- }
117
-
118
- .result {
119
- margin-top: 2rem;
120
- padding: 1.5rem;
121
- background: #f8f9fa;
122
- border-radius: 10px;
123
- min-height: 100px;
124
- }
125
-
126
- .loading {
127
- display: none;
128
- position: fixed;
129
- top: 0;
130
- left: 0;
131
- width: 100%;
132
- height: 100%;
133
- background: rgba(255, 255, 255, 0.9);
134
- justify-content: center;
135
- align-items: center;
136
- z-index: 1000;
137
- }
138
-
139
- .loading-content {
140
- text-align: center;
141
- }
142
-
143
- .spinner {
144
- width: 50px;
145
- height: 50px;
146
- border: 5px solid #f3f3f3;
147
- border-top: 5px solid #2193b0;
148
  border-radius: 50%;
 
 
149
  animation: spin 1s linear infinite;
150
- margin: 0 auto 1rem;
 
151
  }
152
 
153
  @keyframes spin {
154
  0% { transform: rotate(0deg); }
155
  100% { transform: rotate(360deg); }
156
  }
157
-
158
- .selected-file {
159
- display: none;
160
- margin-top: 1rem;
161
- padding: 0.5rem 1rem;
162
- background: #e9ecef;
163
- border-radius: 5px;
164
- font-size: 0.9rem;
165
- color: #495057;
166
- }
167
-
168
- @media (max-width: 768px) {
169
- .container {
170
- padding: 1.5rem;
171
- }
172
-
173
- .header h1 {
174
- font-size: 2rem;
175
- }
176
-
177
- .upload-btn, .submit-btn {
178
- padding: 0.8rem 1.5rem;
179
- }
180
- }
181
  </style>
182
  </head>
183
  <body>
184
  <div class="container">
185
- <div class="header">
186
- <h1>Mariam AI</h1>
187
- <p>Assistant de résolution d'exercices</p>
188
- </div>
189
-
190
- <form method="post" enctype="multipart/form-data" id="uploadForm">
191
- <div class="upload-section">
192
- <div class="file-upload">
193
- <label for="image" class="upload-btn">
194
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
195
- <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
196
- <polyline points="17 8 12 3 7 8"></polyline>
197
- <line x1="12" y1="3" x2="12" y2="15"></line>
198
- </svg>
199
- Sélectionner une image
200
- </label>
201
- <input type="file" name="image" id="image" accept="image/*" required>
202
- </div>
203
- <div class="selected-file" id="selectedFile"></div>
204
- <button type="submit" class="submit-btn">Analyser</button>
205
  </div>
 
206
  </form>
207
 
208
- <div class="result">
209
- {{ e | safe }}
210
- </div>
211
- </div>
212
 
213
- <div class="loading" id="loading">
214
- <div class="loading-content">
215
- <div class="spinner"></div>
216
- <p>Analyse en cours...</p>
217
- </div>
 
 
 
 
 
 
 
 
 
 
 
218
  </div>
219
-
 
 
220
  <script>
221
- document.getElementById('image').addEventListener('change', function(e) {
222
- const fileName = e.target.files[0]?.name;
223
- const selectedFile = document.getElementById('selectedFile');
224
- if (fileName) {
225
- selectedFile.textContent = `Fichier sélectionné : ${fileName}`;
226
- selectedFile.style.display = 'block';
227
- } else {
228
- selectedFile.style.display = 'none';
229
- }
230
- });
231
-
232
- document.getElementById('uploadForm').addEventListener('submit', function() {
233
- document.getElementById('loading').style.display = 'flex';
234
- });
235
  </script>
236
  </body>
237
  </html>
 
1
  <!DOCTYPE html>
2
+ <html>
3
  <head>
4
+ <title>Générateur de contenu avec Gemini et RDKit</title>
5
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
7
  <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
8
  <style>
9
+ .loader {
10
+ border: 5px solid #f3f3f3; /* Light grey */
11
+ border-top: 5px solid #3498db; /* Blue */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  border-radius: 50%;
13
+ width: 30px;
14
+ height: 30px;
15
  animation: spin 1s linear infinite;
16
+ margin: 20px auto;
17
+ display: none; /* Initialement caché */
18
  }
19
 
20
  @keyframes spin {
21
  0% { transform: rotate(0deg); }
22
  100% { transform: rotate(360deg); }
23
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  </style>
25
  </head>
26
  <body>
27
  <div class="container">
28
+ <h1>Générateur de contenu avec Gemini et RDKit</h1>
29
+ <form method="POST" enctype="multipart/form-data" onsubmit="showLoader()">
30
+ <div class="form-group">
31
+ <label for="image">Image:</label>
32
+ <input type="file" name="image" id="image" class="form-control-file">
33
+ </div>
34
+ <div class="form-group">
35
+ <label for="text_input">Texte:</label>
36
+ <textarea name="text_input" id="text_input" class="form-control" ></textarea>
 
 
 
 
 
 
 
 
 
 
 
37
  </div>
38
+ <button type="submit" class="btn btn-primary">Générer</button>
39
  </form>
40
 
41
+ <div class="loader" id="loader"></div>
 
 
 
42
 
43
+ {% if generated_content %}
44
+ <div class="row">
45
+ <div class="col-md-8">
46
+ <h2>Contenu généré:</h2>
47
+ <div>
48
+ {{ generated_content | safe }}
49
+ </div>
50
+ </div>
51
+ <div class="col-md-4">
52
+ <h2>Structures chimiques:</h2>
53
+ {% for image_path in image_paths %}
54
+ <img src="{{ image_path }}" alt="Structure Chimique" style="width:100%; height:auto;"><br>
55
+ {% endfor %}
56
+ </div>
57
+ </div>
58
+ {% endif %}
59
  </div>
60
+ <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
61
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
62
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
63
  <script>
64
+ function showLoader() {
65
+ document.getElementById('loader').style.display = 'block';
66
+ }
 
 
 
 
 
 
 
 
 
 
 
67
  </script>
68
  </body>
69
  </html>