Spaces:
Running

fle2 / index.html
masterseb's picture
Rendre compatible avec l’écran d’un smartphone - Follow Up Deployment
80c4bd4 verified
Raw History Blame Contribute Delete
49 kB
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Créateur d'activités FLE</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* Custom animations */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.fade-in {
animation: fadeIn 0.3s ease-out forwards;
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
/* Activity card hover effect */
.activity-card {
transition: all 0.2s ease;
}
.activity-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}
</style>
</head>
<body class="bg-gray-50 font-sans">
<div class="min-h-screen flex flex-col">
<!-- Header -->
<header class="bg-blue-600 text-white shadow-lg">
<div class="container mx-auto px-4 py-6">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-2">
<i class="fas fa-language text-3xl"></i>
<h1 class="text-2xl font-bold">FLE Activity Creator</h1>
</div>
<button id="help-btn" class="bg-blue-700 hover:bg-blue-800 px-4 py-2 rounded-lg flex items-center space-x-2 transition">
<i class="fas fa-question-circle"></i>
<span>Aide</span>
</button>
</div>
</div>
</header>
<!-- Main Content -->
<main class="flex-grow container mx-auto px-4 py-8">
<div class="grid grid-cols-1 lg:grid-cols-3 gap-4 lg:gap-8">
<!-- Activity Creator Panel -->
<div class="lg:col-span-1 bg-white rounded-xl shadow-md p-4 lg:p-6 h-fit lg:sticky top-4 lg:top-8">
<h2 class="text-xl font-bold text-gray-800 mb-6 flex items-center">
<i class="fas fa-cog mr-2 text-blue-500"></i>
Créer une activité
</h2>
<form id="activity-form" class="space-y-6">
<!-- Level Selection -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
<i class="fas fa-layer-group mr-1 text-blue-500"></i>
Niveau
</label>
<div class="grid grid-cols-3 gap-2">
<button type="button" data-level="A1" class="level-btn py-2 px-3 rounded-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 transition">
A1
</button>
<button type="button" data-level="A2" class="level-btn py-2 px-3 rounded-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 transition">
A2
</button>
<button type="button" data-level="B1" class="level-btn py-2 px-3 rounded-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 transition">
B1
</button>
<button type="button" data-level="B2" class="level-btn py-2 px-3 rounded-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 transition">
B2
</button>
<button type="button" data-level="C1" class="level-btn py-2 px-3 rounded-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 transition">
C1
</button>
<button type="button" data-level="C2" class="level-btn py-2 px-3 rounded-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 transition">
C2
</button>
</div>
<input type="hidden" id="selected-level" name="level">
</div>
<!-- Theme Selection -->
<div>
<label for="theme" class="block text-sm font-medium text-gray-700 mb-2">
<i class="fas fa-palette mr-1 text-blue-500"></i>
Thème
</label>
<select id="theme" name="theme" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md">
<option value="">Sélectionnez un thème</option>
<option value="vocabulaire">Vocabulaire</option>
<option value="grammaire">Grammaire</option>
<option value="conversation">Conversation</option>
<option value="culture">Culture française</option>
<option value="ecoute">Compréhension orale</option>
<option value="lecture">Compréhension écrite</option>
</select>
</div>
<!-- Activity Type -->
<div>
<label for="activity-type" class="block text-sm font-medium text-gray-700 mb-2">
<i class="fas fa-tasks mr-1 text-blue-500"></i>
Type d'activité
</label>
<select id="activity-type" name="activity-type" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md">
<option value="">Sélectionnez un type</option>
<option value="qcm">QCM</option>
<option value="text-lacunaire">Texte à trous</option>
<option value="association">Association</option>
<option value="dictation">Dictée</option>
<option value="dialogue">Dialogue à compléter</option>
<option value="flashcards">Flashcards</option>
</select>
</div>
<!-- Customization Options (shown based on activity type) -->
<div id="customization-options" class="hidden space-y-4">
<div id="qcm-options" class="hidden">
<h3 class="font-medium text-gray-700 mb-2">
<i class="fas fa-list-ol mr-1 text-blue-500"></i>
Options QCM
</h3>
<div class="space-y-2">
<div>
<label class="block text-sm text-gray-600">Nombre de questions</label>
<input type="number" min="1" max="20" value="5" class="w-full px-3 py-2 border border-gray-300 rounded-md">
</div>
<div>
<label class="block text-sm text-gray-600">Nombre de réponses par question</label>
<input type="number" min="2" max="5" value="3" class="w-full px-3 py-2 border border-gray-300 rounded-md">
</div>
</div>
</div>
<div id="text-lacunaire-options" class="hidden">
<h3 class="font-medium text-gray-700 mb-2">
<i class="fas fa-align-left mr-1 text-blue-500"></i>
Options Texte à trous
</h3>
<div class="space-y-2">
<div>
<label class="block text-sm text-gray-600">Nombre de trous</label>
<input type="number" min="1" max="15" value="5" class="w-full px-3 py-2 border border-gray-300 rounded-md">
</div>
<div>
<label class="block text-sm text-gray-600">Thème du texte</label>
<input type="text" placeholder="Ex: Voyages, cuisine..." class="w-full px-3 py-2 border border-gray-300 rounded-md">
</div>
</div>
</div>
<div id="association-options" class="hidden">
<h3 class="font-medium text-gray-700 mb-2">
<i class="fas fa-object-group mr-1 text-blue-500"></i>
Options Association
</h3>
<div class="space-y-2">
<div>
<label class="block text-sm text-gray-600">Nombre de paires</label>
<input type="number" min="3" max="10" value="5" class="w-full px-3 py-2 border border-gray-300 rounded-md">
</div>
<div>
<label class="block text-sm text-gray-600">Type d'association</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-md">
<option>Mot - Définition</option>
<option>Mot - Image</option>
<option>Question - Réponse</option>
</select>
</div>
</div>
</div>
</div>
<!-- Generate Button -->
<div class="pt-4">
<button type="button" id="generate-btn" class="w-full flex justify-center items-center py-3 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition">
<i class="fas fa-magic mr-2"></i>
Générer l'activité
</button>
</div>
</form>
</div>
<!-- Activity Preview Panel -->
<div class="lg:col-span-2">
<div class="bg-white rounded-xl shadow-md p-6 mb-8">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800 flex items-center">
<i class="fas fa-eye mr-2 text-blue-500"></i>
Aperçu de l'activité
</h2>
<div class="flex space-x-2">
<button id="save-btn" class="bg-green-100 text-green-700 px-4 py-2 rounded-lg flex items-center space-x-2 hover:bg-green-200 transition disabled:opacity-50" disabled>
<i class="fas fa-save"></i>
<span>Enregistrer</span>
</button>
<button id="export-btn" class="bg-purple-100 text-purple-700 px-4 py-2 rounded-lg flex items-center space-x-2 hover:bg-purple-200 transition disabled:opacity-50" disabled>
<i class="fas fa-file-export"></i>
<span>Exporter</span>
</button>
</div>
</div>
<!-- Activity Preview Content -->
<div id="activity-preview" class="min-h-[400px] border-2 border-dashed border-gray-300 rounded-lg flex items-center justify-center text-gray-400">
<div class="text-center p-6">
<i class="fas fa-sliders-h text-4xl mb-4"></i>
<h3 class="text-lg font-medium">Configurez votre activité</h3>
<p class="mt-2">Sélectionnez un niveau, un thème et un type d'activité pour commencer</p>
</div>
</div>
</div>
<!-- Saved Activities -->
<div class="bg-white rounded-xl shadow-md p-6">
<h2 class="text-xl font-bold text-gray-800 mb-6 flex items-center">
<i class="fas fa-archive mr-2 text-blue-500"></i>
Mes activités sauvegardées
</h2>
<div id="saved-activities" class="grid grid-cols-1 sm:grid-cols-2 gap-3">
<!-- Placeholder for saved activities -->
<div class="border border-gray-200 rounded-lg p-4 text-center text-gray-500">
<i class="fas fa-inbox text-3xl mb-2"></i>
<p>Aucune activité sauvegardée</p>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-6">
<div class="container mx-auto px-4 text-center">
<p>Créateur d'activités FLE &copy; 2023 - Tous droits réservés</p>
<div class="flex justify-center space-x-4 mt-2">
<a href="#" class="hover:text-blue-300 transition"><i class="fab fa-twitter"></i></a>
<a href="#" class="hover:text-blue-300 transition"><i class="fab fa-facebook"></i></a>
<a href="#" class="hover:text-blue-300 transition"><i class="fab fa-instagram"></i></a>
</div>
</div>
</footer>
</div>
<!-- Help Modal -->
<div id="help-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto">
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-gray-800">
<i class="fas fa-question-circle text-blue-500 mr-2"></i>
Aide et instructions
</h3>
<button id="close-help-modal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="space-y-4 text-gray-700">
<div>
<h4 class="font-medium text-lg mb-2">Comment créer une activité</h4>
<ol class="list-decimal pl-5 space-y-2">
<li>Sélectionnez le niveau de vos élèves (A1 à C2)</li>
<li>Choisissez un thème pour votre activité</li>
<li>Sélectionnez le type d'activité que vous souhaitez créer</li>
<li>Configurez les options spécifiques à votre activité</li>
<li>Cliquez sur "Générer l'activité"</li>
</ol>
</div>
<div>
<h4 class="font-medium text-lg mb-2">Types d'activités disponibles</h4>
<ul class="space-y-3">
<li>
<span class="font-medium">QCM</span> - Questions à choix multiples avec feedback
</li>
<li>
<span class="font-medium">Texte à trous</span> - Texte avec des mots manquants à compléter
</li>
<li>
<span class="font-medium">Association</span> - Relier des éléments entre eux (mots-définitions, mots-images)
</li>
<li>
<span class="font-medium">Dictée</span> - Exercice d'écoute et de transcription
</li>
<li>
<span class="font-medium">Dialogue à compléter</span> - Dialogue avec répliques manquantes
</li>
<li>
<span class="font-medium">Flashcards</span> - Cartes mémoire pour réviser du vocabulaire
</li>
</ul>
</div>
<div>
<h4 class="font-medium text-lg mb-2">Conseils pédagogiques</h4>
<ul class="space-y-2">
<li><i class="fas fa-check-circle text-green-500 mr-1"></i> Adaptez la difficulté au niveau de vos élèves</li>
<li><i class="fas fa-check-circle text-green-500 mr-1"></i> Variez les types d'activités pour maintenir l'intérêt</li>
<li><i class="fas fa-check-circle text-green-500 mr-1"></i> Utilisez des thèmes qui intéressent vos élèves</li>
<li><i class="fas fa-check-circle text-green-500 mr-1"></i> Intégrez des éléments culturels pour enrichir l'apprentissage</li>
</ul>
</div>
</div>
<div class="mt-6 pt-4 border-t border-gray-200">
<button id="close-help-modal-btn" class="w-full bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700 transition">
J'ai compris
</button>
</div>
</div>
</div>
</div>
<!-- Export Modal -->
<div id="export-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg max-w-md w-full">
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-gray-800">
<i class="fas fa-file-export text-blue-500 mr-2"></i>
Exporter l'activité
</h3>
<button id="close-export-modal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="space-y-4 text-gray-700">
<p>Choisissez le format d'exportation :</p>
<div class="grid grid-cols-2 gap-4">
<button class="export-option border border-gray-200 rounded-lg p-4 hover:bg-gray-50 transition flex flex-col items-center">
<i class="fas fa-file-pdf text-3xl text-red-500 mb-2"></i>
<span>PDF</span>
</button>
<button class="export-option border border-gray-200 rounded-lg p-4 hover:bg-gray-50 transition flex flex-col items-center">
<i class="fas fa-file-word text-3xl text-blue-500 mb-2"></i>
<span>Word</span>
</button>
<button class="export-option border border-gray-200 rounded-lg p-4 hover:bg-gray-50 transition flex flex-col items-center">
<i class="fas fa-file-powerpoint text-3xl text-orange-500 mb-2"></i>
<span>PowerPoint</span>
</button>
<button class="export-option border border-gray-200 rounded-lg p-4 hover:bg-gray-50 transition flex flex-col items-center">
<i class="fas fa-link text-3xl text-purple-500 mb-2"></i>
<span>Lien partageable</span>
</button>
</div>
</div>
<div class="mt-6 pt-4 border-t border-gray-200">
<button id="close-export-modal-btn" class="w-full bg-gray-200 text-gray-800 py-2 px-4 rounded-md hover:bg-gray-300 transition">
Annuler
</button>
</div>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Elements
const levelBtns = document.querySelectorAll('.level-btn');
const themeSelect = document.getElementById('theme');
const activityTypeSelect = document.getElementById('activity-type');
const customizationOptions = document.getElementById('customization-options');
const generateBtn = document.getElementById('generate-btn');
const saveBtn = document.getElementById('save-btn');
const exportBtn = document.getElementById('export-btn');
const activityPreview = document.getElementById('activity-preview');
const savedActivities = document.getElementById('saved-activities');
// Modal elements
const helpBtn = document.getElementById('help-btn');
const helpModal = document.getElementById('help-modal');
const closeHelpModal = document.getElementById('close-help-modal');
const closeHelpModalBtn = document.getElementById('close-help-modal-btn');
const exportModal = document.getElementById('export-modal');
const closeExportModal = document.getElementById('close-export-modal');
const closeExportModalBtn = document.getElementById('close-export-modal-btn');
const exportOptions = document.querySelectorAll('.export-option');
// Sample activities data
const sampleActivities = {
qcm: {
title: "Quiz de vocabulaire",
content: `
<div class="space-y-6">
<h3 class="text-xl font-bold text-blue-600">Quiz de vocabulaire - Niveau A1</h3>
<p class="text-gray-600">Choisissez la bonne réponse pour chaque question.</p>
<div class="space-y-4">
<div class="border border-gray-200 rounded-lg p-4">
<p class="font-medium mb-3">1. Comment dit-on "apple" en français ?</p>
<div class="space-y-2">
<label class="flex items-center space-x-3 cursor-pointer">
<input type="radio" name="q1" class="h-4 w-4 text-blue-600">
<span>La banane</span>
</label>
<label class="flex items-center space-x-3 cursor-pointer">
<input type="radio" name="q1" class="h-4 w-4 text-blue-600">
<span>La pomme</span>
</label>
<label class="flex items-center space-x-3 cursor-pointer">
<input type="radio" name="q1" class="h-4 w-4 text-blue-600">
<span>L'orange</span>
</label>
</div>
</div>
<div class="border border-gray-200 rounded-lg p-4">
<p class="font-medium mb-3">2. Quel est le contraire de "grand" ?</p>
<div class="space-y-2">
<label class="flex items-center space-x-3 cursor-pointer">
<input type="radio" name="q2" class="h-4 w-4 text-blue-600">
<span>Petit</span>
</label>
<label class="flex items-center space-x-3 cursor-pointer">
<input type="radio" name="q2" class="h-4 w-4 text-blue-600">
<span>Beau</span>
</label>
<label class="flex items-center space-x-3 cursor-pointer">
<input type="radio" name="q2" class="h-4 w-4 text-blue-600">
<span>Vieux</span>
</label>
</div>
</div>
<div class="border border-gray-200 rounded-lg p-4">
<p class="font-medium mb-3">3. Complétez : "Je ___ à Paris."</p>
<div class="space-y-2">
<label class="flex items-center space-x-3 cursor-pointer">
<input type="radio" name="q3" class="h-4 w-4 text-blue-600">
<span>habite</span>
</label>
<label class="flex items-center space-x-3 cursor-pointer">
<input type="radio" name="q3" class="h-4 w-4 text-blue-600">
<span>habites</span>
</label>
<label class="flex items-center space-x-3 cursor-pointer">
<input type="radio" name="q3" class="h-4 w-4 text-blue-600">
<span>habitez</span>
</label>
</div>
</div>
</div>
<div class="pt-4">
<button class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">
Valider les réponses
</button>
</div>
</div>
`
},
'text-lacunaire': {
title: "Texte à trous - La famille",
content: `
<div class="space-y-6">
<h3 class="text-xl font-bold text-blue-600">Texte à trous - La famille (Niveau A1)</h3>
<p class="text-gray-600">Complétez le texte avec les mots appropriés.</p>
<div class="border border-gray-200 rounded-lg p-6 bg-gray-50">
<p class="mb-4">Je m'appelle Pierre. J'ai une grande <input type="text" class="border-b border-gray-400 px-2 py-1 w-24">. Mon <input type="text" class="border-b border-gray-400 px-2 py-1 w-24"> s'appelle Jean et ma <input type="text" class="border-b border-gray-400 px-2 py-1 w-24"> s'appelle Marie. Nous <input type="text" class="border-b border-gray-400 px-2 py-1 w-24"> à Lyon. Mes <input type="text" class="border-b border-gray-400 px-2 py-1 w-24"> habitent à la campagne.</p>
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
<h4 class="font-medium text-blue-800 mb-2">Mots à utiliser :</h4>
<div class="flex flex-wrap gap-2">
<span class="bg-white border border-blue-200 px-3 py-1 rounded-full text-sm">famille</span>
<span class="bg-white border border-blue-200 px-3 py-1 rounded-full text-sm">père</span>
<span class="bg-white border border-blue-200 px-3 py-1 rounded-full text-sm">mère</span>
<span class="bg-white border border-blue-200 px-3 py-1 rounded-full text-sm">habitons</span>
<span class="bg-white border border-blue-200 px-3 py-1 rounded-full text-sm">grands-parents</span>
</div>
</div>
</div>
<div class="pt-4">
<button class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">
Vérifier les réponses
</button>
</div>
</div>
`
},
association: {
title: "Association mots-images",
content: `
<div class="space-y-6">
<h3 class="text-xl font-bold text-blue-600">Association mots-images (Niveau A1)</h3>
<p class="text-gray-600">Reliez chaque mot à l'image correspondante.</p>
<div class="grid grid-cols-2 gap-4">
<!-- Words Column -->
<div class="space-y-3">
<div class="border border-gray-200 rounded-lg p-3 cursor-move bg-white draggable" draggable="true" data-word="pomme">
<p class="text-center font-medium">La pomme</p>
</div>
<div class="border border-gray-200 rounded-lg p-3 cursor-move bg-white draggable" draggable="true" data-word="chien">
<p class="text-center font-medium">Le chien</p>
</div>
<div class="border border-gray-200 rounded-lg p-3 cursor-move bg-white draggable" draggable="true" data-word="maison">
<p class="text-center font-medium">La maison</p>
</div>
<div class="border border-gray-200 rounded-lg p-3 cursor-move bg-white draggable" draggable="true" data-word="voiture">
<p class="text-center font-medium">La voiture</p>
</div>
</div>
<!-- Images Column -->
<div class="space-y-3">
<div class="border border-gray-200 rounded-lg p-3 h-[60px] flex items-center justify-center dropzone" data-word="maison">
<div class="w-10 h-10 bg-blue-200 rounded"></div>
</div>
<div class="border border-gray-200 rounded-lg p-3 h-[60px] flex items-center justify-center dropzone" data-word="chien">
<div class="w-10 h-10 bg-yellow-200 rounded"></div>
</div>
<div class="border border-gray-200 rounded-lg p-3 h-[60px] flex items-center justify-center dropzone" data-word="voiture">
<div class="w-10 h-10 bg-red-200 rounded"></div>
</div>
<div class="border border-gray-200 rounded-lg p-3 h-[60px] flex items-center justify-center dropzone" data-word="pomme">
<div class="w-10 h-10 bg-green-200 rounded"></div>
</div>
</div>
</div>
<div class="pt-4 flex justify-between">
<button class="bg-gray-200 text-gray-800 px-4 py-2 rounded-md hover:bg-gray-300 transition">
Réinitialiser
</button>
<button class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">
Vérifier les associations
</button>
</div>
</div>
`
},
dictation: {
title: "Dictée - Ma journée",
content: `
<div class="space-y-6">
<h3 class="text-xl font-bold text-blue-600">Dictée - Ma journée (Niveau A2)</h3>
<p class="text-gray-600">Écoutez le texte et écrivez ce que vous entendez.</p>
<div class="border border-gray-200 rounded-lg p-6 bg-gray-50">
<div class="flex justify-center mb-4">
<button class="bg-blue-600 text-white px-6 py-3 rounded-full hover:bg-blue-700 transition flex items-center space-x-2">
<i class="fas fa-play"></i>
<span>Écouter le texte</span>
</button>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-2">Nombre d'écoutes :</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-md">
<option>1</option>
<option selected>2</option>
<option>3</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Votre texte :</label>
<textarea class="w-full px-3 py-2 border border-gray-300 rounded-md h-32" placeholder="Écrivez ici ce que vous entendez..."></textarea>
</div>
</div>
<div class="pt-4">
<button class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">
Vérifier la dictée
</button>
</div>
</div>
`
},
dialogue: {
title: "Dialogue au restaurant",
content: `
<div class="space-y-6">
<h3 class="text-xl font-bold text-blue-600">Dialogue au restaurant (Niveau A2)</h3>
<p class="text-gray-600">Complétez le dialogue avec les phrases appropriées.</p>
<div class="border border-gray-200 rounded-lg p-6 bg-gray-50">
<div class="space-y-4">
<div class="flex">
<div class="bg-blue-100 rounded-lg p-3 max-w-[80%]">
<p class="font-medium">Serveur :</p>
<p>Bonjour, vous avez choisi ?</p>
</div>
</div>
<div class="flex justify-end">
<div class="bg-green-100 rounded-lg p-3 max-w-[80%]">
<p class="font-medium">Client :</p>
<select class="w-full px-2 py-1 border border-gray-300 rounded">
<option value="">Choisissez une réponse</option>
<option value="1">Oui, je vais prendre le menu du jour</option>
<option value="2">Non, je n'ai pas faim</option>
<option value="3">Je voudrais voir la carte des vins</option>
</select>
</div>
</div>
<div class="flex">
<div class="bg-blue-100 rounded-lg p-3 max-w-[80%]">
<p class="font-medium">Serveur :</p>
<p>Très bien. Comme boisson ?</p>
</div>
</div>
<div class="flex justify-end">
<div class="bg-green-100 rounded-lg p-3 max-w-[80%]">
<p class="font-medium">Client :</p>
<select class="w-full px-2 py-1 border border-gray-300 rounded">
<option value="">Choisissez une réponse</option>
<option value="1">Un verre d'eau, s'il vous plaît</option>
<option value="2">Je préfère un café</option>
<option value="3">Une bouteille de vin rouge</option>
</select>
</div>
</div>
</div>
<div class="mt-6 bg-yellow-50 border border-yellow-200 rounded-lg p-4">
<h4 class="font-medium text-yellow-800 mb-2">Phrases possibles :</h4>
<ul class="list-disc pl-5 space-y-1">
<li>Oui, je vais prendre le menu du jour</li>
<li>Un verre d'eau, s'il vous plaît</li>
<li>Je voudrais voir la carte des vins</li>
<li>Une bouteille de vin rouge</li>
</ul>
</div>
</div>
<div class="pt-4">
<button class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">
Vérifier le dialogue
</button>
</div>
</div>
`
},
flashcards: {
title: "Flashcards - Les animaux",
content: `
<div class="space-y-6">
<h3 class="text-xl font-bold text-blue-600">Flashcards - Les animaux (Niveau A1)</h3>
<p class="text-gray-600">Apprenez le vocabulaire des animaux en français.</p>
<div class="flex justify-center">
<div class="w-full max-w-md h-64 perspective">
<div class="relative w-full h-full transition-transform duration-500 transform-style-preserve-3d" id="flashcard">
<!-- Front of the card -->
<div class="absolute w-full h-full backface-hidden bg-white border border-gray-200 rounded-xl p-6 flex flex-col items-center justify-center">
<div class="w-24 h-24 bg-blue-200 rounded-full mb-4"></div>
<h4 class="text-xl font-bold">Le chien</h4>
<button class="mt-4 text-blue-600 hover:text-blue-800 transition" id="flip-card">
<i class="fas fa-redo mr-1"></i> Retourner
</button>
</div>
<!-- Back of the card -->
<div class="absolute w-full h-full backface-hidden bg-blue-100 border border-blue-200 rounded-xl p-6 flex flex-col items-center justify-center transform-rotate-y-180">
<div class="w-24 h-24 bg-blue-300 rounded-full mb-4 flex items-center justify-center">
<span class="text-4xl">🐶</span>
</div>
<h4 class="text-xl font-bold">Dog</h4>
<p class="text-center mt-2">Animal domestique fidèle</p>
<button class="mt-4 text-blue-600 hover:text-blue-800 transition" id="flip-card-back">
<i class="fas fa-redo mr-1"></i> Retourner
</button>
</div>
</div>
</div>
</div>
<div class="flex justify-between pt-4">
<button class="bg-gray-200 text-gray-800 px-4 py-2 rounded-md hover:bg-gray-300 transition">
<i class="fas fa-arrow-left mr-1"></i> Précédent
</button>
<div class="text-gray-600">
Carte 1/10
</div>
<button class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">
Suivant <i class="fas fa-arrow-right ml-1"></i>
</button>
</div>
</div>
`
}
};
// Selected level
let selectedLevel = '';
// Function to check if form is valid
function checkFormValidity() {
const isLevelSelected = selectedLevel !== '';
const isThemeSelected = themeSelect.value !== '';
const isActivityTypeSelected = activityTypeSelect.value !== '';
generateBtn.disabled = !(isLevelSelected && isThemeSelected && isActivityTypeSelected);
}
// Handle level selection
levelBtns.forEach(btn => {
btn.addEventListener('click', function() {
selectedLevel = this.dataset.level;
document.getElementById('selected-level').value = selectedLevel;
this.classList.add('bg-blue-100', 'border-blue-500');
levelBtns.forEach(otherBtn => {
if (otherBtn !== this) {
otherBtn.classList.remove('bg-blue-100', 'border-blue-500');
}
});
checkFormValidity();
});
});
// Handle theme and activity type changes
themeSelect.addEventListener('change', checkFormValidity);
activityTypeSelect.addEventListener('change', function() {
// Hide all options first
document.querySelectorAll('#customization-options > div').forEach(div => {
div.classList.add('hidden');
});
// Show relevant options
const selectedType = this.value;
if (selectedType) {
customizationOptions.classList.remove('hidden');
document.getElementById(`${selectedType}-options`)?.classList.remove('hidden');
} else {
customizationOptions.classList.add('hidden');
}
checkFormValidity();
});
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=masterseb/fle2" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>