diff --git a/viewer/model.go b/viewer/model.go index 8dac9be..bf7a493 100644 --- a/viewer/model.go +++ b/viewer/model.go @@ -3,6 +3,7 @@ package viewer type pageData struct { Title string HasSnapshot bool + PrintMode bool Error string NoticeTitle string NoticeBody string diff --git a/viewer/render.go b/viewer/render.go index 2ce26a3..62c215b 100644 --- a/viewer/render.go +++ b/viewer/render.go @@ -86,6 +86,7 @@ type RenderOptions struct { DownloadArchiveLabel string NoticeTitle string NoticeBody string + PrintMode bool } func RenderHTML(snapshot []byte, title string) ([]byte, error) { @@ -103,6 +104,7 @@ func RenderHTMLWithOptions(snapshot []byte, title string, opts RenderOptions) ([ func buildPageData(snapshot []byte, title string, opts RenderOptions) (pageData, error) { page := pageData{ Title: title, + PrintMode: opts.PrintMode, NoticeTitle: strings.TrimSpace(opts.NoticeTitle), NoticeBody: strings.TrimSpace(opts.NoticeBody), DownloadArchiveURL: strings.TrimSpace(opts.DownloadArchiveURL), diff --git a/web/static/view.css b/web/static/view.css index 5af724d..ab8baa2 100644 --- a/web/static/view.css +++ b/web/static/view.css @@ -432,3 +432,45 @@ body { } + +/* ── Print / PDF ──────────────────────────────────── */ + +@media print { + .page-header { + background: #fff; + color: #000; + padding: 8px 0; + } + + .header-actions { + display: none; + } + + .page-main { + width: 100%; + margin: 0; + } + + .sections-grid { + grid-template-columns: 1fr; + } + + .section-card-half, + .section-card-full { + grid-column: auto; + } + + .section-card { + break-inside: avoid; + page-break-inside: avoid; + margin-bottom: 20px; + } + + .filter-row { + display: none; + } + + .data-table tbody tr:hover { + background: transparent; + } +} diff --git a/web/templates/view.html b/web/templates/view.html index d9b127a..b709907 100644 --- a/web/templates/view.html +++ b/web/templates/view.html @@ -43,7 +43,8 @@