From 628337f3afcd5125299cbf620832779ab209022b Mon Sep 17 00:00:00 2001 From: Kit La Touche Date: Mon, 30 Dec 2024 15:43:01 -0500 Subject: Add in some hand-rolled styles --- ui/styles/app-bar.css | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ui/styles/app-bar.css (limited to 'ui/styles/app-bar.css') diff --git a/ui/styles/app-bar.css b/ui/styles/app-bar.css new file mode 100644 index 0000000..401a278 --- /dev/null +++ b/ui/styles/app-bar.css @@ -0,0 +1,25 @@ +/* App Bar */ +.app-bar { + height: var(--app-bar-height); + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: stretch; +} + +.app-bar > * { + display: inline-block; +} + +.app-bar .lead { + flex-basis: 60px; +} + +.app-bar .trail { + flex-basis: 60px; +} + +.app-bar button, +.app-bar button img { + height: var(--app-bar-height); +} -- cgit v1.2.3 From c9b3394e9fc2cf6eb505ab03a6479eae996ed6e9 Mon Sep 17 00:00:00 2001 From: Kit La Touche Date: Wed, 1 Jan 2025 18:09:46 -0500 Subject: Just oh so many styles --- ui/app.css | 6 +++ ui/lib/components/Message.svelte | 40 +-------------- ui/lib/components/MessageRun.svelte | 15 +----- ui/routes/(app)/+layout.svelte | 54 ++------------------ ui/routes/(app)/ch/[channel]/+page.svelte | 20 +------- ui/styles/active-channel.css | 3 ++ ui/styles/app-bar.css | 1 + ui/styles/app-layout.css | 56 +++++++++++++++++++++ ui/styles/messages.css | 83 +++++++++++++++++++++++++++++++ ui/styles/sidebar.css | 11 ++++ ui/styles/textarea.css | 38 ++++++++++++++ ui/styles/variables.css | 28 ++++++++--- 12 files changed, 228 insertions(+), 127 deletions(-) create mode 100644 ui/styles/active-channel.css create mode 100644 ui/styles/app-layout.css create mode 100644 ui/styles/messages.css create mode 100644 ui/styles/textarea.css (limited to 'ui/styles/app-bar.css') diff --git a/ui/app.css b/ui/app.css index c4b464b..a945c6a 100644 --- a/ui/app.css +++ b/ui/app.css @@ -2,11 +2,17 @@ @import url("styles/variables.css"); @import url("styles/overscroll.css"); @import url("styles/app-bar.css"); +@import url("styles/app-layout.css"); @import url("styles/sidebar.css"); +@import url("styles/active-channel.css"); +@import url("styles/messages.css"); +@import url("styles/textarea.css"); /* Debugging */ +/* * / div { outline: 1px dashed grey; background-color: var(--colour-background); box-shadow: 5px 5px 5px var(--colour-border); } +/* */ diff --git a/ui/lib/components/Message.svelte b/ui/lib/components/Message.svelte index cfadbba..6918b5d 100644 --- a/ui/lib/components/Message.svelte +++ b/ui/lib/components/Message.svelte @@ -26,8 +26,8 @@
- - diff --git a/ui/lib/components/MessageRun.svelte b/ui/lib/components/MessageRun.svelte index 6cad381..09388ac 100644 --- a/ui/lib/components/MessageRun.svelte +++ b/ui/lib/components/MessageRun.svelte @@ -9,6 +9,7 @@
@@ -19,17 +20,3 @@ {/each}
- - diff --git a/ui/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte index 8a70c4b..cacfc2d 100644 --- a/ui/routes/(app)/+layout.svelte +++ b/ui/routes/(app)/+layout.svelte @@ -126,63 +126,19 @@ {#if loading}

Loading…

{:else} -
+
-
+
{@render children?.()}
{/if} - - diff --git a/ui/routes/(app)/ch/[channel]/+page.svelte b/ui/routes/(app)/ch/[channel]/+page.svelte index d4e04fe..8eba709 100644 --- a/ui/routes/(app)/ch/[channel]/+page.svelte +++ b/ui/routes/(app)/ch/[channel]/+page.svelte @@ -67,24 +67,6 @@
-
+
- - diff --git a/ui/styles/active-channel.css b/ui/styles/active-channel.css new file mode 100644 index 0000000..6efc3e3 --- /dev/null +++ b/ui/styles/active-channel.css @@ -0,0 +1,3 @@ +.active-channel { + padding: 1rem; +} diff --git a/ui/styles/app-bar.css b/ui/styles/app-bar.css index 401a278..caa50ed 100644 --- a/ui/styles/app-bar.css +++ b/ui/styles/app-bar.css @@ -5,6 +5,7 @@ flex-direction: row; justify-content: space-between; align-items: stretch; + background-color: var(--colour-background); } .app-bar > * { diff --git a/ui/styles/app-layout.css b/ui/styles/app-layout.css new file mode 100644 index 0000000..ef1eb10 --- /dev/null +++ b/ui/styles/app-layout.css @@ -0,0 +1,56 @@ +/* TODO: generally remove literals from this file. */ + +#interface { + margin: unset; + display: grid; + grid-template: + 'side main' 1fr + / auto 1fr; + height: calc(100vh - var(--app-bar-height)); + + @media (width > 640px) { + --overlay: static; + --translate: 0; + } +} + +nav#sidebar { + grid-area: side; + inset: auto auto 0 0; + padding-right: 0.5rem; + position: var(--overlay, absolute); + transition: translate 300ms ease-out; + width: var(--nav-width); + height: 100vh; + z-index: 10; + + border-radius: 0 1.4rem 1.4rem 0; + + background-color: var(--colour-background-alt); + + @media (width > 640px) { + height: calc(100vh - var(--app-bar-height)); + } +} + +nav.list-nav { + height: calc(100vh - var(--input-row-height) - var(--interface-padding)); + overflow: auto; + + @media (width > 640px) { + height: calc(100vh - var(--app-bar-height) - var(--input-row-height) - var(--interface-padding)); + } +} + +main { + grid-area: main; + height: calc(100vh - var(--app-bar-height)); +} + +main textarea { + resize: none; +} + +nav[data-expanded='false'] { + translate: var(--translate, -100% 0); +} diff --git a/ui/styles/messages.css b/ui/styles/messages.css new file mode 100644 index 0000000..bd46baf --- /dev/null +++ b/ui/styles/messages.css @@ -0,0 +1,83 @@ +.message-run { + position: relative; + border-radius: 0.25rem; + border: 1px solid var(--colour-border); + padding: 0 0 0.5rem 0; + margin-bottom: 1rem; + box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.5); +} + +/* TODO: replace these with colour variables. */ +.own-message { + background-color: rgb(32, 42, 74); +} + +.own-message * { + color: rgb(198, 198, 198); +} + +.message-run > span { + /* Username */ + color: var(--colour-text); + background-color: rgb(67, 88, 156); +} + +.message { + padding: 0.5rem 0 0 0.5rem; +} + +.message:hover { + background-color: rgb(21, 28, 49); +} + +.message .handle { + --text-size: 0.5rem; + float: right; + line-height: var(--text-size); + font-size: var(--text-size); + top: -0.5rem; + position: relative; + padding: 0.25rem; + border-radius: 0.25rem; + display: none; + background-color: rgb(67, 88, 156); +} + +.message:hover .handle { + display: flex; +} + +.message .handle button { + line-height: 0.35rem; + background: none; + border: none; + cursor: pointer; +} + +.message-body { + overflow: auto; + max-width: 80vw; + + @media (width > 640px) { + /* 21rem is width of the nav bar in full-screen mode. */ + max-width: calc(90vw - 21rem); + } +} + +.message-body:empty:after { + content: '.'; + visibility: hidden; +} + +/* For rendered message bodies: */ +.message-body blockquote { + border-left: 0.25rem solid lightgrey; + margin-left: 0.5rem; + padding-left: 0.5rem; +} +.message-body pre { + border: 1px solid #312e81; + border-radius: 0.25rem; + background-color: #282555;; + padding: 0.25rem; +} diff --git a/ui/styles/sidebar.css b/ui/styles/sidebar.css index e512847..e9098f2 100644 --- a/ui/styles/sidebar.css +++ b/ui/styles/sidebar.css @@ -3,6 +3,10 @@ background-color: var(--colour-background-alt); } +.list-nav ul { + padding: 0.5rem; +} + .list-nav li { padding: 0.5rem; border-radius: 0.5rem; @@ -32,8 +36,15 @@ border: 1px solid var(--colour-border); z-index: 1; /* Just to make the focus-active border go over the following button. */ flex-grow: 1; + background-color: var(--colour-text); + color: var(--colour-background); } .create-channel button { border-radius: 0 0.5rem 0.5rem 0; + border: 1px solid var(--colour-border); + background-color: var(--colour-text); + color: var(--colour-background); } + +/* TODO: media-query stuff. Margin-left at a constant zero? */ diff --git a/ui/styles/textarea.css b/ui/styles/textarea.css new file mode 100644 index 0000000..72d727f --- /dev/null +++ b/ui/styles/textarea.css @@ -0,0 +1,38 @@ +/* Message input */ +.create-message form { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: stretch; +} + +.create-message textarea { + padding: 0.5rem; + border-radius: 0.5rem 0 0 0.5rem; + border: 1px solid var(--colour-border); + z-index: 1; /* Just to make the focus-active border go over the following button. */ + flex-grow: 1; + background-color: var(--colour-text); + color: var(--colour-background); +} + +.create-message button { + border-radius: 0 0.5rem 0.5rem 0; + border: 1px solid var(--colour-border); + background-color: var(--colour-text); + color: var(--colour-background); +} + +.active-channel { + overflow: auto; + flex-grow: 1; + /* TODO: make this all-app background */ + background-color: var(--colour-background); +} + +main { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; +} diff --git a/ui/styles/variables.css b/ui/styles/variables.css index e948c71..5ea4d74 100644 --- a/ui/styles/variables.css +++ b/ui/styles/variables.css @@ -8,11 +8,25 @@ --nav-width: 21rem; /* coloUrs */ - --colour-background: rgba(0, 0, 0, 0.25); - --colour-background-alt: rgba(0, 0, 0, 0.35); - --colour-border: rgba(0, 0, 0, 0.45); - --colour-text: rgb(240, 240, 240); - --colour-okay: #2a9d8f; - --colour-warn: #e9c46a; - --colour-error: #e76f51; + /* Really, we need: + * - Dark header background + * - Medium sidebar background + * - Light channel background + * - okay/warn/error + * - Border colours? + * - Text colour + * - Hover colour + * - Active colour + */ + --colour-background: #253031; + --colour-border: #192122; + + --colour-background-alt: #426A5A; + --colour-border-alt: #2E4A3E; + + --colour-text: #FFFFEA; + + --colour-okay: #6A994E; + --colour-warn: #EBC3BE; + --colour-error: #DE5F55; } -- cgit v1.2.3 From 58a349af98d2b0ea9744e1c5372334f0c826eb47 Mon Sep 17 00:00:00 2001 From: Kit La Touche Date: Sat, 4 Jan 2025 12:14:20 -0500 Subject: Update colour variables --- ui/styles/app-bar.css | 2 +- ui/styles/app-layout.css | 2 +- ui/styles/messages.css | 18 +++++++++++++----- ui/styles/sidebar.css | 20 ++++++++++---------- ui/styles/textarea.css | 14 +++++++------- ui/styles/variables.css | 49 ++++++++++++++++++++++++++++++------------------ 6 files changed, 63 insertions(+), 42 deletions(-) (limited to 'ui/styles/app-bar.css') diff --git a/ui/styles/app-bar.css b/ui/styles/app-bar.css index caa50ed..d34eb87 100644 --- a/ui/styles/app-bar.css +++ b/ui/styles/app-bar.css @@ -5,7 +5,7 @@ flex-direction: row; justify-content: space-between; align-items: stretch; - background-color: var(--colour-background); + background-color: var(--colour-header-bg); } .app-bar > * { diff --git a/ui/styles/app-layout.css b/ui/styles/app-layout.css index ef1eb10..53f003c 100644 --- a/ui/styles/app-layout.css +++ b/ui/styles/app-layout.css @@ -26,7 +26,7 @@ nav#sidebar { border-radius: 0 1.4rem 1.4rem 0; - background-color: var(--colour-background-alt); + background-color: var(--colour-navbar-bg); @media (width > 640px) { height: calc(100vh - var(--app-bar-height)); diff --git a/ui/styles/messages.css b/ui/styles/messages.css index bd46baf..ebb01c9 100644 --- a/ui/styles/messages.css +++ b/ui/styles/messages.css @@ -1,24 +1,32 @@ .message-run { position: relative; border-radius: 0.25rem; - border: 1px solid var(--colour-border); padding: 0 0 0.5rem 0; margin-bottom: 1rem; box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.5); } -/* TODO: replace these with colour variables. */ .own-message { - background-color: rgb(32, 42, 74); + background-color: var(--colour-message-run-self-bg); + border: 1px solid var(--colour-message-run-self-bg); } .own-message * { - color: rgb(198, 198, 198); + color: var(--colour-message-run-text); +} + +.other-message { + background-color: var(--colour-message-run-other-bg); + border: 1px solid var(--colour-message-run-other-bg); +} + +.other-message * { + color: var(--colour-message-run-text); } .message-run > span { /* Username */ - color: var(--colour-text); + color: var(--colour-message-run-text); background-color: rgb(67, 88, 156); } diff --git a/ui/styles/sidebar.css b/ui/styles/sidebar.css index e9098f2..7fe5ca0 100644 --- a/ui/styles/sidebar.css +++ b/ui/styles/sidebar.css @@ -1,6 +1,6 @@ /* Sidebar and channel selector */ #sidebar { - background-color: var(--colour-background-alt); + background-color: var(--colour-navbar-bg); } .list-nav ul { @@ -10,16 +10,16 @@ .list-nav li { padding: 0.5rem; border-radius: 0.5rem; - border: 1px solid var(--colour-border); + border: 1px solid var(--colour-navbar-bg); margin: 0.25rem; } .list-nav li.active { - background-color: var(--colour-okay); + background-color: var(--colour-navbar-bg); } .list-nav li:hover { - background-color: var(--colour-warn); + background-color: var(--colour-navbar-bg); } /* create channel form */ @@ -33,18 +33,18 @@ .create-channel input { padding: 0.5rem; border-radius: 0.5rem 0 0 0.5rem; - border: 1px solid var(--colour-border); + border: 1px solid var(--colour-input-bg); z-index: 1; /* Just to make the focus-active border go over the following button. */ flex-grow: 1; - background-color: var(--colour-text); - color: var(--colour-background); + background-color: var(--colour-input-bg); + color: var(--colour-input-text); } .create-channel button { border-radius: 0 0.5rem 0.5rem 0; - border: 1px solid var(--colour-border); - background-color: var(--colour-text); - color: var(--colour-background); + border: 1px solid var(--colour-input-bg); + background-color: var(--colour-input-bg); + color: var(--colour-input-text); } /* TODO: media-query stuff. Margin-left at a constant zero? */ diff --git a/ui/styles/textarea.css b/ui/styles/textarea.css index 72d727f..3a28d1b 100644 --- a/ui/styles/textarea.css +++ b/ui/styles/textarea.css @@ -9,25 +9,25 @@ .create-message textarea { padding: 0.5rem; border-radius: 0.5rem 0 0 0.5rem; - border: 1px solid var(--colour-border); + border: 1px solid var(--colour-input-bg); z-index: 1; /* Just to make the focus-active border go over the following button. */ flex-grow: 1; - background-color: var(--colour-text); - color: var(--colour-background); + background-color: var(--colour-input-bg); + color: var(--colour-input-text); } .create-message button { border-radius: 0 0.5rem 0.5rem 0; - border: 1px solid var(--colour-border); - background-color: var(--colour-text); - color: var(--colour-background); + border: 1px solid var(--colour-input-bg); + background-color: var(--colour-input-bg); + color: var(--colour-input-text); } .active-channel { overflow: auto; flex-grow: 1; /* TODO: make this all-app background */ - background-color: var(--colour-background); + background-color: var(--colour-active-channel-bg); } main { diff --git a/ui/styles/variables.css b/ui/styles/variables.css index 5ea4d74..0f5cd0e 100644 --- a/ui/styles/variables.css +++ b/ui/styles/variables.css @@ -8,25 +8,38 @@ --nav-width: 21rem; /* coloUrs */ - /* Really, we need: - * - Dark header background - * - Medium sidebar background - * - Light channel background - * - okay/warn/error - * - Border colours? - * - Text colour - * - Hover colour - * - Active colour - */ - --colour-background: #253031; - --colour-border: #192122; - - --colour-background-alt: #426A5A; - --colour-border-alt: #2E4A3E; - - --colour-text: #FFFFEA; - --colour-okay: #6A994E; --colour-warn: #EBC3BE; --colour-error: #DE5F55; + + /* Header BG (dark) */ + --colour-header-bg: rgb(66, 66, 66); + /* Header text (light) */ + --colour-header-text: rgb(245, 245, 245); + /* Navbar BG (medium) */ + --colour-navbar-bg: rgb(117, 117, 117); + /* Navbar text (light) */ + --colour-navbar-text: rgb(224, 224, 224); + /* Input BG (light) */ + --colour-input-bg: rgb(224, 224, 224); + /* Input text (dark) */ + --colour-input-text: rgb(66, 66, 66); + /* Active channel BG (light) */ + --colour-active-channel-bg: rgb(224, 224, 224); + /* MessageRun self BG (medium) */ + --colour-message-run-self-bg: rgb(117, 117, 117); + /* MessageRun other BG (medium) */ + --colour-message-run-other-bg: rgb(117, 117, 117); + /* Message hover BG (medium-dark) */ + --colour-message-hover-bg: rgb(170, 170, 170); + /* Message handle BG (medium-light) */ + --colour-message-handle-bg: rgb(224, 224, 224); + /* Message handle text */ + --colour-message-handle-text: rgb(170, 170, 170); + /* Navbar active BG */ + --colour-navbar-active-bg: rgb(117, 117, 117); + /* Navbar hover BG */ + --colour-navbar-hover-bg: rgb(170, 170, 170); + /* MessageRun text */ + --colour-message-run-text: rgb(170, 170, 170); } -- cgit v1.2.3 From 228dc4fa4a1bb1c2d5c3519984ea0931bc240280 Mon Sep 17 00:00:00 2001 From: Kit La Touche Date: Sat, 4 Jan 2025 22:14:02 -0500 Subject: Stylize app bar --- ui/styles/app-bar.css | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ui/styles/app-bar.css') diff --git a/ui/styles/app-bar.css b/ui/styles/app-bar.css index d34eb87..238e248 100644 --- a/ui/styles/app-bar.css +++ b/ui/styles/app-bar.css @@ -18,6 +18,15 @@ .app-bar .trail { flex-basis: 60px; + line-height: var(--app-bar-height); +} + +.app-bar > a { + line-height: var(--app-bar-height); +} + +.app-bar a { + text-decoration: none; } .app-bar button, -- cgit v1.2.3 From d858fc8105cfe6333671426fe0e43302bceace92 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Sat, 11 Jan 2025 13:33:59 -0500 Subject: Remove padding around the app-bar logo button, to stop safari from laying it out overlapping with the main area --- ui/styles/app-bar.css | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ui/styles/app-bar.css') diff --git a/ui/styles/app-bar.css b/ui/styles/app-bar.css index 238e248..dcc447a 100644 --- a/ui/styles/app-bar.css +++ b/ui/styles/app-bar.css @@ -16,6 +16,11 @@ flex-basis: 60px; } +.app-bar .lead button { + padding: 0; + border: 0; +} + .app-bar .trail { flex-basis: 60px; line-height: var(--app-bar-height); -- cgit v1.2.3