Skip to content

Commit

Permalink
Revised logo and custom fonts on the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Oct 5, 2022
1 parent 44c12fb commit 540670d
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 114 deletions.
13 changes: 12 additions & 1 deletion modules/analyze/html/adalanche.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@
--secondary-color: var(--indigo-color);
}

@font-face {
font-family: Oswald;
src: url(/external/Oswald-VariableFont_wght.ttf);
}

body {
font-family: Oswald;
font-variant: normal;
overflow: hidden;
z-index: -2;
z-index: -2;
}

button, input, optgroup, select, textarea {
font-family: Oswald;
}

.no-wrap {
Expand Down
Binary file not shown.
61 changes: 17 additions & 44 deletions modules/analyze/html/icons/adalanche-logo-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 18 additions & 43 deletions modules/analyze/html/icons/adalanche-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 3 additions & 26 deletions modules/analyze/webservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@ import (
"io/ioutil"
"net/http"
"os"
"path"
"text/template"

"github.com/absfs/gofs"
"github.com/absfs/osfs"
"github.com/gorilla/mux"
jsoniter "github.com/json-iterator/go"
"github.com/lkarlslund/adalanche/modules/engine"
"github.com/lkarlslund/adalanche/modules/ui"
"github.com/pkg/errors"
)

//go:embed html/*
Expand All @@ -42,15 +38,6 @@ func (ufs UnionFS) Open(filename string) (fs.File, error) {
return nil, os.ErrNotExist
}

type AddprefixFS struct {
Prefix string
FS fs.FS
}

func (apfs AddprefixFS) Open(filename string) (fs.File, error) {
return apfs.FS.Open(path.Join(apfs.Prefix, filename))
}

type handlerfunc func(*engine.Objects, http.ResponseWriter, *http.Request)

type webservice struct {
Expand All @@ -69,7 +56,8 @@ func NewWebservice() *webservice {
Router: mux.NewRouter(),
}

ws.AddFS(http.FS(AddprefixFS{"html/", embeddedassets}))
htmlFs, _ := fs.Sub(embeddedassets, "html")
ws.AddFS(http.FS(htmlFs))

// Add stock functions
analysisfuncs(ws)
Expand Down Expand Up @@ -99,18 +87,7 @@ func (w *webservice) Start(bind string, objs *engine.Objects, localhtml []string
if stat, err := os.Stat(html); err == nil && stat.IsDir() {
// Use local files if they exist
ui.Info().Msgf("Adding local HTML folder %v", html)
if osf, err := osfs.NewFS(); err == nil {
err = osf.Chdir(html)
if err != nil {
return errors.Wrap(err, "")
}

overrideassets, err := gofs.NewFs(osf)
if err != nil {
return errors.Wrap(err, "")
}
w.AddFS(http.FS(overrideassets))
}
w.AddFS(http.FS(os.DirFS(html)))
} else {
ui.Fatal().Msgf("Could not add local HTML folder %v, failure: %v", html, err)
}
Expand Down

0 comments on commit 540670d

Please sign in to comment.