This commit is contained in:
Kim Ravn Hansen
2025-09-15 12:33:08 +02:00
parent c19557ba33
commit 63dff39be2
12 changed files with 84 additions and 59 deletions

View File

@@ -1,6 +1,8 @@
import { crackdown } from "../utils/crackdown.js";
import { parseArgs } from "../utils/parseArgs.js";
import { MessageType } from "../utils/messages.js";
import { sprintf } from "sprintf-js";
import { Config } from "../config.js";
/** Regex to validate if a :help [topic] command i entered correctly */
const helpRegex = /^:help(?:\s+(.*))?$/;
@@ -72,7 +74,10 @@ class MUDClient {
connect() {
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
const wsUrl = `${protocol}//${window.location.host}`;
const wsUrl = `${protocol}//${window.location.host}`.replace(/:\d+$/, Config.port);
console.log(window.location);
this.updateStatus("Connecting...", "connecting");

View File

@@ -6,9 +6,9 @@
<title>WebSocket MUD</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="stylesheet" href="style.sass" />
<link rel="stylesheet" href="style.scss" />
<link rel="manifest" href="manifest.json" />
<lin rel="icon" href="favicon.ico" />
<lin rel="icon" href="/favicon.ico" />
</head>
<body>
<div id="container">
@@ -28,5 +28,6 @@
</div>
<script type="module" src="client.js"></script>
//# sourceMappingURL=
</body>
</html>

View File

@@ -1 +1,20 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
{
"name": "",
"short_name": "",
"icons": [
{
"src": "./img/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "./img/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

View File

@@ -26,20 +26,20 @@ body {
overflow: hidden;
}
/* #output { */
/* flex: 1; */
/* background-color: #000; */
/* border: 2px solid #333; */
/* padding: 15px; */
/* overflow-y: auto; */
/* white-space: pre-wrap; */
/* line-height: 1.4; */
/* margin-bottom: 20px; */
/* font-family: "Fira Code", monospace; */
/* font-optical-sizing: auto; */
/* font-size: 14px; */
/* width: 100ch; */
/* } */
#output {
flex: 1;
background-color: #000;
border: 2px solid #333;
padding: 15px;
overflow-y: auto;
white-space: pre-wrap;
line-height: 1.4;
margin-bottom: 20px;
font-family: "Fira Code", monospace;
font-optical-sizing: auto;
font-size: 14px;
width: 100ch;
}
#input-container {
display: flex;

View File

@@ -1,8 +1,12 @@
export default {
import { defineConfig } from "vite";
import devtoolsJson from "vite-plugin-devtools-json";
export default defineConfig({
root: ".",
plugins: [devtoolsJson()],
build: {
outDir: "../public/",
emptyOutDir: true, // also necessary
sourcemap: "inline",
sourcemap: true,
},
};
});