version without chat
This commit is contained in:
parent
9bc81847af
commit
0381e4484b
@ -1 +1 @@
|
|||||||
body { font-family: "Courier New", monospace; background-color: #000; color: #0FF; } .navbar, .card, footer { background-color: #002B36 !important; border: 1px solid #0FF; } .navbar-brand, .nav-link, h1, h2, h5, p { color: #0FF !important; } .btn-primary { background-color: #0FF; color: #000; border: none; } .vibe-preview { padding: 2rem; border: 1px dashed #0FF; margin-top: 2rem; }
|
@import url("https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;700&display=swap"); body { font-family: "Roboto Slab", serif; background-color: #D2B48C; color: #333; } .navbar, .card, footer { background-color: #8B4513 !important; color: white; border: 3px solid #654321; } .navbar-brand, .nav-link, h1, h2, h5, p, .card-body { color: #fff !important; } .btn-primary { background-color: #008000; color: #fff; border: 2px solid #006400; } .vibe-preview { padding: 2rem; border: 2px solid #654321; margin-top: 2rem; background-color: #F5DEB3; } .vibe-preview h2, .vibe-preview p { color: #333 !important; }
|
||||||
BIN
assets/images/pexels/34170429.jpg
Normal file
BIN
assets/images/pexels/34170429.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
BIN
assets/images/pexels/34233235.jpg
Normal file
BIN
assets/images/pexels/34233235.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
BIN
assets/images/pexels/34256624.jpg
Normal file
BIN
assets/images/pexels/34256624.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
97
chat.php
97
chat.php
@ -1,97 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Chat with Gemini</title>
|
|
||||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
|
||||||
<style>
|
|
||||||
.chat-container {
|
|
||||||
max-width: 800px;
|
|
||||||
margin: 50px auto;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-radius: 10px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.chat-header {
|
|
||||||
background-color: #f8f9fa;
|
|
||||||
padding: 15px;
|
|
||||||
border-bottom: 1px solid #ddd;
|
|
||||||
font-size: 1.2rem;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.chat-box {
|
|
||||||
height: 400px;
|
|
||||||
overflow-y: auto;
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
.chat-input {
|
|
||||||
padding: 15px;
|
|
||||||
border-top: 1px solid #ddd;
|
|
||||||
}
|
|
||||||
.message {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
.user-message {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
.bot-message .card-body {
|
|
||||||
background-color: #f1f1f1;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<?php include 'navbar.php'; ?>
|
|
||||||
<div class="container">
|
|
||||||
<div class="chat-container">
|
|
||||||
<div class="chat-header">
|
|
||||||
Chat with Gemini
|
|
||||||
</div>
|
|
||||||
<div class="chat-box" id="chat-box">
|
|
||||||
<!-- Messages will be appended here -->
|
|
||||||
</div>
|
|
||||||
<div class="chat-input">
|
|
||||||
<form id="chat-form">
|
|
||||||
<div class="input-group">
|
|
||||||
<input type="text" id="user-input" class="form-control" placeholder="Ask me about the app...">
|
|
||||||
<div class="input-group-append">
|
|
||||||
<button class="btn btn-primary" type="submit">Send</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
|
||||||
<script>
|
|
||||||
$(document).ready(function() {
|
|
||||||
$("#chat-form").submit(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
var userInput = $("#user-input").val();
|
|
||||||
if (userInput.trim() === "") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Display user message
|
|
||||||
$("#chat-box").append('<div class="message user-message"><div class="card d-inline-block"><div class="card-body">' + userInput + '</div></div></div>');
|
|
||||||
$("#user-input").val("");
|
|
||||||
$("#chat-box").scrollTop($("#chat-box")[0].scrollHeight);
|
|
||||||
|
|
||||||
|
|
||||||
// Send user input to the bot
|
|
||||||
$.ajax({
|
|
||||||
url: "chat_logic.php",
|
|
||||||
type: "POST",
|
|
||||||
data: { message: userInput },
|
|
||||||
success: function(response) {
|
|
||||||
// Display bot response
|
|
||||||
$("#chat-box").append('<div class="message bot-message"><div class="card d-inline-block"><div class="card-body">' + response + '</div></div></div>');
|
|
||||||
$("#chat-box").scrollTop($("#chat-box")[0].scrollHeight);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
$message = strtolower($_POST['message'] ?? '');
|
|
||||||
|
|
||||||
if (str_contains($message, 'hello') || str_contains($message, 'hi')) {
|
|
||||||
echo "Hello! I'm Gemini, your in-app assistant. Ask me anything about this application.";
|
|
||||||
} elseif (str_contains($message, 'vibe')) {
|
|
||||||
echo "The 'Vibe Generator' (`vibe.php`) lets you generate random color palettes and CSS gradients. You can even save and share your favorite themes.";
|
|
||||||
} elseif (str_contains($message, 'seo')) {
|
|
||||||
echo "The 'SEO Checker' (`seo.php`) analyzes the on-page SEO of a given URL. It checks for title tags, meta descriptions, headings, and more.";
|
|
||||||
} elseif (str_contains($message, 'sandbox')) {
|
|
||||||
echo "The 'PHP Sandbox' (`sandbox.php`) is a safe environment where you can execute arbitrary PHP code and see the output.";
|
|
||||||
} elseif (str_contains($message, 'contact')) {
|
|
||||||
echo "The 'Contact' page (`contact.php`) contains a form that allows you to send an email using the app's built-in mail service.";
|
|
||||||
} elseif (str_contains($message, 'admin')) {
|
|
||||||
echo "The 'Admin' page (`admin.php`) is for managing the 'Nokia Facts'. It's a full CRUD interface for creating, reading, updating, and deleting facts.";
|
|
||||||
} elseif (str_contains($message, 'chat')) {
|
|
||||||
echo "This is the 'Chat' page (`chat.php`). You're talking to me right now! I can tell you about the different features of this application.";
|
|
||||||
} elseif (str_contains($message, 'home') || str_contains($message, 'index')) {
|
|
||||||
echo "The 'Home' page (`index.php`) is the main landing page of the application.";
|
|
||||||
} else {
|
|
||||||
echo "I'm sorry, I don't have information about that. I can answer questions about the Vibe Generator, SEO Checker, PHP Sandbox, Contact Form, Admin page, and the Chat feature.";
|
|
||||||
}
|
|
||||||
@ -21,9 +21,7 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="contact.php">Contact</a>
|
<a class="nav-link" href="contact.php">Contact</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="chat.php">Chat</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="admin.php">Admin</a>
|
<a class="nav-link" href="admin.php">Admin</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user