Auto commit: 2025-09-24T15:38:11.043Z

This commit is contained in:
Flatlogic Bot 2025-09-24 15:38:11 +00:00
parent 7dd5bd3287
commit 005dbf1478
7 changed files with 122 additions and 62 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

184
index.php
View File

@ -4,31 +4,79 @@ declare(strict_types=1);
@error_reporting(E_ALL);
@date_default_timezone_set('UTC');
$phpVersion = PHP_VERSION;
$now = date('Y-m-d H:i:s');
$happy_things = [
"Why do programmers prefer dark mode? Because light attracts bugs.",
"A programmer puts two glasses on his bedside table. One with water if he gets thirsty, and one empty in case he doesn't.",
"['hip', 'hip']",
"To understand what recursion is, you must first understand recursion.",
"I'm not lazy, I'm just on energy-saving mode.",
"Why did the programmer quit his job? Because he didn't get arrays.",
"A programmer's wife tells him: 'Go to the store and buy a loaf of bread. If they have eggs, buy a dozen.' The programmer returns with 12 loaves of bread.",
"There are 10 types of people in the world: those who understand binary, and those who don't.",
"Documentation is like sex: when it's good, it's very, very good; and when it's bad, it's better than nothing.",
"The best thing about a boolean is even if you are wrong, you are only off by a bit.",
"A programmer had a problem. He decided to use Java. Now he has a ProblemFactory.",
"Don't worry if it doesn't work right. If everything did, you'd be out of a job.",
"Programming is like writing a book... if you miss a single comma on page 1, the whole story makes no sense.",
"The six stages of debugging: 1. That can't happen. 2. It shouldn't happen. 3. It did happen. 4. Why did it happen? 5. Oh, I see. 6. How did that ever work?",
"Talk is cheap. Show me the code.",
"It's not a bug, it's an undocumented feature.",
"Weeks of programming can save you hours of planning.",
"One man's crappy software is another man's full-time job."
];
$happy_thing = $happy_things[array_rand($happy_things)];
// Fetch a background image from Pexels
$bg_image_url = 'assets/pasted-20250924-152027-2c3eed44.jpg'; // Fallback image
$pexels_api_key = getenv('PEXELS_KEY') ?: 'Vc99rnmOhHhJAbgGQoKLZtsaIVfkeownoQNbTj78VemUjKh08ZYRbf18';
$query = 'developer desk';
$pexels_url = 'https://api.pexels.com/v1/search?query=' . urlencode($query) . '&orientation=landscape&per_page=1';
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $pexels_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: ' . $pexels_api_key],
CURLOPT_TIMEOUT => 15,
]);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($http_code >= 200 && $http_code < 300 && $response) {
$data = json_decode($response, true);
if (!empty($data['photos'])) {
$photo = $data['photos'][0];
$src = $photo['src']['large2x'] ?? $photo['src']['large'] ?? $photo['src']['original'];
$bg_image_url = $src;
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>New Style</title>
<title>How to Make a Developer Happy</title>
<meta name="description" content="A simple page to bring a smile to a developer's face.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Source+Code+Pro&display=swap" rel="stylesheet">
<style>
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
--card-bg-color: rgba(0, 0, 0, 0.4);
--card-border-color: rgba(255, 255, 255, 0.2);
--button-bg-color: #007bff;
--button-hover-bg-color: #0056b3;
}
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
background: url('<?= htmlspecialchars($bg_image_url) ?>') no-repeat center center fixed;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
@ -44,88 +92,100 @@ $now = date('Y-m-d H:i:s');
left: 0;
width: 100%;
height: 100%;
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
animation: bg-pan 20s linear infinite;
z-index: -1;
}
@keyframes bg-pan {
0% { background-position: 0% 0%; }
100% { background-position: 100% 100%; }
background-color: rgba(0, 0, 0, 0.5);
z-index: 1;
}
main {
padding: 2rem;
position: relative;
z-index: 2;
}
.card {
background: var(--card-bg-color);
border: 1px solid var(--card-border-color);
border-radius: 16px;
padding: 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}
.loader {
margin: 1.25rem auto 1.25rem;
width: 48px;
height: 48px;
border: 3px solid rgba(255, 255, 255, 0.25);
border-top-color: #fff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.hint {
opacity: 0.9;
}
.sr-only {
position: absolute;
width: 1px; height: 1px;
padding: 0; margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap; border: 0;
padding: 2rem 3rem;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
max-width: 600px;
}
h1 {
font-size: 3rem;
font-size: 2.5rem;
font-weight: 700;
margin: 0 0 1rem;
margin: 0 0 1.5rem;
letter-spacing: -1px;
}
p {
margin: 0.5rem 0;
font-size: 1.1rem;
.happy-content {
font-family: 'Source Code Pro', monospace;
font-size: 1.2rem;
margin: 2rem 0;
min-height: 80px;
display: flex;
align-items: center;
justify-content: center;
}
code {
background: rgba(0,0,0,0.2);
padding: 2px 6px;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
.btn {
background-color: var(--button-bg-color);
color: var(--text-color);
border: none;
padding: 1rem 2rem;
font-size: 1.2rem;
font-weight: 700;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease;
text-decoration: none;
}
.btn:hover {
background-color: var(--button-hover-bg-color);
}
footer {
position: absolute;
bottom: 1rem;
font-size: 0.8rem;
opacity: 0.7;
z-index: 2;
}
</style>
</head>
<body>
<main>
<div class="card">
<h1>Analyzing your requirements and generating your website…</h1>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
<span class="sr-only">Loading…</span>
<h1>How to Make a Developer Happy</h1>
<div id="question-container">
<p class="happy-content">Ready for some developer happiness?</p>
<button id="show-happiness-btn" class="btn">Yes!</button>
</div>
<div id="happiness-container" style="display: none;">
<div id="happy-content" class="happy-content">
<p><?= htmlspecialchars($happy_thing) ?></p>
</div>
<button id="make-happy-btn" class="btn">Make me happy</button>
</div>
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWiZZy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
<p class="hint">This page will update automatically as the plan is implemented.</p>
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
</div>
</main>
<footer>
Page updated: <?= htmlspecialchars($now) ?> (UTC)
Powered by Gemini
</footer>
<script>
const happyThings = <?= json_encode($happy_things) ?>;
const happyContent = document.getElementById('happy-content');
const makeHappyBtn = document.getElementById('make-happy-btn');
const showHappinessBtn = document.getElementById('show-happiness-btn');
const questionContainer = document.getElementById('question-container');
const happinessContainer = document.getElementById('happiness-container');
showHappinessBtn.addEventListener('click', () => {
questionContainer.style.display = 'none';
happinessContainer.style.display = 'block';
});
makeHappyBtn.addEventListener('click', () => {
const randomIndex = Math.floor(Math.random() * happyThings.length);
const newHappyThing = happyThings[randomIndex];
happyContent.innerHTML = `<p>${newHappyThing}</p>`;
});
</script>
</body>
</html>
</html>