From 134a9475475a55f721b05cb96cf9bfdf7fc9c0c6 Mon Sep 17 00:00:00 2001 From: Alessandro Pignotti Date: Sun, 13 Oct 2024 22:14:40 +0200 Subject: [PATCH] Svelte: Restore welcome message Compared to the side bar is much more visible --- src/lib/messages.js | 29 +++++++++++++++++++++++++++++ src/routes/+page.svelte | 7 +++++++ 2 files changed, 36 insertions(+) create mode 100644 src/lib/messages.js diff --git a/src/lib/messages.js b/src/lib/messages.js new file mode 100644 index 0000000..2c427ec --- /dev/null +++ b/src/lib/messages.js @@ -0,0 +1,29 @@ +const underline= "\x1b[94;4m"; +const normal= "\x1b[0m"; +export const introMessage = [ + "+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+", + "| |", + "| WebVM is a server-less virtual Linux environment running fully client-side |", + "| in HTML5/WebAssembly. |", + "| |", + "| WebVM is powered by the CheerpX virtualization engine, which enables safe, |", + "| sandboxed client-side execution of x86 binaries on any browser. |", + "| |", + "| CheerpX includes an x86-to-WebAssembly JIT compiler, a virtual block-based |", + "| file system, and a Linux syscall emulator. |", + "| |", + "| Your own WebVM with custom images via Dockerfile: |", + "| |", + "| " + underline + "https://leaningtech.com/mini-webvm-your-linux-box-from-dockerfile-via-wasm" + normal +" |", + "| |", + "+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+", + "", + " Welcome to WebVM. If unsure, try these examples:", + "", + " python3 examples/python3/fibonacci.py ", + " gcc -o helloworld examples/c/helloworld.c && ./helloworld", + " objdump -d ./helloworld | less -M", + " vim examples/c/helloworld.c", + " curl --max-time 15 parrot.live # requires networking", + "", +]; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index ff9d6b1..7bf55ca 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -12,6 +12,7 @@ import '@fortawesome/fontawesome-free/css/all.min.css' import { networkInterface, startLogin } from '$lib/network.js' import { cpuActivity, diskActivity } from '$lib/activities.js' + import { introMessage } from '$lib/messages.js' var term = new Terminal({cursorBlink:true, convertEol:true, fontFamily:"monospace", fontWeight: 400, fontWeightBold: 700}); var cx = null; @@ -31,6 +32,11 @@ for(var i=0;i