Chatify
This commit is contained in:
parent
696019034b
commit
5a7b56fd21
206
assets/css/custom.css
Normal file
206
assets/css/custom.css
Normal file
@ -0,0 +1,206 @@
|
|||||||
|
/* General Styles */
|
||||||
|
body {
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
background-color: #F0F2F5;
|
||||||
|
margin: 0;
|
||||||
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-container {
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-icon {
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Conversations Pane */
|
||||||
|
.conversations-pane {
|
||||||
|
width: 360px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-right: 1px solid #ddd;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-header {
|
||||||
|
padding: 1rem 1.5rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-search .form-control:focus {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-list {
|
||||||
|
overflow-y: auto;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0.75rem 1.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-item:hover {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-item.active {
|
||||||
|
background-color: #e7f3ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-item-avatar {
|
||||||
|
position: relative;
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-item-avatar img {
|
||||||
|
width: 56px;
|
||||||
|
height: 56px;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.online-dot {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 2px;
|
||||||
|
right: 2px;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
background-color: #31a24c;
|
||||||
|
border: 2px solid #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-item-content {
|
||||||
|
flex-grow: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-item-title {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-item-time {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ch-item-preview {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Chat Window Pane */
|
||||||
|
.chat-window-pane {
|
||||||
|
flex-grow: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: #F0F2F5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0.75rem 1.5rem;
|
||||||
|
background-color: #fff;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-body {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 1.5rem;
|
||||||
|
overflow-y: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
max-width: 60%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-bubble {
|
||||||
|
padding: 0.75rem 1rem;
|
||||||
|
border-radius: 16px;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message.received {
|
||||||
|
align-self: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message.received .message-bubble {
|
||||||
|
background-color: #fff;
|
||||||
|
color: #212529;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message.sent {
|
||||||
|
align-self: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message.sent .message-bubble {
|
||||||
|
background-image: linear-gradient(to right, #007bff, #00C6FF);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-footer {
|
||||||
|
padding: 1rem 1.5rem;
|
||||||
|
background-color: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-footer .form-control {
|
||||||
|
border-radius: 20px;
|
||||||
|
background-color: #F0F2F5;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-footer .form-control:focus {
|
||||||
|
box-shadow: none;
|
||||||
|
background-color: #e9ecef;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.conversations-pane {
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 10;
|
||||||
|
transition: transform 0.3s ease-in-out;
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-window-pane {
|
||||||
|
display: none; /* Hidden by default on mobile */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add class to show chat window and hide conversations */
|
||||||
|
.chat-container.show-chat .conversations-pane {
|
||||||
|
transform: translateX(-100%);
|
||||||
|
}
|
||||||
|
.chat-container.show-chat .chat-window-pane {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
37
assets/js/main.js
Normal file
37
assets/js/main.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
const conversationItems = document.querySelectorAll('.ch-item');
|
||||||
|
const chatHeaderName = document.getElementById('chat-header-name');
|
||||||
|
const chatHeaderImg = document.getElementById('chat-header-img');
|
||||||
|
|
||||||
|
conversationItems.forEach(item => {
|
||||||
|
item.addEventListener('click', function() {
|
||||||
|
// Remove active class from all items
|
||||||
|
conversationItems.forEach(i => i.classList.remove('active'));
|
||||||
|
|
||||||
|
// Add active class to the clicked item
|
||||||
|
this.classList.add('active');
|
||||||
|
|
||||||
|
// Update chat header
|
||||||
|
const name = this.dataset.name;
|
||||||
|
const imgSrc = this.dataset.img;
|
||||||
|
|
||||||
|
if (chatHeaderName) {
|
||||||
|
chatHeaderName.textContent = name;
|
||||||
|
}
|
||||||
|
if (chatHeaderImg) {
|
||||||
|
chatHeaderImg.src = imgSrc;
|
||||||
|
}
|
||||||
|
|
||||||
|
// On mobile, this would also trigger showing the chat pane
|
||||||
|
document.querySelector('.chat-container').classList.add('show-chat');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Example of how to go back on mobile (you'd need a back button in the chat header)
|
||||||
|
// const backButton = document.getElementById('back-to-conversations');
|
||||||
|
// if(backButton) {
|
||||||
|
// backButton.addEventListener('click', () => {
|
||||||
|
// document.querySelector('.chat-container').classList.remove('show-chat');
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
});
|
||||||
263
index.php
263
index.php
@ -1,150 +1,127 @@
|
|||||||
<?php
|
<!DOCTYPE html>
|
||||||
declare(strict_types=1);
|
|
||||||
@ini_set('display_errors', '1');
|
|
||||||
@error_reporting(E_ALL);
|
|
||||||
@date_default_timezone_set('UTC');
|
|
||||||
|
|
||||||
$phpVersion = PHP_VERSION;
|
|
||||||
$now = date('Y-m-d H:i:s');
|
|
||||||
?>
|
|
||||||
<!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.0">
|
||||||
<title>New Style</title>
|
<title>Chatify</title>
|
||||||
<?php
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
// Read project preview data from environment
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
||||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||||
?>
|
|
||||||
<?php if ($projectDescription): ?>
|
|
||||||
<!-- Meta description -->
|
|
||||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
|
||||||
<!-- Open Graph meta tags -->
|
|
||||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
|
||||||
<!-- Twitter meta tags -->
|
|
||||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($projectImageUrl): ?>
|
|
||||||
<!-- Open Graph image -->
|
|
||||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
|
||||||
<!-- Twitter image -->
|
|
||||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
|
||||||
<?php endif; ?>
|
|
||||||
<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">
|
|
||||||
<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);
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
font-family: 'Inter', sans-serif;
|
|
||||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
|
||||||
color: var(--text-color);
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
min-height: 100vh;
|
|
||||||
text-align: center;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
body::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
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%; }
|
|
||||||
}
|
|
||||||
main {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
font-size: 3rem;
|
|
||||||
font-weight: 700;
|
|
||||||
margin: 0 0 1rem;
|
|
||||||
letter-spacing: -1px;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
margin: 0.5rem 0;
|
|
||||||
font-size: 1.1rem;
|
|
||||||
}
|
|
||||||
code {
|
|
||||||
background: rgba(0,0,0,0.2);
|
|
||||||
padding: 2px 6px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
||||||
}
|
|
||||||
footer {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 1rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main>
|
|
||||||
<div class="card">
|
<div class="chat-container">
|
||||||
<h1>Analyzing your requirements and generating your website…</h1>
|
<!-- Conversations Pane -->
|
||||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
<div class="conversations-pane">
|
||||||
<span class="sr-only">Loading…</span>
|
<div class="ch-header">
|
||||||
</div>
|
<h1 class="h4 fw-bold">Chats</h1>
|
||||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
<button class="btn btn-icon btn-light">
|
||||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
<i data-feather="edit-3"></i>
|
||||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="ch-search px-3">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-0"><i data-feather="search" class="text-muted"></i></span>
|
||||||
|
<input type="text" class="form-control bg-light border-0" placeholder="Search Messenger">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ch-list">
|
||||||
|
<!-- Conversation Item -->
|
||||||
|
<div class="ch-item active" data-name="Alice" data-img="https://i.pravatar.cc/150?u=alice">
|
||||||
|
<div class="ch-item-avatar">
|
||||||
|
<img src="https://i.pravatar.cc/150?u=alice" alt="Alice">
|
||||||
|
<div class="online-dot"></div>
|
||||||
|
</div>
|
||||||
|
<div class="ch-item-content">
|
||||||
|
<div class="ch-item-title">
|
||||||
|
<span class="fw-bold">Alice</span>
|
||||||
|
<span class="ch-item-time text-muted">15m</span>
|
||||||
|
</div>
|
||||||
|
<p class="ch-item-preview text-muted mb-0">You: Sure, sounds good! See you then.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Conversation Item -->
|
||||||
|
<div class="ch-item" data-name="Bob" data-img="https://i.pravatar.cc/150?u=bob">
|
||||||
|
<div class="ch-item-avatar">
|
||||||
|
<img src="https://i.pravatar.cc/150?u=bob" alt="Bob">
|
||||||
|
</div>
|
||||||
|
<div class="ch-item-content">
|
||||||
|
<div class="ch-item-title">
|
||||||
|
<span class="fw-bold">Bob</span>
|
||||||
|
<span class="ch-item-time text-muted">1h</span>
|
||||||
|
</div>
|
||||||
|
<p class="ch-item-preview text-muted mb-0">Thanks for the update.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Conversation Item -->
|
||||||
|
<div class="ch-item" data-name="Charlie" data-img="https://i.pravatar.cc/150?u=charlie">
|
||||||
|
<div class="ch-item-avatar">
|
||||||
|
<img src="https://i.pravatar.cc/150?u=charlie" alt="Charlie">
|
||||||
|
<div class="online-dot"></div>
|
||||||
|
</div>
|
||||||
|
<div class="ch-item-content">
|
||||||
|
<div class="ch-item-title">
|
||||||
|
<span class="fw-bold">Charlie</span>
|
||||||
|
<span class="ch-item-time text-muted">3h</span>
|
||||||
|
</div>
|
||||||
|
<p class="ch-item-preview text-muted mb-0">Haha, that's hilarious! 😂</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Chat Window Pane -->
|
||||||
|
<div class="chat-window-pane">
|
||||||
|
<div class="chat-header">
|
||||||
|
<div class="ch-item-avatar me-3">
|
||||||
|
<img src="https://i.pravatar.cc/150?u=alice" alt="Alice" id="chat-header-img">
|
||||||
|
<div class="online-dot"></div>
|
||||||
|
</div>
|
||||||
|
<div class="ch-item-content">
|
||||||
|
<h2 class="h6 fw-bold mb-0" id="chat-header-name">Alice</h2>
|
||||||
|
<p class="text-muted small mb-0">Active now</p>
|
||||||
|
</div>
|
||||||
|
<div class="ms-auto">
|
||||||
|
<button class="btn btn-icon btn-light me-1"><i data-feather="phone"></i></button>
|
||||||
|
<button class="btn btn-icon btn-light"><i data-feather="video"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="chat-body">
|
||||||
|
<!-- Message Received -->
|
||||||
|
<div class="message received">
|
||||||
|
<div class="message-bubble">Hey, are we still on for lunch tomorrow?</div>
|
||||||
|
</div>
|
||||||
|
<!-- Message Sent -->
|
||||||
|
<div class="message sent">
|
||||||
|
<div class="message-bubble">Hey! Absolutely. 1pm at the usual spot?</div>
|
||||||
|
</div>
|
||||||
|
<!-- Message Received -->
|
||||||
|
<div class="message received">
|
||||||
|
<div class="message-bubble">Perfect!</div>
|
||||||
|
</div>
|
||||||
|
<div class="message received">
|
||||||
|
<div class="message-bubble">I might be a few minutes late, wrapping up a meeting.</div>
|
||||||
|
</div>
|
||||||
|
<!-- Message Sent -->
|
||||||
|
<div class="message sent">
|
||||||
|
<div class="message-bubble">No worries at all.</div>
|
||||||
|
</div>
|
||||||
|
<div class="message sent">
|
||||||
|
<div class="message-bubble">Sure, sounds good! See you then.</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="chat-footer">
|
||||||
|
<button class="btn btn-icon btn-light"><i data-feather="plus-circle"></i></button>
|
||||||
|
<input type="text" class="form-control mx-2" placeholder="Type a message...">
|
||||||
|
<button class="btn btn-primary btn-icon"><i data-feather="send"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
|
||||||
<footer>
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
<script>
|
||||||
</footer>
|
feather.replace()
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user