Docfile commited on
Commit
f698087
·
verified ·
1 Parent(s): 83a0d15

Delete templates/indeex.html

Browse files
Files changed (1) hide show
  1. templates/indeex.html +0 -397
templates/indeex.html DELETED
@@ -1,397 +0,0 @@
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>AI Flashcards Generator</title>
7
- <script src="https://cdn.tailwindcss.com"></script>
8
- <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
9
- <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.6.2/axios.min.js"></script>
10
- <link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" rel="stylesheet">
11
- <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
12
-
13
- <style>
14
- @import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
15
-
16
- body {
17
- font-family: 'Space Grotesk', sans-serif;
18
- background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
19
- }
20
-
21
- .glass-morph {
22
- background: rgba(255, 255, 255, 0.05);
23
- backdrop-filter: blur(10px);
24
- border: 1px solid rgba(255, 255, 255, 0.1);
25
- }
26
-
27
- .card-hover {
28
- transition: all 0.3s ease;
29
- }
30
-
31
- .card-hover:hover {
32
- transform: translateY(-5px);
33
- box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
34
- }
35
-
36
- .gradient-text {
37
- background: linear-gradient(45deg, #60a5fa, #a855f7);
38
- -webkit-background-clip: text;
39
- background-clip: text;
40
- color: transparent;
41
- }
42
-
43
- .custom-loader {
44
- width: 50px;
45
- height: 50px;
46
- border: 3px solid #fff;
47
- border-radius: 50%;
48
- display: inline-block;
49
- position: relative;
50
- box-sizing: border-box;
51
- animation: rotation 1s linear infinite;
52
- }
53
-
54
- .custom-loader::after {
55
- content: '';
56
- box-sizing: border-box;
57
- position: absolute;
58
- left: 50%;
59
- top: 50%;
60
- transform: translate(-50%, -50%);
61
- width: 40px;
62
- height: 40px;
63
- border-radius: 50%;
64
- border: 3px solid transparent;
65
- border-bottom-color: #60a5fa;
66
- }
67
-
68
- @keyframes rotation {
69
- 0% { transform: rotate(0deg) }
70
- 100% { transform: rotate(360deg) }
71
- }
72
-
73
- .fade-enter-active, .fade-leave-active {
74
- transition: opacity 0.5s ease;
75
- }
76
- .fade-enter-from, .fade-leave-to {
77
- opacity: 0;
78
- }
79
-
80
- .flip-card {
81
- perspective: 1000px;
82
- height: 300px;
83
- }
84
-
85
- .flip-card-inner {
86
- position: relative;
87
- width: 100%;
88
- height: 100%;
89
- text-align: center;
90
- transition: transform 0.8s;
91
- transform-style: preserve-3d;
92
- cursor: pointer;
93
- }
94
-
95
- .flip-card.flipped .flip-card-inner {
96
- transform: rotateY(180deg);
97
- }
98
-
99
- .flip-card-front, .flip-card-back {
100
- position: absolute;
101
- width: 100%;
102
- height: 100%;
103
- -webkit-backface-visibility: hidden;
104
- backface-visibility: hidden;
105
- display: flex;
106
- align-items: center;
107
- justify-content: center;
108
- padding: 2rem;
109
- border-radius: 1rem;
110
- }
111
-
112
- .flip-card-front {
113
- background: rgba(255, 255, 255, 0.05);
114
- }
115
-
116
- .flip-card-back {
117
- background: rgba(255, 255, 255, 0.07);
118
- transform: rotateY(180deg);
119
- }
120
-
121
- .keyboard-shortcut {
122
- display: inline-flex;
123
- align-items: center;
124
- justify-content: center;
125
- min-width: 24px;
126
- height: 24px;
127
- padding: 0 6px;
128
- border-radius: 4px;
129
- background: rgba(255, 255, 255, 0.1);
130
- font-size: 0.875rem;
131
- margin: 0 2px;
132
- }
133
-
134
- .progress-bar {
135
- height: 4px;
136
- background: rgba(96, 165, 250, 0.2);
137
- border-radius: 2px;
138
- overflow: hidden;
139
- }
140
-
141
- .progress-value {
142
- height: 100%;
143
- background: linear-gradient(90deg, #60a5fa, #a855f7);
144
- transition: width 0.3s ease;
145
- }
146
- </style>
147
- </head>
148
- <body class="min-h-screen text-gray-100">
149
- <div id="app" class="container mx-auto px-4 py-12">
150
- <!-- Hero Section -->
151
- <div class="text-center mb-16 animate__animated animate__fadeIn">
152
- <h1 class="text-5xl font-bold mb-4 gradient-text">AI Flashcards Generator</h1>
153
- <p class="text-xl text-gray-400 mb-8">Transformez vos sujets en cartes d'apprentissage intelligentes</p>
154
- </div>
155
-
156
- <!-- Main Content -->
157
- <div class="max-w-4xl mx-auto">
158
- <!-- Input Section -->
159
- <div class="glass-morph rounded-2xl p-8 mb-12 card-hover">
160
- <div class="mb-6">
161
- <label for="topic" class="block text-lg font-medium mb-3 text-gray-300">Quel sujet souhaitez-vous explorer ?</label>
162
- <div class="relative">
163
- <input
164
- type="text"
165
- id="topic"
166
- v-model="topic"
167
- @keyup.enter="generateFlashcards"
168
- class="w-full px-6 py-4 bg-gray-800/50 rounded-xl border border-gray-700 focus:ring-2 focus:ring-blue-500 focus:border-transparent text-lg transition-all duration-300"
169
- placeholder="Ex: Intelligence Artificielle, Quantum Computing..."
170
- :disabled="isLoading"
171
- >
172
- </div>
173
- </div>
174
- <button
175
- @click="generateFlashcards"
176
- :disabled="isLoading"
177
- class="w-full bg-gradient-to-r from-blue-500 to-purple-600 text-white py-4 px-8 rounded-xl font-medium text-lg hover:opacity-90 transition-all duration-300 flex items-center justify-center space-x-3"
178
- >
179
- <span v-if="!isLoading">Générer les Flashcards</span>
180
- <span v-else class="custom-loader"></span>
181
- </button>
182
- </div>
183
-
184
- <!-- Error Message -->
185
- <transition name="fade">
186
- <div v-if="error" class="mb-8 animate__animated animate__shakeX">
187
- <div class="bg-red-500/20 border border-red-500/50 text-red-300 px-6 py-4 rounded-xl">
188
- [[error]]
189
- </div>
190
- </div>
191
- </transition>
192
-
193
- <!-- Results Section -->
194
- <transition name="fade">
195
- <div v-if="flashcards.length > 0" class="glass-morph rounded-2xl overflow-hidden">
196
- <!-- Progress Bar -->
197
- <div class="progress-bar">
198
- <div class="progress-value" :style="{ width: `${(currentCardIndex + 1) * 100 / flashcards.length}%` }"></div>
199
- </div>
200
-
201
- <!-- Tabs -->
202
- <div class="border-b border-gray-700/50">
203
- <div class="flex">
204
- <button
205
- v-for="tab in ['study', 'json']"
206
- :key="tab"
207
- @click="activeTab = tab"
208
- :class="[
209
- 'px-8 py-4 font-medium text-lg transition-all duration-300',
210
- activeTab === tab
211
- ? 'gradient-text border-b-2 border-blue-500'
212
- : 'text-gray-400 hover:text-gray-300'
213
- ]"
214
- >
215
- [[tab === 'study' ? 'Mode Étude' : 'Mode JSON']]
216
- </button>
217
- </div>
218
- </div>
219
-
220
- <!-- Tab Content -->
221
- <div class="p-6">
222
- <!-- Study Mode -->
223
- <div v-if="activeTab === 'study'" class="space-y-6">
224
- <!-- Keyboard Shortcuts Info -->
225
- <div class="text-center mb-6 text-gray-400">
226
- <span class="keyboard-shortcut">←</span> Précédent
227
- <span class="keyboard-shortcut mx-2">→</span> Suivant
228
- <span class="keyboard-shortcut">Espace</span> Retourner la carte
229
- </div>
230
-
231
- <div class="flip-card" :class="{ 'flipped': currentCard.showAnswer }" @click="toggleCard">
232
- <div class="flip-card-inner">
233
- <div class="flip-card-front">
234
- <div class="text-center">
235
- <div class="text-2xl font-medium mb-4">[[currentCard.question]]</div>
236
- <div class="text-gray-400 text-sm">(Cliquez pour voir la réponse)</div>
237
- </div>
238
- </div>
239
- <div class="flip-card-back">
240
- <div class="text-center">
241
- <div class="text-xl">[[currentCard.answer]]</div>
242
- </div>
243
- </div>
244
- </div>
245
- </div>
246
-
247
- <!-- Navigation Controls -->
248
- <div class="flex items-center justify-center space-x-4 mt-8">
249
- <button
250
- @click="previousCard"
251
- :disabled="currentCardIndex === 0"
252
- class="px-6 py-3 bg-blue-500/20 rounded-lg hover:bg-blue-500/30 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-300"
253
- >
254
- ← Précédent
255
- </button>
256
- <div class="text-lg font-medium">
257
- [[currentCardIndex + 1]] / [[flashcards.length]]
258
- </div>
259
- <button
260
- @click="nextCard"
261
- :disabled="currentCardIndex === flashcards.length - 1"
262
- class="px-6 py-3 bg-blue-500/20 rounded-lg hover:bg-blue-500/30 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-300"
263
- >
264
- Suivant →
265
- </button>
266
- </div>
267
- </div>
268
-
269
- <!-- JSON Mode -->
270
- <div v-if="activeTab === 'json'" class="bg-gray-800/50 rounded-xl p-6 overflow-x-auto">
271
- <pre class="text-gray-300">[[JSON.stringify(flashcards, null, 2)]]</pre>
272
- </div>
273
- </div>
274
- </div>
275
- </transition>
276
- </div>
277
- </div>
278
-
279
- <script>
280
- const { createApp } = Vue
281
-
282
- createApp({
283
- delimiters: ['[[', ']]'],
284
- data() {
285
- return {
286
- topic: '',
287
- flashcards: [],
288
- activeTab: 'study',
289
- isLoading: false,
290
- error: null,
291
- currentCardIndex: 0
292
- }
293
- },
294
- computed: {
295
- currentCard() {
296
- return this.flashcards[this.currentCardIndex] || {
297
- question: '',
298
- answer: '',
299
- showAnswer: false
300
- }
301
- }
302
- },
303
- methods: {
304
- async generateFlashcards() {
305
- if (!this.topic.trim()) {
306
- this.error = 'Veuillez entrer un sujet.'
307
- return
308
- }
309
-
310
- this.isLoading = true
311
- this.error = null
312
- this.flashcards = []
313
- this.currentCardIndex = 0
314
-
315
- try {
316
- const response = await axios.post('/generate', {
317
- topic: this.topic
318
- })
319
-
320
- if (response.data.success) {
321
- const cards = response.data.flashcards.map(card => ({
322
- ...card,
323
- showAnswer: false
324
- }))
325
-
326
- setTimeout(() => {
327
- this.flashcards = cards
328
- this.$nextTick(() => {
329
- gsap.from('.flip-card', {
330
- y: 30,
331
- opacity: 0,
332
- duration: 0.5
333
- })
334
- })
335
- }, 300)
336
- }
337
- } catch (error) {
338
- this.error = error.response?.data?.error || 'Une erreur est survenue lors de la génération.'
339
- } finally {
340
- this.isLoading = false
341
- }
342
- },
343
- nextCard() {
344
- if (this.currentCardIndex < this.flashcards.length - 1) {
345
- this.flashcards[this.currentCardIndex].showAnswer = false
346
- this.currentCardIndex++
347
- this.animateCardTransition('next')
348
- }
349
- },
350
- previousCard() {
351
- if (this.currentCardIndex > 0) {
352
- this.flashcards[this.currentCardIndex].showAnswer = false
353
- this.currentCardIndex--
354
- this.animateCardTransition('prev')
355
- }
356
- },
357
- toggleCard() {
358
- this.flashcards[this.currentCardIndex].showAnswer = !this.flashcards[this.currentCardIndex].showAnswer
359
- },
360
- animateCardTransition(direction) {
361
- const xOffset = direction === 'next' ? -50 : 50
362
- gsap.fromTo('.flip-card',
363
- {
364
- x: xOffset,
365
- opacity: 0
366
- },
367
- {
368
- x: 0,
369
- opacity: 1,
370
- duration: 0.3
371
- }
372
- )
373
- }
374
- },
375
- mounted() {
376
- gsap.from('.gradient-text', {
377
- y: -50,
378
- opacity: 0,
379
- duration: 1,
380
- ease: 'power3.out'
381
- })
382
-
383
- window.addEventListener('keydown', (e) => {
384
- if (this.activeTab === 'study') {
385
- if (e.key === 'ArrowRight') this.nextCard()
386
- if (e.key === 'ArrowLeft') this.previousCard()
387
- if (e.key === ' ') {
388
- e.preventDefault()
389
- this.toggleCard()
390
- }
391
- }
392
- })
393
- }
394
- }).mount('#app')
395
- </script>
396
- </body>
397
- </html>