This commit is contained in:
Flatlogic Bot 2025-12-10 13:17:07 +00:00
parent 54ccc4bd18
commit f472381401
4 changed files with 359 additions and 145 deletions

136
assets/css/custom.css Normal file
View File

@ -0,0 +1,136 @@
/* General & Typography */
body {
font-family: 'Helvetica', 'Arial', sans-serif;
color: #212529;
background-color: #f8f9fa;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Georgia', 'Times New Roman', Times, serif;
font-weight: 700;
}
.fw-medium {
font-weight: 500;
}
/* Navbar */
.navbar {
transition: background-color 0.3s ease-in-out;
}
.navbar-brand {
font-family: 'Georgia', 'Times New Roman', Times, serif;
font-weight: bold;
}
/* Hero Section */
.hero {
padding: 6rem 0;
background-color: #f8f9fa;
background-image: linear-gradient(135deg, rgba(44, 110, 73, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
}
.hero h1 {
font-size: 3.5rem;
}
.hero .lead {
font-size: 1.25rem;
color: #495057;
}
/* Buttons */
.btn-primary {
background-color: #2c6e49;
border-color: #2c6e49;
padding: 0.75rem 1.5rem;
border-radius: 0.5rem;
transition: background-color 0.2s, border-color 0.2s;
}
.btn-primary:hover, .btn-primary:focus {
background-color: #1e4932;
border-color: #1e4932;
}
.btn-secondary {
background-color: #fe7f2d;
border-color: #fe7f2d;
padding: 0.75rem 1.5rem;
border-radius: 0.5rem;
color: #fff;
transition: background-color 0.2s, border-color 0.2s;
}
.btn-secondary:hover, .btn-secondary:focus {
background-color: #e46815;
border-color: #e46815;
color: #fff;
}
/* Sections */
section {
padding: 5rem 0;
}
.section-title {
font-size: 2.5rem;
margin-bottom: 3rem;
text-align: center;
}
/* Service Section */
.service-card {
border: none;
border-radius: 0.5rem;
padding: 2rem;
background-color: #ffffff;
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
transition: transform 0.3s, box-shadow 0.3s;
height: 100%;
}
.service-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.service-icon {
font-size: 3rem;
color: #2c6e49;
margin-bottom: 1.5rem;
}
/* About Section */
#about {
background-color: #ffffff;
}
#about img {
border-radius: 0.5rem;
}
/* Contact Section */
#contact {
background-color: #f8f9fa;
}
.form-control {
border-radius: 0.5rem;
padding: 0.75rem;
}
.form-control:focus {
border-color: #2c6e49;
box-shadow: 0 0 0 0.25rem rgba(44, 110, 73, 0.25);
}
/* Footer */
.footer {
background-color: #212529;
color: #f8f9fa;
padding: 2rem 0;
}

23
assets/js/main.js Normal file
View File

@ -0,0 +1,23 @@
document.addEventListener('DOMContentLoaded', function() {
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Navbar shrink on scroll
const navbar = document.querySelector('.navbar');
if (navbar) {
window.addEventListener('scroll', () => {
if (window.scrollY > 50) {
navbar.classList.add('bg-white', 'shadow-sm');
} else {
navbar.classList.remove('bg-white', 'shadow-sm');
}
});
}
});

53
contact.php Normal file
View File

@ -0,0 +1,53 @@
<?php
ini_set('display_errors', 0);
error_reporting(E_ALL & ~E_NOTICE);
require_once __DIR__ . '/mail/MailService.php';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$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 (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
header("Location: index.php?status=error&msg=Invalid+email#contact");
exit;
}
if (empty($name) || empty($message)) {
header("Location: index.php?status=error&msg=Please+fill+out+all+fields#contact");
exit;
}
$to = getenv('MAIL_TO') ?: (getenv('MAIL_FROM') ?: 'admin@example.com');
$subject = "New Contact Form Submission from " . $name;
$html_content = "<h3>New Contact Form Submission</h3>";
$html_content .= "<p><b>Name:</b> " . htmlspecialchars($name) . "</p>";
$html_content .= "<p><b>Email:</b> " . htmlspecialchars($email) . "</p>";
$html_content .= "<p><b>Message:</b><br>" . nl2br(htmlspecialchars($message)) . "</p>";
$text_content = "New Contact Form Submission\n";
$text_content .= "Name: " . $name . "\n";
$text_content .= "Email: " . $email . "\n";
$text_content .= "Message:\n" . $message . "\n";
$options = [
'reply_to' => $email,
'from_name' => $name
];
$result = MailService::sendMail($to, $subject, $html_content, $text_content, $options);
if (!empty($result['success'])) {
header("Location: index.php?status=success#contact");
exit;
} else {
error_log("MailService Error: " . ($result['error'] ?? 'Unknown error'));
header("Location: index.php?status=error&msg=Could+not+send+message#contact");
exit;
}
} else {
header("Location: index.php");
exit;
}

284
index.php
View File

@ -1,150 +1,152 @@
<?php <!DOCTYPE html>
declare(strict_types=1);
@ini_set('display_errors', '1');
@error_reporting(E_ALL);
@date_default_timezone_set('UTC');
$phpVersion = PHP_VERSION;
$now = date('Y-m-d H:i:s');
?>
<!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Style</title>
<?php <title><?php echo htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'AgriTrade Connect'); ?></title>
// Read project preview data from environment <meta name="description" content="<?php echo htmlspecialchars($_SERVER['PROJECT_DESCRIPTION'] ?? 'A modern platform for farmers to sell grains and for agencies to win leads.'); ?>">
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? ''; <!-- SEO Meta Tags -->
?> <meta name="robots" content="index, follow">
<?php if ($projectDescription): ?>
<!-- Meta description --> <!-- Open Graph / Twitter -->
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' /> <meta property="og:title" content="<?php echo htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'AgriTrade Connect'); ?>">
<!-- Open Graph meta tags --> <meta property="og:description" content="<?php echo htmlspecialchars($_SERVER['PROJECT_DESCRIPTION'] ?? 'A modern platform for farmers to sell grains and for agencies to win leads.'); ?>">
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" /> <meta property="og:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?>">
<!-- Twitter meta tags --> <meta name="twitter:card" content="summary_large_image">
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<?php endif; ?> <!-- Stylesheets -->
<?php if ($projectImageUrl): ?> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Open Graph image --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" /> <link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<!-- 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> </head>
<body> <body>
<main>
<div class="card"> <!-- Header -->
<h1>Analyzing your requirements and generating your website…</h1> <nav class="navbar navbar-expand-lg navbar-light fixed-top">
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes"> <div class="container">
<span class="sr-only">Loading…</span> <a class="navbar-brand fs-4" href="#"><?php echo htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'AgriTrade'); ?></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="#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 btn btn-secondary btn-sm px-3 text-white" href="#contact">Get a Quote</a></li>
</ul>
</div> </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> </div>
</main> </nav>
<footer>
Page updated: <?= htmlspecialchars($now) ?> (UTC) <!-- Hero Section -->
<section class="hero text-center">
<div class="container">
<h1 class="display-3">Connecting Farmers to the Future of Trade</h1>
<p class="lead col-lg-8 mx-auto">We build powerful online marketplaces for agricultural commodities and create winning strategies for agri-businesses to capture new leads.</p>
<a href="#contact" class="btn btn-primary btn-lg">Request a Consultation</a>
</div>
</section>
<!-- Services Section -->
<section id="services">
<div class="container">
<h2 class="section-title">Our Services</h2>
<div class="row g-4">
<div class="col-md-4">
<div class="service-card text-center">
<i class="bi bi-shop service-icon"></i>
<h3 class="fs-4">Marketplace Development</h3>
<p>We build robust, scalable online marketplaces for farmers to sell their produce directly to buyers, ensuring fair prices and wide reach.</p>
</div>
</div>
<div class="col-md-4">
<div class="service-card text-center">
<i class="bi bi-bullseye service-icon"></i>
<h3 class="fs-4">Lead Generation</h3>
<p>Our digital marketing strategies for agri-businesses are designed to attract, engage, and convert high-quality leads.</p>
</div>
</div>
<div class="col-md-4">
<div class="service-card text-center">
<i class="bi bi-graph-up-arrow service-icon"></i>
<h3 class="fs-4">Agri-Tech Consulting</h3>
<p>Leverage our expertise to integrate modern technology into your agricultural business for improved efficiency and growth.</p>
</div>
</div>
</div>
</div>
</section>
<!-- About Section -->
<section id="about">
<div class="container">
<div class="row align-items-center g-5">
<div class="col-lg-6">
<img src="https://images.pexels.com/photos/4245826/pexels-photo-4245826.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" class="img-fluid shadow-lg" alt="Lush green field" style="border-radius: .5rem;">
</div>
<div class="col-lg-6">
<h2 class="section-title text-start">Our Mission</h2>
<p class="lead">Our mission is to empower farmers and agricultural businesses through technology. We believe in creating transparent, efficient, and profitable connections that strengthen the entire agricultural value chain.</p>
<p>From custom software solutions to targeted digital marketing, we are dedicated to helping our clients thrive in a rapidly evolving industry. We are more than a service provider; we are your partner in growth.</p>
</div>
</div>
</div>
</section>
<!-- Contact Section -->
<section id="contact">
<div class="container">
<h2 class="section-title">Get in Touch</h2>
<div class="row">
<div class="col-lg-8 mx-auto">
<?php if(isset($_GET['status'])): ?>
<div class="alert alert-<?php echo $_GET['status'] == 'success' ? 'success' : 'danger'; ?> alert-dismissible fade show" role="alert">
<?php
if($_GET['status'] == 'success'){
echo "Thank you for your message! We will get back to you shortly.";
} else {
echo htmlspecialchars($_GET['msg'] ?? 'An error occurred. Please try again.');
}
?>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<?php endif; ?>
<div class="p-4 p-md-5 bg-white shadow-sm" style="border-radius: .5rem;">
<form action="contact.php" method="POST">
<div class="mb-3">
<label for="name" class="form-label">Your Name</label>
<input type="text" class="form-control" id="name" name="name" required>
</div>
<div class="mb-3">
<label for="email" class="form-label">Your 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>
<div class="text-center">
<button type="submit" class="btn btn-primary btn-lg">Send Message</button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="footer text-center">
<div class="container">
<p>&copy; <?php echo date("Y"); ?> <?php echo htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'AgriTrade'); ?>. All Rights Reserved.</p>
</div>
</footer> </footer>
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body> </body>
</html> </html>