-
+
- + + @IconSolid("book") + Your Logbooks + + +
- + + @IconSolid("users-rectangle") + Your Nets + + +
- + + @IconSolid("people-group") + Your Clubs + + +
- + + @IconSolid("sliders") + Settings + + +
diff --git a/internal/handlers/navigation.go b/internal/handlers/navigation.go new file mode 100644 index 0000000..e984a0a --- /dev/null +++ b/internal/handlers/navigation.go @@ -0,0 +1,30 @@ +package handlers + +import ( + "net/http" + + "github.com/go-chi/chi" + "github.com/ryanfaerman/netctl/internal/middleware" + "github.com/ryanfaerman/netctl/internal/views" + "github.com/ryanfaerman/netctl/web/named" +) + +type Navigation struct{} + +func init() { + global.handlers = append(global.handlers, Navigation{}) +} + +func (h Navigation) Routes(r chi.Router) { + r.Use(middleware.HTMXOnly) + r.Get(named.Route("slide-over-show", "/-/slide-over/show"), h.SlideOverShow) + r.Get(named.Route("slide-over-hide", "/-/slide-over/hide"), h.SlideOverHide) +} + +func (h Navigation) SlideOverShow(w http.ResponseWriter, r *http.Request) { + views.SlideOver().Render(r.Context(), w) +} + +func (h Navigation) SlideOverHide(w http.ResponseWriter, r *http.Request) { + views.SlideOverTarget().Render(r.Context(), w) +} diff --git a/internal/handlers/static/custom.css b/internal/handlers/static/custom.css index 122cfd1..98e8f67 100644 --- a/internal/handlers/static/custom.css +++ b/internal/handlers/static/custom.css @@ -1009,3 +1009,110 @@ textarea { display: none; } +.slide-overlay { + height: 100%; + background-color: #000; + width: 100%; + position: fixed; + z-index: 200; + opacity: .1; +} + + +.htmx-swapping .slide-over { + /* background: red; */ + /* width: 0; */ +} + +@keyframes slide-over-from-right { + 0% { + transform: translateX(320px); + } + 100% { + transform: translateX(0px); + } +} +.slide-over { + position: fixed; + top: 0; + + background: var(--background-color); + z-index: 210; + height: 100%; + width: 300px; + + padding: 0.5rem 1rem; + + border-radius: 0.4rem; + animation: slide-over-from-right 100ms ease-in; +} + +.slide-over[data-slide-from="right"] { + right: 0; + border-left: 1px solid var(--border-color); + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} + +.slide-over header { + width: 100%; + height: fit-content; + + display: grid; + grid-template-columns: 3fr 1fr; + grid-template-rows: auto; + grid-template-areas: + "title close" + "subtitle ." ; + + + column-gap: 1rem; + margin-bottom: 1rem; +} + +.slide-over header .title { + grid-area: title; + font-size: 1.2em; + font-weight: bold; +} +.slide-over header .subtitle { + grid-area: subtitle; + font-size: 1.0em; + color: var(--text-color-softer); +} + +.slide-over header .close { + grid-area: close; + text-align: right; + cursor: pointer; + font-size: 1.3em; + color: var(--text-color-softer); +} + +.slide-over ul { + border-top: 1px solid var(--background-color-softer); + list-style: none; + margin-bottom: 0; + padding: 1rem 0; +} + +.slide-over ul a { + color: var(--text-color-softer); + text-decoration: none; +} + +.slide-over ul li { + padding: 0.75rem 0.5rem; + border-radius: 0.3em; + margin-bottom: 0; +} + +.slide-over ul li:hover { + background: var(--background-color-softer); +} + +.slide-over a i { + margin-left: 0.5rem; + margin-right: 0.5rem; + width: 1.5em; +} diff --git a/internal/views/navigation.templ b/internal/views/navigation.templ index 1c29659..4167379 100644 --- a/internal/views/navigation.templ +++ b/internal/views/navigation.templ @@ -96,7 +96,12 @@ templ (m Menu) NewAppBar() { @item.Item() }