34669-vm/index.php
Flatlogic Bot 6db56c92fb 1.1
2025-10-04 18:38:46 +00:00

190 lines
10 KiB
PHP

<?php
require_once __DIR__ . '/db/config.php';
require_once __DIR__ . '/mail/MailService.php';
$success_message = '';
$error_message = '';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = trim($_POST["name"]);
$email = trim($_POST["email"]);
$message = trim($_POST["message"]);
if (empty($name) || empty($email) || empty($message)) {
$error_message = "Please fill in all fields.";
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error_message = "Invalid email format.";
} else {
try {
$stmt = db()->prepare("INSERT INTO contact_submissions (name, email, message) VALUES (?, ?, ?)");
$stmt->execute([$name, $email, $message]);
MailService::sendContactMessage($name, $email, $message);
$success_message = "Thank you for your message! I will get back to you shortly.";
} catch (Exception $e) {
$error_message = "Something went wrong. Please try again later.";
// Optionally log the error: error_log($e->getMessage());
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>John Doe - Personal Portfolio</title>
<meta name="description" content="Showcase your talent with a personal portfolio site and get contact requests effortlessly.">
<meta name="keywords" content="personal portfolio, web developer, designer, freelancer, project showcase, contact form, resume, cv, skills">
<meta property="og:title" content="John Doe - Personal Portfolio">
<meta property="og:description" content="Showcase your talent with a personal portfolio site and get contact requests effortlessly.">
<meta property="og:image" content="https://project-screens.s3.amazonaws.com/screenshots/34669/app-hero-20251004-183255.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://project-screens.s3.amazonaws.com/screenshots/34669/app-hero-20251004-183255.png">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<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&family=Georgia:wght@700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light fixed-top py-3">
<div class="container">
<a class="navbar-brand fw-bold" href="#">John Doe</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="#about">About</a></li>
<li class="nav-item"><a class="nav-link" href="#portfolio">Portfolio</a></li>
<li class="nav-item"><a class="nav-link" href="#testimonials">Testimonials</a></li>
<li class="nav-item"><a class="nav-link" href="#contact">Contact</a></li>
</ul>
</div>
</div>
</nav>
<header class="vh-100 d-flex align-items-center text-center text-white" style="background: url('https://picsum.photos/seed/hero/1600/900') no-repeat center center; background-size: cover;">
<div class="container">
<h1 class="display-1 fw-bold">I build <span class="gradient-text">beautiful</span> web experiences.</h1>
<p class="lead my-4">I'm a passionate web developer and designer. Let's create something amazing together.</p>
<a href="#contact" class="btn btn-primary btn-lg">Get in Touch</a>
</div>
</header>
<main>
<section id="about" class="section">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-6">
<h2 class="display-4">About Me</h2>
<p class="lead">I am a creative developer with a passion for building beautiful and functional websites. With a background in design and a love for code, I strive to create user experiences that are both intuitive and engaging.</p>
<p>When I'm not coding, you can find me exploring new technologies, contributing to open-source projects, or enjoying a good cup of coffee.</p>
</div>
<div class="col-lg-6 text-center">
<img src="https://picsum.photos/seed/avatar/400/400" class="img-fluid rounded-circle" alt="A portrait of John Doe">
</div>
</div>
</div>
</section>
<section id="portfolio" class="section bg-light">
<div class="container">
<h2 class="display-4 text-center mb-5">My Work</h2>
<div class="row g-4">
<div class="col-md-6">
<div class="card h-100">
<img src="https://picsum.photos/seed/project1/800/600" class="card-img-top" alt="Placeholder for project 1.">
<div class="card-body">
<h5 class="card-title">Project One</h5>
<p class="card-text">A brief description of the project, highlighting the technologies used and the problems solved.</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card h-100">
<img src="https://picsum.photos/seed/project2/800/600" class="card-img-top" alt="Placeholder for project 2.">
<div class="card-body">
<h5 class="card-title">Project Two</h5>
<p class="card-text">Another project description, focusing on the creative process and the final outcome.</p>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="testimonials" class="section">
<div class="container">
<h2 class="display-4 text-center mb-5">What People Say</h2>
<div id="testimonialCarousel" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner text-center">
<div class="carousel-item active">
<p class="lead fst-italic">"Working with John was a fantastic experience. He is a true professional with a keen eye for detail."</p>
<footer class="blockquote-footer">Jane Smith, CEO of ExampleCorp</footer>
</div>
<div class="carousel-item">
<p class="lead fst-italic">"The final product exceeded all our expectations. Highly recommended!"</p>
<footer class="blockquote-footer">Mark Johnson, Founder of Startup Inc.</footer>
</div>
</div>
</div>
</div>
</section>
<section id="contact" class="section bg-light">
<div class="container">
<h2 class="display-4 text-center mb-5">Get In Touch</h2>
<div class="row justify-content-center">
<div class="col-lg-6">
<?php if ($success_message): ?>
<div class="alert alert-success" role="alert">
<?php echo $success_message; ?>
</div>
<?php endif; ?>
<?php if ($error_message): ?>
<div class="alert alert-danger" role="alert">
<?php echo $error_message; ?>
</div>
<?php endif; ?>
<form id="contactForm" action="index.php#contact" method="POST" class="<?php echo $success_message ? 'd-none' : ''; ?>">
<div class="mb-3">
<label for="name" class="form-label">Name</label>
<input type="text" class="form-control" id="name" name="name" required>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<input type="email" class="form-control" id="email" name="email" required>
</div>
<div class="mb-3">
<label for="message" class="form-label">Message</label>
<textarea class="form-control" id="message" name="message" rows="5" required></textarea>
</div>
<button type="submit" class="btn btn-primary w-100">Send Message</button>
</form>
<div id="formSuccess" style="display: none;" class="text-center">
<h3>Thank you!</h3>
<p>Your message has been sent successfully.</p>
</div>
</div>
</div>
</div>
</section>
</main>
<footer class="py-4 text-center">
<div class="container">
<p>&copy; <?php echo date("Y"); ?> John Doe. All Rights Reserved.</p>
<p><a href="privacy.php">Privacy Policy</a></p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>