From 600cd7bf9bd002e6024da55e7b5bc29c797720c1 Mon Sep 17 00:00:00 2001 From: jholdstock Date: Wed, 17 Jun 2020 11:59:48 +0100 Subject: [PATCH] Use modern logo and colours. --- config.go | 3 +++ harness.sh | 1 + main.go | 1 + webapi/homepage.go | 2 ++ webapi/public/css/fonts.css | 2 +- webapi/public/css/vspd.css | 19 ++++++++++-------- webapi/public/images/decred-logo.svg | 1 - webapi/templates/header.html | 30 ++++++++++++++++++++++------ webapi/webapi.go | 3 ++- 9 files changed, 45 insertions(+), 17 deletions(-) delete mode 100644 webapi/public/images/decred-logo.svg diff --git a/config.go b/config.go index 0322ad1..7cbce15 100644 --- a/config.go +++ b/config.go @@ -32,6 +32,7 @@ var ( defaultWebServerDebug = false defaultBackupInterval = time.Minute * 3 defaultVspClosed = false + defaultDesignation = "Voting Service Provider" ) // config defines the configuration options for the VSP. @@ -53,6 +54,7 @@ type config struct { BackupInterval time.Duration `long:"backupinterval" ini-name:"backupinterval" description:"Time period between automatic database backups. Valid time units are {s,m,h}. Minimum 30 seconds."` VspClosed bool `long:"vspclosed" ini-name:"vspclosed" description:"Closed prevents the VSP from accepting new tickets."` AdminPass string `long:"adminpass" ini-name:"adminpass" description:"Password for accessing admin page."` + Designation string `long:"designation" ini-name:"designation" description:"Short name for the VSP. Customizes the logo in the top toolbar."` // The following flags should be set on CLI only, not via config file. FeeXPub string `long:"feexpub" no-ini:"true" description:"Cold wallet xpub used for collecting fees. Should be provided once to initialize a vspd database."` @@ -164,6 +166,7 @@ func loadConfig() (*config, error) { WebServerDebug: defaultWebServerDebug, BackupInterval: defaultBackupInterval, VspClosed: defaultVspClosed, + Designation: defaultDesignation, } // Pre-parse the command line options to see if an alternative config diff --git a/harness.sh b/harness.sh index b2f478d..a0bbfe1 100755 --- a/harness.sh +++ b/harness.sh @@ -126,6 +126,7 @@ supportemail = example@test.com backupinterval = 3m0s vspclosed = false adminpass=12345 +designation = harness EOF tmux new-window -t $TMUX_SESSION -n "vspd" diff --git a/main.go b/main.go index 26280be..47b40c5 100644 --- a/main.go +++ b/main.go @@ -75,6 +75,7 @@ func run(ctx context.Context) error { VspClosed: cfg.VspClosed, AdminPass: cfg.AdminPass, Debug: cfg.WebServerDebug, + Designation: cfg.Designation, } err = webapi.Start(ctx, shutdownRequestChannel, &shutdownWg, cfg.Listen, db, dcrd, wallets, apiCfg) diff --git a/webapi/homepage.go b/webapi/homepage.go index cbe5854..926e851 100644 --- a/webapi/homepage.go +++ b/webapi/homepage.go @@ -20,6 +20,7 @@ type vspStats struct { SupportEmail string VspClosed bool Debug bool + Designation string } var statsMtx sync.RWMutex @@ -51,6 +52,7 @@ func updateVSPStats(db *database.VspDatabase, cfg Config) error { SupportEmail: cfg.SupportEmail, VspClosed: cfg.VspClosed, Debug: cfg.Debug, + Designation: cfg.Designation, } return nil diff --git a/webapi/public/css/fonts.css b/webapi/public/css/fonts.css index ae2c71c..8a28ff9 100644 --- a/webapi/public/css/fonts.css +++ b/webapi/public/css/fonts.css @@ -57,7 +57,7 @@ html, body { font-family: "vspd", "Verdana", "sans-serif" !important; } -pre, code { +pre, code, .code { /* use !important to prevent issues with browser extensions that change fonts */ font-family: "vspd-code", "Courier New", "monospace" !important; } diff --git a/webapi/public/css/vspd.css b/webapi/public/css/vspd.css index ecc3f04..306e583 100644 --- a/webapi/public/css/vspd.css +++ b/webapi/public/css/vspd.css @@ -1,10 +1,17 @@ body { - background-color: #091440; - color: white; + background-color: #F3F5F6; + color: #3D5873; } -.navbar-brand img { - height: 70px; +.logo--logo { + padding-right: 5px; + border-right: 0.3px solid #091440; +} +.logo--text { + padding: 0 5px; + font-size: 15px; + line-height: 1; + color: #091440; } th { @@ -15,7 +22,3 @@ td { font-family: "vspd-code"; word-break: break-word; } - -.code { - font-family: "vspd-code"; -} diff --git a/webapi/public/images/decred-logo.svg b/webapi/public/images/decred-logo.svg deleted file mode 100644 index e5bc1de..0000000 --- a/webapi/public/images/decred-logo.svg +++ /dev/null @@ -1 +0,0 @@ -transparent background - primary - negative - gardient \ No newline at end of file diff --git a/webapi/templates/header.html b/webapi/templates/header.html index 31abad4..46836ed 100644 --- a/webapi/templates/header.html +++ b/webapi/templates/header.html @@ -2,10 +2,10 @@ - + - vspd + Decred VSP - {{ .VspStats.Designation }} @@ -42,9 +42,25 @@ -