From 292c400dfbb640b24bfcb9ebde9234b2df0bd190 Mon Sep 17 00:00:00 2001 From: Ben Visness Date: Fri, 23 Apr 2021 23:27:45 -0500 Subject: [PATCH] Fix up landing page colors --- public/style.css | 48 ++++--- src/db/db.go | 11 +- src/rawdata/scss/_core.scss | 12 ++ src/rawdata/scss/_forum.scss | 44 ++---- src/rawdata/scss/_landing.scss | 5 + src/templates/src/include/post_list_item.html | 4 +- src/templates/src/index.html | 134 +++++++++--------- src/templates/src/layouts/base.html | 4 +- src/templates/src/project.css | 37 ++--- src/templates/templates.go | 29 ++-- src/website/landing.go | 60 ++++++-- 11 files changed, 220 insertions(+), 168 deletions(-) diff --git a/public/style.css b/public/style.css index 5b691bb..ed6248a 100644 --- a/public/style.css +++ b/public/style.css @@ -7438,6 +7438,15 @@ article code { .mw-site { max-width: 80rem; } +.mh-3 { + max-height: 4rem; } + +.mh-4 { + max-height: 8rem; } + +.mh-5 { + max-height: 16rem; } + .mh-100 { max-height: 100%; } @@ -8576,17 +8585,6 @@ input[type=submit] { border-bottom-color: transparent; } .thread .title:hover { border-bottom-color: initial; } - .thread.read { - color: #555; - color: var(--forum-thread-read-color); } - .thread.read td { - color: #555; - color: var(--forum-thread-read-color); } - .thread.read a { - color: #888; - color: var(--forum-thread-read-link-color); } - .thread.read .title { - font-weight: 500; } .forum .thread .info th { width: 50px; } @@ -8598,18 +8596,18 @@ input[type=submit] { overflow: hidden; background-color: #bbb; background-color: var(--dimmest-color); } - .thread .avatar-icon:not(.lite) { - left: 30px; - bottom: 10px; } - .thread .info .avatar-icon:not(.lite) { - bottom: 0px; - left: 0px; } - .feed .avatar-icon:not(.lite) { - left: -50px; - bottom: -10px; } - .project .box .avatar-icon:not(.lite) { - left: 0px; - bottom: -10px; } + +.read { + color: #555; + color: var(--forum-thread-read-color); } + .read td { + color: #555; + color: var(--forum-thread-read-color); } + .read a { + color: #888; + color: var(--forum-thread-read-link-color); } + .read .title { + font-weight: 500; } .goto { font-size: 200%; @@ -9220,6 +9218,10 @@ span.icon-rss::before { width: 10rem; height: 10rem; } } +.landing .excerpt-fade { + background-image: linear-gradient(to top, var(--content-background), rgba(0, 0, 0, 0)); + pointer-events: none; } + .star-btn { border-bottom-width: 2px; background-color: #fff; diff --git a/src/db/db.go b/src/db/db.go index c79a7e8..87f7edd 100644 --- a/src/db/db.go +++ b/src/db/db.go @@ -72,11 +72,18 @@ func (it *StructQueryIterator) Next() (interface{}, bool) { field = field.Elem() } + // Some actual values still come through as pointers (like net.IPNet). Dunno why. + // Regardless, we know it's not nil, so we can get at the contents. + valReflected := reflect.ValueOf(val) + if valReflected.Kind() == reflect.Ptr { + valReflected = valReflected.Elem() + } + switch field.Kind() { case reflect.Int: - field.SetInt(reflect.ValueOf(val).Int()) + field.SetInt(valReflected.Int()) default: - field.Set(reflect.ValueOf(val)) + field.Set(valReflected) } } diff --git a/src/rawdata/scss/_core.scss b/src/rawdata/scss/_core.scss index a968e26..d0daa3b 100644 --- a/src/rawdata/scss/_core.scss +++ b/src/rawdata/scss/_core.scss @@ -248,6 +248,18 @@ article code { max-width: 80rem; } +.mh-3 { + max-height: $height-3; +} + +.mh-4 { + max-height: $height-4; +} + +.mh-5 { + max-height: $height-5; +} + .mh-100 { max-height: 100%; } diff --git a/src/rawdata/scss/_forum.scss b/src/rawdata/scss/_forum.scss index 899daf9..20430cd 100644 --- a/src/rawdata/scss/_forum.scss +++ b/src/rawdata/scss/_forum.scss @@ -47,22 +47,6 @@ } } - &.read { - @include usevar('color', 'forum-thread-read-color'); - - td { - @include usevar('color', 'forum-thread-read-color'); - } - - a { - @include usevar('color', 'forum-thread-read-link-color'); - } - - .title { - font-weight: 500; - } - } - .forum & .info th { width: 50px; } @@ -75,27 +59,21 @@ border-radius: 100%; overflow: hidden; @include usevar(background-color, dimmest-color); +} - &:not(.lite) { - .thread & { - left: 30px; - bottom: 10px; - } +.read { + @include usevar('color', 'forum-thread-read-color'); - .thread .info & { - bottom: 0px; - left: 0px; - } + td { + @include usevar('color', 'forum-thread-read-color'); + } - .feed & { - left: -50px; - bottom: -10px; - } + a { + @include usevar('color', 'forum-thread-read-link-color'); + } - .project .box & { - left: 0px; - bottom: -10px; - } + .title { + font-weight: 500; } } diff --git a/src/rawdata/scss/_landing.scss b/src/rawdata/scss/_landing.scss index 7fd06a0..1961cad 100644 --- a/src/rawdata/scss/_landing.scss +++ b/src/rawdata/scss/_landing.scss @@ -83,4 +83,9 @@ height: 10rem; } } + + .excerpt-fade { + background-image: linear-gradient(to top, var(--content-background) , rgba(0, 0, 0, 0)); + pointer-events: none; + } } diff --git a/src/templates/src/include/post_list_item.html b/src/templates/src/include/post_list_item.html index 200ac4e..9da08d8 100644 --- a/src/templates/src/include/post_list_item.html +++ b/src/templates/src/include/post_list_item.html @@ -1,10 +1,10 @@ {{/* This template is intended to display a single post or thread in the context of a forum, the feed, or a similar layout. -It should be called with PostListItemData. +It should be called with PostListItem. */}} -
+