Update 404.html
This commit is contained in:
1 parent
9fd4fee2a7
commit
339286fd08
1 file changed
+88
-1
@@ -116,6 +116,93 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="https://js.puter.com/v2/"></script>
|
||||
<script>
|
||||
let aiChatWindow = null;
|
||||
let chatVisible = false;
|
||||
|
||||
// Detect Ctrl+T
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (e.ctrlKey && e.key.toLowerCase() === "t") {
|
||||
e.preventDefault();
|
||||
toggleAIChat();
|
||||
}
|
||||
});
|
||||
|
||||
async function toggleAIChat() {
|
||||
if (!chatVisible) {
|
||||
aiChatWindow = document.createElement("div");
|
||||
aiChatWindow.style = `
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
width: 400px;
|
||||
height: 500px;
|
||||
background: #1e1e1e;
|
||||
color: #f0f0f0;
|
||||
border: 2px solid #444;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 0 20px rgba(0,0,0,0.5);
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
font-family: system-ui, sans-serif;
|
||||
`;
|
||||
aiChatWindow.innerHTML = `
|
||||
<div style="background:#222;padding:10px;text-align:center;font-weight:bold;">
|
||||
🎮 Fun Miles AI Chat
|
||||
</div>
|
||||
<div id="chatLog" style="flex:1;overflow-y:auto;padding:10px;"></div>
|
||||
<div style="display:flex;border-top:1px solid #333;">
|
||||
<input id="chatInput" type="text" placeholder="Type a message..."
|
||||
style="flex:1;padding:10px;background:#2a2a2a;color:#fff;border:none;outline:none;">
|
||||
<button id="chatSend" style="padding:10px 15px;background:#444;color:#fff;border:none;">Send</button>
|
||||
</div>
|
||||
`;
|
||||
document.body.appendChild(aiChatWindow);
|
||||
|
||||
const chatLog = aiChatWindow.querySelector("#chatLog");
|
||||
const chatInput = aiChatWindow.querySelector("#chatInput");
|
||||
const chatSend = aiChatWindow.querySelector("#chatSend");
|
||||
|
||||
// Custom intro message
|
||||
chatLog.innerHTML = `
|
||||
<div style="margin-bottom:10px;">
|
||||
<b>AI:</b> 👋 Hi! I'm the <b>Fun Miles AI</b> — here to answer your <b>gaming questions</b>, chat about mods, or just have fun.
|
||||
Ask me anything!
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Send message
|
||||
chatSend.onclick = async () => {
|
||||
const msg = chatInput.value.trim();
|
||||
if (!msg) return;
|
||||
chatLog.innerHTML += `<div><b>You:</b> ${msg}</div>`;
|
||||
chatInput.value = "";
|
||||
|
||||
try {
|
||||
const response = await puter.ai.chat(msg);
|
||||
chatLog.innerHTML += `<div><b>AI:</b> ${response}</div>`;
|
||||
chatLog.scrollTop = chatLog.scrollHeight;
|
||||
} catch (err) {
|
||||
chatLog.innerHTML += `<div style="color:red;"><b>Error:</b> ${err.message}</div>`;
|
||||
}
|
||||
};
|
||||
|
||||
// Send on Enter
|
||||
chatInput.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Enter") chatSend.click();
|
||||
});
|
||||
|
||||
chatVisible = true;
|
||||
} else {
|
||||
aiChatWindow.remove();
|
||||
chatVisible = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<h1>404 Not Found</h1>
|
||||
<p>Oops! The page you are looking for does not exist.</p>
|
||||
<p>It might have been removed, had its name changed, or is temporarily unavailable.</p>
|
||||
@@ -134,4 +221,4 @@
|
||||
window.onload = applyDarkMode;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
Reference in new issue
Block a user