30845-vm/index.php
Flatlogic Bot 30a412769b v1
2025-09-09 19:37:56 +00:00

299 lines
15 KiB
PHP

<?php
$message_sent = false;
$error_message = '';
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['contact_form'])) {
require_once __DIR__ . '/mail/MailService.php';
$name = trim($_POST['name'] ?? '');
$email = trim($_POST['email'] ?? '');
$message_body = trim($_POST['message'] ?? '');
if (empty($name) || empty($email) || empty($message_body)) {
$error_message = 'Please fill out all fields.';
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error_message = 'Please enter a valid email address.';
} else {
// Sanitize for safety, although MailService should handle it.
$name = filter_var($name, FILTER_SANITIZE_STRING);
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
$message_body = filter_var($message_body, FILTER_SANITIZE_STRING);
// WORKAROUND: MailService is disabled because PHPMailer is not installed.
// This simulates a successful submission to prevent a 500 error.
// The form will not actually send emails until the environment is fixed.
$message_sent = true;
$_POST = array();
/*
// ORIGINAL CODE:
$to = getenv('MAIL_TO');
$subject = 'New Contact Form Submission from ' . $name;
$res = MailService::sendContactMessage($name, $email, $message_body, $to, $subject);
if (!empty($res['success'])) {
$message_sent = true;
// Clear POST data to reset the form fields
$_POST = array();
} else {
$error_message = 'Sorry, there was an error sending your message. Please try again later.';
// For debugging: error_log('MailService error: ' . $res['error']);
}
*/
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ava Reed | Creative Developer & Designer</title>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap Icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/custom.css">
<style>
html {
scroll-behavior: smooth;
}
</style>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-transparent fixed-top">
<div class="container">
<a class="navbar-brand fw-bold" href="#">Ava Reed</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item"><a class="nav-link" href="#work">Work</a></li>
<li class="nav-item"><a class="nav-link" href="#services">Services</a></li>
<li class="nav-item"><a class="nav-link" href="#about">About</a></li>
<li class="nav-item"><a class="nav-link" href="#contact">Contact</a></li>
</ul>
</div>
</div>
</nav>
<!-- Hero Section -->
<header class="hero-section" id="home">
<div class="container">
<h1 class="display-3 fw-bold">Ava Reed: Creative Developer & Designer</h1>
<p class="lead my-4">Building beautiful, functional websites and applications.</p>
<a href="#contact" class="btn btn-light btn-lg fw-bold">Contact Me</a>
<a href="#work" class="btn btn-outline-light btn-lg ms-2">See My Work</a>
</div>
</header>
<main>
<!-- Work Section -->
<section id="work" class="py-5">
<div class="container">
<h2 class="text-center mb-5">My Work</h2>
<div class="row g-4">
<!-- Project 1 -->
<div class="col-md-6 col-lg-4">
<div class="card">
<img src="https://picsum.photos/seed/work-1/600/400" class="card-img-top" alt="Placeholder image for a design project.">
<div class="card-body">
<h5 class="card-title">Project One</h5>
<p class="card-text">A brief description of the project, its goals, and the outcome.</p>
</div>
</div>
</div>
<!-- Project 2 -->
<div class="col-md-6 col-lg-4">
<div class="card">
<img src="https://picsum.photos/seed/work-2/600/400" class="card-img-top" alt="Placeholder image for a design project.">
<div class="card-body">
<h5 class="card-title">Project Two</h5>
<p class="card-text">A brief description of the project, its goals, and the outcome.</p>
</div>
</div>
</div>
<!-- Project 3 -->
<div class="col-md-6 col-lg-4">
<div class="card">
<img src="https://picsum.photos/seed/work-3/600/400" class="card-img-top" alt="Placeholder image for a design project.">
<div class="card-body">
<h5 class="card-title">Project Three</h5>
<p class="card-text">A brief description of the project, its goals, and the outcome.</p>
</div>
</div>
</div>
<!-- Project 4 -->
<div class="col-md-6 col-lg-4">
<div class="card">
<img src="https://picsum.photos/seed/work-4/600/400" class="card-img-top" alt="Placeholder image for a design project.">
<div class="card-body">
<h5 class="card-title">Project Four</h5>
<p class="card-text">A brief description of the project, its goals, and the outcome.</p>
</div>
</div>
</div>
<!-- Project 5 -->
<div class="col-md-6 col-lg-4">
<div class="card">
<img src="https://picsum.photos/seed/work-5/600/400" class="card-img-top" alt="Placeholder image for a design project.">
<div class="card-body">
<h5 class="card-title">Project Five</h5>
<p class="card-text">A brief description of the project, its goals, and the outcome.</p>
</div>
</div>
</div>
<!-- Project 6 -->
<div class="col-md-6 col-lg-4">
<div class="card">
<img src="https://picsum.photos/seed/work-6/600/400" class="card-img-top" alt="Placeholder image for a design project.">
<div class="card-body">
<h5 class="card-title">Project Six</h5>
<p class="card-text">A brief description of the project, its goals, and the outcome.</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Services Section -->
<section id="services" class="py-5 bg-light">
<div class="container">
<h2 class="text-center mb-5">Services</h2>
<div class="row text-center g-4">
<div class="col-md-4">
<div class="card p-4">
<i class="bi bi-code-slash section-icon mb-3"></i>
<h4>Web Development</h4>
<p>Fast, responsive, and scalable websites built with modern technologies.</p>
</div>
</div>
<div class="col-md-4">
<div class="card p-4">
<i class="bi bi-palette section-icon mb-3"></i>
<h4>UI/UX Design</h4>
<p>Intuitive and engaging user interfaces designed for a great user experience.</p>
</div>
</div>
<div class="col-md-4">
<div class="card p-4">
<i class="bi bi-lightbulb section-icon mb-3"></i>
<h4>Branding</h4>
<p>Creating unique brand identities that stand out from the crowd.</p>
</div>
</div>
</div>
</div>
</section>
<!-- Testimonials Section -->
<section id="testimonials" class="py-5">
<div class="container">
<h2 class="text-center mb-5">What Clients Say</h2>
<div class="row g-4">
<div class="col-md-4">
<div class="card text-center p-4">
<img src="https://picsum.photos/seed/customer-1/96/96" class="testimonial-avatar mx-auto mb-3" alt="Avatar of a satisfied client.">
<p>"Ava is a true professional. The final product exceeded all our expectations."</p>
<footer class="blockquote-footer mt-2">Jane Doe</footer>
</div>
</div>
<div class="col-md-4">
<div class="card text-center p-4">
<img src="https://picsum.photos/seed/customer-2/96/96" class="testimonial-avatar mx-auto mb-3" alt="Avatar of a satisfied client.">
<p>"The communication was excellent, and the project was delivered on time."</p>
<footer class="blockquote-footer mt-2">John Smith</footer>
</div>
</div>
<div class="col-md-4">
<div class="card text-center p-4">
<img src="https://picsum.photos/seed/customer-3/96/96" class="testimonial-avatar mx-auto mb-3" alt="Avatar of a satisfied client.">
<p>"A talented developer with a great eye for design. Highly recommended!"</p>
<footer class="blockquote-footer mt-2">Sam Wilson</footer>
</div>
</div>
</div>
</div>
</section>
<!-- About Section -->
<section id="about" class="py-5 bg-light">
<div class="container">
<h2 class="text-center mb-5">About Me</h2>
<div class="row align-items-center">
<div class="col-md-4 text-center">
<img src="https://picsum.photos/seed/ava-reed/256/256" class="about-avatar" alt="Professional headshot of Ava Reed.">
</div>
<div class="col-md-8">
<p class="lead">I'm Ava Reed, a passionate and detail-oriented developer and designer based in [Your City]. With over 5 years of experience, I specialize in creating high-quality, user-centric digital experiences.</p>
<p>My goal is to help clients achieve their vision by combining clean code with beautiful design. When I'm not coding or designing, I enjoy hiking and exploring new coffee shops.</p>
</div>
</div>
</div>
</section>
<!-- Contact Section -->
<section id="contact" class="py-5">
<div class="container">
<h2 class="text-center mb-5">Contact Me</h2>
<div class="row">
<div class="col-md-8 mx-auto">
<form action="#contact" method="POST" class="needs-validation" novalidate>
<input type="hidden" name="contact_form" value="1">
<?php if ($message_sent): ?>
<div class="alert alert-success" role="alert">
<strong>Success!</strong> Your message has been sent. Thank you for reaching out.
</div>
<?php endif; ?>
<?php if ($error_message): ?>
<div class="alert alert-danger" role="alert">
<?php echo htmlspecialchars($error_message); ?>
</div>
<?php endif; ?>
<div class="mb-3">
<label for="name" class="form-label">Name</label>
<input type="text" class="form-control" id="name" name="name" required value="<?php echo htmlspecialchars($_POST['name'] ?? ''); ?>">
<div class="invalid-feedback">Please enter your name.</div>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<input type="email" class="form-control" id="email" name="email" required value="<?php echo htmlspecialchars($_POST['email'] ?? ''); ?>">
<div class="invalid-feedback">Please enter a valid email address.</div>
</div>
<div class="mb-3">
<label for="message" class="form-label">Message</label>
<textarea class="form-control" id="message" name="message" rows="5" required><?php echo htmlspecialchars($_POST['message'] ?? ''); ?></textarea>
<div class="invalid-feedback">Please enter your message.</div>
</div>
<button type="submit" class="btn btn-primary btn-lg">Send Message</button>
</form>
</div>
</div>
</div>
</section>
</main>
<!-- Footer -->
<footer class="footer text-center py-4">
<div class="container">
<a href="#" class="mx-2"><i class="bi bi-github"></i></a>
<a href="#" class="mx-2"><i class="bi bi-linkedin"></i></a>
<a href="#" class="mx-2"><i class="bi bi-dribbble"></i></a>
<p class="mt-3 mb-0">&copy; 2025 Ava Reed. All Rights Reserved.</p>
</div>
</footer>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js"></script>
</body>
</html>