Compare commits

..

No commits in common. "ai-dev" and "master" have entirely different histories.

5 changed files with 142 additions and 454 deletions

View File

@ -1,190 +0,0 @@
/* CrownEd Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Poppins:wght@400;600&display=swap');
:root {
--background-color: #121212;
--surface-color: #1E1E1E;
--primary-color: #FFD700;
--text-color: #FFFFFF;
--text-muted-color: #E0E0E0;
--border-radius: 8px;
--spacing-unit: 8px;
}
body {
background-color: var(--background-color);
color: var(--text-color);
font-family: 'Poppins', sans-serif;
margin: 0;
line-height: 1.6;
}
.container {
width: 90%;
max-width: 1100px;
margin: 0 auto;
padding: calc(var(--spacing-unit) * 4) 0;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Playfair Display', serif;
color: var(--primary-color);
margin-top: 0;
}
h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
a {
color: var(--primary-color);
text-decoration: none;
}
.btn {
display: inline-block;
padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 4);
background-color: var(--primary-color);
color: var(--background-color);
border: none;
border-radius: 9999px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
text-transform: uppercase;
letter-spacing: 1px;
}
.btn:hover {
transform: translateY(-3px);
box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}
header {
padding: calc(var(--spacing-unit) * 2) 0;
border-bottom: 1px solid var(--surface-color);
}
header .container {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-family: 'Playfair Display', serif;
font-size: 1.8rem;
font-weight: 700;
color: var(--primary-color);
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
}
nav ul li {
margin-left: calc(var(--spacing-unit) * 4);
}
nav a {
color: var(--text-color);
font-weight: 600;
transition: color 0.3s ease;
}
nav a:hover {
color: var(--primary-color);
}
.hero {
text-align: center;
padding: calc(var(--spacing-unit) * 10) 0;
}
.hero h1 {
margin-bottom: calc(var(--spacing-unit) * 2);
}
.hero p {
font-size: 1.2rem;
color: var(--text-muted-color);
max-width: 600px;
margin: 0 auto calc(var(--spacing-unit) * 4) auto;
}
.section {
padding: calc(var(--spacing-unit) * 8) 0;
text-align: center;
}
.section-title {
margin-bottom: calc(var(--spacing-unit) * 6);
}
.card {
background-color: var(--surface-color);
border: 1px solid var(--primary-color);
border-radius: var(--border-radius);
padding: calc(var(--spacing-unit) * 4);
margin-bottom: calc(var(--spacing-unit) * 4);
text-align: left;
}
.form-group {
margin-bottom: calc(var(--spacing-unit) * 2);
}
.form-control {
width: 100%;
padding: calc(var(--spacing-unit) * 1.5);
background-color: var(--surface-color);
border: 1px solid var(--primary-color);
border-radius: var(--border-radius);
color: var(--text-color);
font-family: 'Poppins', sans-serif;
}
.form-control:focus {
outline: none;
box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
textarea.form-control {
resize: vertical;
min-height: 150px;
}
footer {
text-align: center;
padding: calc(var(--spacing-unit) * 4) 0;
margin-top: calc(var(--spacing-unit) * 8);
border-top: 1px solid var(--surface-color);
color: var(--text-muted-color);
}
footer a {
margin: 0 calc(var(--spacing-unit) * 2);
}
#notification {
position: fixed;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
padding: 15px 30px;
border-radius: 5px;
color: #fff;
display: none;
z-index: 1000;
}
#notification.success {
background-color: #28a745;
}
#notification.error {
background-color: #dc3545;
}

View File

@ -1,26 +0,0 @@
// CrownEd Custom Scripts
document.addEventListener('DOMContentLoaded', function() {
const notification = document.getElementById('notification');
if (notification) {
// Show the notification if it exists
if (notification.textContent.trim().length > 0) {
notification.style.display = 'block';
setTimeout(() => {
notification.style.display = 'none';
}, 5000); // Hide after 5 seconds
}
}
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
if (this.getAttribute('href').length > 1) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
}
});
});
});

267
index.php
View File

@ -1,135 +1,150 @@
<?php
$notification = null;
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['contact_form'])) {
require_once __DIR__ . '/mail/MailService.php';
declare(strict_types=1);
@ini_set('display_errors', '1');
@error_reporting(E_ALL);
@date_default_timezone_set('UTC');
$name = filter_var(trim($_POST['name']), FILTER_SANITIZE_STRING);
$email = filter_var(trim($_POST['email']), FILTER_SANITIZE_EMAIL);
$message = filter_var(trim($_POST['message']), FILTER_SANITIZE_STRING);
if (empty($name) || !filter_var($email, FILTER_VALIDATE_EMAIL) || empty($message)) {
$notification = ['status' => 'error', 'message' => 'Please fill all fields correctly.'];
} else {
// IMPORTANT: Ask the user for the recipient email address.
// For now, we use the default from .env or MailService config.
$to = null;
$subject = 'New Contact Form Submission from ' . $name;
$res = MailService::sendContactMessage($name, $email, $message, $to, $subject);
if (!empty($res['success'])) {
$notification = ['status' => 'success', 'message' => 'Thank you! Your message has been sent.'];
} else {
// Do not expose detailed error messages to the user.
error_log('MailService Error: ' . $res['error']);
$notification = ['status' => 'error', 'message' => 'Sorry, there was an error sending your message. Please try again later.'];
}
}
}
$phpVersion = PHP_VERSION;
$now = date('Y-m-d H:i:s');
?>
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CrownEd - Luxury Education Platform</title>
<meta name="description" content="CrownEd is a next-generation learning platform offering past papers, AI-powered study assistance, and premium educational content.">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>New Style</title>
<?php
// Read project preview data from environment
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
?>
<?php if ($projectDescription): ?>
<!-- Meta description -->
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
<!-- Open Graph meta tags -->
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<!-- Twitter meta tags -->
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<?php endif; ?>
<?php if ($projectImageUrl): ?>
<!-- Open Graph image -->
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<!-- Twitter image -->
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<?php endif; ?>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<style>
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
}
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
}
body::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
animation: bg-pan 20s linear infinite;
z-index: -1;
}
@keyframes bg-pan {
0% { background-position: 0% 0%; }
100% { background-position: 100% 100%; }
}
main {
padding: 2rem;
}
.card {
background: var(--card-bg-color);
border: 1px solid var(--card-border-color);
border-radius: 16px;
padding: 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}
.loader {
margin: 1.25rem auto 1.25rem;
width: 48px;
height: 48px;
border: 3px solid rgba(255, 255, 255, 0.25);
border-top-color: #fff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.hint {
opacity: 0.9;
}
.sr-only {
position: absolute;
width: 1px; height: 1px;
padding: 0; margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap; border: 0;
}
h1 {
font-size: 3rem;
font-weight: 700;
margin: 0 0 1rem;
letter-spacing: -1px;
}
p {
margin: 0.5rem 0;
font-size: 1.1rem;
}
code {
background: rgba(0,0,0,0.2);
padding: 2px 6px;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
footer {
position: absolute;
bottom: 1rem;
font-size: 0.8rem;
opacity: 0.7;
}
</style>
</head>
<body>
<header>
<div class="container">
<a href="/" class="logo">CrownEd</a>
<nav>
<ul>
<li><a href="past-papers.php">Past Papers</a></li>
<li><a href="#features">Features</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#" class="btn">Login</a></li>
</ul>
</nav>
</div>
</header>
<main>
<section class="hero">
<div class="container">
<h1>Unlock Your Academic Potential</h1>
<p>Experience a new era of learning with AI-powered tools, extensive resources, and a community dedicated to excellence.</p>
<a href="#" class="btn">Get Started Now</a>
</div>
</section>
<section id="features" class="section">
<div class="container">
<h2 class="section-title">Platform Features</h2>
<div class="card">
<h3>Past Papers Archive</h3>
<p>Access a vast and organized library of past examination papers. Search, filter, and download resources to prepare effectively.</p>
</div>
<div class="card">
<h3>AI Study Helper</h3>
<p>Our intelligent assistant helps you tackle difficult questions, understand complex topics, and get personalized study recommendations.</p>
</div>
<div class="card">
<h3>Community & Collaboration</h3>
<p>Connect with peers and educators. Share knowledge, form study groups, and grow together in a supportive environment.</p>
</div>
</div>
</section>
<section id="about" class="section">
<div class="container">
<h2 class="section-title">About CrownEd</h2>
<p style="max-width: 800px; margin: 0 auto; color: var(--text-muted-color);">CrownEd was founded on the principle that every student deserves access to the best educational tools. We blend traditional resources with cutting-edge technology to create a learning experience that is not only effective but also inspiring. Our mission is to empower the next generation of leaders, thinkers, and innovators.</p>
</div>
</section>
<section id="contact" class="section">
<div class="container">
<h2 class="section-title">Get In Touch</h2>
<div class="card" style="max-width: 600px; margin: 0 auto;">
<form id="contactForm" method="POST" action="/#contact">
<input type="hidden" name="contact_form" value="1">
<div class="form-group">
<label for="name">Full Name</label>
<input type="text" id="name" name="name" class="form-control" required>
</div>
<div class="form-group">
<label for="email">Email Address</label>
<input type="email" id="email" name="email" class="form-control" required>
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea id="message" name="message" class="form-control" required></textarea>
</div>
<button type="submit" class="btn">Send Message</button>
</form>
</div>
<div style="margin-top: 20px; font-size: 0.9em;">
This is for testing purposes only Flatlogic does not guarantee usage of the mail server. Please set up your own SMTP in .env (MAIL_/SMTP_ vars) with our AI Agent.
</div>
</div>
</section>
</main>
<footer>
<div class="container">
<p>&copy; <?php echo date("Y"); ?> CrownEd. All Rights Reserved.</p>
<p>
<a href="privacy.php">Privacy Policy</a>
</p>
</div>
</footer>
<?php if ($notification): ?>
<div id="notification" class="<?php echo $notification['status']; ?>" style="display: block;">
<?php echo htmlspecialchars($notification['message']); ?>
</div>
<?php endif; ?>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
<main>
<div class="card">
<h1>Analyzing your requirements and generating your website…</h1>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
<span class="sr-only">Loading…</span>
</div>
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
<p class="hint">This page will update automatically as the plan is implemented.</p>
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
</div>
</main>
<footer>
Page updated: <?= htmlspecialchars($now) ?> (UTC)
</footer>
</body>
</html>

View File

@ -1,107 +0,0 @@
<?php
// This is a placeholder for any future PHP logic.
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Past Papers Search - CrownEd</title>
<meta name="description" content="Search and filter through a vast archive of past examination papers to enhance your study sessions.">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<header>
<div class="container">
<a href="/" class="logo">CrownEd</a>
<nav>
<ul>
<li><a href="past-papers.php">Past Papers</a></li>
<li><a href="/#features">Features</a></li>
<li><a href="/#about">About</a></li>
<li><a href="/#contact">Contact</a></li>
<li><a href="#" class="btn">Login</a></li>
</ul>
</nav>
</div>
</header>
<main>
<section class="hero">
<div class="container">
<h1>Past Papers Archive</h1>
<p>Find the exact resources you need from our extensive library of examination papers.</p>
</div>
</section>
<section id="search-section" class="section">
<div class="container">
<!-- Search and Filter Form -->
<div class="card" style="max-width: 800px; margin: 0 auto 40px auto;">
<form id="searchForm">
<div class="form-group">
<label for="searchQuery">Search by Keyword</label>
<input type="text" id="searchQuery" name="searchQuery" class="form-control" placeholder="e.g., 'Mathematics Paper 2'">
</div>
<div style="display: flex; gap: 20px; margin-bottom: 20px;">
<div class="form-group" style="flex: 1;">
<label for="subject">Subject</label>
<select id="subject" name="subject" class="form-control">
<option value="">All Subjects</option>
<option value="math">Mathematics</option>
<option value="phy">Physics</option>
<option value="chem">Chemistry</option>
<option value="bio">Biology</option>
</select>
</div>
<div class="form-group" style="flex: 1;">
<label for="year">Year</label>
<select id="year" name="year" class="form-control">
<option value="">All Years</option>
<option value="2023">2023</option>
<option value="2022">2022</option>
<option value="2021">2021</option>
</select>
</div>
</div>
<button type="submit" class="btn">Search Papers</button>DE>
</form>
</div>
<!-- Search Results Placeholder -->
<h2 class="section-title">Results</h2>
<div id="results-container">
<div class="card">
<h4>Mathematics - Paper 1 (2023)</h4>
<p>Exam Board: Cambridge | Level: A-Level</p>
<a href="#" class="btn-outline">View Details</a>
</div>
<div class="card">
<h4>Physics - Unit 4 (2022)</h4>
<p>Exam Board: Edexcel | Level: A-Level</p>
<a href="#" class="btn-outline">View Details</a>
</div>
<div class="card">
<h4>Chemistry - Inorganic (2023)</h4>
<p>Exam Board: AQA | Level: GCSE</p>
<a href="#" class="btn-outline">View Details</a>
</div>
<p style="text-align: center; color: var(--text-muted-color); margin-top: 20px;">Search functionality will be implemented soon.</p>
</div>
</div>
</section>
</main>
<footer>
<div class="container">
<p>&copy; <?php echo date("Y"); ?> CrownEd. All Rights Reserved.</p>
<p>
<a href="privacy.php">Privacy Policy</a>
</p>
</div>
</footer>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>

View File

@ -1,4 +0,0 @@
<?php
// Privacy Policy Page
echo "Privacy Policy Page";
?>