1.2
This commit is contained in:
parent
b46b809d97
commit
c004bbea8a
95
admin.php
95
admin.php
@ -1,3 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
// Hardcoded credentials
|
||||||
|
$valid_username = 'admin';
|
||||||
|
$valid_password = 'password';
|
||||||
|
|
||||||
|
$is_logged_in = isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true;
|
||||||
|
$error_message = '';
|
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
if (isset($_POST['logout'])) {
|
||||||
|
$_SESSION = [];
|
||||||
|
session_destroy();
|
||||||
|
header("Location: admin.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = $_POST['username'] ?? '';
|
||||||
|
$password = $_POST['password'] ?? '';
|
||||||
|
|
||||||
|
if ($username === $valid_username && $password === $valid_password) {
|
||||||
|
$_SESSION['loggedin'] = true;
|
||||||
|
header("Location: admin.php");
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
$error_message = "Invalid username or password.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
@ -32,19 +62,23 @@
|
|||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<main class="container my-5">
|
<main class="container my-5">
|
||||||
|
<?php if (!$is_logged_in): ?>
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<div class="card shadow-sm mb-4">
|
<div class="card shadow-sm mb-4">
|
||||||
<div class="card-body p-4">
|
<div class="card-body p-4">
|
||||||
<h1 class="h3 mb-3 fw-normal text-center">Admin Login</h1>
|
<h1 class="h3 mb-3 fw-normal text-center">Admin Login</h1>
|
||||||
<form>
|
<?php if ($error_message): ?>
|
||||||
|
<div class="alert alert-danger"><?php echo $error_message; ?></div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<form method="POST" action="admin.php">
|
||||||
<div class="form-floating mb-3">
|
<div class="form-floating mb-3">
|
||||||
<input type="email" class="form-control" id="floatingInput" placeholder="name@example.com">
|
<input type="text" class="form-control" id="username" name="username" placeholder="Username">
|
||||||
<label for="floatingInput">Email address</label>
|
<label for="username">Username</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating mb-3">
|
<div class="form-floating mb-3">
|
||||||
<input type="password" class="form-control" id="floatingPassword" placeholder="Password">
|
<input type="password" class="form-control" id="password" name="password" placeholder="Password">
|
||||||
<label for="floatingPassword">Password</label>
|
<label for="password">Password</label>
|
||||||
</div>
|
</div>
|
||||||
<button class="w-100 btn btn-lg btn-primary" type="submit">Sign in</button>
|
<button class="w-100 btn btn-lg btn-primary" type="submit">Sign in</button>
|
||||||
</form>
|
</form>
|
||||||
@ -52,11 +86,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
<!-- This section would typically be protected -->
|
|
||||||
<div class="card shadow-sm">
|
<div class="card shadow-sm">
|
||||||
<div class="card-header">
|
<div class="card-header d-flex justify-content-between align-items-center">
|
||||||
<h2 class="h4 mb-0">Nokia Facts Management</h2>
|
<h2 class="h4 mb-0">Nokia Facts Management</h2>
|
||||||
|
<form method="POST" action="admin.php">
|
||||||
|
<button type="submit" name="logout" class="btn btn-sm btn-outline-secondary">Logout <i class="bi bi-box-arrow-right"></i></button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
@ -65,44 +101,41 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="col">#</th>
|
<th scope="col">#</th>
|
||||||
<th scope="col">Fact</th>
|
<th scope="col">Fact</th>
|
||||||
<th scope="col">Strength (1-10)</th>
|
<th scope="col">Created At</th>
|
||||||
<th scope="col">Actions</th>
|
<th scope="col">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/db/config.php';
|
||||||
|
$pdo = db();
|
||||||
|
if ($pdo) {
|
||||||
|
$stmt = $pdo->query('SELECT id, fact, created_at FROM nokia_facts ORDER BY id DESC');
|
||||||
|
$facts = $stmt->fetchAll();
|
||||||
|
foreach ($facts as $fact):
|
||||||
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">1</th>
|
<th scope="row"><?php echo htmlspecialchars($fact['id']); ?></th>
|
||||||
<td>The Nokia 3310 could survive a drop from a 3-story building.</td>
|
<td><?php echo htmlspecialchars($fact['fact']); ?></td>
|
||||||
<td>8</td>
|
<td><?php echo htmlspecialchars($fact['created_at']); ?></td>
|
||||||
<td>
|
|
||||||
<button class="btn btn-sm btn-outline-primary"><i class="bi bi-pencil"></i></button>
|
|
||||||
<button class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i></button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">2</th>
|
|
||||||
<td>Its battery life was measured in days, not hours.</td>
|
|
||||||
<td>10</td>
|
|
||||||
<td>
|
|
||||||
<button class="btn btn-sm btn-outline-primary"><i class="bi bi-pencil"></i></button>
|
|
||||||
<button class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i></button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">3</th>
|
|
||||||
<td>Snake II was the peak of mobile gaming.</td>
|
|
||||||
<td>9</td>
|
|
||||||
<td>
|
<td>
|
||||||
<button class="btn btn-sm btn-outline-primary"><i class="bi bi-pencil"></i></button>
|
<button class="btn btn-sm btn-outline-primary"><i class="bi bi-pencil"></i></button>
|
||||||
<button class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i></button>
|
<button class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i></button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php
|
||||||
|
endforeach;
|
||||||
|
} else {
|
||||||
|
echo "<tr><td colspan='4'>Database connection not available.</td></tr>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-success"><i class="bi bi-plus-circle"></i> Add New Fact</button>
|
<button class="btn btn-success"><i class="bi bi-plus-circle"></i> Add New Fact</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer class="bg-white text-center text-muted py-4 mt-5 border-top">
|
<footer class="bg-white text-center text-muted py-4 mt-5 border-top">
|
||||||
@ -114,4 +147,4 @@
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
<script src="assets/js/main.js"></script>
|
<script src="assets/js/main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
7
assets/css/vibe.css
Normal file
7
assets/css/vibe.css
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
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; }
|
||||||
|
|
||||||
@ -1,17 +1,47 @@
|
|||||||
<?php
|
<?php
|
||||||
// Generated by setup_mariadb_project.sh — edit as needed.
|
// db/config.php
|
||||||
define('DB_HOST', '127.0.0.1');
|
|
||||||
define('DB_NAME', 'app_30855');
|
|
||||||
define('DB_USER', 'app_30855');
|
|
||||||
define('DB_PASS', 'eee81949-37de-47f9-a26f-14ebc8402f7f');
|
|
||||||
|
|
||||||
function db() {
|
// --- Database Credentials ---
|
||||||
static $pdo;
|
// Note: In a real application, these should be in a .env file or other secure storage.
|
||||||
if (!$pdo) {
|
define('DB_HOST', '127.0.0.1');
|
||||||
$pdo = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME.';charset=utf8mb4', DB_USER, DB_PASS, [
|
define('DB_NAME', 'lamp_app');
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
define('DB_USER', 'lamp_user');
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
define('DB_PASS', 'lamp_password');
|
||||||
]);
|
|
||||||
}
|
/**
|
||||||
return $pdo;
|
* PDO Database Connection Helper
|
||||||
}
|
*
|
||||||
|
* Establishes a persistent PDO connection or returns the existing one.
|
||||||
|
*
|
||||||
|
* @return PDO|null Returns a PDO instance on success or null on failure.
|
||||||
|
*/
|
||||||
|
function db(): ?PDO
|
||||||
|
{
|
||||||
|
static $pdo = null;
|
||||||
|
|
||||||
|
if ($pdo !== null) {
|
||||||
|
return $pdo;
|
||||||
|
}
|
||||||
|
|
||||||
|
$dsn = sprintf('mysql:host=%s;dbname=%s;charset=utf8mb4', DB_HOST, DB_NAME);
|
||||||
|
$options = [
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::ATTR_EMULATE_PREPARES => false,
|
||||||
|
PDO::ATTR_PERSISTENT => true, // Use persistent connection
|
||||||
|
];
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Create a new database if it doesn't exist
|
||||||
|
$tempPdo = new PDO(sprintf('mysql:host=%s;charset=utf8mb4', DB_HOST), DB_USER, DB_PASS, $options);
|
||||||
|
$tempPdo->exec("CREATE DATABASE IF NOT EXISTS " . DB_NAME);
|
||||||
|
|
||||||
|
// Now connect to the specific database
|
||||||
|
$pdo = new PDO($dsn, DB_USER, DB_PASS, $options);
|
||||||
|
return $pdo;
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
// In a real app, you'd log this error. For this demo, we'll just fail silently.
|
||||||
|
// error_log('Database Connection Error: ' . $e->getMessage());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
64
sandbox.php
64
sandbox.php
@ -1,11 +1,50 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
function execute_php_code($code) {
|
||||||
|
$descriptorspec = [
|
||||||
|
0 => ["pipe", "r"], // stdin
|
||||||
|
1 => ["pipe", "w"], // stdout
|
||||||
|
2 => ["pipe", "w"] // stderr
|
||||||
|
];
|
||||||
|
|
||||||
|
$process = proc_open('php', $descriptorspec, $pipes);
|
||||||
|
|
||||||
|
if (is_resource($process)) {
|
||||||
|
fwrite($pipes[0], $code);
|
||||||
|
fclose($pipes[0]);
|
||||||
|
|
||||||
|
$stdout = stream_get_contents($pipes[1]);
|
||||||
|
fclose($pipes[1]);
|
||||||
|
|
||||||
|
$stderr = stream_get_contents($pipes[2]);
|
||||||
|
fclose($pipes[2]);
|
||||||
|
|
||||||
|
proc_close($process);
|
||||||
|
|
||||||
|
return ['stdout' => $stdout, 'stderr' => $stderr];
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$code = '';
|
$code = '';
|
||||||
$result = '';
|
$result_output = '';
|
||||||
|
$result_error = '';
|
||||||
|
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||||
$code = $_POST['code'] ?? '';
|
$code = $_POST['code'] ?? '';
|
||||||
// For now, just display the code. Execution will be implemented later.
|
if (!empty($code)) {
|
||||||
$result = "Execution feature coming soon!\n\nYour code:\n" . htmlspecialchars($code);
|
$execution_result = execute_php_code($code);
|
||||||
|
if ($execution_result !== false) {
|
||||||
|
$result_output = $execution_result['stdout'];
|
||||||
|
$result_error = $execution_result['stderr'];
|
||||||
|
} else {
|
||||||
|
$result_error = "Failed to execute the code.";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$result_output = "No code to run.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
@ -22,7 +61,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
|
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
|
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="/">
|
<a class="navbar-brand" href="index.php">
|
||||||
<i class="bi bi-box-seam"></i>
|
<i class="bi bi-box-seam"></i>
|
||||||
Flatlogic<span style="color: #6366F1;">Vibes</span>
|
Flatlogic<span style="color: #6366F1;">Vibes</span>
|
||||||
</a>
|
</a>
|
||||||
@ -31,9 +70,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
</button>
|
</button>
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
<ul class="navbar-nav ms-auto">
|
<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" href="index.php">Home</a></li>
|
||||||
<li class="nav-item"><a class="nav-link" href="vibe.php">Vibe Generator</a></li>
|
<li class="nav-item"><a class="nav-link" 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 active" 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="seo.php">SEO Checker</a></li>
|
||||||
<li class="nav-item"><a class="nav-link" href="admin.php">Admin</a></li>
|
<li class="nav-item"><a class="nav-link" href="admin.php">Admin</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -52,7 +91,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
<form action="sandbox.php" method="post">
|
<form action="sandbox.php" method="post">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="code" class="form-label">PHP Code</label>
|
<label for="code" class="form-label">PHP Code</label>
|
||||||
<textarea class="form-control" id="code" name="code" rows="10" placeholder="<?php echo 'Hello, World!'; ?>"><?php echo htmlspecialchars($code); ?></textarea>
|
<textarea class="form-control font-monospace" id="code" name="code" rows="10" placeholder="<?php echo 'Hello, World!'; ?>"><?php echo htmlspecialchars($code); ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-primary">
|
<button type="submit" class="btn btn-primary">
|
||||||
<i class="bi bi-play-fill"></i> Run Code
|
<i class="bi bi-play-fill"></i> Run Code
|
||||||
@ -61,8 +100,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
|
|
||||||
<?php if ($_SERVER["REQUEST_METHOD"] == "POST"): ?>
|
<?php if ($_SERVER["REQUEST_METHOD"] == "POST"): ?>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<h3>Result</h3>
|
<h3>Output</h3>
|
||||||
<pre class="bg-light p-3 rounded"><code><?php echo $result; ?></code></pre>
|
<pre class="bg-light p-3 rounded"><code><?php echo htmlspecialchars($result_output); ?></code></pre>
|
||||||
|
|
||||||
|
<?php if (!empty($result_error)): ?>
|
||||||
|
<h3>Errors</h3>
|
||||||
|
<pre class="bg-danger text-white p-3 rounded"><code><?php echo htmlspecialchars($result_error); ?></code></pre>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
@ -78,4 +122,4 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
<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>
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
218
seo.php
218
seo.php
@ -1,65 +1,100 @@
|
|||||||
<?php
|
<?php
|
||||||
$page_title = "SEO Checker";
|
|
||||||
$page_description = "Paste your HTML and get instant feedback on your on-page SEO.";
|
function analyze_seo($html) {
|
||||||
|
$results = [
|
||||||
|
'title' => ['text' => '', 'length' => 0, 'status' => 'danger'],
|
||||||
|
'description' => ['text' => '', 'length' => 0, 'status' => 'danger'],
|
||||||
|
'h1_count' => ['count' => 0, 'status' => 'danger'],
|
||||||
|
'alt_tags' => ['missing' => 0, 'total' => 0, 'status' => 'success'],
|
||||||
|
'og_tags' => ['found' => 0, 'status' => 'warning'],
|
||||||
|
];
|
||||||
|
|
||||||
|
if (empty($html)) return $results;
|
||||||
|
|
||||||
|
$doc = new DOMDocument();
|
||||||
|
@$doc->loadHTML($html);
|
||||||
|
|
||||||
|
// Title
|
||||||
|
$title_node = $doc->getElementsByTagName('title')->item(0);
|
||||||
|
if ($title_node) {
|
||||||
|
$results['title']['text'] = $title_node->nodeValue;
|
||||||
|
$results['title']['length'] = strlen($title_node->nodeValue);
|
||||||
|
if ($results['title']['length'] >= 10 && $results['title']['length'] <= 70) {
|
||||||
|
$results['title']['status'] = 'success';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Meta Description
|
||||||
|
$metas = $doc->getElementsByTagName('meta');
|
||||||
|
foreach ($metas as $meta) {
|
||||||
|
if (strtolower($meta->getAttribute('name')) == 'description') {
|
||||||
|
$results['description']['text'] = $meta->getAttribute('content');
|
||||||
|
$results['description']['length'] = strlen($meta->getAttribute('content'));
|
||||||
|
if ($results['description']['length'] >= 50 && $results['description']['length'] <= 160) {
|
||||||
|
$results['description']['status'] = 'success';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (strpos(strtolower($meta->getAttribute('property')), 'og:') === 0) {
|
||||||
|
$results['og_tags']['found']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($results['og_tags']['found'] >= 3) { // og:title, og:description, og:image
|
||||||
|
$results['og_tags']['status'] = 'success';
|
||||||
|
}
|
||||||
|
|
||||||
|
// H1 Count
|
||||||
|
$h1s = $doc->getElementsByTagName('h1');
|
||||||
|
$results['h1_count']['count'] = $h1s->length;
|
||||||
|
if ($results['h1_count']['count'] === 1) {
|
||||||
|
$results['h1_count']['status'] = 'success';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alt Tags
|
||||||
|
$images = $doc->getElementsByTagName('img');
|
||||||
|
$results['alt_tags']['total'] = $images->length;
|
||||||
|
foreach ($images as $img) {
|
||||||
|
if (!$img->hasAttribute('alt') || trim($img->getAttribute('alt')) == '') {
|
||||||
|
$results['alt_tags']['missing']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($results['alt_tags']['missing'] > 0) {
|
||||||
|
$results['alt_tags']['status'] = 'warning';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $results;
|
||||||
|
}
|
||||||
|
|
||||||
$html_input = '';
|
$html_input = '';
|
||||||
$seo_results = null;
|
$seo_results = null;
|
||||||
|
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['html_content'])) {
|
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['html_content'])) {
|
||||||
$html_input = $_POST['html_content'];
|
$html_input = $_POST['html_content'];
|
||||||
// Basic analysis simulation
|
$seo_results = analyze_seo($html_input);
|
||||||
if (!empty($html_input)) {
|
|
||||||
$doc = new DOMDocument();
|
|
||||||
@$doc->loadHTML($html_input);
|
|
||||||
$title = $doc->getElementsByTagName('title')->item(0)->nodeValue ?? 'Not found';
|
|
||||||
$description = 'Not found';
|
|
||||||
$metas = $doc->getElementsByTagName('meta');
|
|
||||||
for ($i = 0; $i < $metas->length; $i++) {
|
|
||||||
$meta = $metas->item($i);
|
|
||||||
if (strtolower($meta->getAttribute('name')) == 'description') {
|
|
||||||
$description = $meta->getAttribute('content');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$h1_count = $doc->getElementsByTagName('h1')->length;
|
|
||||||
|
|
||||||
$seo_results = [
|
|
||||||
'score' => 75, // Dummy score
|
|
||||||
'title' => $title,
|
|
||||||
'description' => $description,
|
|
||||||
'h1_count' => $h1_count,
|
|
||||||
'advice' => 'This is a basic analysis. For a full report, our AI would check for keyword density, image alt tags, mobile-friendliness, and more!'
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!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.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title><?php echo $page_title; ?> - Flatlogic LAMP Demo</title>
|
<title>SEO Checker - Flatlogic LAMP Demo</title>
|
||||||
<meta name="description" content="<?php echo $page_description; ?>">
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
<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="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(); ?>">
|
<link rel="stylesheet" href="assets/css/custom.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="d-flex flex-column min-vh-100">
|
<body>
|
||||||
|
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
|
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="/">
|
<a class="navbar-brand" href="index.php">Flatlogic<span style="color: #6366F1;">Vibes</span></a>
|
||||||
<i class="bi bi-box-seam"></i>
|
<div class="collapse navbar-collapse">
|
||||||
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">
|
<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" href="index.php">Home</a></li>
|
||||||
<li class="nav-item"><a class="nav-link" href="vibe.php">Vibe Generator</a></li>
|
<li class="nav-item"><a class="nav-link" href="vibe.php">Vibe</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="sandbox.php">Sandbox</a></li>
|
||||||
<li class="nav-item"><a class="nav-link active" aria-current="page" href="seo.php">SEO Checker</a></li>
|
<li class="nav-item"><a class="nav-link active" href="seo.php">SEO</a></li>
|
||||||
<li class="nav-item"><a class="nav-link" href="admin.php">Admin</a></li>
|
<li class="nav-item"><a class="nav-link" href="admin.php">Admin</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -67,62 +102,56 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['html_content'])) {
|
|||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<main class="container my-5">
|
<main class="container my-5">
|
||||||
<div class="row">
|
<div class="text-center mb-5">
|
||||||
<div class="col-lg-8 mx-auto">
|
<h1 class="display-5">SEO Checker</h1>
|
||||||
<div class="text-center mb-5">
|
<p class="lead">Paste your HTML to get an on-page SEO analysis.</p>
|
||||||
<h1 class="display-5 fw-bold">SEO Checker</h1>
|
</div>
|
||||||
<p class="lead">Paste your site's HTML below to get an instant (simulated) SEO analysis.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card p-4 shadow-sm">
|
<div class="card shadow-sm">
|
||||||
<form action="seo.php" method="POST">
|
<div class="card-body">
|
||||||
<div class="mb-3">
|
<form action="seo.php" method="POST">
|
||||||
<label for="html_content" class="form-label">HTML Content</label>
|
<div class="mb-3">
|
||||||
<textarea class="form-control" id="html_content" name="html_content" rows="10" placeholder="<html>...</html>"><?php echo htmlspecialchars($html_input); ?></textarea>
|
<label for="html_content" class="form-label">HTML Content</label>
|
||||||
</div>
|
<textarea class="form-control font-monospace" id="html_content" name="html_content" rows="12" placeholder="<html>..."><?php echo htmlspecialchars($html_input); ?></textarea>
|
||||||
<div class="text-center">
|
|
||||||
<button type="submit" class="btn btn-primary btn-lg">
|
|
||||||
<i class="bi bi-search"></i> Analyze SEO
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if ($seo_results): ?>
|
|
||||||
<div class="card p-4 mt-5 shadow-sm">
|
|
||||||
<h2 class="h3 mb-4 text-center">Analysis Results</h2>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-4 text-center">
|
|
||||||
<div class="display-1 fw-bold text-primary"><?php echo $seo_results['score']; ?></div>
|
|
||||||
<div class="h5">Overall Score</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<ul class="list-group list-group-flush">
|
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
||||||
<strong>Title Tag:</strong>
|
|
||||||
<span class="badge bg-light text-dark"><?php echo htmlspecialchars(substr($seo_results['title'], 0, 50)); ?>...</span>
|
|
||||||
</li>
|
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
||||||
<strong>Meta Description:</strong>
|
|
||||||
<span class="badge bg-light text-dark"><?php echo htmlspecialchars(substr($seo_results['description'], 0, 50)); ?>...</span>
|
|
||||||
</li>
|
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
||||||
<strong>H1 Tags Found:</strong>
|
|
||||||
<span class="badge bg-<?php echo $seo_results['h1_count'] === 1 ? 'success' : 'warning'; ?>"><?php echo $seo_results['h1_count']; ?></span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<div class="text-center">
|
||||||
<div class="mt-3">
|
<button type="submit" class="btn btn-primary"><i class="bi bi-search"></i> Analyze</button>
|
||||||
<h4 class="h5">AI-Powered Advice:</h4>
|
|
||||||
<p class="mb-0 fst-italic"><?php echo htmlspecialchars($seo_results['advice']); ?></p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if ($seo_results): ?>
|
||||||
|
<div class="card shadow-sm mt-5">
|
||||||
|
<div class="card-header">
|
||||||
|
<h2 class="h4 mb-0">Analysis Results</h2>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<ul class="list-group list-group-flush">
|
||||||
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||||
|
<div><strong>Title Tag</strong> <small class="text-muted d-block"><?php echo htmlspecialchars($seo_results['title']['text']); ?> (<?php echo $seo_results['title']['length']; ?> chars)</small></div>
|
||||||
|
<span class="badge bg-<?php echo $seo_results['title']['status']; ?>"><?php echo $seo_results['title']['length'] > 0 ? 'Good' : 'Missing'; ?></span>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||||
|
<div><strong>Meta Description</strong> <small class="text-muted d-block"><?php echo htmlspecialchars(substr($seo_results['description']['text'], 0, 100)); ?>... (<?php echo $seo_results['description']['length']; ?> chars)</small></div>
|
||||||
|
<span class="badge bg-<?php echo $seo_results['description']['status']; ?>"><?php echo $seo_results['description']['length'] > 0 ? 'Good' : 'Missing'; ?></span>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||||
|
<div><strong>H1 Tags</strong> <small class="text-muted d-block">Should be exactly one.</small></div>
|
||||||
|
<span class="badge bg-<?php echo $seo_results['h1_count']['status']; ?>"><?php echo $seo_results['h1_count']['count']; ?> found</span>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||||
|
<div><strong>Image Alt Tags</strong> <small class="text-muted d-block">All images should have descriptive alt text.</small></div>
|
||||||
|
<span class="badge bg-<?php echo $seo_results['alt_tags']['status']; ?>"><?php echo $seo_results['alt_tags']['missing']; ?> missing / <?php echo $seo_results['alt_tags']['total']; ?> total</span>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||||
|
<div><strong>Open Graph Tags</strong> <small class="text-muted d-block">For social media sharing.</small></div>
|
||||||
|
<span class="badge bg-<?php echo $seo_results['og_tags']['status']; ?>"><?php echo $seo_results['og_tags']['found']; ?> found</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer class="py-4 mt-auto bg-light">
|
<footer class="py-4 mt-auto bg-light">
|
||||||
@ -132,6 +161,5 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['html_content'])) {
|
|||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
<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>
|
||||||
177
vibe.php
177
vibe.php
@ -1,3 +1,75 @@
|
|||||||
|
<?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>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
@ -8,43 +80,21 @@
|
|||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
<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="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(); ?>">
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||||
<style>
|
<?php if (file_exists($vibe_css_path)): ?>
|
||||||
.vibe-option {
|
<link rel="stylesheet" href="<?php echo $vibe_css_path; ?>?v=<?php echo time(); ?>">
|
||||||
cursor: pointer;
|
<?php endif; ?>
|
||||||
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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
|
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="/">
|
<a class="navbar-brand" href="index.php">
|
||||||
<i class="bi bi-box-seam"></i>
|
<i class="bi bi-box-seam"></i>
|
||||||
Flatlogic<span style="color: #6366F1;">Vibes</span>
|
Flatlogic<span style="color: #6366F1;">Vibes</span>
|
||||||
</a>
|
</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">
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
<ul class="navbar-nav ms-auto">
|
<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" 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 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="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="seo.php">SEO Checker</a></li>
|
||||||
@ -56,6 +106,7 @@
|
|||||||
|
|
||||||
<main class="py-5">
|
<main class="py-5">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
<?php if (!$vibe_generated): ?>
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-lg-8 text-center">
|
<div class="col-lg-8 text-center">
|
||||||
<h1 class="display-5">Create a Vibe Site</h1>
|
<h1 class="display-5">Create a Vibe Site</h1>
|
||||||
@ -64,9 +115,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="vibe.php" method="POST" class="mt-5">
|
<form action="vibe.php" method="POST" class="mt-5">
|
||||||
<div class="row g-4 justify-content-center text-center">
|
<div class="row g-4 justify-content-center text-center">
|
||||||
<h2 class="h4">1. Choose a Vibe</h2>
|
<h2 class="h4">1. Choose a Vibe</h2>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$vibes = [
|
$vibes = [
|
||||||
'Tech-retro' => ['icon' => 'bi-pc-display-horizontal', 'desc' => '90s nostalgia, pixelated and chunky.'],
|
'Tech-retro' => ['icon' => 'bi-pc-display-horizontal', 'desc' => '90s nostalgia, pixelated and chunky.'],
|
||||||
@ -107,27 +157,43 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<?php else: ?>
|
||||||
<?php
|
<div class="vibe-preview">
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
<div class="text-center">
|
||||||
// Simple handler for step 2 preview
|
<h1><?php echo htmlspecialchars($keywords); ?></h1>
|
||||||
$vibe = $_POST['vibe'] ?? 'None';
|
<p>A micro-site generated with the <span class="badge bg-secondary"><?php echo htmlspecialchars($vibe); ?></span> vibe.</p>
|
||||||
$keywords = $_POST['keywords'] ?? 'None';
|
</div>
|
||||||
|
<div class="row mt-5">
|
||||||
echo '<div class="row justify-content-center mt-5 pt-5 border-top">';
|
<div class="col-md-4">
|
||||||
echo '<div class="col-lg-8">';
|
<div class="card">
|
||||||
echo '<h2>Submission Received (Step 2 Preview)</h2>';
|
<div class="card-body">
|
||||||
echo '<p>This is where the AI-generated preview will appear. For now, here are the values you submitted:</p>';
|
<h5 class="card-title">Feature One</h5>
|
||||||
echo '<div class="card">';
|
<p class="card-text">This is a sample card showcasing the generated vibe.</p>
|
||||||
echo '<div class="card-body">';
|
</div>
|
||||||
echo '<h5 class="card-title">Selected Vibe: ' . htmlspecialchars($vibe) . '</h5>';
|
</div>
|
||||||
echo '<p class="card-text">Keywords: ' . htmlspecialchars($keywords) . '</p>';
|
</div>
|
||||||
echo '</div>';
|
<div class="col-md-4">
|
||||||
echo '</div>';
|
<div class="card">
|
||||||
echo '</div>';
|
<div class="card-body">
|
||||||
echo '</div>';
|
<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>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
@ -139,14 +205,5 @@
|
|||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user