feat: add PWA support and mobile-responsive layouts
- Add web app manifest, maskable/apple-touch icons, and a production-only service worker that caches the app shell for offline start - Improve mobile UX: responsive breakpoints from ~320px, 44px touch targets, safe-area insets, dvh heights, 16px inputs to avoid iOS zoom - Serve .webmanifest with correct content type in the Go static handler - Document PWA behavior and mobile features in the README
This commit is contained in:
parent
f220d96e3b
commit
cbc03c56bf
18 changed files with 277 additions and 9 deletions
|
|
@ -78,6 +78,9 @@ func (s *Server) Router() http.Handler {
|
|||
static := s.Cfg.StaticDir
|
||||
r.Get("/*", func(w http.ResponseWriter, req *http.Request) {
|
||||
p := filepath.Join(static, filepath.Clean(req.URL.Path))
|
||||
if strings.HasSuffix(p, ".webmanifest") {
|
||||
w.Header().Set("Content-Type", "application/manifest+json")
|
||||
}
|
||||
if st, err := os.Stat(p); err == nil && !st.IsDir() {
|
||||
http.ServeFile(w, req, p)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue