initial commit: vibe coded compiler
This commit is contained in:
14
templates/base.gohtml
Normal file
14
templates/base.gohtml
Normal file
@@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>{{ .Title }}</title>
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
</head>
|
||||
<body {{ .PageSizeAttr }}>
|
||||
<div id="page">{{ .Content }}</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
29
templates/index.gohtml
Normal file
29
templates/index.gohtml
Normal file
@@ -0,0 +1,29 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>All Pages</title>
|
||||
<link rel="stylesheet" href="/css/style.css" />
|
||||
<style>
|
||||
html, body { margin: 0; padding: 0; height: 100%; }
|
||||
body { background: #eeeeee; }
|
||||
.main { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1rem; box-sizing: border-box; }
|
||||
.thumb { display: flex; flex-direction: column; align-items: center; }
|
||||
.label { font: 12px/1.2 -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif; color: #555; margin: 0.25rem 0; }
|
||||
.thumb iframe { width: 5.5in; height: 8.5in; border: 0; background: white; box-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.18); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
{{ range .Pages }}
|
||||
<div class="thumb">
|
||||
<div class="label">{{ .Name }}</div>
|
||||
<iframe src="/{{ .Href }}" loading="lazy"></iframe>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
29
templates/print.gohtml
Normal file
29
templates/print.gohtml
Normal file
@@ -0,0 +1,29 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Print</title>
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
<style>
|
||||
/* Ensure a clean print with no gaps between pages */
|
||||
@media screen { body { background: #eeeeee; } }
|
||||
/* Do NOT constrain the whole document to one page; let it flow across pages */
|
||||
html, body { margin: 0; padding: 0; }
|
||||
@media print {
|
||||
html, body { width: auto !important; height: auto !important; overflow: visible !important; margin: 0 !important; padding: 0 !important; background: white !important; }
|
||||
}
|
||||
/* Each #page is a fixed-size sheet */
|
||||
#page { width: var(--page-w, 5.5in); height: var(--page-h, 8.5in); background: white; box-shadow: none !important; overflow: hidden; }
|
||||
#page { page-break-after: always; break-after: page; }
|
||||
#page:last-child { page-break-after: auto; break-after: auto; }
|
||||
</style>
|
||||
</head>
|
||||
<body {{ .PageSizeAttr }}>
|
||||
{{ range .Pages }}
|
||||
<div id="page">{{ .Content }}</div>
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
32
templates/print_2up.gohtml
Normal file
32
templates/print_2up.gohtml
Normal file
@@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Print 2-Up</title>
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
<style>
|
||||
/* Letter page with two half-letter pages laid out horizontally */
|
||||
/* Do NOT constrain the whole document to a single sheet */
|
||||
html, body { margin: 0; padding: 0; background: white; }
|
||||
@media print { html, body { width: auto !important; height: auto !important; overflow: visible !important; } }
|
||||
|
||||
/* Each .sheet is one letter-sized page */
|
||||
.sheet { display: flex; gap: 0; margin: 0; padding: 0; width: 11in; height: 8.5in; }
|
||||
.cell { width: 5.5in; height: 8.5in; overflow: hidden; }
|
||||
.cell > #page { width: 5.5in; height: 8.5in; box-shadow: none !important; }
|
||||
.sheet { page-break-after: always; break-after: page; }
|
||||
.sheet:last-child { page-break-after: auto; break-after: auto; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
{{ range .Sheets }}
|
||||
<div class="sheet">
|
||||
<div class="cell"><div id="page">{{ .Left.Content }}</div></div>
|
||||
{{ if .Right }}<div class="cell"><div id="page">{{ .Right.Content }}</div></div>{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user