diff --git a/internal/epub/core.go b/internal/epub/core.go index da0ff2c..bef59dd 100644 --- a/internal/epub/core.go +++ b/internal/epub/core.go @@ -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, }) } diff --git a/internal/epub/templates/blank.xhtml.tmpl b/internal/epub/templates/blank.xhtml.tmpl index 0252f8b..8e4f241 100644 --- a/internal/epub/templates/blank.xhtml.tmpl +++ b/internal/epub/templates/blank.xhtml.tmpl @@ -7,6 +7,8 @@ -

{{ if .Info.Manga }}←{{ else }}→{{ end }}

+
+

{{ if .Info.Manga }}←{{ else }}→{{ end }}

+
\ No newline at end of file diff --git a/internal/epub/templates/content.opf.tmpl b/internal/epub/templates/content.opf.tmpl index 730190c..8cd2e6d 100644 --- a/internal/epub/templates/content.opf.tmpl +++ b/internal/epub/templates/content.opf.tmpl @@ -14,8 +14,7 @@ pre-paginated - portrait - + {{ if eq $info.AddPanelView true }} {{ end }} @@ -49,9 +48,9 @@ {{ range .Images }} {{ if eq .NeedSpace true }} - + {{ end }} - + {{ end }} diff --git a/internal/epub/templates/part.xhtml.tmpl b/internal/epub/templates/part.xhtml.tmpl index 15dfed0..7f02155 100644 --- a/internal/epub/templates/part.xhtml.tmpl +++ b/internal/epub/templates/part.xhtml.tmpl @@ -7,9 +7,11 @@ -

{{ .Info.Title }}

+
+

{{ .Info.Title }}

{{ if gt .Total 1 }} -

Part {{ .Part }} / {{ .Total }}

+

Part {{ .Part }} / {{ .Total }}

{{ end }} +
\ No newline at end of file diff --git a/internal/epub/templates/style.css.tmpl b/internal/epub/templates/style.css.tmpl index 2bbe2ef..34060e1 100644 --- a/internal/epub/templates/style.css.tmpl +++ b/internal/epub/templates/style.css.tmpl @@ -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; } diff --git a/internal/epub/templates/text.xhtml.tmpl b/internal/epub/templates/text.xhtml.tmpl index d92b6f6..9cee97a 100644 --- a/internal/epub/templates/text.xhtml.tmpl +++ b/internal/epub/templates/text.xhtml.tmpl @@ -5,10 +5,10 @@ Page {{ .Image.Id }}_p{{ .Image.Part}} - + -
+
diff --git a/internal/epub/templates/textnopanel.xhtml.tmpl b/internal/epub/templates/textnopanel.xhtml.tmpl index 0350f5a..9674592 100644 --- a/internal/epub/templates/textnopanel.xhtml.tmpl +++ b/internal/epub/templates/textnopanel.xhtml.tmpl @@ -4,10 +4,10 @@ Page {{ .Image.Id }}_p{{ .Image.Part}} - + -
+