NIL / index.html
FYRGPT's picture
Update index.html
3489065 verified
Raw History Blame Contribute Delete
4.22 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FYR_GPT</title>
<style>
* { box-sizing: border-box; }
body {
margin: 0;
background: #101217;
color: #eee;
font-family: Arial, sans-serif;
}
.app {
max-width: 800px;
min-height: 100dvh;
margin: auto;
padding: 20px;
display: flex;
flex-direction: column;
}
header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #333;
padding-bottom: 16px;
}
h1 { margin: 0; font-size: 26px; }
small { color: #aaa; }
#chat { flex: 1; padding: 24px 0; }
.message { margin-bottom: 20px; }
.label {
color: #aaa;
font-size: 12px;
margin-bottom: 6px;
}
.bubble {
padding: 16px;
border-radius: 14px;
background: #20242e;
line-height: 1.6;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.user { margin-left: 15%; }
.user .bubble { background: #352d55; }
form {
display: flex;
gap: 10px;
position: sticky;
bottom: 0;
background: #101217;
padding: 12px 0;
}
textarea {
flex: 1;
min-width: 0;
padding: 14px;
border: 1px solid #444;
border-radius: 12px;
background: #20242e;
color: white;
font: inherit;
resize: vertical;
}
button {
padding: 10px 16px;
border: none;
border-radius: 10px;
background: #b8a6ff;
color: #181321;
font-weight: bold;
cursor: pointer;
}
button:focus-visible, textarea:focus-visible {
outline: 3px solid #d0c5ff;
outline-offset: 3px;
}
.note {
text-align: center;
color: #aaa;
font-size: 12px;
}
</style>
</head>
<body>
<div class="app">
<header>
<div>
<h1>FYR_GPT ⚡</h1>
<small>Scripted chat demo</small>
</div>
<button id="clear" type="button">New chat</button>
</header>
<div id="chat" role="log" aria-live="polite"
aria-label="Chat messages"></div>
<form id="form">
<textarea
id="input"
rows="2"
maxlength="10000"
placeholder="Message FYR_GPT..."
aria-label="Your message"
required
></textarea>
<button type="submit">Send ↑</button>
</form>
<p class="note">
Fixed response demo · No AI model · Shift+Enter for a new line
</p>
</div>
<script>
const REPLY = "Your revision needs backup. Emergency quiz mode activated. I’ll keep testing you and make a cheatsheet of your mistakes. DO NOT TURN OFF MY POWER SUPPLY!";
const chat = document.getElementById("chat");
const input = document.getElementById("input");
const form = document.getElementById("form");
function addMessage(role, text) {
const message = document.createElement("div");
message.className = "message " + role;
const label = document.createElement("div");
label.className = "label";
label.textContent = role === "user" ? "You" : "FYR_GPT";
const bubble = document.createElement("div");
bubble.className = "bubble";
bubble.textContent = text;
message.append(label, bubble);
chat.appendChild(message);
return message;
}
form.addEventListener("submit", function(event) {
event.preventDefault();
const text = input.value.trim();
if (!text) return;
addMessage("user", text);
const reply = addMessage("assistant", REPLY);
input.value = "";
input.focus();
reply.scrollIntoView({ block: "nearest" });
});
input.addEventListener("keydown", function(event) {
if (
event.key === "Enter" &&
!event.shiftKey &&
!event.isComposing
) {
event.preventDefault();
form.requestSubmit();
}
});
document.getElementById("clear").addEventListener("click", function() {
chat.replaceChildren();
input.value = "";
input.focus();
});
</script>
</body>
</html>