From 81e18d4e60360de2aad2d9a8a18df696b59eb81e Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Tue, 6 Sep 2022 16:48:25 -0400 Subject: [PATCH] Collapsible query settings and better mobile support. Also use a larger list of test clusters, for testing. --- src/app.css | 59 ++++++++- src/routes/+page.svelte | 203 +++++++++++++------------------ src/routes/settings/+page.svelte | 18 +-- src/utils.js | 30 +++-- 4 files changed, 162 insertions(+), 148 deletions(-) diff --git a/src/app.css b/src/app.css index 2c3308d..72ef145 100644 --- a/src/app.css +++ b/src/app.css @@ -38,6 +38,11 @@ select, input { padding: 0.3em; background-color: white; border-radius: 4px; + max-width: 90%; +} + +main { + height: calc(100% - 4em); } select option { @@ -230,13 +235,12 @@ button { border-style: solid; border-width: 1px; border-color: #95c1d3; - flex-grow: 2; + flex-grow: 1; padding: 1em; background-color: #e2eaff; - height: 84vh; - max-width: 65vw; min-width: 65vw; overflow-y: scroll; + margin-bottom: 1em; } .settings-option { @@ -254,8 +258,57 @@ button:focus:not(:focus-visible) { outline: none; } +.query-settings-hider { + color: rgba(0,0,0, 0.5) +} +.query-settings-shower { + color: rgba(0,0,0, 0.5) +} + +.query-settings-hider:before { + content: "«"; +} +.query-settings-shower:before { + content: "»"; +} + +section { + display: flex; + flex-direction: row; + flex: 1; + justify-content: space-between; + overflow: hidden; +} + +.query-settings { + margin-right: 1rem; + display: flex; + flex-direction: column; + padding: 1em; +} + @media (min-width: 720px) { h1 { font-size: 2.4rem; } + .query-settings { + overflow: scroll; + } +} + +@media (max-width: 719px) { + section { + flex-direction: column; + overflow: scroll; + } + .query-settings { + flex-grow: 1; + overflow: visible; + } + .query-settings-hider:before { + content: '▲'; + } + .query-settings-shower:before { + content: '▼'; + } } diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 83cd349..09b637e 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -16,6 +16,7 @@ } from './+page.js'; export let errors, data + let showQuerySettings = true let showQueryModal = false let queryRunning = '' @@ -90,120 +91,99 @@
-
- -

Topic Search

-
- {#if $state.error} - {$state.error} - {#if $state.errorDetails} -
{$state.errorDetails}
+ {#if showQuerySettings} +
+ +

Topic Search

+
+ {#if $state.error} + {$state.error} + {#if $state.errorDetails} +
{$state.errorDetails}
+ {/if} + {:else} +   {/if} - {:else} -   - {/if} -
+
-
-

Cluster

- -
+
+

Cluster

+ +
-
-

Topic

- -
+
+

Topic

+ +
-
- -
-
- -
- - {#if querySettings.jsFilter} - - {/if} - {#if showQueryModal} - showQueryModal = false} - onCancel={null} - onConfirm={() => showQueryModal = false} - confirm="Close" - title={'JS Filter'}> - - - {/if} -
- - - -
- {#if queryRunning && $state.queryState !== queryState.DONE} -
- -
- {:else} -
- -
- -
- {/if} -
-
+ {/if}
+