Docfile commited on
Commit
41ab6cb
·
verified ·
1 Parent(s): d5ce766

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +136 -97
templates/index.html CHANGED
@@ -4,32 +4,59 @@
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Mariam AI - Analyse d'Image</title>
7
- <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
8
- <script src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js"></script>
9
- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js"></script>
10
- <script src="https://cdn.jsdelivr.net/npm/[email protected]/moment.min.js"></script>
11
- <style>
12
- @layer utilities {
13
- .markdown-content {
14
- @apply prose prose-sm md:prose-base lg:prose-lg mx-auto;
 
 
 
 
 
 
 
 
 
 
15
  }
 
 
16
 
17
- .markdown-content table {
18
- @apply w-full table-auto border-collapse my-4;
19
- }
 
20
 
21
- .markdown-content th,
22
- .markdown-content td {
23
- @apply border border-gray-300 p-2 text-left align-top break-words;
24
- min-width: auto;
25
- white-space: normal;
26
- }
 
27
 
28
- .markdown-content pre {
29
- @apply overflow-x-auto p-4 rounded-lg bg-gray-100;
30
- }
 
 
 
 
 
 
 
 
31
  }
32
 
 
 
 
 
 
33
  .loader {
34
  width: 48px;
35
  height: 48px;
@@ -46,6 +73,7 @@
46
  100% { transform: rotate(360deg); }
47
  }
48
 
 
49
  .fade-in {
50
  animation: fadeIn 0.3s ease-in;
51
  }
@@ -55,119 +83,130 @@
55
  100% { opacity: 1; }
56
  }
57
 
 
58
  .upload-zone {
59
- @apply relative border-2 border-dashed border-indigo-500 rounded-lg p-8 transition-all duration-300 ease-in-out;
60
- }
61
-
62
- .upload-zone.drag-over {
63
- @apply border-indigo-600 bg-indigo-50;
64
- }
65
-
66
- .tab-button {
67
- @apply px-4 py-2 rounded-lg transition-all duration-200 text-sm md:text-base;
68
  }
69
 
70
- .tab-button:not(.active) {
71
- @apply bg-white text-indigo-600 hover:bg-indigo-50;
 
72
  }
73
 
74
- .tab-button.active {
75
- @apply bg-indigo-600 text-white;
76
- }
77
-
78
- .backup-item {
79
- @apply flex flex-col md:flex-row justify-between items-start md:items-center gap-2 p-4 rounded-lg border border-gray-200 hover:bg-gray-50 transition-colors duration-200;
80
- }
81
-
82
- .backup-actions {
83
- @apply flex gap-2 w-full md:w-auto justify-end;
84
  }
85
  </style>
86
  </head>
87
 
88
  <body class="min-h-screen bg-gray-50">
89
- <header class="bg-white shadow-sm sticky top-0 z-50">
90
  <div class="max-w-7xl mx-auto px-4 py-4 sm:px-6 lg:px-8">
91
  <h1 class="text-2xl md:text-3xl font-bold text-indigo-600">Mariam AI</h1>
92
  <p class="mt-1 text-sm text-gray-500">Assistant pour commentaire composé</p>
93
  </div>
94
  </header>
95
 
96
- <main class="max-w-7xl mx-auto px-4 py-8 sm:px-6 lg:px-8 space-y-8">
97
- <form id="uploadForm" class="bg-white rounded-xl shadow-sm p-6">
98
- <div class="upload-zone" id="dropZone">
99
- <input type="file" id="imageInput" accept="image/*" class="hidden" />
100
- <label for="imageInput" class="block text-center cursor-pointer">
101
- <svg class="mx-auto h-12 w-12 text-indigo-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
102
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
103
- </svg>
104
- <p id="fileName" class="mt-2 text-sm text-gray-500">
105
- Cliquez ou glissez une image ici
106
- </p>
107
- </label>
108
- </div>
109
-
110
- <div id="imagePreview" class="hidden mt-6">
111
- <div class="relative max-w-md mx-auto">
112
- <img id="preview" src="#" alt="Prévisualisation" class="rounded-lg shadow-md max-h-[400px] w-full object-contain" />
113
- <button type="button" onclick="removeImage()" class="absolute top-2 right-2 p-2 rounded-full bg-white/90 hover:bg-red-500 hover:text-white transition-colors duration-200">
114
- <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
115
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
116
  </svg>
117
- </button>
 
 
 
118
  </div>
119
- </div>
120
 
121
- <div class="mt-6 flex justify-center">
122
- <button type="submit" class="inline-flex items-center px-6 py-3 rounded-lg bg-indigo-600 text-white font-medium hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-200">
123
- Analyser l'image
124
- </button>
125
- </div>
126
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
 
128
  <div id="loading" class="hidden">
129
- <div class="flex flex-col items-center justify-center gap-4">
130
  <span class="loader"></span>
131
  <p class="text-gray-500">Analyse en cours, veuillez patienter...</p>
132
  </div>
133
  </div>
134
 
135
- <div id="results" class="hidden space-y-6">
136
- <div class="flex justify-center gap-2">
137
- <button id="showDissertation" class="tab-button active">Dissertation</button>
138
- <button id="showTableau" class="tab-button">Tableau</button>
139
- <button id="showBackups" class="tab-button">Sauvegardes</button>
 
 
 
 
 
 
 
 
 
 
 
 
140
  </div>
141
 
142
- <div id="dissertationTab" class="tab-content active">
143
- <div class="bg-white rounded-xl shadow-sm p-6">
144
- <h2 class="text-xl md:text-2xl font-bold text-gray-900 mb-4">Dissertation</h2>
145
- <div id="dissertationResult" class="markdown-content"></div>
146
- <button id="saveDissertation" class="mt-6 px-4 py-2 rounded-lg bg-green-600 text-white hover:bg-green-700 transition-colors duration-200">
147
- Sauvegarder la dissertation
148
- </button>
149
- </div>
150
  </div>
151
 
152
- <div id="tableauTab" class="tab-content hidden">
153
- <div class="bg-white rounded-xl shadow-sm p-6">
154
- <h2 class="text-xl md:text-2xl font-bold text-gray-900 mb-4">Tableau d'analyse</h2>
155
- <div id="tableauResult" class="markdown-content"></div>
156
- <button id="saveTableau" class="mt-6 px-4 py-2 rounded-lg bg-green-600 text-white hover:bg-green-700 transition-colors duration-200">
157
- Sauvegarder le tableau
158
- </button>
159
- </div>
160
  </div>
161
 
162
- <div id="backupsTab" class="tab-content hidden">
163
- <div class="bg-white rounded-xl shadow-sm p-6">
164
- <h2 class="text-xl md:text-2xl font-bold text-gray-900 mb-4">Sauvegardes locales</h2>
165
- <div id="backupList" class="space-y-3"></div>
166
- </div>
167
  </div>
168
  </div>
169
  </main>
170
 
 
171
  <script>
172
  let tableauContent = '';
173
  let dissertationContent = '';
 
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Mariam AI - Analyse d'Image</title>
7
+
8
+ <!-- Tailwind CSS -->
9
+ <script src="https://cdn.tailwindcss.com"></script>
10
+ <script>
11
+ tailwind.config = {
12
+ theme: {
13
+ extend: {
14
+ typography: {
15
+ DEFAULT: {
16
+ css: {
17
+ maxWidth: 'none',
18
+ table: {
19
+ width: '100%'
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
25
  }
26
+ }
27
+ </script>
28
 
29
+ <!-- Autres CDN -->
30
+ <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
31
+ <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
32
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/moment.min.js"></script>
33
 
34
+ <style>
35
+ /* Base styles */
36
+ .markdown-content {
37
+ width: 100%;
38
+ max-width: 100%;
39
+ overflow-x: auto;
40
+ }
41
 
42
+ .markdown-content table {
43
+ width: 100%;
44
+ border-collapse: collapse;
45
+ margin: 1rem 0;
46
+ }
47
+
48
+ .markdown-content th,
49
+ .markdown-content td {
50
+ border: 1px solid #e5e7eb;
51
+ padding: 0.75rem;
52
+ text-align: left;
53
  }
54
 
55
+ .markdown-content th {
56
+ background-color: #f9fafb;
57
+ }
58
+
59
+ /* Loader */
60
  .loader {
61
  width: 48px;
62
  height: 48px;
 
73
  100% { transform: rotate(360deg); }
74
  }
75
 
76
+ /* Animations */
77
  .fade-in {
78
  animation: fadeIn 0.3s ease-in;
79
  }
 
83
  100% { opacity: 1; }
84
  }
85
 
86
+ /* Upload zone styles */
87
  .upload-zone {
88
+ border: 2px dashed #6366F1;
89
+ border-radius: 0.5rem;
90
+ padding: 2rem;
91
+ transition: all 0.3s ease;
 
 
 
 
 
92
  }
93
 
94
+ .upload-zone:hover {
95
+ border-color: #4F46E5;
96
+ background-color: #EEF2FF;
97
  }
98
 
99
+ /* SweetAlert customization */
100
+ .swal2-popup {
101
+ font-size: 0.875rem;
 
 
 
 
 
 
 
102
  }
103
  </style>
104
  </head>
105
 
106
  <body class="min-h-screen bg-gray-50">
107
+ <header class="bg-white shadow-sm">
108
  <div class="max-w-7xl mx-auto px-4 py-4 sm:px-6 lg:px-8">
109
  <h1 class="text-2xl md:text-3xl font-bold text-indigo-600">Mariam AI</h1>
110
  <p class="mt-1 text-sm text-gray-500">Assistant pour commentaire composé</p>
111
  </div>
112
  </header>
113
 
114
+ <main class="max-w-7xl mx-auto px-4 py-8 sm:px-6 lg:px-8">
115
+ <div class="bg-white rounded-lg shadow p-6 mb-8">
116
+ <form id="uploadForm" class="space-y-6">
117
+ <div class="upload-zone" id="dropZone">
118
+ <input type="file" id="imageInput" accept="image/*" class="hidden">
119
+ <label for="imageInput" class="block text-center cursor-pointer">
120
+ <svg class="mx-auto h-12 w-12 text-indigo-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
121
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
122
+ d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
 
 
 
 
 
 
 
 
 
 
 
123
  </svg>
124
+ <p id="fileName" class="mt-2 text-sm text-gray-500">
125
+ Cliquez ou glissez une image ici
126
+ </p>
127
+ </label>
128
  </div>
 
129
 
130
+ <div id="imagePreview" class="hidden">
131
+ <div class="relative max-w-lg mx-auto">
132
+ <img id="preview" src="#" alt="Prévisualisation"
133
+ class="rounded-lg shadow-md max-h-[400px] w-full object-contain">
134
+ <button type="button" onclick="removeImage()"
135
+ class="absolute top-2 right-2 p-2 rounded-full bg-white/90 hover:bg-red-500 hover:text-white
136
+ transition-colors duration-200">
137
+ <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
138
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
139
+ d="M6 18L18 6M6 6l12 12" />
140
+ </svg>
141
+ </button>
142
+ </div>
143
+ </div>
144
+
145
+ <div class="flex justify-center">
146
+ <button type="submit"
147
+ class="px-6 py-3 bg-indigo-600 text-white font-medium rounded-lg
148
+ hover:bg-indigo-700 focus:outline-none focus:ring-2
149
+ focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-200">
150
+ Analyser l'image
151
+ </button>
152
+ </div>
153
+ </form>
154
+ </div>
155
 
156
  <div id="loading" class="hidden">
157
+ <div class="flex flex-col items-center justify-center space-y-4">
158
  <span class="loader"></span>
159
  <p class="text-gray-500">Analyse en cours, veuillez patienter...</p>
160
  </div>
161
  </div>
162
 
163
+ <div id="results" class="space-y-8 hidden">
164
+ <div class="flex justify-center space-x-4">
165
+ <button id="showDissertation"
166
+ class="px-4 py-2 rounded-lg bg-indigo-600 text-white hover:bg-indigo-700
167
+ transition-colors duration-200">
168
+ Dissertation
169
+ </button>
170
+ <button id="showTableau"
171
+ class="px-4 py-2 rounded-lg bg-white text-indigo-600 hover:bg-indigo-50
172
+ transition-colors duration-200">
173
+ Tableau
174
+ </button>
175
+ <button id="showBackups"
176
+ class="px-4 py-2 rounded-lg bg-white text-indigo-600 hover:bg-indigo-50
177
+ transition-colors duration-200">
178
+ Sauvegardes
179
+ </button>
180
  </div>
181
 
182
+ <div id="dissertationTab" class="tab-content bg-white rounded-lg shadow p-6">
183
+ <h2 class="text-xl font-bold text-gray-900 mb-4">Dissertation</h2>
184
+ <div id="dissertationResult" class="markdown-content"></div>
185
+ <button id="saveDissertation"
186
+ class="mt-4 px-6 py-2 bg-green-600 text-white rounded-lg
187
+ hover:bg-green-700 transition-colors duration-200">
188
+ Sauvegarder la dissertation
189
+ </button>
190
  </div>
191
 
192
+ <div id="tableauTab" class="tab-content bg-white rounded-lg shadow p-6 hidden">
193
+ <h2 class="text-xl font-bold text-gray-900 mb-4">Tableau d'analyse</h2>
194
+ <div id="tableauResult" class="markdown-content"></div>
195
+ <button id="saveTableau"
196
+ class="mt-4 px-6 py-2 bg-green-600 text-white rounded-lg
197
+ hover:bg-green-700 transition-colors duration-200">
198
+ Sauvegarder le tableau
199
+ </button>
200
  </div>
201
 
202
+ <div id="backupsTab" class="tab-content bg-white rounded-lg shadow p-6 hidden">
203
+ <h2 class="text-xl font-bold text-gray-900 mb-4">Sauvegardes locales</h2>
204
+ <div id="backupList" class="space-y-3"></div>
 
 
205
  </div>
206
  </div>
207
  </main>
208
 
209
+
210
  <script>
211
  let tableauContent = '';
212
  let dissertationContent = '';