From 70994ddaf48a92d062977bc667c72685a4ccb815 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Mon, 18 May 2026 17:02:32 +0200 Subject: try to use bun for bundling --- static/index.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'static/index.js') diff --git a/static/index.js b/static/index.js index 5979d86..ddbead7 100644 --- a/static/index.js +++ b/static/index.js @@ -1,7 +1,6 @@ import * as sfw from 'sfw'; import * as api from 'api'; import Month from './month.js'; -import * as service_worker from './service-worker/index.js'; import LoginView from './pages/login/index.js'; import MainView from './pages/main/index.js'; @@ -12,24 +11,18 @@ import SettingsView from './pages/settings/index.js'; import ShuffleView from './pages/shuffle/index.js'; import UploadBar from './widgets/upload-bar/index.js'; -await service_worker.register() - -sfw.theme.add_css(await sfw.css(import.meta.url, './index.css')); +import stylesheet from './index.css'; +sfw.theme.add_css(await sfw.css.sheet(stylesheet)); const image_viewer = ImageViewer.new(); const reload = () => { - image_viewer.clear(); api.images.list().then(images => { const last = Month.from_unix(images[0].timestamp); let first = Month.from_unix(images.findLast(i => i.timestamp).timestamp); month_select.months = first.to(last); - for (const image of images) { - image_viewer.add(image); - } - - image_viewer.preload_all(); + image_viewer.images = images; shuffle.images = images; }); } @@ -90,11 +83,11 @@ const main = MainView.new({ month_select.show(); }, onupload: async () => { - const uploader = await api.images.upload_to_timeline(); - upload_bar.progress = 0; upload_bar.show(); + const uploader = await api.images.upload_to_timeline(); + uploader.onprogress = (count, total) => { upload_bar.progress = count / total; } -- cgit v1.2.3-70-g09d2