This commit is contained in:
Celogeek 2023-04-12 21:51:34 +02:00
parent 5276f2ba6f
commit 9809de878a
Signed by: celogeek
SSH Key Fingerprint: SHA256:njNJLzoLQdbV9PC6ehcruRb0QnEgxABoCYZ+0+aUIYc
7 changed files with 44 additions and 16 deletions

View File

@ -291,7 +291,9 @@ func (e *ePub) Write() error {
"Title": title,
"TOC": string(toc),
})},
{"OEBPS/Text/style.css", styleTmpl},
{"OEBPS/Text/style.css", e.render(styleTmpl, map[string]any{
"Info": e,
})},
{"OEBPS/Text/part.xhtml", e.render(partTmpl, map[string]any{
"Info": e,
"Part": i + 1,
@ -321,11 +323,13 @@ func (e *ePub) Write() error {
var content string
if e.AddPanelView {
content = e.render(textTmpl, map[string]any{
"Info": e,
"Image": img,
"Manga": e.Manga,
})
} else {
content = e.render(textNoPanelTmpl, map[string]any{
"Info": e,
"Image": img,
})
}

View File

@ -7,6 +7,8 @@
<meta name="viewport" content="width={{ .Info.ViewWidth }}, height={{ .Info.ViewHeight }}"/>
</head>
<body>
<h1>{{ if .Info.Manga }}&#8592;{{ else }}&#8594;{{ end }}</h1>
<div class="content">
<h1>{{ if .Info.Manga }}&#8592;{{ else }}&#8594;{{ end }}</h1>
</div>
</body>
</html>

View File

@ -14,8 +14,7 @@
<meta name="book-type" content="comic"/>
<meta name="primary-writing-mode" content="horizontal-{{ if $info.Manga }}rl{{ else }}lr{{ end }}"/>
<meta property="rendition:layout">pre-paginated</meta>
<meta property="rendition:orientation">portrait</meta>
<meta name="orientation-lock" content="portrait"/>
<meta name="rendition:spread" content="landscape"/>
{{ if eq $info.AddPanelView true }}
<meta name="region-mag" content="true"/>
{{ end }}
@ -49,9 +48,9 @@
<itemref idref="page_part" linear="yes"/>
{{ range .Images }}
{{ if eq .NeedSpace true }}
<itemref idref="page_{{ .Id }}_sp" linear="yes"/>
<itemref idref="page_{{ .Id }}_sp" linear="yes" />
{{ end }}
<itemref idref="page_{{ .Id }}_p{{ .Part }}" linear="yes"/>
<itemref idref="page_{{ .Id }}_p{{ .Part }}" linear="yes" {{ if eq .Part 1 }}properties="page-spread-left"{{ end }}{{ if eq .Part 2 }}properties="page-spread-right"{{ end }}/>
{{ end }}
</spine>
</package>

View File

@ -7,9 +7,11 @@
<meta name="viewport" content="width={{ .Info.ViewWidth }}, height={{ .Info.ViewHeight }}"/>
</head>
<body>
<h1>{{ .Info.Title }}</h1>
<div class="content">
<h2>{{ .Info.Title }}</h2>
{{ if gt .Total 1 }}
<h1>Part {{ .Part }} / {{ .Total }}</h1>
<h3>Part {{ .Part }} / {{ .Total }}</h3>
{{ end }}
</div>
</body>
</html>

View File

@ -6,10 +6,10 @@ html {
}
body {
font-size: 16px;
font-size: 1em;
text-align: center;
width: 100%;
height: 100%;
width:{{ .Info.ViewWidth }}px;
height:{{ .Info.ViewHeight }}px;
}
body,
@ -32,6 +32,15 @@ td {
padding: 0
}
div.content {
width:100%;
height:100%;
display:flex;
flex-direction:column;
justify-content:center;
align-items:center;
}
table {
border-collapse: collapse;
border-spacing: 0;
@ -64,10 +73,22 @@ h3,
h4,
h5,
h6 {
font-size: 150%;
-webkit-hyphens:none;
font-weight: normal;
}
h1 {
font-size: 1500%;
}
h2 {
font-size: 1000%;
}
h3 {
font-size: 800%;
}
sup {
vertical-align: text-top;
}

View File

@ -5,10 +5,10 @@
<title>Page {{ .Image.Id }}_p{{ .Image.Part}}</title>
<link href="style.css" type="text/css" rel="stylesheet"/>
<link href="panelview.css" type="text/css" rel="stylesheet"/>
<meta name="viewport" content="width={{ .Image.Width }}, height={{ .Image.Height }}"/>
<meta name="viewport" content="width={{ .Info.ViewWidth }}, height={{ .Info.ViewHeight }}"/>
</head>
<body>
<div>
<div class="content">
<img style="width:{{ .Image.Width }}px; height:{{ .Image.Height }}px" src="../Images/{{ .Image.Id }}_p{{ .Image.Part}}.jpg"/>
</div>
<div id="PV">

View File

@ -4,10 +4,10 @@
<head>
<title>Page {{ .Image.Id }}_p{{ .Image.Part}}</title>
<link href="style.css" type="text/css" rel="stylesheet"/>
<meta name="viewport" content="width={{ .Image.Width }}, height={{ .Image.Height }}"/>
<meta name="viewport" content="width={{ .Info.ViewWidth }}, height={{ .Info.ViewHeight }}"/>
</head>
<body>
<div>
<div class="content">
<img style="width:{{ .Image.Width }}px; height:{{ .Image.Height }}px" src="../Images/{{ .Image.Id }}_p{{ .Image.Part}}.jpg"/>
</div>
</body>