diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..33fc0d9 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,5 @@ +public/app.js +public/app.js.map +node_modules/ +yarn.lock +package-lock.json diff --git a/frontend/app.js b/frontend/app.js index 8e8d3ab..ceb05eb 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1,11 +1,8 @@ -import RFB from "https://cdn.skypack.dev/pin/@novnc/novnc@v1.3.0-RRNSIy674lWHJVNg8Apd/mode=imports,min/unoptimized/core/rfb.js"; +import RFB from "@novnc/novnc/core/rfb.js"; // DOS-style box for text const cmd = document.getElementById("cmd-text"); -// random tile wallpaper -document.body.style.backgroundImage = "url('tiles/tile_" + Math.floor(20 * Math.random()) + ".jpg')"; - if (window.WebSocket) { // https://github.com/novnc/noVNC/blob/master/docs/API.md const rfb = new RFB( diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 0000000..f7409b5 --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,11 @@ +{ + "scripts": { + "build": "esbuild app.js --outdir=public --platform=browser --target=es2020 --bundle --minify --sourcemap" + }, + "dependencies": { + "@novnc/novnc": "1.3.0" + }, + "devDependencies": { + "esbuild": "^0.13.14" + } +} diff --git a/frontend/404.html b/frontend/public/404.html similarity index 100% rename from frontend/404.html rename to frontend/public/404.html diff --git a/frontend/favicon.ico b/frontend/public/favicon.ico similarity index 100% rename from frontend/favicon.ico rename to frontend/public/favicon.ico diff --git a/frontend/fonts/perfect-dos.woff b/frontend/public/fonts/perfect-dos.woff similarity index 100% rename from frontend/fonts/perfect-dos.woff rename to frontend/public/fonts/perfect-dos.woff diff --git a/frontend/fonts/perfect-dos.woff2 b/frontend/public/fonts/perfect-dos.woff2 similarity index 100% rename from frontend/fonts/perfect-dos.woff2 rename to frontend/public/fonts/perfect-dos.woff2 diff --git a/frontend/index.html b/frontend/public/index.html similarity index 81% rename from frontend/index.html rename to frontend/public/index.html index f19d9b8..e20dc0f 100644 --- a/frontend/index.html +++ b/frontend/public/index.html @@ -14,18 +14,15 @@ -
-