fix(web): fit every page to phone widths
4 files changed, +18 −8
- Dockerfile modified +5 −2
- deploy/compose.yaml modified +5 −1
- forge/extra.go modified +2 −2
- web/static/style.css modified +6 −3
Dockerfile modified
| @@ -6,10 +6,13 @@ COPY . . | ||
| 6 | 6 | RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /gitpocket . |
| 7 | 7 | |
| 8 | 8 | FROM alpine:3.22 |
| 9 | -RUN apk add --no-cache git gnupg openssh-keygen ca-certificates | |
| 9 | +ARG UID=65532 GID=65532 | |
| 10 | +RUN apk add --no-cache git gnupg openssh-keygen ca-certificates && \ | |
| 11 | + (getent group "$GID" || addgroup -g "$GID" git) && \ | |
| 12 | + adduser -D -H -h /srv/gitpocket -s /sbin/nologin -u "$UID" -G "$(getent group "$GID" | cut -d: -f1)" git | |
| 10 | 13 | COPY --from=build /gitpocket /usr/local/bin/gitpocket |
| 11 | 14 | ENV HOME=/tmp GOMEMLIMIT=192MiB |
| 12 | -USER 65532:65532 | |
| 15 | +USER $UID:$GID | |
| 13 | 16 | EXPOSE 3200 |
| 14 | 17 | ENTRYPOINT ["/usr/local/bin/gitpocket", "-root", "/srv/gitpocket"] |
| 15 | 18 | CMD ["serve", "-listen", ":3200"] |
deploy/compose.yaml modified
| @@ -2,7 +2,11 @@ name: gitpocket | ||
| 2 | 2 | |
| 3 | 3 | services: |
| 4 | 4 | gitpocket: |
| 5 | - build: .. | |
| 5 | + build: | |
| 6 | + context: .. | |
| 7 | + args: | |
| 8 | + UID: "${GITPOCKET_UID:?set GITPOCKET_UID}" | |
| 9 | + GID: "${GITPOCKET_GID:?set GITPOCKET_GID}" | |
| 6 | 10 | image: gitpocket |
| 7 | 11 | container_name: gitpocket |
| 8 | 12 | command: ["serve", "-listen", ":3200", "-host", "${GITPOCKET_HOST:?set GITPOCKET_HOST}", "-proxy", "172.31.255.1/32"] |
forge/extra.go modified
| @@ -604,7 +604,7 @@ func (s *Server) activity(owner User, year int) heatView { | ||
| 604 | 604 | view.Total += n |
| 605 | 605 | } |
| 606 | 606 | var b strings.Builder |
| 607 | - fmt.Fprintf(&b, `<div class="heat" style="--weeks:%d"><div class="months">`, weeks) | |
| 607 | + fmt.Fprintf(&b, `<div class="heatwrap"><div class="heat" style="--weeks:%d"><div class="months">`, weeks) | |
| 608 | 608 | lastMonth := -1 |
| 609 | 609 | for w := 0; w < weeks; w++ { |
| 610 | 610 | d := start.AddDate(0, 0, 7*w) |
| @@ -643,7 +643,7 @@ func (s *Server) activity(owner User, year int) heatView { | ||
| 643 | 643 | } |
| 644 | 644 | fmt.Fprintf(&b, `<span class="c h%d%s" data-tip="%s" aria-label="%s" tabindex="0"></span>`, level, edge, tip, tip) |
| 645 | 645 | } |
| 646 | - b.WriteString(`</div></div>`) | |
| 646 | + b.WriteString(`</div></div></div>`) | |
| 647 | 647 | view.Grid = template.HTML(b.String()) |
| 648 | 648 | return view |
| 649 | 649 | } |
web/static/style.css modified
| @@ -44,7 +44,8 @@ nav.subtabs a:hover,nav.tabs a:hover{text-decoration:none;color:var(--fg)} | ||
| 44 | 44 | .repohead{margin-top:-1rem} |
| 45 | 45 | .repohead h2{padding:.4rem 0 .3rem;font-size:1.9rem} |
| 46 | 46 | .tabbar{background:var(--bar)} |
| 47 | -nav.tabs{display:flex} | |
| 47 | +nav.tabs{display:flex;overflow-x:auto;scrollbar-width:none} | |
| 48 | +nav.tabs a{white-space:nowrap} | |
| 48 | 49 | nav.tabs a{padding:.25rem .9rem} |
| 49 | 50 | nav.tabs a.active{background:var(--bg);color:var(--fg)} |
| 50 | 51 | .repohead .desc{margin:0 0 .4rem;color:var(--muted)} |
| @@ -120,7 +121,8 @@ dl.meta dd{margin:0;overflow-wrap:anywhere} | ||
| 120 | 121 | .readme code,.readme pre{font-size:13.5px} |
| 121 | 122 | .readme p{margin:.6rem 0} |
| 122 | 123 | .readme img{max-width:100%} |
| 123 | -.readme table{border-collapse:collapse} | |
| 124 | +.readme table{border-collapse:collapse;display:block;max-width:100%;overflow-x:auto} | |
| 125 | +.readme{overflow-wrap:break-word} | |
| 124 | 126 | .readme td,.readme th{border:1px solid var(--line);padding:.2rem .5rem} |
| 125 | 127 | .readme code{background:var(--code);padding:.05rem .25rem} |
| 126 | 128 | .readme pre code{padding:0;background:none} |
| @@ -136,7 +138,7 @@ table.tree .size{color:var(--muted);text-align:right} | ||
| 136 | 138 | table.tree .last{max-width:30rem;overflow:hidden;text-overflow:ellipsis;width:100%} |
| 137 | 139 | table.tree .when{text-align:right} |
| 138 | 140 | table.refs td,table.keys td{padding:.3rem 1rem .3rem 0;border-bottom:1px solid var(--line)} |
| 139 | -.code{margin:0 -1rem;line-height:1.45;min-height:70vh} | |
| 141 | +.code{margin:0 -1rem;line-height:1.45;min-height:70vh;overflow-x:auto} | |
| 140 | 142 | .code .chroma .lntable{width:auto;min-width:0} |
| 141 | 143 | .code .chroma .lntd:last-child{border-right:1px solid var(--bar);min-width:calc(80ch + 1rem);padding-right:1rem;width:auto} |
| 142 | 144 | table.blob{width:100%} |
| @@ -531,3 +533,4 @@ nav.site .bell .badge{position:absolute;top:-.35rem;left:.85rem;min-width:1rem;p | ||
| 531 | 533 | fieldset.links{border:0;padding:0;margin:0 0 .8rem;display:flex;flex-direction:column;gap:.35rem;min-width:0} |
| 532 | 534 | fieldset.links legend{padding:0;margin-bottom:.25rem} |
| 533 | 535 | @media(max-width:700px){.inboxpanel{position:fixed;top:3.2rem;left:1rem;right:1rem;width:auto;max-width:none}} |
| 536 | +@media(max-width:800px){.btn{white-space:nowrap}.dashhead{flex-wrap:wrap;row-gap:.4rem}.dashhead h3{white-space:nowrap}.columns.pullbody,.columns.browse,.dash:has(>section+section){grid-template-columns:minmax(0,1fr)}nav.tabs a{padding:.25rem .6rem}table.tree .last,table.tree .mode{display:none}table.tree td.name{white-space:normal;overflow-wrap:anywhere}main a,.crumbs{overflow-wrap:anywhere;min-width:0}.userhead{flex-wrap:wrap;gap:.2rem 1rem}.userhead nav.tabs.small{margin-bottom:0;max-width:100%}.titlerow{flex-wrap:wrap;gap:.3rem .8rem}.titlerow .btn{white-space:nowrap}.columns.user,.columns.orgbody{grid-template-columns:minmax(0,1fr)}.heatwrap{overflow-x:auto;direction:rtl;padding-bottom:2.4rem;margin-bottom:-2.4rem}.heatwrap>.heat{direction:ltr;min-width:620px}.heat .c:hover::after,.heat .c:focus::after{bottom:auto;top:calc(100% + 6px)}} | |