From 2d3d1741fdb23856ed377f7201231aadf84e1cfc Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 28 Nov 2025 00:36:51 +0000 Subject: [PATCH] Auto commit: 2025-11-28T00:36:51.588Z --- assets/css/custom.css | 103 ++++++++++++++++++ index.php | 243 ++++++++++++++++++------------------------ 2 files changed, 205 insertions(+), 141 deletions(-) create mode 100644 assets/css/custom.css diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..5cc44df --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,103 @@ + +body { + background-color: #E5E5E5; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; +} + +.chat-container { + display: flex; + flex-direction: column; + height: 100vh; + max-width: 800px; + margin: 0 auto; + background-color: #E5E5E5; + border-left: 1px solid #ddd; + border-right: 1px solid #ddd; +} + +.chat-header { + background-color: #0088cc; + color: white; + padding: 1rem; + text-align: center; + font-size: 1.25rem; + font-weight: 500; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); + z-index: 10; +} + +.chat-messages { + flex-grow: 1; + overflow-y: auto; + padding: 1rem; + display: flex; + flex-direction: column; + gap: 0.75rem; + padding-bottom: 80px; /* Space for the input form */ +} + +.message-bubble { + padding: 0.75rem 1rem; + border-radius: 1.25rem; + max-width: 75%; + word-wrap: break-word; + box-shadow: 0 1px 2px rgba(0,0,0,0.05); +} + +.message-bubble.sent { + background-color: #DCF8C6; + align-self: flex-end; + border-bottom-right-radius: 0.25rem; +} + +.message-bubble.received { + background-color: #FFFFFF; + align-self: flex-start; + border-bottom-left-radius: 0.25rem; +} + +.message-time { + font-size: 0.75rem; + color: #999; + margin-top: 4px; + text-align: right; +} + +.chat-form { + position: fixed; + bottom: 0; + left: 0; + right: 0; + max-width: 800px; + margin: 0 auto; + padding: 1rem; + background-color: #f0f0f0; + border-top: 1px solid #ddd; + box-shadow: 0 -2px 5px rgba(0,0,0,0.05); +} + +.chat-form form { + display: flex; + gap: 0.5rem; +} + +.chat-form input { + flex-grow: 1; + border-radius: 1.5rem; + border: 1px solid #ccc; + padding: 0.75rem 1rem; +} + +.chat-form button { + border-radius: 50%; + width: 48px; + height: 48px; + border: none; + background-color: #0088cc; + color: white; + font-size: 1.5rem; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; +} diff --git a/index.php b/index.php index 7205f3d..1216a8a 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,111 @@ exec("CREATE TABLE IF NOT EXISTS messages ( + id INT AUTO_INCREMENT PRIMARY KEY, + message TEXT NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + );"); + + // Handle new message submission (Post/Redirect/Get pattern) + if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty(trim($_POST['message']))) { + $stmt = $pdo->prepare("INSERT INTO messages (message) VALUES (?)"); + $stmt->execute([$_POST['message']]); + // Prevent form resubmission on refresh + header("Location: index.php"); + exit; + } + + // Fetch all messages for display + $messages = $pdo->query("SELECT * FROM messages ORDER BY created_at ASC")->fetchAll(PDO::FETCH_ASSOC); + +} catch (PDOException $e) { + // For a real app, you'd want to log this and show a user-friendly error page. + error_log("Database error: " . $e->getMessage()); + // Keep the page from crashing, show an error inline. + $dbError = "Could not connect to the database or run the query. Please check server logs."; +} + +// --- Dynamic Meta Tags & SEO --- (Platform-managed) +$project_name = htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'Telegram App'); +$project_description = htmlspecialchars($_SERVER['PROJECT_DESCRIPTION'] ?? 'A simple messaging app.'); +$project_image_url = htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); -$phpVersion = PHP_VERSION; -$now = date('Y-m-d H:i:s'); ?> - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + <?= $project_name ?> + + + + + + + + + + + + + + + + + + + + + + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ +
+
+ Public Chat +
+ +
+ +
Error:
+ +
No messages yet. Be the first to post!
+ + +
+
+
+
+ + +
+ +
+
+ + +
+
-
- + + + - + \ No newline at end of file