From 14d496a78d15926ca52e63d1e51641a5f8350c00 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Fri, 14 Nov 2025 22:14:00 +0100 Subject: login-page: add login transition --- static/index.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'static/index.js') 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(); -- cgit v1.2.3-70-g09d2