Crée un site web de gestion de notes scolaires en HTML, CSS et JavaScript uniquement, avec localStorage comme base de données. Le site doit comporter trois pages : index.html, admin.html et result.html.
044eeb7 verified | <html lang="fr" class="light"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>GradeGenius | Accueil</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <script> | |
| tailwind.config = { | |
| theme: { | |
| extend: { | |
| colors: { | |
| primary: '#3b82f6', | |
| secondary: '#10b981' | |
| } | |
| } | |
| } | |
| } | |
| </script> | |
| <style> | |
| .school-photo { | |
| transition: all 0.3s ease; | |
| } | |
| .school-photo:hover { | |
| transform: scale(1.02); | |
| box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); | |
| } | |
| .input-field:focus { | |
| border-color: #3b82f6; | |
| box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen"> | |
| <!-- Navigation --> | |
| <nav class="bg-primary-500 text-white shadow-lg"> | |
| <div class="container mx-auto px-4 py-3 flex justify-between items-center"> | |
| <div class="flex items-center space-x-2"> | |
| <div class="bg-secondary-500 p-2 rounded-lg"> | |
| <i data-feather="book-open" class="text-white"></i> | |
| </div> | |
| <span class="font-bold text-xl">Lycée Excellence</span> | |
| </div> | |
| <div class="hidden md:flex space-x-6"> | |
| <a href="index.html" class="hover:text-secondary-300 transition">Accueil</a> | |
| <a href="admin.html" class="hover:text-secondary-300 transition">Administration</a> | |
| </div> | |
| <button class="md:hidden" id="mobile-menu-button"> | |
| <i data-feather="menu"></i> | |
| </button> | |
| </div> | |
| </nav> | |
| <!-- Main Content --> | |
| <main class="container mx-auto px-4 py-8"> | |
| <!-- School Photo --> | |
| <div class="max-w-4xl mx-auto mb-12 overflow-hidden rounded-lg border-4 border-secondary-500 school-photo"> | |
| <img src="http://static.photos/education/1200x630/42" alt="Lycée Excellence" class="w-full h-auto"> | |
| </div> | |
| <!-- Student ID Check --> | |
| <div class="max-w-md mx-auto bg-white rounded-xl shadow-md overflow-hidden p-6"> | |
| <h2 class="text-2xl font-bold text-gray-800 mb-6 text-center">Consulter vos résultats</h2> | |
| <div class="mb-4"> | |
| <label for="studentId" class="block text-gray-700 text-sm font-bold mb-2">Numéro de matricule</label> | |
| <input type="text" id="studentId" class="input-field w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary-500"> | |
| </div> | |
| <button id="checkBtn" class="w-full bg-primary-500 hover:bg-primary-600 text-white font-bold py-2 px-4 rounded-md transition duration-300 flex items-center justify-center"> | |
| <i data-feather="search" class="mr-2"></i> Vérifier | |
| </button> | |
| <div id="errorMsg" class="mt-4 text-center text-red-500 hidden"> | |
| <i data-feather="alert-circle" class="inline mr-2"></i> | |
| <span>Matricule non trouvé. Veuillez réessayer.</span> | |
| </div> | |
| </div> | |
| </main> | |
| <script> | |
| // Initialize localStorage if empty | |
| if (!localStorage.getItem('students')) { | |
| localStorage.setItem('students', JSON.stringify([])); | |
| } | |
| document.getElementById('checkBtn').addEventListener('click', function() { | |
| const studentId = document.getElementById('studentId').value.trim(); | |
| const students = JSON.parse(localStorage.getItem('students')); | |
| const foundStudent = students.find(student => student.id === studentId); | |
| if (foundStudent) { | |
| localStorage.setItem('currentStudent', JSON.stringify(foundStudent)); | |
| window.location.href = 'result.html'; | |
| } else { | |
| document.getElementById('errorMsg').classList.remove('hidden'); | |
| setTimeout(() => { | |
| document.getElementById('errorMsg').classList.add('hidden'); | |
| }, 3000); | |
| } | |
| }); | |
| // Mobile menu toggle | |
| document.getElementById('mobile-menu-button').addEventListener('click', function() { | |
| // Implement mobile menu toggle functionality | |
| alert("Menu mobile à implémenter"); | |
| }); | |
| // Feather icons | |
| feather.replace(); | |
| </script> | |
| </body> | |
| </html> | |