Skip to content

Commit

Permalink
replace background image (grpc-bg.svg) with a simple gradient (#317)
Browse files Browse the repository at this point in the history
#316

> The background image (grpc-bg.svg) is significantly large in size
(1.7MB). When embedded into servers with limited bandwidth, it consumes
a significant portion of the available resources and results in slower
load times.
> 
> Please consider replacing the existing image with a simpler pattern or
opt for a plain color background.

Before:

<img width="735" alt="Screenshot 2024-04-27 at 11 29 56 AM"
src="https://github.com/fullstorydev/grpcui/assets/1919660/19d65eb2-38fa-4a42-a2ca-331911766c9d">

After:

<img width="732" alt="Screenshot 2024-04-27 at 11 31 33 AM"
src="https://github.com/fullstorydev/grpcui/assets/1919660/4e89e990-d635-4443-a6e2-1e4628494911">

Any feedback on the exact color choices is welcome.
CC: @lqs
  • Loading branch information
dragonsinth authored Apr 29, 2024
1 parent 11bfac0 commit a84a94c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/resources/standalone/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

const IndexTemplateName = "index-template.html"

//go:embed *.html *.css *.png *.js *.svg
//go:embed *.html *.css *.png *.js
var res embed.FS

func IndexTemplate() []byte {
Expand Down
1 change: 0 additions & 1 deletion internal/resources/standalone/grpc-bg.svg

This file was deleted.

2 changes: 1 addition & 1 deletion internal/resources/standalone/index-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
margin: 0;
padding: 32px 24px;
color: white;
background: #186064 url("grpc-bg.svg") no-repeat center/cover;
background: linear-gradient(to bottom right, #0C4348, #317178, #5F8C8C)
}

.heading h1 {
Expand Down
2 changes: 1 addition & 1 deletion standalone/standalone.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func Handler(ch grpcdynamic.Channel, target string, methods []*desc.MethodDescri

var mux http.ServeMux

// Add go-bindata resources bundled in standalone package TOC
// Add embedded resources bundled in standalone package TOC
for _, assetName := range standalone.AssetNames() {
// the index file will be handled separately
if assetName == standalone.IndexTemplateName {
Expand Down

0 comments on commit a84a94c

Please # to comment.