Files
SWE/webseite/homepage.php
2024-10-28 18:57:59 +01:00

244 lines
9.0 KiB
PHP

<!DOCTYPE html>
<!--Homepage-->
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modernes Lernportal</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
<style>
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-20px); }
}
.card-hover {
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.card-hover:hover {
transform: translateY(-10px) scale(1.02);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.gradient-border {
position: relative;
background: linear-gradient(white, white) padding-box,
linear-gradient(45deg, #7C3AED, #F59E0B) border-box;
border: 4px solid transparent;
border-radius: 1rem;
}
.blob {
animation: blob 7s infinite;
filter: blur(40px);
}
@keyframes blob {
0%, 100% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; }
33% { border-radius: 72% 28% 30% 70% / 53% 51% 49% 47%; }
66% { border-radius: 38% 62% 63% 37% / 46% 48% 52% 54%; }
}
.pulse {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
/* Improved icon hover effect */
.w-12 {
transition: all 0.3s ease;
}
.card-hover:hover .w-12 {
transform: scale(1.1) rotate(-5deg);
}
/* Improved button hover effect */
.hover\:bg-purple-700:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}
/* Scroll to top button */
.scroll-top {
position: fixed;
bottom: 2rem;
right: 6rem; /* Move scroll-top button to the left of accessibility button */
background: linear-gradient(135deg, #7C3AED, #F59E0B);
color: white;
padding: 1rem;
border-radius: 50%;
cursor: pointer;
opacity: 0;
transition: all 0.3s ease;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.scroll-top.visible {
opacity: 1;
}
.scroll-top:hover {
transform: translateY(-3px);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
</style>
</head>
<body class="bg-gray-50">
<!-- Animated background blobs -->
<div class="fixed inset-0 -z-10 overflow-hidden">
<div class="blob absolute w-96 h-96 bg-purple-300/30 -top-48 -left-16"></div>
<div class="blob absolute w-96 h-96 bg-amber-300/30 bottom-0 right-0"></div>
</div>
<!-- Navigation -->
<nav class="fixed top-0 w-full bg-white/80 backdrop-blur-lg shadow-sm z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<span class="text-2xl font-bold text-purple-600">Lern<span class="text-amber-500">Portal</span></span>
</div>
<!-- Add this accessibility controls -->
</div>
</div>
</nav>
<!-- Hero Section -->
<div class="pt-24 pb-16 px-4">
<div class="max-w-7xl mx-auto">
<div class="text-center">
<h1 class="text-5xl md:text-6xl font-bold text-gray-900 mb-6 pulse">
Entdecke deine <span class="text-purple-600">Lernreise</span>
</h1>
<p class="text-xl text-gray-600 max-w-2xl mx-auto">
Interaktives Lernen für die digitale Generation. Personalisierte Lernpfade, sofortiges Feedback und spielerische Elemente.
</p>
</div>
</div>
</div>
<!-- Subject Grid -->
<div class="max-w-7xl mx-auto px-4 py-12 grid grid-cols-1 md:grid-cols-2 gap-8">
<!-- Mathematik -->
<?php
require_once ("classes/SubjectData.php");
$subjects = SubjectData::getAll();
foreach ($subjects as $subject) {
?>
<a href="subject.php?subject=<?php echo($subject->id); ?>" class="block">
<div class="gradient-border p-6 card-hover bg-white">
<div class="flex items-start space-x-4">
<div class="w-12 h-12 rounded-lg bg-purple-100 flex items-center justify-center">
<i class="fas <?php echo($subject->icon); ?> text-2xl text-purple-600"></i>
</div>
<div class="flex-1">
<h3 class="text-xl font-bold text-gray-900 mb-2"><?php echo($subject->displayName); ?></h3>
<p class="text-gray-600 mb-4"><?php echo($subject->description); ?></p>
<div class="grid grid-cols-3 gap-4 mb-4">
<div class="text-center p-2 rounded-lg bg-purple-50">
<div class="font-bold text-purple-600">150+</div>
<div class="text-sm text-gray-600">Übungen</div>
</div>
<div class="text-center p-2 rounded-lg bg-purple-50">
<div class="font-bold text-purple-600">12</div>
<div class="text-sm text-gray-600">Kapitel</div>
</div>
<div class="text-center p-2 rounded-lg bg-purple-50">
<div class="font-bold text-purple-600">4.8</div>
<div class="text-sm text-gray-600">Bewertung</div>
</div>
</div>
<div class="flex items-center space-x-2">
<span class="text-sm text-gray-500">Aktuelle Einheit:</span>
<span class="px-2 py-1 rounded-full bg-purple-100 text-purple-600 text-sm">Bruchrechnung</span>
</div>
</div>
</div>
</div>
</a>
<?php
}
?>
</div>
<button class="scroll-top" onclick="scrollToTop()" id="scrollTop">
<i class="fas fa-arrow-up"></i>
</button>
<script>
// Initialize GSAP animations
gsap.from(".gradient-border", {
duration: 0.8,
y: 60,
opacity: 0,
stagger: 0.2,
ease: "power3.out"
});
// Add intersection observer for scroll animations
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.transform = "translateY(0)";
entry.target.style.opacity = "1";
}
});
}, { threshold: 0.1 });
document.querySelectorAll('.gradient-border').forEach((el) => {
observer.observe(el);
});
// Scroll to top functionality
window.onscroll = function() {
const scrollBtn = document.getElementById('scrollTop');
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
scrollBtn.classList.add('visible');
} else {
scrollBtn.classList.remove('visible');
}
};
function scrollToTop() {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
}
// Add hover effects for subject cards
document.querySelectorAll('.gradient-border').forEach(card => {
card.addEventListener('mouseenter', () => {
gsap.to(card.querySelector('.w-12'), {
rotate: -10,
scale: 1.2,
duration: 0.3
});
});
card.addEventListener('mouseleave', () => {
gsap.to(card.querySelector('.w-12'), {
rotate: 0,
scale: 1,
duration: 0.3
});
});
});
</script>
</body>
</html>