35530-vm/index.php
Flatlogic Bot 41e158c880 1
2025-11-06 18:37:28 +00:00

118 lines
5.3 KiB
PHP

<?php
// CONFIG
$content_file = __DIR__ . '/db/content.json';
// Default content
$content = [
'hero_title' => 'Build Your Dream Website',
'hero_subtitle' => 'Visually design, customize, and publish beautiful, responsive websites. No code required.'
];
// Handle POST request to update content
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['hero_title']) && isset($_POST['hero_subtitle'])) {
$content['hero_title'] = htmlspecialchars($_POST['hero_title']);
$content['hero_subtitle'] = htmlspecialchars($_POST['hero_subtitle']);
file_put_contents($content_file, json_encode($content, JSON_PRETTY_PRINT));
// Redirect to avoid form resubmission
header("Location: " . $_SERVER['REQUEST_URI']);
exit;
}
}
// Load content from JSON file if it exists
if (file_exists($content_file)) {
$json_content = file_get_contents($content_file);
$loaded_content = json_decode($json_content, true);
if ($loaded_content) {
$content = $loaded_content;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>webCreatorSaas</title>
<meta name="description" content="Built with Flatlogic Generator">
<meta name="keywords" content="saas website builder, no-code website builder, drag and drop editor, custom website design, responsive web design, small business websites, portfolio websites, Flatlogic Generator">
<meta property="og:title" content="webCreatorSaas">
<meta property="og:description" content="Built with Flatlogic Generator">
<meta property="og:image" content="">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="">
<!-- Bootstrap 5 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?v=<?php echo time(); ?>">
</head>
<body>
<!-- Header -->
<header class="py-3 mb-4 border-bottom bg-white sticky-top">
<div class="container d-flex flex-wrap justify-content-center">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
<i class="bi bi-gem me-2" style="font-size: 1.5rem; color: #6366F1;"></i>
<span class="fs-4 fw-bold">webCreatorSaas</span>
</a>
</div>
</header>
<!-- Main Content -->
<main>
<!-- Hero Section -->
<section class="hero-section text-center">
<div class="container">
<h1 class="display-4 fw-bold gradient-text"><?php echo htmlspecialchars($content['hero_title']); ?></h1>
<p class="lead my-4"><?php echo htmlspecialchars($content['hero_subtitle']); ?></p>
<a href="#" class="btn btn-primary btn-lg">Start Building for Free</a>
</div>
</section>
<!-- Editor Section -->
<section class="editor-section">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="card p-4 p-md-5">
<h2 class="text-center mb-4"><i class="bi bi-pencil-square me-2"></i>Live Editor</h2>
<p class="text-center text-muted mb-4">Change the text in the hero section above.</p>
<form method="POST" action="index.php">
<div class="mb-3">
<label for="hero_title" class="form-label">Hero Title</label>
<input type="text" class="form-control form-control-lg" id="hero_title" name="hero_title" value="<?php echo htmlspecialchars($content['hero_title']); ?>">
</div>
<div class="mb-3">
<label for="hero_subtitle" class="form-label">Hero Subtitle</label>
<textarea class="form-control" id="hero_subtitle" name="hero_subtitle" rows="3"><?php echo htmlspecialchars($content['hero_subtitle']); ?></textarea>
</div>
<div class="d-grid">
<button type="submit" class="btn btn-primary btn-lg">Update Content</button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</main>
<!-- Footer -->
<footer class="container py-5">
<div class="row">
<div class="col-12 col-md text-center">
<p class="text-muted">&copy; <?php echo date("Y"); ?> webCreatorSaas. Built with love by Flatlogic.</p>
</div>
</div>
</footer>
<!-- Bootstrap 5 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?v=<?php echo time(); ?>"></script>
</body>
</html>