34107-vm/vibe.php
Flatlogic Bot b46b809d97 1.1
2025-09-16 16:33:34 +00:00

153 lines
7.1 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vibe Generator - Flatlogic LAMP Demo</title>
<meta name="description" content="Generate a micro-site based on a vibe and keywords.">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<style>
.vibe-option {
cursor: pointer;
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.vibe-option:hover {
transform: translateY(-5px);
box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15)!important;
}
.vibe-option input[type="radio"] {
display: none;
}
.vibe-option.selected {
border-color: #6366F1;
border-width: 2px;
box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}
.vibe-icon {
font-size: 2rem;
margin-bottom: 0.5rem;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
<div class="container">
<a class="navbar-brand" href="/">
<i class="bi bi-box-seam"></i>
Flatlogic<span style="color: #6366F1;">Vibes</span>
</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="/">Home</a></li>
<li class="nav-item"><a class="nav-link active" href="vibe.php">Vibe Generator</a></li>
<li class="nav-item"><a class="nav-link" href="sandbox.php">PHP Sandbox</a></li>
<li class="nav-item"><a class="nav-link" href="seo.php">SEO Checker</a></li>
<li class="nav-item"><a class="nav-link" href="admin.php">Admin</a></li>
</ul>
</div>
</div>
</nav>
<main class="py-5">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8 text-center">
<h1 class="display-5">Create a Vibe Site</h1>
<p class="lead">Step 1: Choose your aesthetic and provide a few keywords.</p>
</div>
</div>
<form action="vibe.php" method="POST" class="mt-5">
<div class="row g-4 justify-content-center text-center">
<h2 class="h4">1. Choose a Vibe</h2>
<?php
$vibes = [
'Tech-retro' => ['icon' => 'bi-pc-display-horizontal', 'desc' => '90s nostalgia, pixelated and chunky.'],
'Synthwave' => ['icon' => 'bi-sunset', 'desc' => 'Neon grids, chrome, and 80s futurism.'],
'Brutalism' => ['icon' => 'bi-building', 'desc' => 'Raw, blocky, and unapologetically functional.'],
'Dad-garage' => ['icon' => 'bi-tools', 'desc' => 'Rugged, practical, and built to last.'],
'Zen-mono' => ['icon' => 'bi-yin-yang', 'desc' => 'Minimalist, monochrome, and serene.']
];
foreach ($vibes as $name => $details):
?>
<div class="col-md-4 col-lg-2">
<label class="card h-100 vibe-option p-3">
<input type="radio" name="vibe" value="<?php echo htmlspecialchars($name); ?>" required>
<div class="vibe-icon"><i class="bi <?php echo $details['icon']; ?>"></i></div>
<h5 class="h6"><?php echo htmlspecialchars($name); ?></h5>
<small class="text-muted"><?php echo htmlspecialchars($details['desc']); ?></small>
</label>
</div>
<?php endforeach; ?>
</div>
<div class="row justify-content-center mt-5">
<div class="col-lg-6">
<h2 class="h4 text-center">2. Enter Keywords</h2>
<div class="mb-3">
<label for="keywords" class="form-label visually-hidden">Keywords</label>
<input type="text" class="form-control form-control-lg" id="keywords" name="keywords" placeholder="e.g., My personal blog, AI experiments" required>
<div class="form-text text-center">Enter 1-3 key phrases that describe your site.</div>
</div>
</div>
</div>
<div class="text-center mt-4">
<button type="submit" class="btn btn-primary btn-lg px-5">
<i class="bi bi-stars"></i>
Generate
</button>
</div>
</form>
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Simple handler for step 2 preview
$vibe = $_POST['vibe'] ?? 'None';
$keywords = $_POST['keywords'] ?? 'None';
echo '<div class="row justify-content-center mt-5 pt-5 border-top">';
echo '<div class="col-lg-8">';
echo '<h2>Submission Received (Step 2 Preview)</h2>';
echo '<p>This is where the AI-generated preview will appear. For now, here are the values you submitted:</p>';
echo '<div class="card">';
echo '<div class="card-body">';
echo '<h5 class="card-title">Selected Vibe: ' . htmlspecialchars($vibe) . '</h5>';
echo '<p class="card-text">Keywords: ' . htmlspecialchars($keywords) . '</p>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
?>
</div>
</main>
<footer class="py-4 mt-auto bg-light">
<div class="container text-center">
<p class="mb-0 text-muted">&copy; <?php echo date("Y"); ?> Flatlogic. All rights reserved.</p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.querySelectorAll('.vibe-option').forEach(item => {
item.addEventListener('click', event => {
document.querySelectorAll('.vibe-option').forEach(opt => opt.classList.remove('selected'));
item.classList.add('selected');
// No need to manually check the radio, the label does that.
});
});
</script>
</body>
</html>