Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
Binary file not shown.
|
Before Width: | Height: | Size: 58 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 92 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 58 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 58 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 92 KiB |
184
index.php
184
index.php
@ -4,79 +4,31 @@ declare(strict_types=1);
|
|||||||
@error_reporting(E_ALL);
|
@error_reporting(E_ALL);
|
||||||
@date_default_timezone_set('UTC');
|
@date_default_timezone_set('UTC');
|
||||||
|
|
||||||
$happy_things = [
|
$phpVersion = PHP_VERSION;
|
||||||
"Why do programmers prefer dark mode? Because light attracts bugs.",
|
$now = date('Y-m-d H:i:s');
|
||||||
"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>
|
<!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" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>How to Make a Developer Happy</title>
|
<title>New Style</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.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Source+Code+Pro&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
|
--bg-color-start: #6a11cb;
|
||||||
|
--bg-color-end: #2575fc;
|
||||||
--text-color: #ffffff;
|
--text-color: #ffffff;
|
||||||
--card-bg-color: rgba(0, 0, 0, 0.4);
|
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||||
--card-border-color: rgba(255, 255, 255, 0.2);
|
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||||
--button-bg-color: #007bff;
|
|
||||||
--button-hover-bg-color: #0056b3;
|
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: 'Inter', sans-serif;
|
font-family: 'Inter', sans-serif;
|
||||||
|
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
background: url('<?= htmlspecialchars($bg_image_url) ?>') no-repeat center center fixed;
|
|
||||||
background-size: cover;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -92,100 +44,88 @@ if ($http_code >= 200 && $http_code < 300 && $response) {
|
|||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: rgba(0, 0, 0, 0.5);
|
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>');
|
||||||
z-index: 1;
|
animation: bg-pan 20s linear infinite;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
@keyframes bg-pan {
|
||||||
|
0% { background-position: 0% 0%; }
|
||||||
|
100% { background-position: 100% 100%; }
|
||||||
}
|
}
|
||||||
main {
|
main {
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
position: relative;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
}
|
||||||
.card {
|
.card {
|
||||||
background: var(--card-bg-color);
|
background: var(--card-bg-color);
|
||||||
border: 1px solid var(--card-border-color);
|
border: 1px solid var(--card-border-color);
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
padding: 2rem 3rem;
|
padding: 2rem;
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(20px);
|
||||||
-webkit-backdrop-filter: blur(10px);
|
-webkit-backdrop-filter: blur(20px);
|
||||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
|
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||||
max-width: 600px;
|
}
|
||||||
|
.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;
|
||||||
}
|
}
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 2.5rem;
|
font-size: 3rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
margin: 0 0 1.5rem;
|
margin: 0 0 1rem;
|
||||||
letter-spacing: -1px;
|
letter-spacing: -1px;
|
||||||
}
|
}
|
||||||
.happy-content {
|
p {
|
||||||
font-family: 'Source Code Pro', monospace;
|
margin: 0.5rem 0;
|
||||||
font-size: 1.2rem;
|
font-size: 1.1rem;
|
||||||
margin: 2rem 0;
|
|
||||||
min-height: 80px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
}
|
||||||
.btn {
|
code {
|
||||||
background-color: var(--button-bg-color);
|
background: rgba(0,0,0,0.2);
|
||||||
color: var(--text-color);
|
padding: 2px 6px;
|
||||||
border: none;
|
border-radius: 4px;
|
||||||
padding: 1rem 2rem;
|
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||||
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 {
|
footer {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 1rem;
|
bottom: 1rem;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
z-index: 2;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main>
|
<main>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h1>How to Make a Developer Happy</h1>
|
<h1>Analyzing your requirements and generating your website…</h1>
|
||||||
<div id="question-container">
|
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||||
<p class="happy-content">Ready for some developer happiness?</p>
|
<span class="sr-only">Loading…</span>
|
||||||
<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>
|
</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>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
Powered by Gemini
|
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||||
</footer>
|
</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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user