209 lines
10 KiB
PHP
209 lines
10 KiB
PHP
<?php
|
|
|
|
function get_vibe_css($vibe) {
|
|
$css = '';
|
|
switch ($vibe) {
|
|
case 'Tech-retro':
|
|
$css = '
|
|
body { font-family: "Courier New", monospace; background-color: #000; color: #0FF; }
|
|
.navbar, .card, footer { background-color: #002B36 !important; border: 1px solid #0FF; }
|
|
.navbar-brand, .nav-link, h1, h2, h5, p { color: #0FF !important; }
|
|
.btn-primary { background-color: #0FF; color: #000; border: none; }
|
|
.vibe-preview { padding: 2rem; border: 1px dashed #0FF; margin-top: 2rem; }
|
|
';
|
|
break;
|
|
case 'Synthwave':
|
|
$css = '
|
|
@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap");
|
|
body { font-family: "Orbitron", sans-serif; background: linear-gradient(to bottom, #2c003e, #ff00c1); color: #fff; }
|
|
.navbar, .card, footer { background-color: rgba(0,0,0,0.5) !important; backdrop-filter: blur(10px); border: 1px solid #ff00c1; }
|
|
.navbar-brand, .nav-link, h1, h2, h5, p { color: #fff !important; text-shadow: 0 0 10px #ff00c1; }
|
|
.btn-primary { background: #ff00c1; border: none; box-shadow: 0 0 15px #ff00c1; }
|
|
.vibe-preview { padding: 2rem; border: 1px solid #ff00c1; margin-top: 2rem; }
|
|
';
|
|
break;
|
|
case 'Brutalism':
|
|
$css = '
|
|
body { font-family: "Arial", sans-serif; background-color: #f0f0f0; color: #000; }
|
|
.navbar, .card, footer { background-color: #f0f0f0 !important; border: 2px solid #000; box-shadow: none !important; border-radius: 0; }
|
|
.navbar-brand, .nav-link, h1, h2, h5, p { color: #000 !important; }
|
|
.btn-primary { background-color: #FFFF00; color: #000; border: 2px solid #000; border-radius: 0; }
|
|
.vibe-preview { padding: 2rem; border: 2px solid #000; margin-top: 2rem; }
|
|
';
|
|
break;
|
|
case 'Dad-garage':
|
|
$css = '
|
|
@import url("https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;700&display=swap");
|
|
body { font-family: "Roboto Slab", serif; background-color: #D2B48C; color: #333; }
|
|
.navbar, .card, footer { background-color: #8B4513 !important; color: white; border: 3px solid #654321; }
|
|
.navbar-brand, .nav-link, h1, h2, h5, p, .card-body { color: #fff !important; }
|
|
.btn-primary { background-color: #008000; color: #fff; border: 2px solid #006400; }
|
|
.vibe-preview { padding: 2rem; border: 2px solid #654321; margin-top: 2rem; background-color: #F5DEB3; }
|
|
.vibe-preview h2, .vibe-preview p { color: #333 !important; }
|
|
';
|
|
break;
|
|
case 'Zen-mono':
|
|
$css = '
|
|
body { font-family: "Helvetica Neue", sans-serif; background-color: #fff; color: #333; }
|
|
.navbar, .card, footer { background-color: #fff !important; border: 1px solid #ddd; box-shadow: none !important; }
|
|
.navbar-brand, .nav-link, h1, h2, h5, p { color: #333 !important; }
|
|
.btn-primary { background-color: #333; color: #fff; border: none; border-radius: 50px; }
|
|
.vibe-preview { padding: 2rem; border: 1px solid #eee; margin-top: 2rem; }
|
|
';
|
|
break;
|
|
}
|
|
return $css;
|
|
}
|
|
|
|
$vibe_css_path = 'assets/css/vibe.css';
|
|
$vibe_generated = false;
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
$vibe = $_POST['vibe'] ?? '';
|
|
$keywords = $_POST['keywords'] ?? '';
|
|
|
|
if ($vibe) {
|
|
$css_content = get_vibe_css($vibe);
|
|
file_put_contents($vibe_css_path, $css_content);
|
|
$vibe_generated = true;
|
|
}
|
|
}
|
|
|
|
?>
|
|
<!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(); ?>">
|
|
<?php if (file_exists($vibe_css_path)): ?>
|
|
<link rel="stylesheet" href="<?php echo $vibe_css_path; ?>?v=<?php echo time(); ?>">
|
|
<?php endif; ?>
|
|
</head>
|
|
<body>
|
|
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
|
|
<div class="container">
|
|
<a class="navbar-brand" href="index.php">
|
|
<i class="bi bi-box-seam"></i>
|
|
Flatlogic<span style="color: #6366F1;">Vibes</span>
|
|
</a>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav ms-auto">
|
|
<li class="nav-item"><a class="nav-link" href="index.php">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">
|
|
<?php if (!$vibe_generated): ?>
|
|
<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 else: ?>
|
|
<div class="vibe-preview">
|
|
<div class="text-center">
|
|
<h1><?php echo htmlspecialchars($keywords); ?></h1>
|
|
<p>A micro-site generated with the <span class="badge bg-secondary"><?php echo htmlspecialchars($vibe); ?></span> vibe.</p>
|
|
</div>
|
|
<div class="row mt-5">
|
|
<div class="col-md-4">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Feature One</h5>
|
|
<p class="card-text">This is a sample card showcasing the generated vibe.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Feature Two</h5>
|
|
<p class="card-text">The colors, fonts, and styles are all part of the vibe.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Feature Three</h5>
|
|
<p class="card-text">Click the button below to start over.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="text-center mt-5">
|
|
<a href="vibe.php" class="btn btn-secondary">Start Over</a>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
</main>
|
|
|
|
<footer class="py-4 mt-auto bg-light">
|
|
<div class="container text-center">
|
|
<p class="mb-0 text-muted">© <?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>
|
|
</body>
|
|
</html>
|