aboutsummaryrefslogtreecommitdiff
path: root/static/index.js
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2025-11-14 22:14:00 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2025-11-14 22:14:00 +0100
commit14d496a78d15926ca52e63d1e51641a5f8350c00 (patch)
tree22aff03b61e98c64520d413e8daf65803566c257 /static/index.js
parent54cf8b71c6db92f34a596408e3c00feb0afffa67 (diff)
login-page: add login transition
Diffstat (limited to 'static/index.js')
-rw-r--r--static/index.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/static/index.js b/static/index.js
index c6388eb..a7211e2 100644
--- a/static/index.js
+++ b/static/index.js
@@ -33,12 +33,7 @@ const image_viewer = ImageViewer.new();
const login = LoginView.new({
onlogin: async (user, password) => {
if (await api.auth.login(user, password)) {
- document.body.innerHTML = '';
- document.body.append(
- main,
- search,
- month_select,
- )
+ login.hide();
} else {
login.comment = 'Incorrect username or password.';
}
@@ -63,8 +58,7 @@ const month_select = MonthSelect.new({
const settings = SettingsView.new({
onlogout: () => {
- document.body.innerHTML = '';
- document.body.append(login)
+ login.show();
main.active_view = image_viewer;
},
});
@@ -101,4 +95,11 @@ const main = MainView.new({
},
});
-document.body.append(login);
+document.body.append(
+ login,
+ main,
+ search,
+ month_select,
+);
+
+login.focus();