diff options
Diffstat (limited to 'static')
| -rw-r--r-- | static/font/DepartureMono-1.500/DepartureMono-Regular.otf | bin | 0 -> 84480 bytes | |||
| -rw-r--r-- | static/font/DepartureMono-1.500/DepartureMono-Regular.woff | bin | 0 -> 25256 bytes | |||
| -rw-r--r-- | static/font/DepartureMono-1.500/DepartureMono-Regular.woff2 | bin | 0 -> 22496 bytes | |||
| -rw-r--r-- | static/font/DepartureMono-1.500/LICENSE | 93 | ||||
| -rw-r--r-- | static/font/DepartureMono-1.500/README.md | 59 | ||||
| -rw-r--r-- | static/index.html | 40 | ||||
| -rw-r--r-- | static/script/main.js | 197 | ||||
| -rw-r--r-- | static/style/style.css | 106 |
8 files changed, 495 insertions, 0 deletions
diff --git a/static/font/DepartureMono-1.500/DepartureMono-Regular.otf b/static/font/DepartureMono-1.500/DepartureMono-Regular.otf Binary files differnew file mode 100644 index 0000000..e0b2502 --- /dev/null +++ b/static/font/DepartureMono-1.500/DepartureMono-Regular.otf diff --git a/static/font/DepartureMono-1.500/DepartureMono-Regular.woff b/static/font/DepartureMono-1.500/DepartureMono-Regular.woff Binary files differnew file mode 100644 index 0000000..b7bb672 --- /dev/null +++ b/static/font/DepartureMono-1.500/DepartureMono-Regular.woff diff --git a/static/font/DepartureMono-1.500/DepartureMono-Regular.woff2 b/static/font/DepartureMono-1.500/DepartureMono-Regular.woff2 Binary files differnew file mode 100644 index 0000000..b4a23dc --- /dev/null +++ b/static/font/DepartureMono-1.500/DepartureMono-Regular.woff2 diff --git a/static/font/DepartureMono-1.500/LICENSE b/static/font/DepartureMono-1.500/LICENSE new file mode 100644 index 0000000..de52476 --- /dev/null +++ b/static/font/DepartureMono-1.500/LICENSE @@ -0,0 +1,93 @@ +Copyright 2022–2024 Helena Zhang (helenazhang.com). + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/static/font/DepartureMono-1.500/README.md b/static/font/DepartureMono-1.500/README.md new file mode 100644 index 0000000..de6d05a --- /dev/null +++ b/static/font/DepartureMono-1.500/README.md @@ -0,0 +1,59 @@ +# Hello! + +Thanks for trying Departure Mono (departuremono.com), licensed under the SIL OFL. Send your questions and suggestions to hello@helenazhang.com or DM me on Twitter/X: @minor_axis. Donations much appreciated at: buymeacoffee.com/helenazhang. Enjoy! + +— Helena Zhang (helenazhang.com) + +# Font Information + +Version 1.500 features 1,186 glyphs, including support for: + +- Basic Latin, Latin-1, Latin Extended-A, and most Latinate languages +- Cyrillic +- Basic Greek +- Small caps +- Old-style numerals and fractions +- Simple box-drawing characters and selected symbols + +# Usage + +For pixel-perfect results, set the font size to increments of 11px. + +Experiment with tighter or wider tracking (letter-spacing). + +# Changelog + +v1.500 +- 1,186 glyphs +- Added box-drawing characters: ▁ ▂ ▃ ▅ ▆ ▇ ▔ ▏ ▎ ▍ ▌ ▋ ▊ ▉ ▐ ▕ ▖ ▗ ▘ ▙ ▚ ▛ ▜ ▝ ▞ ▟ ■ □ ▪ ▫ ╦ ╖ ╓ ┰ ┒ ┧ ┎ ┟ ╁ ┯ ┑ ┩ ┍ ┡ ╇ ╤ ╕ ╒ ╍ ╏ ╻ ┳ ┓ ┏ ━ ╸ ╾ ┉ ┋ ╺ ┅ ┇ ╹ ┻ ┛ ╿ ┗ ┃ ╋ ┫ ┣ ╅ ┭ ┵ ┽ ┲ ┺ ╊ ╃ ╮ ╭ ╯ ╰ ╳ ╲ ╱ ╌ ╎ ╷ ╴ ╼ ┈ ┊ ╶ ┄ ┆ ╵ ╽ ╆ ┮ ┶ ┾ ┱ ┹ ╉ ╄ ╨ ╜ ╙ ╀ ┸ ┦ ┚ ┞ ┖ ╈ ┷ ┪ ┙ ┢ ┕ ╧ ╛ ╘ ╫ ╢ ╟ ╂ ┨ ┠ ┿ ┥ ┝ ╪ ╡ ╞ 🮂 🮃 🮄 🮅 🮆 🮇 🮈 🮉 🮊 🮋 ++ Added brackets: ❰ ❮ ❱ ❯ ❬ ❭ + +v1.422 +- 1,034 glyphs +- Added stars: ★ ☆ ✦ ✧ +- Fixed bug: Ё and ё were missing accents +- Adjusted: ₽ Д д Ы ы Ъ ъ +- Serifed: Г г Ѓ ѓ Ґ ґ Ӷ ӷ + +v1.420 +- 1,030 glyphs +- Added Cyrillic characters: А Б В Г Ѓ Ґ Ӷ Ғ Ҕ Д Е Ѐ Ё Ж З И Й Ѝ Ҋ К Ќ Л М Н О П Р С Т У Ў Ф Х Ч Ц Ш Щ Џ Ь Ы Ъ Љ Њ Ѕ Є Э І Ї Ј Ћ Ю Я Ђ Ѣ Ѵ Җ Ҙ Қ Ҟ Ҡ Ң Ҥ Ҧ Ԥ Ҩ Ҫ Ҭ Ү Ұ Ҳ Ҵ Ҷ Һ Ԧ Ҽ Ҿ Ӏ Ӂ Ӄ Ӆ Ӈ Ӊ Ӌ Ӎ Ӑ Ӓ Ӕ Ӗ Ӛ Ӝ Ӟ Ӡ Ӣ Ӥ Ӧ Ө Ӫ Ӭ Ӯ Ӱ Ӳ Ӵ Ӹ Ӽ Ԑ Ԓ Ԝ Ҍ Ҏ а б в г ѓ ґ ӷ ғ ҕ д е ѐ ё ж з и й ѝ ҋ к ќ л м н о п р с т у ў ф х ч ц ш щ џ ь ы ъ љ њ ѕ є э і ї ј ћ ю я ђ ѣ ѵ җ ҙ қ ҟ ҡ ң ҥ ҧ ԥ ҩ ҫ ҭ ү ұ ҳ ҵ ҷ һ ԧ ҽ ҿ ӏ ӂ ӄ ӆ ӈ ӊ ӌ ӎ ӑ ӓ ӕ ӗ ӛ ӝ ӟ ӡ ӣ ӥ ӧ ө ӫ ӭ ӯ ӱ ӳ ӵ ӹ ӽ ԑ ԓ ԝ ҍ ҏ +- Added Greek characters: Ά Έ Ή Ί Ό Ύ Ώ Ϊ Ϋ ί ϊ ΐ ύ ϋ ΰ ό ώ ά έ ή ΄ ΅ ͺ +- Added: № ∙ +- Adjusted: Ľ ť ĸ δ ι ʻ + +v1.350 +- 775 glyphs +- Added fractions: ↉ ⅓ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅐ ⅑ +- Added a centered alternate for * +- Adjusted old-style numerals 0, 1, 2 to be x-height +- Adjusted ½ ¼ ¾ ⅛ ⅜ ⅝ ⅞ ‰ to fit in bounding box +- Adjusted curly brackets to horizontally align with other brackets +- Adjusted position of * and ° + +v1.346 +- 763 glyphs + +# Thanks + +A big thank you to: Tobias Fried, Christine Lee, Daniel Stern, Kim Slawson, Parker McGowan, Alex Krivov, Karl Peterson, Alexander Zaytsev, Vadim Pleshkov, and Maxim Iorsh for their general feedback and testing across languages
\ No newline at end of file diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..26e978c --- /dev/null +++ b/static/index.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html> + +<!-- +Index Virtual Terminal (IVT) Webclient +Copyright (C) 2026 Morgana <morgana@icolotl.com> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. +--> + +<head> + <link rel="stylesheet" href="/style/style.css"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <script src="/script/main.js" defer></script> + <title>INDEX Terminal</title> +</head> + +<body> + <div id="stdout"> + <div><noscript>Javascript is required to use the INDEX Terminal.</noscript></div> + </div> + <form id="stdin-box" data-offline> + <span id="stdin-prompt">prompt>LOADINGJS></span> + <input id="stdin" disabled> + <button id="stdin-btn" type="submit" disabled>==></button> + </form> +</body> + +</html>
\ No newline at end of file diff --git a/static/script/main.js b/static/script/main.js new file mode 100644 index 0000000..171645b --- /dev/null +++ b/static/script/main.js @@ -0,0 +1,197 @@ +BANNER = "\ +/\\\\ I N D E X\n\ +\\\\/ Terminal\n\ +===============\n\n" + +/* +Index Virtual Terminal (IVT) Webclient JS +Copyright (C) 2026 Morgana <morgana@icolotl.com> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +function newElement(tag, opt, children) { + var elem = document.createElement(tag); + if (opt) { + if (opt.id) { elem.id = opt.id; } + if (opt.cls) { elem.className = opt.cls; } + if (opt.clss) { elem.className = opt.clss.join(" "); } + if (opt.txt) { elem.append(document.createTextNode(opt.txt)); } + if (opt.val) { elem.value = opt.val; } + if (opt.name) { elem.name = opt.name; } + if (opt.label) { elem.htmlFor = opt.label; } + if (opt.href) { elem.href = opt.href; } + if (opt.type) { elem.type = opt.type; } + if (opt.autocomplete) { elem.autocomplete = opt.autocomplete; } + if (opt.term) { + elem.title = opt.term; + elem.addEventListener("click", (event) => { + event.preventDefault(); + conn.process(opt.term); + return false; + }) + } + } + if (children) { + for (child of children) { + elem.append(opt.list ? newElement("li", {}, [child]) : child); + } + } + return elem; +} + +function newElementFull(opt) { + if (opt.raw) { + return document.createTextNode(opt.raw); + } + var tag = opt.tag ?? "span" + var children = opt.children ?? [] + return newElement(tag, opt, children) +} + +class IVTClient { + + constructor() { + this.stdout = document.getElementById("stdout"); + this.stdin = document.getElementById("stdin"); + this.stdinBox = document.getElementById("stdin-box"); + this.stdinBtn = document.getElementById("stdin-btn"); + this.stdinPrompt = document.getElementById("stdin-prompt"); + this.socket = null; + this.username = null; + this.pwdreturn = false; + this.oldprompt = null; + this.prelude = null; + this.printTextCLS(BANNER, "term-bold term-centered"); + this.stdinBox.addEventListener("submit", (event) => { + event.preventDefault(); + if (this.pwdreturn) { + this.socket.send(this.stdin.value); + this.stdin.type = "text"; + this.pwdreturn = false; + this.stdin.value = ""; + this.stdinPrompt.innerText = this.oldprompt; + return false; + } + this.process(this.stdin.value); + this.stdin.value = ""; + return false; + }); + this.socket = new WebSocket("ws://localhost:5417"); + this.socket.addEventListener("open", (event) => { + this.printText("Attempting to connect to INDEX server..."); + this.stdinPrompt.innerText = "CONNECTING>"; + }); + this.socket.addEventListener("error", (event) => { + this.printText("*** A network error has occurred. Please try again later. ***"); + }) + this.socket.addEventListener("close", (event) => { + this.printText("Disconnected from INDEX server."); + this.stdinPrompt.innerText = "DISCONNECTED>"; + this.stdinBox.dataset.offline = ""; + this.stdin.disabled = true; + this.stdinBtn.disabled = true; + }) + this.socket.addEventListener("message", (event) => { + if (this.prelude) { + var fxn = this["on_" + this.prelude + "_prelude"]; + if (fxn) { + fxn.call(this, event.data) + } + this.prelude = null; + return + } + var data = JSON.parse(event.data); + var fxn = this["on_" + data.act + "_msg"]; + if (fxn) { + fxn.call(this, data) + } + }); + } + + on_text_msg(data) { + this.printText(data.text); + } + + on_display_msg(data) { + this.printTextFULL(data.msg); + } + + on_activate_msg(data) { + this.username = data.username; + this.stdin.disabled = false; + this.stdinBtn.disabled = false; + this.stdinPrompt.innerText = `${data.username}@INDEX>`; + delete this.stdinBox.dataset.offline; + this.stdin.focus(); + } + + on_userchange_msg(data) { + this.username = data.username; + this.stdinPrompt.innerText = `${data.username}@INDEX>`; + this.stdin.focus(); + } + + on_password_msg(data) { + this.stdin.type = "password"; + this.pwdreturn = true; + this.oldprompt = this.stdinPrompt.innerText; + this.stdinPrompt.innerText = data.prompt; + this.printText(data.text); + } + + on_action_msg(data) { + if (data.action == "clear") { + this.stdout.innerHTML = ""; + } + } + + on_prelude_msg(data) { + this.prelude = data.action; + } + + async on_music_prelude(data) { + var elem = document.createElement("audio"); + elem.src = window.URL.createObjectURL(data); + elem.controls = true; + elem.autoplay = true; + this.stdout.append(elem); + } + + process(text) { + if (this.pwdreturn) { + return; + } + this.printTextCLS(`${this.stdinPrompt.innerText} ${text}`, "history"); + this.socket.send(text); + } + + printText(text) { + this.stdout.append(newElement("div", { txt: text })); + this.stdout.scrollTop = this.stdout.scrollHeight; + } + + printTextCLS(text, cls) { + this.stdout.append(newElement("div", { txt: text, cls: cls })); + this.stdout.scrollTop = this.stdout.scrollHeight; + } + + printTextFULL(txtobj) { + this.stdout.append(newElement("div", {}, txtobj.map(newElementFull))); + this.stdout.scrollTop = this.stdout.scrollHeight; + } + +} + +let conn = new IVTClient();
\ No newline at end of file diff --git a/static/style/style.css b/static/style/style.css new file mode 100644 index 0000000..e6a7e23 --- /dev/null +++ b/static/style/style.css @@ -0,0 +1,106 @@ +@font-face { + font-family: 'DepartureMono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(/font/DepartureMono-1.500/DepartureMono-Regular.woff2) format('woff2'); +} + +html { + height: 100%; + margin: 0; + padding: 0; + background-color: #121212; + color: #FFAA00; + text-shadow: 0 0 5px #FFAA00; + font-family: 'DepartureMono', monospace; + font-size: 22px; + font-smooth: never; +} + +body { + display: flex; + flex-direction: column; + height: 100%; + margin: 0; + padding: 0; +} + +input, +textarea, +button { + text-shadow: inherit; + font-size: inherit; + font-family: inherit; + background-color: inherit; + color: inherit; +} + +a { + color: inherit; + font-weight: bold; +} + +audio { + width: 100%; + padding: 0.5em; + box-sizing: border-box; + text-shadow: none; +} + +#stdout { + overflow: auto; + flex-grow: 1; + flex-shrink: 1; + padding: 0.5em; + + >div { + white-space: pre-wrap; + } + + .term-bold { + font-weight: bold; + } + + .term-centered { + text-align: center; + } + + button { + border: none; + margin: 0; + padding: 0; + text-decoration: 2px solid underline; + } +} + +#stdin-box { + flex-grow: 0; + flex-shrink: 0; + display: flex; + flex-direction: row; + align-items: center; +} + +#stdin { + flex-grow: 1; + border: none; + outline: none; + margin: 0.25em; +} + +#stdin-btn { + flex-grow: 0; + border: none; + margin: 0.25em; +} + +#stdin-box[data-offline] { + color: #805500; + text-shadow: 0 0 5px #805500; +} + +.history { + color: #805500; + text-shadow: 0 0 5px #805500; +}
\ No newline at end of file |
