From a655fe96bc709f49c45de0532c3f9355f1fbf17b Mon Sep 17 00:00:00 2001 From: Ben Visness Date: Sat, 28 Aug 2021 07:14:49 -0500 Subject: [PATCH] Fix up remaining project colors --- public/style.css | 136 +++++++++--------- .../2021-08-28T121228Z_ChangeHMNColors.go | 52 +++++++ src/rawdata/scss/_core.scss | 7 +- src/templates/src/include/header.html | 4 +- src/templates/src/landing.html | 2 - src/templates/src/project.css | 100 +++++++------ 6 files changed, 180 insertions(+), 121 deletions(-) create mode 100644 src/migration/migrations/2021-08-28T121228Z_ChangeHMNColors.go diff --git a/public/style.css b/public/style.css index 0a44db6d..17abea0f 100644 --- a/public/style.css +++ b/public/style.css @@ -7595,31 +7595,31 @@ article code { margin-right: auto; margin-left: auto; } -header { - border-bottom: 2px solid #333; } - header .menu-bar { - width: 100%; - z-index: 10; } - header .menu-bar .hmdev-logo { - background-image: url("/public/logo_nounder.svg"); } - header .menu-bar .hmdev-logo .underscore { - background-image: url("/public/logo_underscore.svg"); } - header .menu-bar .items a { - font-weight: bold; } - header .menu-bar .items a.patreon { - float: right; - height: 30px; - padding-top: 18px; - display: inline-block; } - header .menu-bar .items a h1 { - display: inline; } - header .menu-bar .hmdev-logo { - width: 100%; } - @media screen and (min-width: 30em) { - header .menu-bar .hmdev-logo { - width: 11.25rem; } } - header .menu-bar .hmdev-logo.project { - width: 70px; } +header .menu-bar { + width: 100%; + z-index: 10; } + header .menu-bar .hmdev-logo { + background-image: url("/public/logo_nounder.svg"); } + header .menu-bar .hmdev-logo.project { + background-image: url("/public/logo_net.svg"); } + header .menu-bar .hmdev-logo .underscore { + background-image: url("/public/logo_underscore.svg"); } + header .menu-bar .items a { + font-weight: bold; } + header .menu-bar .items a.patreon { + float: right; + height: 30px; + padding-top: 18px; + display: inline-block; } + header .menu-bar .items a h1 { + display: inline; } + header .menu-bar .hmdev-logo { + width: 100%; } + @media screen and (min-width: 30em) { + header .menu-bar .hmdev-logo { + width: 11.25rem; } } + header .menu-bar .hmdev-logo.project { + width: 70px; } @keyframes logo-blink { from { @@ -7632,48 +7632,50 @@ header { opacity: 0.0; } to { opacity: 1.0; } } - header .menu-bar .logo { - height: 3.75rem; - background-color: #333; - margin: 0px; - padding: 0px; } - header .menu-bar .underscore { - width: 100%; - height: 100%; - animation: logo-blink 1s infinite alternate; - -webkit-animation: logo-blink 1s infinite alternate ease-in-out; } - header .menu-bar .logo, header .menu-bar .underscore { - background-size: 8.75rem; - background-repeat: no-repeat; - background-position: center center; } - header .user-options { - position: relative; } - header .login, header .register { - text-align: center; } - header #login-popup { - background-color: #fbfbfb; - background-color: var(--login-popup-background); - color: black; - color: var(--fg-font-color); - border-width: 1px; - border-style: dashed; - visibility: hidden; - position: absolute; - z-index: 12; - margin-top: 10px; - right: 0px; - top: 20px; - width: 290px; - max-height: 0px; - overflow: hidden; - opacity: 0; - transition: all 0.2s; } - header #login-popup.open { - max-height: 170px; - opacity: 1; - visibility: visible; } - header #login-popup label { - padding-right: 10px; } + header .menu-bar .logo { + height: 3.75rem; + margin: 0px; + padding: 0px; } + header .menu-bar .underscore { + width: 100%; + height: 100%; + animation: logo-blink 1s infinite alternate; + -webkit-animation: logo-blink 1s infinite alternate ease-in-out; } + header .menu-bar .logo, header .menu-bar .underscore { + background-size: 8.75rem; + background-repeat: no-repeat; + background-position: center center; } + +header .user-options { + position: relative; } + +header .login, header .register { + text-align: center; } + +header #login-popup { + background-color: #fbfbfb; + background-color: var(--login-popup-background); + color: black; + color: var(--fg-font-color); + border-width: 1px; + border-style: dashed; + visibility: hidden; + position: absolute; + z-index: 12; + margin-top: 10px; + right: 0px; + top: 20px; + width: 290px; + max-height: 0px; + overflow: hidden; + opacity: 0; + transition: all 0.2s; } + header #login-popup.open { + max-height: 170px; + opacity: 1; + visibility: visible; } + header #login-popup label { + padding-right: 10px; } @media screen and (min-width: 30em) { footer .list li:not(:last-child)::after { diff --git a/src/migration/migrations/2021-08-28T121228Z_ChangeHMNColors.go b/src/migration/migrations/2021-08-28T121228Z_ChangeHMNColors.go new file mode 100644 index 00000000..f3d54f6b --- /dev/null +++ b/src/migration/migrations/2021-08-28T121228Z_ChangeHMNColors.go @@ -0,0 +1,52 @@ +package migrations + +import ( + "context" + "time" + + "git.handmade.network/hmn/hmn/src/migration/types" + "git.handmade.network/hmn/hmn/src/oops" + "github.com/jackc/pgx/v4" +) + +func init() { + registerMigration(ChangeHMNColors{}) +} + +type ChangeHMNColors struct{} + +func (m ChangeHMNColors) Version() types.MigrationVersion { + return types.MigrationVersion(time.Date(2021, 8, 28, 12, 12, 28, 0, time.UTC)) +} + +func (m ChangeHMNColors) Name() string { + return "ChangeHMNColors" +} + +func (m ChangeHMNColors) Description() string { + return "Change the colors for the HMN project" +} + +func (m ChangeHMNColors) Up(ctx context.Context, tx pgx.Tx) error { + tag, err := tx.Exec(ctx, ` + UPDATE handmade_project + SET + color_1 = 'ab4c47', + color_2 = 'a5467d' + WHERE + slug = 'hmn' + `) + if err != nil { + return oops.New(err, "failed to update HMN colors") + } + + if tag.RowsAffected() != 1 { + return oops.New(nil, "was supposed to update only HMN, but updated %d projects instead", tag.RowsAffected()) + } + + return nil +} + +func (m ChangeHMNColors) Down(ctx context.Context, tx pgx.Tx) error { + panic("Implement me") +} diff --git a/src/rawdata/scss/_core.scss b/src/rawdata/scss/_core.scss index 347d0e02..1aaa3411 100644 --- a/src/rawdata/scss/_core.scss +++ b/src/rawdata/scss/_core.scss @@ -436,8 +436,6 @@ article code { } header { - border-bottom: 2px solid #333; - .menu-bar { width: 100%; z-index: 10; @@ -445,6 +443,10 @@ header { .hmdev-logo { background-image: url("/public/logo_nounder.svg"); + &.project { + background-image:url("/public/logo_net.svg"); + } + .underscore { background-image: url("/public/logo_underscore.svg"); } @@ -511,7 +513,6 @@ header { .logo { height: px2rem(60px); - background-color: #333; margin: 0px; padding: 0px; } diff --git a/src/templates/src/include/header.html b/src/templates/src/include/header.html index 016cbc93..0f4805bc 100644 --- a/src/templates/src/include/header.html +++ b/src/templates/src/include/header.html @@ -1,4 +1,4 @@ -
+
{{ if .User }} {{ if .User.IsStaff }} @@ -33,7 +33,7 @@