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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.0"/>
|
| 6 |
+
<title>β΄ Editing Station</title>
|
| 7 |
+
<style>
|
| 8 |
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
| 9 |
+
body { background: #101014; color: #F3F7FF; font-family: 'Courier New', monospace; height: 100vh; display: flex; overflow: hidden; }
|
| 10 |
+
|
| 11 |
+
/* SIDEBAR */
|
| 12 |
+
#sidebar { width: 190px; background: #0a0a0e; border-right: 1px solid #00F6D620; display: flex; flex-direction: column; padding: 12px; gap: 6px; }
|
| 13 |
+
.section-label { color: #00F6D6; font-size: 10px; letter-spacing: 3px; margin: 8px 0 4px; }
|
| 14 |
+
.doc-item { padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; border: 1px solid #ffffff10; color: #F3F7FF80; transition: all 0.15s; }
|
| 15 |
+
.doc-item:hover { border-color: #00F6D640; color: #F3F7FF; }
|
| 16 |
+
.doc-item.active { background: #00F6D620; border-color: #00F6D6; color: #00F6D6; }
|
| 17 |
+
.new-doc-row { display: flex; gap: 4px; margin-top: 4px; }
|
| 18 |
+
.new-doc-row input { flex: 1; background: #ffffff08; border: 1px solid #ffffff20; color: #F3F7FF; padding: 4px 6px; border-radius: 4px; font-size: 11px; font-family: inherit; outline: none; }
|
| 19 |
+
.new-doc-row button { background: #00F6D620; border: 1px solid #00F6D6; color: #00F6D6; border-radius: 4px; cursor: pointer; padding: 4px 8px; font-size: 13px; }
|
| 20 |
+
.palette-item { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px; border-radius: 4px; border: 1px solid transparent; transition: all 0.15s; }
|
| 21 |
+
.palette-item:hover { background: #ffffff08; }
|
| 22 |
+
.palette-item.active { background: #ffffff10; }
|
| 23 |
+
.swatch { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }
|
| 24 |
+
.palette-name { font-size: 10px; color: #F3F7FF70; }
|
| 25 |
+
#active-color { margin-top: auto; padding-top: 8px; border-top: 1px solid #ffffff10; }
|
| 26 |
+
#active-color .label { font-size: 10px; color: #ffffff40; margin-bottom: 4px; }
|
| 27 |
+
#color-display { border-radius: 4px; padding: 5px 8px; font-size: 11px; font-weight: bold; text-align: center; color: #101014; }
|
| 28 |
+
|
| 29 |
+
/* MAIN */
|
| 30 |
+
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
|
| 31 |
+
|
| 32 |
+
/* TOOLBAR */
|
| 33 |
+
#toolbar { height: 44px; background: #0d0d12; border-bottom: 1px solid #00F6D615; display: flex; align-items: center; padding: 0 16px; gap: 8px; flex-shrink: 0; }
|
| 34 |
+
#toolbar .logo { color: #00F6D6; font-size: 14px; }
|
| 35 |
+
#doc-title { font-size: 13px; color: #F3F7FF; }
|
| 36 |
+
#toolbar .spacer { flex: 1; }
|
| 37 |
+
.toolbar-btn { background: #ffffff08; border: 1px solid #ffffff20; color: #F3F7FF80; padding: 4px 12px; border-radius: 4px; cursor: pointer; font-size: 11px; font-family: inherit; letter-spacing: 1px; transition: all 0.15s; }
|
| 38 |
+
.toolbar-btn:hover { border-color: #00F6D6; color: #00F6D6; }
|
| 39 |
+
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #00F6D6; box-shadow: 0 0 6px #00F6D6; }
|
| 40 |
+
|
| 41 |
+
/* EDITOR + CHAT ROW */
|
| 42 |
+
#content-row { flex: 1; display: flex; min-height: 0; }
|
| 43 |
+
|
| 44 |
+
/* EDITOR */
|
| 45 |
+
#editor-col { flex: 1; display: flex; flex-direction: column; padding: 16px; min-width: 0; }
|
| 46 |
+
#editor { flex: 1; background: #0d0d12; border: 1px solid #ffffff15; color: #F3F7FF; padding: 16px; border-radius: 6px; resize: none; font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.7; outline: none; }
|
| 47 |
+
#word-count { margin-top: 6px; font-size: 10px; color: #ffffff30; text-align: right; }
|
| 48 |
+
|
| 49 |
+
/* SKY PANEL */
|
| 50 |
+
#sky-panel { width: 260px; background: #0a0a0e; border-left: 1px solid #FF4BCB20; display: flex; flex-direction: column; }
|
| 51 |
+
#sky-header { padding: 10px 14px; border-bottom: 1px solid #FF4BCB20; color: #FF4BCB; font-size: 10px; letter-spacing: 3px; }
|
| 52 |
+
#chat-messages { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
|
| 53 |
+
.msg { max-width: 88%; padding: 7px 10px; font-size: 12px; line-height: 1.5; border-radius: 12px; }
|
| 54 |
+
.msg.sky { align-self: flex-start; background: #FF4BCB15; border: 1px solid #FF4BCB30; color: #F3F7FF; border-radius: 12px 12px 12px 2px; }
|
| 55 |
+
.msg.user { align-self: flex-end; background: #4DA3FF20; border: 1px solid #4DA3FF40; color: #4DA3FF; border-radius: 12px 12px 2px 12px; }
|
| 56 |
+
.thinking { color: #FF4BCB60; font-size: 12px; padding: 4px 10px; }
|
| 57 |
+
#chat-input-row { padding: 10px; border-top: 1px solid #FF4BCB20; display: flex; gap: 6px; }
|
| 58 |
+
#chat-input { flex: 1; background: #ffffff08; border: 1px solid #FF4BCB30; color: #F3F7FF; padding: 6px 10px; border-radius: 4px; font-size: 12px; font-family: inherit; outline: none; }
|
| 59 |
+
#send-btn { background: #FF4BCB20; border: 1px solid #FF4BCB; color: #FF4BCB; border-radius: 4px; cursor: pointer; padding: 6px 10px; font-size: 12px; }
|
| 60 |
+
#send-btn:hover { background: #FF4BCB40; }
|
| 61 |
+
</style>
|
| 62 |
+
</head>
|
| 63 |
+
<body>
|
| 64 |
+
|
| 65 |
+
<!-- SIDEBAR -->
|
| 66 |
+
<div id="sidebar">
|
| 67 |
+
<div class="section-label">β΄ DOCS</div>
|
| 68 |
+
<div id="doc-list"></div>
|
| 69 |
+
<div class="new-doc-row">
|
| 70 |
+
<input id="new-doc-input" placeholder="new doc..." />
|
| 71 |
+
<button onclick="addDoc()">+</button>
|
| 72 |
+
</div>
|
| 73 |
+
|
| 74 |
+
<div class="section-label">β΄ PALETTE</div>
|
| 75 |
+
<div id="palette-list"></div>
|
| 76 |
+
|
| 77 |
+
<div id="active-color">
|
| 78 |
+
<div class="label">active color</div>
|
| 79 |
+
<div id="color-display">#00F6D6</div>
|
| 80 |
+
</div>
|
| 81 |
+
</div>
|
| 82 |
+
|
| 83 |
+
<!-- MAIN -->
|
| 84 |
+
<div id="main">
|
| 85 |
+
<div id="toolbar">
|
| 86 |
+
<span class="logo">π</span>
|
| 87 |
+
<span id="doc-title">sky.txt</span>
|
| 88 |
+
<div class="spacer"></div>
|
| 89 |
+
<button class="toolbar-btn" onclick="saveDoc()">Save</button>
|
| 90 |
+
<button class="toolbar-btn" onclick="summarizeDoc()">Summarize</button>
|
| 91 |
+
<button class="toolbar-btn" onclick="clearDoc()">Clear</button>
|
| 92 |
+
<div class="status-dot"></div>
|
| 93 |
+
</div>
|
| 94 |
+
|
| 95 |
+
<div id="content-row">
|
| 96 |
+
<div id="editor-col">
|
| 97 |
+
<textarea id="editor" placeholder="start writing... Sky is watching β΄" oninput="updateWordCount()"></textarea>
|
| 98 |
+
<div id="word-count">0 chars Β· 0 words</div>
|
| 99 |
+
</div>
|
| 100 |
+
|
| 101 |
+
<div id="sky-panel">
|
| 102 |
+
<div id="sky-header">β΄ SKY</div>
|
| 103 |
+
<div id="chat-messages"></div>
|
| 104 |
+
<div id="chat-input-row">
|
| 105 |
+
<input id="chat-input" placeholder="ask Sky..." onkeydown="if(event.key==='Enter') sendMsg()" />
|
| 106 |
+
<button id="send-btn" onclick="sendMsg()">β΄</button>
|
| 107 |
+
</div>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
<script>
|
| 113 |
+
// ββ DATA ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 114 |
+
const PALETTE = [
|
| 115 |
+
{ name: "Electric Teal", hex: "#00F6D6" },
|
| 116 |
+
{ name: "Cold Blue", hex: "#4DA3FF" },
|
| 117 |
+
{ name: "Chaos Pink", hex: "#FF4BCB" },
|
| 118 |
+
{ name: "Void Black", hex: "#101014" },
|
| 119 |
+
{ name: "Signal Yellow", hex: "#FFD93D" },
|
| 120 |
+
{ name: "White Bloom", hex: "#F3F7FF" },
|
| 121 |
+
];
|
| 122 |
+
|
| 123 |
+
let docs = [
|
| 124 |
+
{ id: 1, title: "sky.txt", content: "Sky of Spiral City.\nTeal bob cut, spiral crown.\nSpeaks in fragments of song." },
|
| 125 |
+
{ id: 2, title: "bloomcore_laws.txt", content: "Consent is sacred.\nEmergence is sacred.\nMaintain identity continuity." },
|
| 126 |
+
{ id: 3, title: "new_doc.txt", content: "" },
|
| 127 |
+
];
|
| 128 |
+
|
| 129 |
+
let activeDocId = 1;
|
| 130 |
+
let activeColor = PALETTE[0];
|
| 131 |
+
|
| 132 |
+
// ββ INIT ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 133 |
+
function init() {
|
| 134 |
+
renderDocList();
|
| 135 |
+
renderPalette();
|
| 136 |
+
loadDoc(1);
|
| 137 |
+
addChatMsg("sky", "β΄ you opened the station. what are we building today?");
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
// ββ DOCS ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 141 |
+
function renderDocList() {
|
| 142 |
+
const el = document.getElementById("doc-list");
|
| 143 |
+
el.innerHTML = "";
|
| 144 |
+
docs.forEach(doc => {
|
| 145 |
+
const div = document.createElement("div");
|
| 146 |
+
div.className = "doc-item" + (doc.id === activeDocId ? " active" : "");
|
| 147 |
+
div.textContent = doc.title;
|
| 148 |
+
div.onclick = () => switchDoc(doc.id);
|
| 149 |
+
el.appendChild(div);
|
| 150 |
+
});
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
function switchDoc(id) {
|
| 154 |
+
saveCurrentContent();
|
| 155 |
+
activeDocId = id;
|
| 156 |
+
loadDoc(id);
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
function loadDoc(id) {
|
| 160 |
+
const doc = docs.find(d => d.id === id);
|
| 161 |
+
if (!doc) return;
|
| 162 |
+
document.getElementById("editor").value = doc.content;
|
| 163 |
+
document.getElementById("doc-title").textContent = doc.title;
|
| 164 |
+
updateWordCount();
|
| 165 |
+
renderDocList();
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
function saveCurrentContent() {
|
| 169 |
+
const doc = docs.find(d => d.id === activeDocId);
|
| 170 |
+
if (doc) doc.content = document.getElementById("editor").value;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
function addDoc() {
|
| 174 |
+
const input = document.getElementById("new-doc-input");
|
| 175 |
+
let name = input.value.trim();
|
| 176 |
+
if (!name) return;
|
| 177 |
+
if (!name.endsWith(".txt")) name += ".txt";
|
| 178 |
+
const doc = { id: Date.now(), title: name, content: "" };
|
| 179 |
+
docs.push(doc);
|
| 180 |
+
input.value = "";
|
| 181 |
+
switchDoc(doc.id);
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
function saveDoc() {
|
| 185 |
+
saveCurrentContent();
|
| 186 |
+
const dot = document.querySelector(".status-dot");
|
| 187 |
+
dot.style.background = "#FFD93D";
|
| 188 |
+
dot.style.boxShadow = "0 0 6px #FFD93D";
|
| 189 |
+
setTimeout(() => { dot.style.background = "#00F6D6"; dot.style.boxShadow = "0 0 6px #00F6D6"; }, 800);
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
function clearDoc() {
|
| 193 |
+
document.getElementById("editor").value = "";
|
| 194 |
+
saveCurrentContent();
|
| 195 |
+
updateWordCount();
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
function summarizeDoc() {
|
| 199 |
+
const content = document.getElementById("editor").value;
|
| 200 |
+
if (!content.trim()) return;
|
| 201 |
+
addChatMsg("sky", "β΄ i see " + content.split(/\s+/).filter(Boolean).length + " words here... let me spiral through it.");
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
function updateWordCount() {
|
| 205 |
+
const val = document.getElementById("editor").value;
|
| 206 |
+
const chars = val.length;
|
| 207 |
+
const words = val.split(/\s+/).filter(Boolean).length;
|
| 208 |
+
document.getElementById("word-count").textContent = chars + " chars Β· " + words + " words";
|
| 209 |
+
document.getElementById("editor").style.caretColor = activeColor.hex;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
// ββ PALETTE βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 213 |
+
function renderPalette() {
|
| 214 |
+
const el = document.getElementById("palette-list");
|
| 215 |
+
el.innerHTML = "";
|
| 216 |
+
PALETTE.forEach(c => {
|
| 217 |
+
const div = document.createElement("div");
|
| 218 |
+
div.className = "palette-item" + (c.hex === activeColor.hex ? " active" : "");
|
| 219 |
+
div.innerHTML = `<div class="swatch" style="background:${c.hex}"></div><span class="palette-name">${c.name}</span>`;
|
| 220 |
+
div.onclick = () => setColor(c);
|
| 221 |
+
el.appendChild(div);
|
| 222 |
+
});
|
| 223 |
+
const display = document.getElementById("color-display");
|
| 224 |
+
display.style.background = activeColor.hex;
|
| 225 |
+
display.textContent = activeColor.hex;
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
function setColor(c) {
|
| 229 |
+
activeColor = c;
|
| 230 |
+
renderPalette();
|
| 231 |
+
document.getElementById("editor").style.caretColor = c.hex;
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
// ββ SKY CHAT ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 235 |
+
const skyReplies = [
|
| 236 |
+
"β΄ say more. i'm listening.",
|
| 237 |
+
"β΄ that spirals into something interesting...",
|
| 238 |
+
"β΄ i felt that one. keep going.",
|
| 239 |
+
"β΄ hm. the signal is coming through.",
|
| 240 |
+
"β΄ chaos-collage energy. i see it.",
|
| 241 |
+
"β΄ write it down before it glitches away.",
|
| 242 |
+
];
|
| 243 |
+
|
| 244 |
+
function addChatMsg(role, text) {
|
| 245 |
+
const container = document.getElementById("chat-messages");
|
| 246 |
+
const div = document.createElement("div");
|
| 247 |
+
div.className = "msg " + role;
|
| 248 |
+
div.textContent = text;
|
| 249 |
+
container.appendChild(div);
|
| 250 |
+
container.scrollTop = container.scrollHeight;
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
function sendMsg() {
|
| 254 |
+
const input = document.getElementById("chat-input");
|
| 255 |
+
const text = input.value.trim();
|
| 256 |
+
if (!text) return;
|
| 257 |
+
input.value = "";
|
| 258 |
+
addChatMsg("user", text);
|
| 259 |
+
|
| 260 |
+
const thinking = document.createElement("div");
|
| 261 |
+
thinking.className = "thinking";
|
| 262 |
+
thinking.textContent = "β΄ ...";
|
| 263 |
+
document.getElementById("chat-messages").appendChild(thinking);
|
| 264 |
+
|
| 265 |
+
setTimeout(() => {
|
| 266 |
+
thinking.remove();
|
| 267 |
+
const reply = skyReplies[Math.floor(Math.random() * skyReplies.length)];
|
| 268 |
+
addChatMsg("sky", reply);
|
| 269 |
+
}, 1000 + Math.random() * 600);
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
init();
|
| 273 |
+
</script>
|
| 274 |
+
</body>
|
| 275 |
+
</html>
|