From 2f6fd8843421edc9c8bbfc259c7880f1be3d123f Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Mon, 25 Aug 2025 14:10:19 -0400 Subject: [PATCH] More complete UI prototype laid out and ready to get working. --- api/handlers.go | 2 + pages/login/index.html | 2 +- pages/register/index.html | 2 +- ssgod.toml | 2 +- static/icons/arrow-big-up.svg | 1 + static/icons/bookmark.svg | 1 + static/icons/heart.svg | 1 + static/icons/log-in.svg | 1 + static/icons/log-out.svg | 1 + static/icons/message-square.svg | 1 + static/icons/refresh-cw.svg | 1 + static/icons/reply.svg | 1 + static/icons/rss.svg | 1 + static/icons/user-plus.svg | 1 + static/input_style.css | 19 ++++++--- static/style.css | 70 ++++++++++++++++-------------- views/feed.html | 49 ++++++++++++++++----- views/layouts/main.html | 75 ++++++++++++++++++++++++++------- views/profile.html | 3 ++ views/settings.html | 3 ++ 20 files changed, 172 insertions(+), 65 deletions(-) create mode 100644 views/profile.html create mode 100644 views/settings.html diff --git a/api/handlers.go b/api/handlers.go index 01870df..2ce66de 100644 --- a/api/handlers.go +++ b/api/handlers.go @@ -80,6 +80,8 @@ func Setup(app *fiber.App) { app.Get("/feed/", Page("feed")) app.Get("/post/view/:id/", Page("post/view")) app.Get("/post/new/", Page("post/new")) + app.Get("/settings/", Page("settings")) + app.Get("/u/:user_id", Page("profile")) } func Shutdown() { diff --git a/pages/login/index.html b/pages/login/index.html index 5509c18..b4e4437 100644 --- a/pages/login/index.html +++ b/pages/login/index.html @@ -1,4 +1,4 @@ -
+

Login

diff --git a/pages/register/index.html b/pages/register/index.html index 6f4c67b..5bc37ab 100644 --- a/pages/register/index.html +++ b/pages/register/index.html @@ -1,4 +1,4 @@ -
+

Register

diff --git a/ssgod.toml b/ssgod.toml index 71a1a2c..9967d27 100644 --- a/ssgod.toml +++ b/ssgod.toml @@ -1,5 +1,5 @@ views = "pages" -layout = "pages/layouts/main.html" +layout = "views/layouts/main.html" target = "public" watch_delay = "500ms" sync_dir = "static" diff --git a/static/icons/arrow-big-up.svg b/static/icons/arrow-big-up.svg index 9464eae..c7f7865 100644 --- a/static/icons/arrow-big-up.svg +++ b/static/icons/arrow-big-up.svg @@ -8,6 +8,7 @@ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" + id="img" > diff --git a/static/icons/bookmark.svg b/static/icons/bookmark.svg index 6d6a7c0..d38d42d 100644 --- a/static/icons/bookmark.svg +++ b/static/icons/bookmark.svg @@ -8,6 +8,7 @@ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" + id="img" > diff --git a/static/icons/heart.svg b/static/icons/heart.svg index e0f5330..29add65 100644 --- a/static/icons/heart.svg +++ b/static/icons/heart.svg @@ -8,6 +8,7 @@ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" + id="img" > diff --git a/static/icons/log-in.svg b/static/icons/log-in.svg index bffc91e..af19cf8 100644 --- a/static/icons/log-in.svg +++ b/static/icons/log-in.svg @@ -8,6 +8,7 @@ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" + id="img" > diff --git a/static/icons/log-out.svg b/static/icons/log-out.svg index 4abe340..c6e2f9e 100644 --- a/static/icons/log-out.svg +++ b/static/icons/log-out.svg @@ -8,6 +8,7 @@ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" + id="img" > diff --git a/static/icons/message-square.svg b/static/icons/message-square.svg index be1caf3..5cd9c73 100644 --- a/static/icons/message-square.svg +++ b/static/icons/message-square.svg @@ -8,6 +8,7 @@ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" + id="img" > diff --git a/static/icons/refresh-cw.svg b/static/icons/refresh-cw.svg index babf4fa..a08d94d 100644 --- a/static/icons/refresh-cw.svg +++ b/static/icons/refresh-cw.svg @@ -8,6 +8,7 @@ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" + id="img" > diff --git a/static/icons/reply.svg b/static/icons/reply.svg index 335bb63..a9ee123 100644 --- a/static/icons/reply.svg +++ b/static/icons/reply.svg @@ -8,6 +8,7 @@ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" + id="img" > diff --git a/static/icons/rss.svg b/static/icons/rss.svg index 3b87036..7cec310 100644 --- a/static/icons/rss.svg +++ b/static/icons/rss.svg @@ -8,6 +8,7 @@ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" + id="img" > diff --git a/static/icons/user-plus.svg b/static/icons/user-plus.svg index 32b8435..c2cd7fa 100644 --- a/static/icons/user-plus.svg +++ b/static/icons/user-plus.svg @@ -8,6 +8,7 @@ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" + id="img" > diff --git a/static/input_style.css b/static/input_style.css index d1fbdc9..1864eca 100644 --- a/static/input_style.css +++ b/static/input_style.css @@ -13,8 +13,20 @@ header { @apply flex flex-col justify-stretch; } +footer { + @apply bg-gray-950 text-gray-50 text-lg flex p-1; +} + +@utility sticky-bottom { + @apply w-full sticky bottom-0 left-0; +} + nav { - @apply flex bg-gray-950 *:text-gray-50 *:flex-1 *:text-xl p-6; + @apply flex justify-center items-center bg-gray-950 *:text-gray-50 *:flex-1 *:text-xl w-full justify-evenly; +} + +nav > a { + @apply flex justify-center items-center pt-1; } code { @@ -23,16 +35,13 @@ code { } pre { - @apply bg-gray-950 rounded-lg border-1 border-gray-300 mb-4 p-1; + @apply bg-gray-950 border-1 border-gray-600 mb-4 p-1; } pre > code { @apply !bg-gray-950 p-1; } -footer { - @apply bg-gray-950 text-gray-50 text-lg flex p-6; -} h1 { @apply text-6xl mb-2 mt-4; diff --git a/static/style.css b/static/style.css index a5ad48c..97e25e3 100644 --- a/static/style.css +++ b/static/style.css @@ -217,6 +217,12 @@ .visible { visibility: visible; } + .sticky-bottom { + position: sticky; + bottom: calc(var(--spacing) * 0); + left: calc(var(--spacing) * 0); + width: 100%; + } .static { position: static; } @@ -235,12 +241,12 @@ .mt-2 { margin-top: calc(var(--spacing) * 2); } + .mt-4 { + margin-top: calc(var(--spacing) * 4); + } .\!mb-0 { margin-bottom: calc(var(--spacing) * 0) !important; } - .\!mb-2 { - margin-bottom: calc(var(--spacing) * 2) !important; - } .mb-2 { margin-bottom: calc(var(--spacing) * 2); } @@ -287,9 +293,6 @@ .h-15 { height: calc(var(--spacing) * 15); } - .h-20 { - height: calc(var(--spacing) * 20); - } .max-h-10 { max-height: calc(var(--spacing) * 10); } @@ -317,9 +320,6 @@ .max-w-20 { max-width: calc(var(--spacing) * 20); } - .min-w-md { - min-width: var(--container-md); - } .flex-1 { flex: 1; } @@ -386,9 +386,6 @@ .gap-10 { gap: calc(var(--spacing) * 10); } - .\!rounded-full { - border-radius: calc(infinity * 1px) !important; - } .rounded-full { border-radius: calc(infinity * 1px); } @@ -488,15 +485,15 @@ .bg-gray-400 { background-color: var(--color-gray-400); } - .bg-gray-500 { - background-color: var(--color-gray-500); - } .bg-gray-600 { background-color: var(--color-gray-600); } .bg-gray-700 { background-color: var(--color-gray-700); } + .bg-gray-800 { + background-color: var(--color-gray-800); + } .bg-green-400\! { background-color: var(--color-green-400) !important; } @@ -509,9 +506,6 @@ .\!p-4 { padding: calc(var(--spacing) * 4) !important; } - .p-0 { - padding: calc(var(--spacing) * 0); - } .p-0\! { padding: calc(var(--spacing) * 0) !important; } @@ -524,12 +518,18 @@ .p-4 { padding: calc(var(--spacing) * 4); } - .p-6 { - padding: calc(var(--spacing) * 6); + .\!pt-0 { + padding-top: calc(var(--spacing) * 0) !important; + } + .\!pt-1 { + padding-top: calc(var(--spacing) * 1) !important; } .pt-4 { padding-top: calc(var(--spacing) * 4); } + .pt-6 { + padding-top: calc(var(--spacing) * 6); + } .pb-0\! { padding-bottom: calc(var(--spacing) * 0) !important; } @@ -691,10 +691,21 @@ header { flex-direction: column; justify-content: stretch; } +footer { + display: flex; + background-color: var(--color-gray-950); + padding: calc(var(--spacing) * 1); + font-size: var(--text-lg); + line-height: var(--tw-leading, var(--text-lg--line-height)); + color: var(--color-gray-50); +} nav { display: flex; + width: 100%; + align-items: center; + justify-content: center; + justify-content: space-evenly; background-color: var(--color-gray-950); - padding: calc(var(--spacing) * 6); :is(& > *) { flex: 1; } @@ -706,6 +717,12 @@ nav { color: var(--color-gray-50); } } +nav > a { + display: flex; + align-items: center; + justify-content: center; + padding-top: calc(var(--spacing) * 1); +} code { speak-as: literal-punctuation; display: inline-block; @@ -714,10 +731,9 @@ code { } pre { margin-bottom: calc(var(--spacing) * 4); - border-radius: var(--radius-lg); border-style: var(--tw-border-style); border-width: 1px; - border-color: var(--color-gray-300); + border-color: var(--color-gray-600); background-color: var(--color-gray-950); padding: calc(var(--spacing) * 1); } @@ -725,14 +741,6 @@ pre > code { background-color: var(--color-gray-950) !important; padding: calc(var(--spacing) * 1); } -footer { - display: flex; - background-color: var(--color-gray-950); - padding: calc(var(--spacing) * 6); - font-size: var(--text-lg); - line-height: var(--tw-leading, var(--text-lg--line-height)); - color: var(--color-gray-50); -} h1 { margin-top: calc(var(--spacing) * 4); margin-bottom: calc(var(--spacing) * 2); diff --git a/views/feed.html b/views/feed.html index 6354d30..077441f 100644 --- a/views/feed.html +++ b/views/feed.html @@ -1,3 +1,33 @@ +{{define "post-action-bar"}} + + + + + + + + + + + + + + +{{end}} + + diff --git a/views/layouts/main.html b/views/layouts/main.html index 7e4ca50..caec067 100644 --- a/views/layouts/main.html +++ b/views/layouts/main.html @@ -12,7 +12,7 @@ ZedShaw.games - +
@@ -33,17 +46,49 @@ {{embed}} -