Compare commits

...

4 Commits

Author SHA1 Message Date
667dd7d662 scss tweaking 2025-02-23 14:08:21 -05:00
9bf6389376 experimenting with the browser useragent as a hostname string
get apple/safari working
2025-02-23 14:05:29 -05:00
3f7e0edf38 remove unused import 2025-02-23 14:00:06 -05:00
d6effa3838 add joseluisq/static-web-server for production 2025-02-23 13:58:41 -05:00
5 changed files with 35 additions and 22 deletions

View File

@ -1,7 +1,16 @@
FROM oven/bun AS build
FROM oven/bun AS builder
COPY package.json astro.config.mjs /tmp/
COPY src public /tmp/
WORKDIR /rhpidfyre.io
COPY src package.json vite.config.js tsconfig.json ./
RUN bun run install
RUN bun run build
FROM joseluisq/static-web-server
COPY --from=builder /rhpidfyre.io/dist .
EXPOSE 8787/tcp
ENTRYPOINT [ "static-web-server", "-p", "8787", "-d", "dist/", "-g", "trace" ]

View File

@ -3,13 +3,6 @@ import { get_working_dir_name } from "../shell/fs/fn"
import create from "./create"
const userAgent = navigator.userAgent
const browser_name_fallible = userAgent.match(/Firefox.\d+[\d.\d]+|Chrome.\d+[\d.\d]+/gm)?.map(f => f.split("/")[0])
let browser_name = "unknown"
if (browser_name_fallible) {
browser_name = browser_name_fallible[0] === "Firefox" ? "gecko" : "chromium"
}
interface Ps1Prompt {
readonly body: HTMLDivElement,
readonly input: HTMLInputElement
@ -23,6 +16,24 @@ let inputs: Inputs = {
new: undefined
}
function browser_name_via_useragent(): string {
const userAgent = navigator.userAgent
const browser_name_fallible = userAgent.match(/Firefox.\d+[\d.\d]+|Chrome.\d+[\d.\d]+/gm)?.map(f => f.split("/")[0])
if (browser_name_fallible) {
const useragent_name = browser_name_fallible[0]
if (useragent_name === "Firefox") {
return "gecko"
} else if (useragent_name === "Chrome") {
return "chromium"
}/* else if (useragent_name === "AppleWebKit") {
return "safari"
} */
}
return "unknown"
}
const browser_name = browser_name_via_useragent()
function ps1_element(user: HTMLSpanElement, dir: HTMLSpanElement) {
const display = create("p")
display.appendChild(user)

View File

@ -1,4 +1,4 @@
import { Entry, EntryType, fs, type FsEntrySignature } from "./fs"
import { EntryType, fs, type FsEntrySignature } from "./fs"
let working_dir = ["/", "home", "user"]

View File

@ -19,7 +19,7 @@
height: 100%;
padding: 0 20px 0 20px;
&:hover { background-color: var(--hf-button-hover-color) }
&:hover { background-color: rgb(255,255,255) }
}
}

View File

@ -5,25 +5,18 @@
@use "./elements/main.scss";
@use "./elements/footer.scss";
:root {
color-scheme: dark;
--body-background-color: rgb(0,0,0);
--hf-button-hover-color: rgb(255,255,255);
}
:root { color-scheme: dark; }
::selection {
background-color: rgb(255,255,255);
color: rgb(0,0,0);
}
::spelling-error {
text-decoration: none
}
::spelling-error { text-decoration: none; }
body {
box-sizing: border-box;
margin: 0;
overflow: hidden;
background-color: var(--body-background-color);
background-color: rgb(0,0,0);
}
button {
background-color: transparent;