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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
+
<title>FYR_GPT</title>
|
| 7 |
+
<style>
|
| 8 |
+
* { box-sizing: border-box; }
|
| 9 |
+
body {
|
| 10 |
+
margin: 0;
|
| 11 |
+
background: #101217;
|
| 12 |
+
color: #eee;
|
| 13 |
+
font-family: Arial, sans-serif;
|
| 14 |
+
}
|
| 15 |
+
.app {
|
| 16 |
+
max-width: 800px;
|
| 17 |
+
min-height: 100dvh;
|
| 18 |
+
margin: auto;
|
| 19 |
+
padding: 20px;
|
| 20 |
+
display: flex;
|
| 21 |
+
flex-direction: column;
|
| 22 |
+
}
|
| 23 |
+
header {
|
| 24 |
+
display: flex;
|
| 25 |
+
justify-content: space-between;
|
| 26 |
+
align-items: center;
|
| 27 |
+
border-bottom: 1px solid #333;
|
| 28 |
+
padding-bottom: 16px;
|
| 29 |
+
}
|
| 30 |
+
h1 { margin: 0; font-size: 26px; }
|
| 31 |
+
small { color: #aaa; }
|
| 32 |
+
#chat { flex: 1; padding: 24px 0; }
|
| 33 |
+
.message { margin-bottom: 20px; }
|
| 34 |
+
.label {
|
| 35 |
+
color: #aaa;
|
| 36 |
+
font-size: 12px;
|
| 37 |
+
margin-bottom: 6px;
|
| 38 |
+
}
|
| 39 |
+
.bubble {
|
| 40 |
+
padding: 16px;
|
| 41 |
+
border-radius: 14px;
|
| 42 |
+
background: #20242e;
|
| 43 |
+
line-height: 1.6;
|
| 44 |
+
white-space: pre-wrap;
|
| 45 |
+
overflow-wrap: anywhere;
|
| 46 |
+
}
|
| 47 |
+
.user { margin-left: 15%; }
|
| 48 |
+
.user .bubble { background: #352d55; }
|
| 49 |
+
form {
|
| 50 |
+
display: flex;
|
| 51 |
+
gap: 10px;
|
| 52 |
+
position: sticky;
|
| 53 |
+
bottom: 0;
|
| 54 |
+
background: #101217;
|
| 55 |
+
padding: 12px 0;
|
| 56 |
+
}
|
| 57 |
+
textarea {
|
| 58 |
+
flex: 1;
|
| 59 |
+
min-width: 0;
|
| 60 |
+
padding: 14px;
|
| 61 |
+
border: 1px solid #444;
|
| 62 |
+
border-radius: 12px;
|
| 63 |
+
background: #20242e;
|
| 64 |
+
color: white;
|
| 65 |
+
font: inherit;
|
| 66 |
+
resize: vertical;
|
| 67 |
+
}
|
| 68 |
+
button {
|
| 69 |
+
padding: 10px 16px;
|
| 70 |
+
border: none;
|
| 71 |
+
border-radius: 10px;
|
| 72 |
+
background: #b8a6ff;
|
| 73 |
+
color: #181321;
|
| 74 |
+
font-weight: bold;
|
| 75 |
+
cursor: pointer;
|
| 76 |
+
}
|
| 77 |
+
button:focus-visible, textarea:focus-visible {
|
| 78 |
+
outline: 3px solid #d0c5ff;
|
| 79 |
+
outline-offset: 3px;
|
| 80 |
+
}
|
| 81 |
+
.note {
|
| 82 |
+
text-align: center;
|
| 83 |
+
color: #aaa;
|
| 84 |
+
font-size: 12px;
|
| 85 |
+
}
|
| 86 |
+
</style>
|
| 87 |
+
</head>
|
| 88 |
+
<body>
|
| 89 |
+
<div class="app">
|
| 90 |
+
<header>
|
| 91 |
+
<div>
|
| 92 |
+
<h1>FYR_GPT ⚡</h1>
|
| 93 |
+
<small>Scripted chat demo</small>
|
| 94 |
+
</div>
|
| 95 |
+
<button id="clear" type="button">New chat</button>
|
| 96 |
+
</header>
|
| 97 |
+
|
| 98 |
+
<div id="chat" role="log" aria-live="polite"
|
| 99 |
+
aria-label="Chat messages"></div>
|
| 100 |
+
|
| 101 |
+
<form id="form">
|
| 102 |
+
<textarea
|
| 103 |
+
id="input"
|
| 104 |
+
rows="2"
|
| 105 |
+
maxlength="10000"
|
| 106 |
+
placeholder="Message FYR_GPT..."
|
| 107 |
+
aria-label="Your message"
|
| 108 |
+
required
|
| 109 |
+
></textarea>
|
| 110 |
+
<button type="submit">Send ↑</button>
|
| 111 |
+
</form>
|
| 112 |
+
|
| 113 |
+
<p class="note">
|
| 114 |
+
Fixed response demo · No AI model · Shift+Enter for a new line
|
| 115 |
+
</p>
|
| 116 |
+
</div>
|
| 117 |
+
|
| 118 |
+
<script>
|
| 119 |
+
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!";
|
| 120 |
+
|
| 121 |
+
const chat = document.getElementById("chat");
|
| 122 |
+
const input = document.getElementById("input");
|
| 123 |
+
const form = document.getElementById("form");
|
| 124 |
+
|
| 125 |
+
function addMessage(role, text) {
|
| 126 |
+
const message = document.createElement("div");
|
| 127 |
+
message.className = "message " + role;
|
| 128 |
+
|
| 129 |
+
const label = document.createElement("div");
|
| 130 |
+
label.className = "label";
|
| 131 |
+
label.textContent = role === "user" ? "You" : "FYR_GPT";
|
| 132 |
+
|
| 133 |
+
const bubble = document.createElement("div");
|
| 134 |
+
bubble.className = "bubble";
|
| 135 |
+
bubble.textContent = text;
|
| 136 |
+
|
| 137 |
+
message.append(label, bubble);
|
| 138 |
+
chat.appendChild(message);
|
| 139 |
+
return message;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
form.addEventListener("submit", function(event) {
|
| 143 |
+
event.preventDefault();
|
| 144 |
+
|
| 145 |
+
const text = input.value.trim();
|
| 146 |
+
if (!text) return;
|
| 147 |
+
|
| 148 |
+
addMessage("user", text);
|
| 149 |
+
const reply = addMessage("assistant", REPLY);
|
| 150 |
+
|
| 151 |
+
input.value = "";
|
| 152 |
+
input.focus();
|
| 153 |
+
reply.scrollIntoView({ block: "nearest" });
|
| 154 |
+
});
|
| 155 |
+
|
| 156 |
+
input.addEventListener("keydown", function(event) {
|
| 157 |
+
if (
|
| 158 |
+
event.key === "Enter" &&
|
| 159 |
+
!event.shiftKey &&
|
| 160 |
+
!event.isComposing
|
| 161 |
+
) {
|
| 162 |
+
event.preventDefault();
|
| 163 |
+
form.requestSubmit();
|
| 164 |
+
}
|
| 165 |
+
});
|
| 166 |
+
|
| 167 |
+
document.getElementById("clear").addEventListener("click", function() {
|
| 168 |
+
chat.replaceChildren();
|
| 169 |
+
input.value = "";
|
| 170 |
+
input.focus();
|
| 171 |
+
});
|
| 172 |
+
</script>
|
| 173 |
+
</body>
|
| 174 |
+
</html>
|