1.0
This commit is contained in:
parent
116f0906b3
commit
5d115dd2f0
149
assets/css/custom.css
Normal file
149
assets/css/custom.css
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
|
||||||
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||||
|
background-color: #F9F9F9;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 800px;
|
||||||
|
height: 90vh;
|
||||||
|
max-height: 1000px;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 16px;
|
||||||
|
border: 1px solid #E5E5E5;
|
||||||
|
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-header {
|
||||||
|
padding: 16px 20px;
|
||||||
|
background: #FFFFFF;
|
||||||
|
color: #000000;
|
||||||
|
font-weight: 600;
|
||||||
|
text-align: center;
|
||||||
|
border-bottom: 1px solid #F0F0F0;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-body {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 30px 20px;
|
||||||
|
overflow-y: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-greeting {
|
||||||
|
text-align: center;
|
||||||
|
margin: auto 0;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-greeting h1 {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 2.5rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-greeting p {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
color: #6c757d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-message {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 16px;
|
||||||
|
max-width: 100%;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-message .avatar {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-content {
|
||||||
|
padding-top: 8px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-user .avatar {
|
||||||
|
background-color: #E0E0E0;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-bot .avatar {
|
||||||
|
background-color: #D0E6A5;
|
||||||
|
color: #4A5C2F;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-footer {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-top: 1px solid #F0F0F0;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-input-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border: 1px solid #E0E0E0;
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 8px 8px 8px 20px;
|
||||||
|
transition: border-color .2s;
|
||||||
|
background: #F9F9F9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-input-container:focus-within {
|
||||||
|
border-color: #AAA;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-footer .form-control {
|
||||||
|
border: none;
|
||||||
|
box-shadow: none;
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 10px 0;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-footer .form-control:focus {
|
||||||
|
box-shadow: none;
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-footer .btn {
|
||||||
|
border-radius: 8px;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
background-color: #333;
|
||||||
|
border-color: #333;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.chat-footer .btn:hover {
|
||||||
|
background-color: #000;
|
||||||
|
border-color: #000;
|
||||||
|
}
|
||||||
64
assets/js/main.js
Normal file
64
assets/js/main.js
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
const sendBtn = document.getElementById('chat-send-btn');
|
||||||
|
const chatInput = document.getElementById('chat-input');
|
||||||
|
const chatBody = document.getElementById('chat-body');
|
||||||
|
const chatGreeting = document.querySelector('.chat-greeting');
|
||||||
|
|
||||||
|
const appendMessage = (text, sender) => {
|
||||||
|
// Remove greeting if it exists
|
||||||
|
if (chatGreeting && chatGreeting.parentElement === chatBody) {
|
||||||
|
chatBody.removeChild(chatGreeting);
|
||||||
|
}
|
||||||
|
|
||||||
|
const messageDiv = document.createElement('div');
|
||||||
|
messageDiv.classList.add('chat-message', `message-${sender}`);
|
||||||
|
|
||||||
|
const avatarDiv = document.createElement('div');
|
||||||
|
avatarDiv.classList.add('avatar');
|
||||||
|
|
||||||
|
if (sender === 'bot') {
|
||||||
|
// Simple bot icon
|
||||||
|
avatarDiv.innerHTML = '<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM8.5 12.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm7 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM12 16c-2.33 0-4.32-1.45-5.12-3.5h10.24c-.8 2.05-2.79 3.5-5.12 3.5z"/></svg>';
|
||||||
|
} else {
|
||||||
|
avatarDiv.textContent = 'U'; // Simple text avatar for user
|
||||||
|
}
|
||||||
|
|
||||||
|
const contentDiv = document.createElement('div');
|
||||||
|
contentDiv.classList.add('message-content');
|
||||||
|
contentDiv.textContent = text;
|
||||||
|
|
||||||
|
messageDiv.appendChild(avatarDiv);
|
||||||
|
messageDiv.appendChild(contentDiv);
|
||||||
|
|
||||||
|
chatBody.appendChild(messageDiv);
|
||||||
|
chatBody.scrollTop = chatBody.scrollHeight;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUserMessage = () => {
|
||||||
|
const messageText = chatInput.value.trim();
|
||||||
|
if (messageText === '') return;
|
||||||
|
|
||||||
|
appendMessage(messageText, 'user');
|
||||||
|
chatInput.value = '';
|
||||||
|
|
||||||
|
// Simulate bot response
|
||||||
|
setTimeout(() => {
|
||||||
|
appendMessage('...', 'bot');
|
||||||
|
}, 500);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
// remove the ... message
|
||||||
|
if(chatBody.lastChild.textContent.includes('...')){
|
||||||
|
chatBody.lastChild.remove();
|
||||||
|
}
|
||||||
|
appendMessage('This is a placeholder response. The backend is not yet connected.', 'bot');
|
||||||
|
}, 1500);
|
||||||
|
};
|
||||||
|
|
||||||
|
sendBtn.addEventListener('click', handleUserMessage);
|
||||||
|
chatInput.addEventListener('keypress', function (e) {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
handleUserMessage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
189
index.php
189
index.php
@ -1,150 +1,53 @@
|
|||||||
<?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>
|
|
||||||
<?php
|
<title>blu-magicai</title>
|
||||||
// Read project preview data from environment
|
<meta name="description" content="Built with Flatlogic Generator">
|
||||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
<meta name="keywords" content="AI chatbot, admin dashboard, machine learning, customer support, lead generation, automated chat, dialog flows, intent recognition, chatbot analytics, Built with Flatlogic Generator">
|
||||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
|
||||||
?>
|
<meta property="og:title" content="blu-magicai">
|
||||||
<?php if ($projectDescription): ?>
|
<meta property="og:description" content="Built with Flatlogic Generator">
|
||||||
<!-- Meta description -->
|
<meta property="og:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? '', ENT_QUOTES, 'UTF-8'); ?>">
|
||||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<!-- Open Graph meta tags -->
|
<meta name="twitter:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? '', ENT_QUOTES, 'UTF-8'); ?>">
|
||||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
|
||||||
<!-- Twitter meta tags -->
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<?php endif; ?>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<?php if ($projectImageUrl): ?>
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap" rel="stylesheet">
|
||||||
<!-- Open Graph image -->
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
<script src="https://unpkg.com/feather-icons"></script>
|
||||||
<!-- 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>
|
<!-- Chat Container -->
|
||||||
<div class="card">
|
<div class="chat-container" id="chat-container">
|
||||||
<h1>Analyzing your requirements and generating your website…</h1>
|
<div class="chat-header">
|
||||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
<span>AI Assistant</span>
|
||||||
<span class="sr-only">Loading…</span>
|
</div>
|
||||||
</div>
|
<div class="chat-body" id="chat-body">
|
||||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
<div class="chat-greeting">
|
||||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
<h1>Welcome to blu-magicai</h1>
|
||||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
<p>Your friendly AI assistant is ready to chat.</p>
|
||||||
|
</div>
|
||||||
|
<!-- Messages will be appended here -->
|
||||||
|
</div>
|
||||||
|
<div class="chat-footer">
|
||||||
|
<div class="chat-input-container">
|
||||||
|
<input type="text" id="chat-input" class="form-control" placeholder="Ask me anything...">
|
||||||
|
<button class="btn btn-primary" id="chat-send-btn">
|
||||||
|
<i data-feather="arrow-up"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
|
||||||
<footer>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||||
</footer>
|
<script>
|
||||||
|
feather.replace()
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user