Compare commits

...

1 Commits

Author SHA1 Message Date
Flatlogic Bot
deff7cb3b1 home 2025-10-16 13:57:32 +00:00
4 changed files with 308 additions and 145 deletions

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

@ -0,0 +1,93 @@
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Lato:wght@400;700&display=swap');
body {
font-family: 'Lato', sans-serif;
background-color: #FFF8F0;
color: #333333;
line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Playfair Display', serif;
font-weight: 700;
color: #333333;
}
.navbar-brand {
font-family: 'Playfair Display', serif;
font-size: 1.75rem;
color: #FF6347 !important;
}
.hero {
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.pexels.com/photos/169198/pexels-photo-169198.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1') no-repeat center center;
background-size: cover;
color: white;
padding: 100px 0;
text-align: center;
}
.hero h1 {
font-size: 3.5rem;
color: white;
}
.hero p {
font-size: 1.25rem;
margin-bottom: 30px;
}
.btn-primary {
background-color: #FF6347;
border-color: #FF6347;
padding: 12px 30px;
font-size: 1.1rem;
border-radius: 8px;
transition: background-color 0.3s ease;
}
.btn-primary:hover {
background-color: #E5533D;
border-color: #E5533D;
}
section {
padding: 60px 0;
}
.section-title {
text-align: center;
margin-bottom: 50px;
font-size: 2.5rem;
}
.card {
border: none;
border-radius: 8px;
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.form-control {
border-radius: 8px;
padding: 12px;
}
.form-control:focus {
box-shadow: 0 0 0 0.25rem rgba(255, 99, 71, 0.25);
border-color: #FF6347;
}
footer {
background-color: #333333;
color: white;
padding: 40px 0;
text-align: center;
}
.toast-container {
position: fixed;
top: 20px;
right: 20px;
z-index: 1055;
}

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

@ -0,0 +1,52 @@
document.addEventListener('DOMContentLoaded', function () {
// Contact form validation
const contactForm = document.getElementById('contactForm');
if (contactForm) {
contactForm.addEventListener('submit', function (event) {
if (!contactForm.checkValidity()) {
event.preventDefault();
event.stopPropagation();
}
contactForm.classList.add('was-validated');
}, false);
}
// Toast notification for form submission status
const urlParams = new URLSearchParams(window.location.search);
const status = urlParams.get('status');
if (status) {
const toastContainer = document.getElementById('toast-container');
let toastHTML = '';
if (status === 'success') {
toastHTML = `
<div class="toast align-items-center text-white bg-success border-0 show" role="alert" aria-live="assertive" aria-atomic="true">
<div class="d-flex">
<div class="toast-body">
Message sent successfully! We will get back to you shortly.
</div>
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
</div>
`;
} else if (status === 'error') {
const msg = urlParams.get('msg') || 'An unexpected error occurred.';
toastHTML = `
<div class="toast align-items-center text-white bg-danger border-0 show" role="alert" aria-live="assertive" aria-atomic="true">
<div class="d-flex">
<div class="toast-body">
<strong>Error:</strong> ${decodeURIComponent(msg)}
</div>
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
</div>
`;
}
if(toastContainer) {
toastContainer.innerHTML = toastHTML;
const toastElement = toastContainer.querySelector('.toast');
const toast = new bootstrap.Toast(toastElement, { delay: 5000 });
toast.show();
}
}
});

47
contact.php Normal file
View File

@ -0,0 +1,47 @@
<?php
ini_set('display_errors', 0); // Do not display errors to the user
error_reporting(E_ALL);
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);
$error_message = '';
// Server-side validation
if (empty($name)) {
$error_message = 'Name is required.';
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error_message = 'Invalid email format.';
} elseif (empty($message)) {
$error_message = 'Message is required.';
}
if (!empty($error_message)) {
header('Location: index.php?status=error&msg=' . urlencode($error_message) . '#contact');
exit;
}
// Use MailService to send the email
// The recipient is determined by the MAIL_TO environment variable as per instructions
$subject = "New Contact Form Submission from {$name}";
$res = MailService::sendContactMessage($name, $email, $message, null, $subject);
if (!empty($res['success'])) {
header('Location: index.php?status=success#contact');
exit;
} else {
// Log error internally if possible, and show a generic error to the user
error_log('MailService Error: ' . $res['error']);
$error_message = 'Could not send message. Please try again later.';
header('Location: index.php?status=error&msg=' . urlencode($error_message) . '#contact');
exit;
}
} else {
// Redirect to home if accessed directly
header('Location: index.php');
exit;
}

259
index.php
View File

@ -1,150 +1,121 @@
<?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 <!-- SEO and Meta Tags -->
// Read project preview data from environment <title>Utsav - Indian Event Celebrations Planning</title>
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? ''; <meta name="description" content="Utsav is a comprehensive web platform created to streamline the process of organizing Indian cultural events. Built with Flatlogic Generator.">
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? ''; <meta name="keywords" content="indian wedding planner, event management, cultural events, festival planning, ceremony coordination, destination weddings, guest management, budget planner, Utsav, Built with Flatlogic Generator">
?>
<?php if ($projectDescription): ?> <!-- Open Graph / Facebook -->
<!-- Meta description --> <meta property="og:type" content="website">
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' /> <meta property="og:title" content="Utsav - Indian Event Celebrations Planning">
<!-- Open Graph meta tags --> <meta property="og:description" content="Streamline your Indian cultural events with Utsav, the all-in-one planning platform.">
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" /> <meta property="og:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? 'https://images.pexels.com/photos/169198/pexels-photo-169198.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'); ?>">
<!-- Twitter meta tags -->
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" /> <!-- Twitter -->
<?php endif; ?> <meta property="twitter:card" content="summary_large_image">
<?php if ($projectImageUrl): ?> <meta property="twitter:title" content="Utsav - Indian Event Celebrations Planning">
<!-- Open Graph image --> <meta property="twitter:description" content="Streamline your Indian cultural events with Utsav, the all-in-one planning platform.">
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" /> <meta property="twitter:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? 'https://images.pexels.com/photos/169198/pexels-photo-169198.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'); ?>">
<!-- Twitter image -->
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" /> <!-- Stylesheets -->
<?php endif; ?> <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="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<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"> <!-- Toast container for notifications -->
<h1>Analyzing your requirements and generating your website…</h1> <div id="toast-container" class="toast-container"></div>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
<span class="sr-only">Loading…</span> <!-- Header -->
</div> <nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm sticky-top">
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p> <div class="container">
<p class="hint">This page will update automatically as the plan is implemented.</p> <a class="navbar-brand" href="#">Utsav</a>
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
</div> <span class="navbar-toggler-icon"></span>
</main> </button>
<footer> <div class="collapse navbar-collapse" id="navbarNav">
Page updated: <?= htmlspecialchars($now) ?> (UTC) <ul class="navbar-nav ms-auto">
</footer> <li class="nav-item"><a class="nav-link" href="#home">Home</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 -->
<section id="home" class="hero">
<div class="container">
<h1>Crafting Unforgettable Indian Celebrations</h1>
<p>From weddings to festivals, your vision, perfectly planned.</p>
<a href="#contact" class="btn btn-primary">Plan Your Event</a>
</div>
</section>
<main>
<!-- About Section -->
<section id="about" class="container">
<h2 class="section-title">About Utsav</h2>
<div class="row align-items-center">
<div class="col-md-6">
<img src="https://images.pexels.com/photos/1024989/pexels-photo-1024989.jpeg?auto=compress&cs=tinysrgb&w=600" class="img-fluid rounded-3" alt="Indian celebration decor">
</div>
<div class="col-md-6">
<h3>Your Partner in Perfect Planning</h3>
<p>Utsav addresses the complexity and diverse requirements of traditional Indian occasions by integrating expert planning tools and tailored management workflows. We offer end-to-end event solutions, including guest management, venue selection, budget planning, and more.</p>
<p>Our platform empowers families, social groups, and event organizers to design, monitor, and execute events that honor cultural heritage while embracing the convenience of digital management.</p>
</div>
</div>
</section>
<!-- Contact Section -->
<section id="contact" class="bg-light">
<div class="container">
<h2 class="section-title">Get in Touch</h2>
<div class="row">
<div class="col-lg-8 mx-auto">
<div class="card p-4">
<form id="contactForm" action="contact.php" method="POST" class="needs-validation" novalidate>
<div class="mb-3">
<label for="name" class="form-label">Full Name</label>
<input type="text" class="form-control" id="name" name="name" required>
<div class="invalid-feedback">Please enter your name.</div>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email Address</label>
<input type="email" class="form-control" id="email" name="email" required>
<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></textarea>
<div class="invalid-feedback">Please enter your message.</div>
</div>
<div class="text-center">
<button type="submit" class="btn btn-primary">Send Message</button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</main>
<!-- Footer -->
<footer>
<div class="container">
<p>&copy; <?php echo date('Y'); ?> Utsav. All Rights Reserved.</p>
<p>Built with Flatlogic</p>
</div>
</footer>
<!-- JavaScript -->
<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> </body>
</html> </html>