From c3f1af681885bebb38d9e044e13b9dc854dc71cc Mon Sep 17 00:00:00 2001 From: gornodox Date: Thu, 19 Mar 2026 17:52:36 +0100 Subject: [PATCH] a bit of front-end work, changing users almost done on login, "drunk-code" no more (id hope), continuous processes and keybinds still not done. --- package.json | 2 +- src/lib/assets/login/default.png | Bin 0 -> 11564 bytes .../{login-avatar.png => login/gornodox.png} | Bin src/lib/stores/bash/bash.ts | 11 +-- src/lib/stores/bash/commandRegistry.ts | 7 +- src/lib/stores/bash/commands/ls.ts | 37 ++------ src/lib/stores/bash/commands/testAsync.ts | 14 +-- src/lib/stores/bash/process.ts | 2 +- src/lib/stores/terminal/terminal.ts | 9 +- src/modules/Login.svelte | 81 +++++++++++++++++- src/modules/Terminal.svelte | 4 +- src/modules/terminal/Input.svelte | 16 ++++ src/routes/+page.svelte | 2 +- src/routes/test/+page.svelte | 13 ++- 14 files changed, 136 insertions(+), 62 deletions(-) create mode 100644 src/lib/assets/login/default.png rename src/lib/assets/{login-avatar.png => login/gornodox.png} (100%) diff --git a/package.json b/package.json index 0894270..b3229b3 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "svelte-portfolio", "private": true, - "version": "0.0.1", + "version": "0.0.69", "type": "module", "scripts": { "dev": "vite dev", diff --git a/src/lib/assets/login/default.png b/src/lib/assets/login/default.png new file mode 100644 index 0000000000000000000000000000000000000000..637e5b2921e06964329d4ad4cc63be5f98130720 GIT binary patch literal 11564 zcmV+{Ez{D8P)QLwPEO-)V0!oqcRb)}`H>+9>3l$3sc ze%##LoSdA}($ezs@@{T!hK7d9%F5&8-E9)pUT&+ufP81de7@qFWhgdzJ7d7(i$vZPxN}hud^sVl&=50j=*(l zj;rMgc>Q}E?R6fH`ONdk2kVTEPnwU`5Z`zQFCgC$|F;~UwD3wU3-wnYrx0I(F^B>1 zSn)A6F~_+Byr%P5h-)6PSMb$&VE2;A2iE31+^=Yy^IVSWe4VQ#rf%~=#{uI>T;BHJ z*Nx%b^4||L_li}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zyAaR=&F11n# z6ydT14|#*wu%|x&3hnF#nDor$5Is7{wX5h)+JQ=&O?4^=+2wQ+Pvr6o5Xw8bZP_^@F&KQ2VAf}qC)5oY^%L2!>FeL0H&F7Yv@*r9v5PK<3Nb^; zI%okA@NJ3_TAHGq)1B$Q4un75!M+b$R{87Vj`B_ zL*TmW>!1a}W{awp34m%Ewp|Y698zen)E@Tg_LRgn3^-Cq>|xI8b`g=$&qW?2<$1J8 zy_>$RlnQNAsqTX0K*x~WEE3LO}G#ALU7(7a%r5!KB&wb*N(O);8=65HlM zlhM#fTi{g304lnjzG28qpJycrSloQV2U>FZ@sHgG&rC$nkzC)!|Jpla*y?xfU7bsVTmkNn+#Cq%Y)+g^y| zgXQZP4;uNqe0`DT`B?dSmYWc*9@m8(hh;L%VMTWx|8d6*WPNC&$j`hvq5~s>eR8CX zm{jyWw)L*OsXu-weUZB{tYm8#mEkQqM957uDkp$$pB`Q>Xw8E?2$93p9OZl+2nlJq zTkLwHatv=36xhk%m?RAoHn-uZT$5W|OO3|>ItY62=lIe(o}lL)ep+!pswA}NZP+%i z`;ZhHTLcK;pQd%Y4o?ooCFAyJhTk>9#xPZ$BDvXo=|(7!Q&9l^0cn}Gi~uaBJcl(1 z%9gSUA8aNa5OF)$k?Yix;bj&uFZby>J`G6~hJZ1ft;3SVX<%+$^$=r{@B {console.log("process Kill successfull")}); - } - else { - return ExitCode.SUCCESS; //Temp need to make custom enum value - } - } - throwError(result: Result): void { switch (result.exitCode) { default: { diff --git a/src/lib/stores/bash/commandRegistry.ts b/src/lib/stores/bash/commandRegistry.ts index 8097c27..87dc8f8 100644 --- a/src/lib/stores/bash/commandRegistry.ts +++ b/src/lib/stores/bash/commandRegistry.ts @@ -1,12 +1,13 @@ +import { isBuildCommand } from "typescript"; import type { KeyBind } from "../terminal/keybindRegistry"; import type { Bash, Result } from "./bash"; import { cd } from "./commands/cd"; import { clear } from "./commands/clear"; import { ls } from "./commands/ls"; -import { aSync } from "./commands/testAsync"; +import { testProcess } from "./commands/testAsync"; export type ICommand = { - method: (this: Bash, args: CommandArgs) => Promise; + method: (this: Bash, args: CommandArgs) => Result; keybinds?: Map any>; flags: string[]; help: string; @@ -28,7 +29,7 @@ export const COMMANDS = { cd, ls, clear, - aSync + testProcess } as const satisfies Record; /* //export const commands { diff --git a/src/lib/stores/bash/commands/ls.ts b/src/lib/stores/bash/commands/ls.ts index bef13ea..fedc211 100755 --- a/src/lib/stores/bash/commands/ls.ts +++ b/src/lib/stores/bash/commands/ls.ts @@ -38,7 +38,7 @@ const months: readonly string[] = [ 'Dec' ]; -export const cmd_ls = async function (this: Bash, args: CommandArgs): Promise { +export const cmd_ls = function (this: Bash, args: CommandArgs): Result { const Fs = this.getFs(); const resultData: CommandResultData = { cmd: 'ls', data: null, args: args }; const result: Result = { exitCode: ExitCode.ERROR, path: this.getCwd(), resultData: resultData }; @@ -80,16 +80,16 @@ function result_ls(this: Bash, data: any, args: CommandArgs): HTMLElement { const f_a: boolean = flagInfo.has('a') || flagInfo.has('all'); const f_A: boolean = flagInfo.has('A') || flagInfo.has('almost-all'); - const f_G: boolean = flagInfo.has('G') || flagInfo.has('no-group'); + //const f_G: boolean = flagInfo.has('G') || flagInfo.has('no-group'); const f_h: boolean = flagInfo.has('h') || flagInfo.has('human-readable'); const f_r: boolean = flagInfo.has('r') || flagInfo.has('reverse'); const f_R: boolean = flagInfo.has('R') || flagInfo.has('recursive'); - const f_Q: boolean = flagInfo.has('Q') || flagInfo.has('quote-name'); - const f_n: boolean = flagInfo.has('n') || flagInfo.has('numeric-uid-gid'); - const f_N: boolean = flagInfo.has('N') || flagInfo.has('literal'); - const f_L: boolean = flagInfo.has('L') || flagInfo.has('dereference'); + //const f_Q: boolean = flagInfo.has('Q') || flagInfo.has('quote-name'); + //const f_n: boolean = flagInfo.has('n') || flagInfo.has('numeric-uid-gid'); + //const f_N: boolean = flagInfo.has('N') || flagInfo.has('literal'); + //const f_L: boolean = flagInfo.has('L') || flagInfo.has('dereference'); const f_i: boolean = flagInfo.has('i') || flagInfo.has('inode'); - const f_help: boolean = flagInfo.has('help'); + //const f_help: boolean = flagInfo.has('help'); const f_si: boolean = flagInfo.has('si'); const f_X: boolean = flagInfo.has('X'); const f_S: boolean = flagInfo.has('S'); @@ -278,8 +278,8 @@ function isValidNodeTimestamp(value: string): value is SortNodeBy.ATIME | SortNo function parsePerms(perms: NodePerms): string { const parts: string[] = []; //for each key (key representing key name and p representing the key contents) of entries in perms as types keyof NodePerms and Permission - for (const [key, p] of Object.entries(perms) as [keyof NodePerms, Permission][]) { - const perms: string = `${p.r ? 'r' : '-'}${p.w ? 'w' : '-'}${p.x ? 'x' : '-'}`; + for (const [, permission] of Object.entries(perms) as [keyof NodePerms, Permission][]) { + const perms: string = `${permission.r ? 'r' : '-'}${permission.w ? 'w' : '-'}${permission.x ? 'x' : '-'}`; parts.push(perms); } return parts.join(''); @@ -371,25 +371,6 @@ function formatName(node: TreeNode, flag: any, shouldShift: boolean) { return flag.has('p') && node.type === Type.Directory ? `${name}/` : name; } -/* function formatOutputShort(node: TreeNode, flag: any) { - let output: string = node.name; - const char: string = flag.has('Q') ? '"' : "'"; - - if (/\s/.test(node.name)) { - if(flag.has('i')) { - - } - else { - output = `${char}${node.name}${char}`; - } - - if(flag.has('i')) { - output = `${node.inode} ${output}` - } - - return flag.has('p') && node.type === Type.Directory ? ` ${output}/ ` : output; -} */ - const checkFlags = (pFlags: string[]) => { const flagSet = new Set(pFlags); diff --git a/src/lib/stores/bash/commands/testAsync.ts b/src/lib/stores/bash/commands/testAsync.ts index ea2d06a..3d131f1 100644 --- a/src/lib/stores/bash/commands/testAsync.ts +++ b/src/lib/stores/bash/commands/testAsync.ts @@ -1,12 +1,16 @@ import type { KeyBind } from "$lib/stores/terminal/keybindRegistry"; +import { mount } from "svelte"; import { type Bash, type Result } from "../bash"; -import type { CommandArgs, ICommand } from "../commandRegistry"; +import type { CommandArgs, CommandResultData, ICommand } from "../commandRegistry"; import { ExitCode } from "../metadata"; +import Login from "../../../../modules/Login.svelte"; +import Loading from "../../../../modules/Loading.svelte"; -export const cmd_async = async function(this: Bash, args: CommandArgs): Promise { +export const cmd_process = function(this: Bash, args: CommandArgs): Result { let result: Result = { exitCode: ExitCode.ERROR, path: this.getCwd() }; - + const resultData: CommandResultData = { cmd: 'ls', data: null, args: args }; + result.resultData = resultData; result.exitCode = ExitCode.SUCCESS; return result; } @@ -28,8 +32,8 @@ const keybinds: Map any> = new Map([ [test_keybind,test] ]); -export const aSync: ICommand = { - method: cmd_async, +export const testProcess: ICommand = { + method: cmd_process, keybinds: keybinds, flags: [] as string[], help: 'PATH TO HELP.md', diff --git a/src/lib/stores/bash/process.ts b/src/lib/stores/bash/process.ts index 7d17baa..eb9b360 100644 --- a/src/lib/stores/bash/process.ts +++ b/src/lib/stores/bash/process.ts @@ -67,7 +67,7 @@ export class Process { } private async _Run(command: ICommand, bashInstance: Bash, args: CommandArgs) { - this._result = await command.method.call( + this._result = command.method.call( bashInstance, args); } diff --git a/src/lib/stores/terminal/terminal.ts b/src/lib/stores/terminal/terminal.ts index a702cb3..c966b90 100755 --- a/src/lib/stores/terminal/terminal.ts +++ b/src/lib/stores/terminal/terminal.ts @@ -1,3 +1,4 @@ +import type { BooleanLiteral } from 'typescript'; import { Bash, Signal, type BashInitArgs, type Result } from '../bash/bash'; import type { CommandArgs } from '../bash/commandRegistry'; import type { User } from '../bash/etc/userData'; @@ -5,7 +6,7 @@ import { VirtualFS, type TreeNode } from '../bash/fs'; import { KeybindInhibitor } from '../bash/keybindInhibitor'; import { ExitCode } from '../bash/metadata'; import type { Process } from '../bash/process'; -import { TERMINAL_KEYBINDS, type KeyStroke } from './keybindRegistry'; +import { TERMINAL_KEYBINDS, type KeyBind } from './keybindRegistry'; //import type { ILocale } from './localeRegistry'; export type TerminalMode = {}; @@ -37,13 +38,15 @@ export class Terminal { private _bash: Bash; private _callbacks: Partial = {}; private _keybindInhibitor: KeybindInhibitor; + + //public isProcessActive: boolean = false; //public locale: ILocale; constructor(args: TermInitArgs) { args.bash.io = this; this._bash = new Bash(args.bash); - const keybinds: Map any> = new Map([ + const keybinds: Map any> = new Map([ [TERMINAL_KEYBINDS.sigint,this._processKill] ]); @@ -62,6 +65,8 @@ export class Terminal { console.log("process kill successful"); }); + //this.isProcessActive = false; + return result; } diff --git a/src/modules/Login.svelte b/src/modules/Login.svelte index a281777..9283659 100644 --- a/src/modules/Login.svelte +++ b/src/modules/Login.svelte @@ -1,21 +1,55 @@
- -
- gornodox + +
+ + {event.currentTarget.innerText = username; event.currentTarget.classList.remove('switchR', 'switchL');}}>gornodox +
{formElem.classList.remove('invalid')}} use:enhance={({ formData }) => { init(formData); } } method="POST" action="?/login" class:invalid={form?.error} name="login-form" autocomplete="off" class="mt-6 flex flex-row gap-1"> +
@@ -35,6 +69,45 @@ animation: fadeIn 0.2s forwards cubic-bezier(.4,.7,0,.99); } +.switchL { + animation: fadeSlideLeft 1s forwards cubic-bezier(.4,.7,0,.99); +} + +.switchR { + animation: fadeSlideRight 1s forwards cubic-bezier(.4,.7,0,.99); +} + + +@keyframes fadeSlideLeft { + 25% { + transform: translateX(-1rem); + opacity: 0; + } + 50% { + transform: translateX(1rem); + opacity: 0; + } + 75% { + transform: none; + opacity: 1; + } +} + +@keyframes fadeSlideRight { + 25% { + transform: translateX(1rem); + opacity: 0; + } + 50% { + transform: translateX(-1rem); + opacity: 0; + } + 100% { + transform: none; + opacity: 1; + } +} + @keyframes fadeIn { to { opacity: 1; diff --git a/src/modules/Terminal.svelte b/src/modules/Terminal.svelte index c909808..a0e34c5 100755 --- a/src/modules/Terminal.svelte +++ b/src/modules/Terminal.svelte @@ -16,13 +16,14 @@ terminal = await initTerminal({ username: 'gornodox', password}, callbackInit, 'en_US'); updateTerminal(); } catch (error) { - console.error('onMount trycatch failed', error); + console.error('terminal init failed', error); } runTerminal(); } function updateTerminal() { + //isProcessActive = terminal.isProcessActive; username = terminal!.getUser().username; cwd = terminal!.getCwd(); } @@ -107,6 +108,7 @@ let terminal: Terminal; let username: string = $state(''); let cwd: string = $state(''); + //let isProcessActive = $state(false); let inputValue = $state(''); diff --git a/src/modules/terminal/Input.svelte b/src/modules/terminal/Input.svelte index 2b09ac6..8ecf716 100755 --- a/src/modules/terminal/Input.svelte +++ b/src/modules/terminal/Input.svelte @@ -8,10 +8,26 @@ function handleInput(event: Event) { inputValue = (event.target as HTMLInputElement).value; } + + /* function moveCursor() { + + } + + function keyDown(event: KeyboardEvent) { + switch(event.key) { + case 'Enter': + inputValue = '' + case 'ArrowRight': + document.getElementById('cursor')?.style.transform = 'translateX(8px)' + case 'ArrowLeft': + + } + } */
e.key === 'Enter' && (inputValue = '')} oninput={handleInput} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 0979627..a963020 100755 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -9,7 +9,7 @@ let { form, data } = $props(); - const MAINTENANCE = $state(Boolean(data.settings[0].setting)); + const MAINTENANCE = $derived(Boolean(data.settings[0].setting)); //export let isWelcomeSequence = false; diff --git a/src/routes/test/+page.svelte b/src/routes/test/+page.svelte index 5c8ba5b..5b28374 100755 --- a/src/routes/test/+page.svelte +++ b/src/routes/test/+page.svelte @@ -1,10 +1,9 @@ - -
-
- {}}/> -
-
-
\ No newline at end of file + + + + \ No newline at end of file