From d28d8333ebe71e2937660b13d9afb1d516cf14f0 Mon Sep 17 00:00:00 2001 From: wlodekm Date: Fri, 15 Nov 2024 09:46:47 +0200 Subject: v1.0.2 --- screen/login.ts | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 screen/login.ts (limited to 'screen/login.ts') diff --git a/screen/login.ts b/screen/login.ts new file mode 100644 index 0000000..bc39655 --- /dev/null +++ b/screen/login.ts @@ -0,0 +1,55 @@ +import { ElemType } from "../screenbuilder.ts"; +import { Screen } from "../screen.ts"; +import * as client from "../client.ts" +import { build } from "../screenbuilder.ts"; +import HomeScreen from "./home.ts"; + +export default { + elements: [ + { + type: ElemType.TextElem, + id: 'username-label', + data: ["Username: \n"] + }, + { + type: ElemType.InputElem, + id: 'username-input', + data: [false] + }, + { + type: ElemType.BR, + id: 'naoiuou' + }, + { + type: ElemType.TextElem, + id: 'password-label', + data: ["Password: \n"] + }, + { + type: ElemType.InputElem, + id: 'password-input', + data: [true] + }, + { + type: ElemType.BR, + id: 'faij0ifsj' + }, + { + type: ElemType.ButtonElem, + id: 'done-btn', + data: ["Done", async function (this: Screen) { + client.setScreen(this) + this.off() + this.logs.push(`clicked button`) + console.clear() + console.log("logging in...") + //@ts-ignore + await client.login(this.elements.get("username-input").value, this.elements.get("password-input").value) + build(HomeScreen); + client + }] + } + ], + focus: "username-input", + name: 'login' +} \ No newline at end of file -- cgit 1.4.1-2-gfad0