From 227fa2208b5e0d7f9a90bcca9bd66e17b01016e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20=C3=85hall?= Date: Tue, 9 Jun 2026 06:43:07 +0200 Subject: [PATCH] WIP sync --- static/css/notes2.css | 71 ++++++++------------------------- static/images/icon_transfer.svg | 49 +++++++++++++++++++++++ static/js/sync.mjs | 10 ++--- views/pages/notes2.gotmpl | 2 + 4 files changed, 73 insertions(+), 59 deletions(-) create mode 100644 static/images/icon_transfer.svg diff --git a/static/css/notes2.css b/static/css/notes2.css index b4d7e02..9805b82 100644 --- a/static/css/notes2.css +++ b/static/css/notes2.css @@ -307,65 +307,28 @@ button { } n2-syncprogress { - --radius: 8px; + position: absolute; + top: 16px; + right: 16px; + padding: 8px 16px; + z-index: 16384; + border-radius: 6px; + font-weight: bold; + background-color: var(--color1); + color: #fff; display: grid; - grid-area: sync; - display: grid; - justify-items: center; + grid-template-columns: min-content repeat(3, min-content); + grid-gap: 8px 8px; + white-space: nowrap; align-items: center; + justify-items: end; - position: relative; - - opacity: 0; - transition: height 0s 500ms, opacity 500ms linear, visibility 0s 500ms; - - &.show { - opacity: 1; - transition: visibility, height 0s, opacity 500ms linear; + img { + grid-row: 1/3; + height: 34px; + margin-right: 8px; } - - progress { - width: 100%; - height: 24px; - border-radius: 8px; - } - - .count { - position: absolute; - top: 16px; - width: 100%; - white-space: nowrap; - color: #888; - text-align: center; - font-size: 12pt; - font-weight: bold; - } - - progress[value]::-webkit-progress-bar { - background-color: #eee; - box-shadow: 0 2px var(--radius) rgba(0, 0, 0, 0.25) inset; - border-radius: var(--radius); - } - - progress[value]::-moz-progress-bar { - background-color: #eee; - box-shadow: 0 2px var(--radius) rgba(0, 0, 0, 0.25) inset; - border-radius: var(--radius); - } - - progress[value]::-webkit-progress-value { - background: rgb(186, 95, 89); - background: linear-gradient(180deg, rgba(186, 95, 89, 1) 0%, rgba(254, 95, 85, 1) 50%, rgba(186, 95, 89, 1) 100%); - border-radius: var(--radius); - } - - progress[value]::-moz-progress-value { - background: rgb(186, 95, 89); - background: linear-gradient(180deg, rgba(186, 95, 89, 1) 0%, rgba(254, 95, 85, 1) 50%, rgba(186, 95, 89, 1) 100%); - border-radius: var(--radius); - } - } /* ============================================================= */ diff --git a/static/images/icon_transfer.svg b/static/images/icon_transfer.svg new file mode 100644 index 0000000..59c900e --- /dev/null +++ b/static/images/icon_transfer.svg @@ -0,0 +1,49 @@ + + + + + + + + file-arrow-up-down-outline + + + diff --git a/static/js/sync.mjs b/static/js/sync.mjs index 291e0b9..47777f5 100644 --- a/static/js/sync.mjs +++ b/static/js/sync.mjs @@ -166,8 +166,9 @@ export class N2SyncProgress extends CustomHTMLElement { static {// {{{ this.tmpl = document.createElement('template') this.tmpl.innerHTML = ` - -
0 / 0
+ +
0
/
0
+
0
/
0
` }// }}} constructor() {//{{{ @@ -211,9 +212,8 @@ export class N2SyncProgress extends CustomHTMLElement { this.render() }//}}} render() {//{{{ - this.elProgress.max = this.state.nodesToSync - this.elProgress.value = this.state.nodesSynced - this.elCount.innerText = `${this.state.nodesSynced} / ${this.state.nodesToSync}` + this.elDownloadTransferred.innerText = this.state.nodesSynced + this.elDownloadTotal.innerText = this.state.nodesToSync }//}}} setSyncState(state) {// {{{ if (state) diff --git a/views/pages/notes2.gotmpl b/views/pages/notes2.gotmpl index 1142eda..422b672 100644 --- a/views/pages/notes2.gotmpl +++ b/views/pages/notes2.gotmpl @@ -22,6 +22,8 @@ + +