mastermath / index.html
jcitf's picture
Add 3 files
47864f9 verified
Raw History Blame Contribute Delete
16.8 kB
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MathMaster 3ème - Préparation au DNB</title>
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
math: {
primary: '#6366f1',
secondary: '#8b5cf6',
accent: '#ec4899',
dark: '#1e1b4b',
light: '#e0e7ff'
}
},
fontFamily: {
sans: ['Inter', 'sans-serif'],
math: ['"Roboto Slab"', 'serif']
}
}
}
}
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto+Slab:wght@400;500;600;700&display=swap">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js"></script>
<style>
/* Previous styles remain the same */
</style>
</head>
<body class="bg-math-light font-sans">
<!-- Fixed background elements -->
<div class="fixed inset-0 overflow-hidden pointer-events-none">
<div class="absolute top-1/4 left-1/4 w-32 h-32 rounded-full bg-purple-200 opacity-20 blur-xl"></div>
<div class="absolute top-1/3 right-1/4 w-40 h-40 rounded-full bg-blue-200 opacity-20 blur-xl"></div>
<div class="absolute bottom-1/4 right-1/3 w-28 h-28 rounded-full bg-pink-200 opacity-20 blur-xl"></div>
</div>
<!-- Header -->
<header class="bg-math-dark text-white shadow-lg relative z-10">
<!-- Header content remains the same -->
</header>
<!-- Main Content -->
<main class="container mx-auto px-4 py-8 relative z-10">
<!-- Welcome Banner -->
<div class="bg-white rounded-xl shadow-lg overflow-hidden mb-8 hero-pattern">
<!-- Welcome content remains the same -->
</div>
<!-- Diagnostic Banner -->
<div id="diagnosticBanner" class="bg-gradient-to-r from-blue-500 to-blue-600 text-white p-5 rounded-xl shadow-lg mb-8 flex flex-col md:flex-row justify-between items-center pulse">
<!-- Diagnostic content remains the same -->
</div>
<!-- Dashboard Grid -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8">
<!-- Progress Summary -->
<div class="bg-white rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-all duration-300 glow-hover">
<!-- Progress content remains the same -->
</div>
<!-- Recommended Section -->
<div class="bg-white rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-all duration-300 glow-hover">
<!-- Recommended content remains the same -->
</div>
<!-- Badges & Achievements -->
<div class="bg-white rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-all duration-300 glow-hover">
<!-- Badges content remains the same -->
</div>
</div>
<!-- Themes Grid -->
<div class="bg-white rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-all duration-300 mb-8">
<!-- Themes content remains the same -->
</div>
<!-- Recent Activity Section -->
<div class="bg-white rounded-xl shadow-lg overflow-hidden mb-8">
<!-- Activity content remains the same -->
</div>
</main>
<!-- AI Assistant Button -->
<div class="fixed bottom-6 right-6 z-20">
<button id="aiAssistantBtn" class="relative bg-gradient-to-br from-math-primary to-math-secondary text-white w-16 h-16 rounded-full shadow-xl flex items-center justify-center transition-transform hover:scale-110 group">
<i class="fas fa-robot text-2xl group-hover:animate-bounce"></i>
<span class="absolute -top-1 -right-1 bg-math-accent text-white text-xs font-bold w-5 h-5 rounded-full flex items-center justify-center animate-pulse">1</span>
</button>
</div>
<!-- AI Assistant Panel -->
<div id="aiAssistantPanel" class="fixed bottom-28 right-6 w-80 bg-white rounded-xl shadow-2xl border border-gray-200 hidden transform transition-all duration-300 ease-in-out z-20">
<!-- AI Panel content remains the same -->
</div>
<!-- Statistics Modal -->
<div id="statsModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<!-- Stats modal content remains the same -->
</div>
<!-- Exercise Modal -->
<div id="exerciseModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<!-- Exercise modal content remains the same -->
</div>
<!-- Diagnostic Modal -->
<div id="diagnosticModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<!-- Diagnostic modal content remains the same -->
</div>
<!-- Theme Details Modal -->
<div id="themeModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<!-- Theme modal content remains the same -->
</div>
<!-- JavaScript to fix all bugs -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// 1. Fix dropdown menu toggle
const userBtn = document.getElementById('userBtn');
const userDropdown = document.getElementById('userDropdown');
if (userBtn && userDropdown) {
userBtn.addEventListener('click', function(e) {
e.stopPropagation();
userDropdown.classList.toggle('hidden');
});
// Close dropdown when clicking outside
document.addEventListener('click', function() {
userDropdown.classList.add('hidden');
});
}
// 2. Fix AI Assistant panel toggle
const aiAssistantBtn = document.getElementById('aiAssistantBtn');
const aiAssistantPanel = document.getElementById('aiAssistantPanel');
const closeAIPanel = document.getElementById('closeAIPanel');
if (aiAssistantBtn && aiAssistantPanel) {
aiAssistantBtn.addEventListener('click', function() {
aiAssistantPanel.classList.toggle('hidden');
});
}
if (closeAIPanel) {
closeAIPanel.addEventListener('click', function() {
aiAssistantPanel.classList.add('hidden');
});
}
// 3. Fix modals toggle
const modals = {
stats: {
open: document.getElementById('statsBtn'),
close: document.getElementById('closeStatsModal'),
modal: document.getElementById('statsModal')
},
exercise: {
open: document.getElementById('startDiagnostic'), // Example - should be proper button
close: document.getElementById('closeExerciseModal'),
modal: document.getElementById('exerciseModal')
},
diagnostic: {
open: document.getElementById('startDiagnostic'),
close: document.getElementById('closeDiagnosticModal'),
modal: document.getElementById('diagnosticModal')
},
theme: {
open: document.querySelectorAll('.theme-card'), // All theme cards
close: document.getElementById('closeThemeModal'),
modal: document.getElementById('themeModal')
}
};
// Set up modal open/close handlers
Object.keys(modals).forEach(key => {
const modal = modals[key];
if (modal.open) {
if (key === 'theme') {
// Special handling for theme cards
modal.open.forEach(card => {
card.addEventListener('click', function() {
modal.modal.classList.remove('hidden');
});
});
} else if (modal.open.addEventListener) {
modal.open.addEventListener('click', function() {
modal.modal.classList.remove('hidden');
});
}
}
if (modal.close) {
modal.close.addEventListener('click', function() {
modal.modal.classList.add('hidden');
});
}
});
// 4. Fix solution toggle in exercise modal
const showSolution = document.getElementById('showSolution');
const solutionSection = document.getElementById('solutionSection');
if (showSolution && solutionSection) {
showSolution.addEventListener('click', function() {
solutionSection.classList.toggle('hidden');
});
}
// 5. Initialize charts in stats modal
if (document.getElementById('themeProgressChart') && document.getElementById('successRateChart')) {
// Theme Progress Chart
const themeProgressCtx = document.getElementById('themeProgressChart').getContext('2d');
new Chart(themeProgressCtx, {
type: 'bar',
data: {
labels: ['Calcul', 'Littéral', 'Géométrie', 'Stats', 'Probas', 'Fonctions'],
datasets: [{
label: 'Progression (%)',
data: [75, 60, 40, 30, 65, 50],
backgroundColor: [
'#6366f1',
'#8b5cf6',
'#ec4899',
'#10b981',
'#f59e0b',
'#3b82f6'
],
borderWidth: 0
}]
},
options: {
responsive: true,
scales: {
y: {
beginAtZero: true,
max: 100
}
}
}
});
// Success Rate Chart
const successRateCtx = document.getElementById('successRateChart').getContext('2d');
new Chart(successRateCtx, {
type: 'doughnut',
data: {
labels: ['Réussite', 'Échec', 'Non tenté'],
datasets: [{
data: [65, 25, 10],
backgroundColor: [
'#10b981',
'#ef4444',
'#e5e7eb'
],
borderWidth: 0
}]
},
options: {
responsive: true,
cutout: '70%'
}
});
}
// 6. Fix form submission and validation
const aiMessageInput = document.getElementById('aiMessageInput');
const sendAIMessage = document.getElementById('sendAIMessage');
const aiChatContainer = document.getElementById('aiChatContainer');
if (sendAIMessage && aiMessageInput && aiChatContainer) {
sendAIMessage.addEventListener('click', function() {
const message = aiMessageInput.value.trim();
if (message) {
// Add user message
const userMessage = document.createElement('div');
userMessage.className = 'ai-message bg-math-primary text-white p-3 rounded-lg mb-3 ml-8 relative';
userMessage.innerHTML = `
<div class="absolute -right-1.5 top-3 w-3 h-3 bg-math-primary transform rotate-45"></div>
<p>${message}</p>
`;
aiChatContainer.appendChild(userMessage);
// Clear input
aiMessageInput.value = '';
// Simulate AI response
setTimeout(() => {
const aiResponse = document.createElement('div');
aiResponse.className = 'ai-message bg-math-light text-gray-800 p-3 rounded-lg mb-3 relative';
aiResponse.innerHTML = `
<div class="absolute -left-1.5 top-3 w-3 h-3 bg-math-light transform rotate-45"></div>
<p>Voici une réponse à votre question sur "${message}". En mathématiques, il est important de comprendre les concepts fondamentaux avant de passer aux exercices complexes.</p>
`;
aiChatContainer.appendChild(aiResponse);
aiChatContainer.scrollTop = aiChatContainer.scrollHeight;
}, 1000);
}
});
// Allow pressing Enter to send message
aiMessageInput.addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
sendAIMessage.click();
}
});
}
// 7. Add confetti effect for achievements
function createConfetti() {
const colors = ['#6366f1', '#8b5cf6', '#ec4899', '#10b981', '#f59e0b'];
for (let i = 0; i < 50; i++) {
const confetti = document.createElement('div');
confetti.className = 'confetti';
confetti.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
confetti.style.left = Math.random() * 100 + 'vw';
confetti.style.top = -10 + 'px';
confetti.style.transform = `rotate(${Math.random() * 360}deg)`;
document.body.appendChild(confetti);
anime({
targets: confetti,
translateY: [0, window.innerHeight],
translateX: [0, Math.random() * 200 - 100],
opacity: [1, 0],
duration: 2000 + Math.random() * 3000,
easing: 'easeInOutQuad',
complete: () => confetti.remove()
});
}
}
// Add confetti when completing a diagnostic
const startDiagnosticTest = document.getElementById('startDiagnosticTest');
if (startDiagnosticTest) {
startDiagnosticTest.addEventListener('click', function() {
document.getElementById('diagnosticModal').classList.add('hidden');
setTimeout(createConfetti, 1000); // Simulate completion after 1s
});
}
});
</script>
<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=jcitf/mastermath" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>