Auto commit: 2025-09-30T15:43:44.747Z

This commit is contained in:
Flatlogic Bot 2025-09-30 15:43:44 +00:00
parent 4272510c2c
commit 9bc81847af
9 changed files with 99 additions and 20 deletions

29
api/pexels.php Normal file
View File

@ -0,0 +1,29 @@
<?php
header('Content-Type: application/json');
require_once __DIR__.'/../includes/pexels.php';
$qs = isset($_GET['queries']) ? explode(',', $_GET['queries']) : ['vibe','code','seo'];
$out = [];
foreach ($qs as $q) {
$u = 'https://api.pexels.com/v1/search?query=' . urlencode(trim($q)) . '&orientation=landscape&per_page=1&page=1';
$d = pexels_get($u);
if ($d && !empty($d['photos'])) {
$p = $d['photos'][0];
$src = $p['src']['large'] ?? null;
$dest = __DIR__.'/../assets/images/pexels/'.$p['id'].'.jpg';
if ($src) download_to($src, $dest);
$out[] = [
'src' => 'assets/images/pexels/'.$p['id'].'.jpg',
'photographer' => $p['photographer'] ?? 'Unknown',
'photographer_url' => $p['photographer_url'] ?? '',
];
} else {
// Fallback: Picsum
$out[] = [
'src' => 'https://picsum.photos/seed/'.urlencode(trim($q)).'/800/600',
'photographer' => 'Random Picsum',
'photographer_url' => 'https://picsum.photos/'
];
}
}
echo json_encode($out);
?>

View File

@ -1,4 +1,3 @@
body {
background-color: #F8FAFC;
color: #0F172A;
@ -6,13 +5,7 @@ body {
}
.hero {
background: linear-gradient(45deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
padding: 6rem 1rem;
text-align: center;
}
.hero h1 {
font-weight: 700;
}
.btn-primary {
@ -26,6 +19,18 @@ body {
}
.card {
border-radius: 0.5rem;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
border: 1px solid #e5e7eb;
border-radius: 0.75rem;
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.card:hover {
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
transform: translateY(-5px);
}
.card img {
aspect-ratio: 16 / 9;
object-fit: cover;
}

View File

@ -1 +1 @@
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; }
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; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

26
includes/pexels.php Normal file
View File

@ -0,0 +1,26 @@
<?php
function pexels_key() {
$k = getenv('PEXELS_KEY');
return $k && strlen($k) > 0 ? $k : 'Vc99rnmOhHhJAbgGQoKLZtsaIVfkeownoQNbTj78VemUjKh08ZYRbf18';
}
function pexels_get($url) {
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Authorization: '. pexels_key() ],
CURLOPT_TIMEOUT => 15,
]);
$resp = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($code >= 200 && $code < 300 && $resp) return json_decode($resp, true);
return null;
}
function download_to($srcUrl, $destPath) {
$data = file_get_contents($srcUrl);
if ($data === false) return false;
if (!is_dir(dirname($destPath))) mkdir(dirname($destPath), 0775, true);
return file_put_contents($destPath, $data) !== false;
}
?>

View File

@ -14,10 +14,10 @@
<?php include 'navbar.php'; ?>
<main>
<section class="hero">
<section class="hero text-center">
<div class="container">
<h1 class="display-4">Generate a Website With a Vibe</h1>
<p class="lead col-lg-8 mx-auto">Tell our AI your vibe, and we'll spin up a micro-site in seconds. From Synthwave to Brutalism, discover your digital aesthetic.</p>
<h1 class="display-3 fw-bold">Generate a Website With a Vibe</h1>
<p class="lead col-lg-8 mx-auto text-muted">Tell our AI your vibe, and we'll spin up a micro-site in seconds. From Synthwave to Brutalism, discover your digital aesthetic.</p>
<a href="vibe.php" class="btn btn-primary btn-lg px-4">
<i class="bi bi-stars"></i>
Create a Vibe Site
@ -25,12 +25,12 @@
</div>
</section>
<section class="py-5">
<section class="py-5 bg-light">
<div class="container">
<div class="row text-center g-4">
<div class="col-lg-4">
<div class="card h-100 p-4">
<img src="https://picsum.photos/seed/lamp-vibe/800/600" class="card-img-top rounded mb-3" alt="A colorful, abstract image representing different design vibes.">
<img id="img-vibe" src="https://picsum.photos/seed/lamp-vibe/800/600" class="card-img-top rounded mb-3" alt="A colorful, abstract image representing different design vibes.">
<div class="card-body">
<h3 class="h4">Vibe Generator</h3>
<p>Choose a vibe, give us a keyword, and watch the magic happen. Your own micro-site, generated by AI.</p>
@ -39,7 +39,7 @@
</div>
<div class="col-lg-4">
<div class="card h-100 p-4">
<img src="https://picsum.photos/seed/lamp-code/800/600" class="card-img-top rounded mb-3" alt="A snippet of code on a dark background, representing the PHP sandbox.">
<img id="img-code" src="https://picsum.photos/seed/lamp-code/800/600" class="card-img-top rounded mb-3" alt="A snippet of code on a dark background, representing the PHP sandbox.">
<div class="card-body">
<h3 class="h4">PHP Sandbox</h3>
<p>Safely run PHP code snippets in an isolated environment. Perfect for testing and learning.</p>
@ -48,7 +48,7 @@
</div>
<div class="col-lg-4">
<div class="card h-100 p-4">
<img src="https://picsum.photos/seed/lamp-seo/800/600" class="card-img-top rounded mb-3" alt="A magnifying glass over a web page, symbolizing SEO analysis.">
<img id="img-seo" src="https://picsum.photos/seed/lamp-seo/800/600" class="card-img-top rounded mb-3" alt="A magnifying glass over a web page, symbolizing SEO analysis.">
<div class="card-body">
<h3 class="h4">SEO Checker</h3>
<p>Paste your HTML and get instant feedback on your on-page SEO, powered by AI analysis.</p>
@ -60,13 +60,32 @@
</section>
</main>
<footer class="py-4 mt-auto bg-light">
<footer class="py-5 bg-dark text-white">
<div class="container text-center">
<p class="mb-0 text-muted">&copy; <?php echo date("Y"); ?> Flatlogic. All rights reserved.</p>
<p class="mb-0">&copy; <?php echo date("Y"); ?> Flatlogic. All rights reserved.</p>
<p class="mb-0">
<a href="contact.php" class="text-white">Contact</a> |
<a href="#" class="text-white">Privacy Policy</a> |
<a href="#" class="text-white">Terms of Service</a>
</p>
</div>
</footer>
<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>
document.addEventListener('DOMContentLoaded', function () {
fetch('api/pexels.php?queries=vibe,code,seo')
.then(response => response.json())
.then(data => {
if (data && data.length === 3) {
document.getElementById('img-vibe').src = data[0].src;
document.getElementById('img-code').src = data[1].src;
document.getElementById('img-seo').src = data[2].src;
}
})
.catch(error => console.error('Error fetching images:', error));
});
</script>
</body>
</html>

View File

@ -1,4 +1,4 @@
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="index.php">Flatlogic</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">