aboutsummaryrefslogtreecommitdiff
path: root/static/pages/login/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/pages/login/index.js')
-rw-r--r--static/pages/login/index.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/static/pages/login/index.js b/static/pages/login/index.js
new file mode 100644
index 0000000..fc14dbf
--- /dev/null
+++ b/static/pages/login/index.js
@@ -0,0 +1,48 @@
+import * as sfw from 'sfw';
+const { Div, Label, H1: Title, Input, Button } = sfw.element.native;
+
+const css = await sfw.css(import.meta.url, './index.css');
+
+export default class LoginView extends sfw.element.Container {
+ #user
+ #password
+
+ constructor() {
+ super({ css });
+
+ this.onlogin = () => {};
+
+ this.body.append(
+ Div.new({
+ id: 'container',
+ children: [
+ Div.new({ id: 'title', innerText: 'Memora' }),
+ Div.new({
+ id: 'box',
+ children: [
+
+ Div.new({
+ id: 'form',
+ children: [
+ Label.new({ innerText: 'User' }),
+ this.#user = Input.new({ }),
+
+ Label.new({ innerText: 'Password' }),
+ this.#password = Input.new({ type: 'password' }),
+ ]
+ }),
+ Button.new({
+ innerText: 'Login',
+ onclick: () => this.onlogin(this.#user.value, this.#password.value),
+ }),
+ ]
+ }),
+ Div.new({
+ id: 'subtitle',
+ innerText: 'Where nostalgia is home.',
+ }),
+ ]
+ })
+ );
+ }
+}