From e4386f417faf894f6706eec005e24d142b577fcb Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Mon, 4 Sep 2023 10:28:55 +0200 Subject: server : add a subtle loading animation to the edit box (#2466) * editorconfig: add override for the server HTML (which already is 2-space indented) * server: add a subtle loading animation to the edit box --- examples/server/public/index.html | 41 +++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) (limited to 'examples/server/public') diff --git a/examples/server/public/index.html b/examples/server/public/index.html index 959a9b9a..1bf2a8b3 100644 --- a/examples/server/public/index.html +++ b/examples/server/public/index.html @@ -145,7 +145,29 @@ color: #888; } + + @keyframes loading-bg-wipe { + 0% { + background-position: 0%; + } + 100% { + background-position: 100%; + } + } + + .loading { + --loading-color-1: #eeeeee00; + --loading-color-2: #eeeeeeff; + background-size: 50% 100%; + background-image: linear-gradient(90deg, var(--loading-color-1), var(--loading-color-2), var(--loading-color-1)); + animation: loading-bg-wipe 2s linear infinite; + } + @media (prefers-color-scheme: dark) { + .loading { + --loading-color-1: #22222200; + --loading-color-2: #222222ff; + } .popover-content { background-color: black; } @@ -321,7 +343,10 @@ const llamaStats = signal(null) const controller = signal(null) - const generating = computed(() => controller.value == null ) + // currently generating a completion? + const generating = computed(() => controller.value != null) + + // has the user started a chat? const chatStarted = computed(() => session.value.transcript.length > 0) const transcriptUpdate = (transcript) => { @@ -430,11 +455,19 @@ return html`
-