mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-25 08:12:36 +02:00
wip
This commit is contained in:
parent
5276f2ba6f
commit
9809de878a
@ -291,7 +291,9 @@ func (e *ePub) Write() error {
|
|||||||
"Title": title,
|
"Title": title,
|
||||||
"TOC": string(toc),
|
"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{
|
{"OEBPS/Text/part.xhtml", e.render(partTmpl, map[string]any{
|
||||||
"Info": e,
|
"Info": e,
|
||||||
"Part": i + 1,
|
"Part": i + 1,
|
||||||
@ -321,11 +323,13 @@ func (e *ePub) Write() error {
|
|||||||
var content string
|
var content string
|
||||||
if e.AddPanelView {
|
if e.AddPanelView {
|
||||||
content = e.render(textTmpl, map[string]any{
|
content = e.render(textTmpl, map[string]any{
|
||||||
|
"Info": e,
|
||||||
"Image": img,
|
"Image": img,
|
||||||
"Manga": e.Manga,
|
"Manga": e.Manga,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
content = e.render(textNoPanelTmpl, map[string]any{
|
content = e.render(textNoPanelTmpl, map[string]any{
|
||||||
|
"Info": e,
|
||||||
"Image": img,
|
"Image": img,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
<meta name="viewport" content="width={{ .Info.ViewWidth }}, height={{ .Info.ViewHeight }}"/>
|
<meta name="viewport" content="width={{ .Info.ViewWidth }}, height={{ .Info.ViewHeight }}"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>{{ if .Info.Manga }}←{{ else }}→{{ end }}</h1>
|
<div class="content">
|
||||||
|
<h1>{{ if .Info.Manga }}←{{ else }}→{{ end }}</h1>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -14,8 +14,7 @@
|
|||||||
<meta name="book-type" content="comic"/>
|
<meta name="book-type" content="comic"/>
|
||||||
<meta name="primary-writing-mode" content="horizontal-{{ if $info.Manga }}rl{{ else }}lr{{ end }}"/>
|
<meta name="primary-writing-mode" content="horizontal-{{ if $info.Manga }}rl{{ else }}lr{{ end }}"/>
|
||||||
<meta property="rendition:layout">pre-paginated</meta>
|
<meta property="rendition:layout">pre-paginated</meta>
|
||||||
<meta property="rendition:orientation">portrait</meta>
|
<meta name="rendition:spread" content="landscape"/>
|
||||||
<meta name="orientation-lock" content="portrait"/>
|
|
||||||
{{ if eq $info.AddPanelView true }}
|
{{ if eq $info.AddPanelView true }}
|
||||||
<meta name="region-mag" content="true"/>
|
<meta name="region-mag" content="true"/>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@ -49,9 +48,9 @@
|
|||||||
<itemref idref="page_part" linear="yes"/>
|
<itemref idref="page_part" linear="yes"/>
|
||||||
{{ range .Images }}
|
{{ range .Images }}
|
||||||
{{ if eq .NeedSpace true }}
|
{{ if eq .NeedSpace true }}
|
||||||
<itemref idref="page_{{ .Id }}_sp" linear="yes"/>
|
<itemref idref="page_{{ .Id }}_sp" linear="yes" />
|
||||||
{{ end }}
|
{{ 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 }}
|
{{ end }}
|
||||||
</spine>
|
</spine>
|
||||||
</package>
|
</package>
|
||||||
|
@ -7,9 +7,11 @@
|
|||||||
<meta name="viewport" content="width={{ .Info.ViewWidth }}, height={{ .Info.ViewHeight }}"/>
|
<meta name="viewport" content="width={{ .Info.ViewWidth }}, height={{ .Info.ViewHeight }}"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>{{ .Info.Title }}</h1>
|
<div class="content">
|
||||||
|
<h2>{{ .Info.Title }}</h2>
|
||||||
{{ if gt .Total 1 }}
|
{{ if gt .Total 1 }}
|
||||||
<h1>Part {{ .Part }} / {{ .Total }}</h1>
|
<h3>Part {{ .Part }} / {{ .Total }}</h3>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -6,10 +6,10 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-size: 16px;
|
font-size: 1em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 100%;
|
width:{{ .Info.ViewWidth }}px;
|
||||||
height: 100%;
|
height:{{ .Info.ViewHeight }}px;
|
||||||
}
|
}
|
||||||
|
|
||||||
body,
|
body,
|
||||||
@ -32,6 +32,15 @@ td {
|
|||||||
padding: 0
|
padding: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.content {
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
display:flex;
|
||||||
|
flex-direction:column;
|
||||||
|
justify-content:center;
|
||||||
|
align-items:center;
|
||||||
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
@ -64,10 +73,22 @@ h3,
|
|||||||
h4,
|
h4,
|
||||||
h5,
|
h5,
|
||||||
h6 {
|
h6 {
|
||||||
font-size: 150%;
|
-webkit-hyphens:none;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 1500%;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 1000%;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: 800%;
|
||||||
|
}
|
||||||
|
|
||||||
sup {
|
sup {
|
||||||
vertical-align: text-top;
|
vertical-align: text-top;
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
<title>Page {{ .Image.Id }}_p{{ .Image.Part}}</title>
|
<title>Page {{ .Image.Id }}_p{{ .Image.Part}}</title>
|
||||||
<link href="style.css" type="text/css" rel="stylesheet"/>
|
<link href="style.css" type="text/css" rel="stylesheet"/>
|
||||||
<link href="panelview.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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div class="content">
|
||||||
<img style="width:{{ .Image.Width }}px; height:{{ .Image.Height }}px" src="../Images/{{ .Image.Id }}_p{{ .Image.Part}}.jpg"/>
|
<img style="width:{{ .Image.Width }}px; height:{{ .Image.Height }}px" src="../Images/{{ .Image.Id }}_p{{ .Image.Part}}.jpg"/>
|
||||||
</div>
|
</div>
|
||||||
<div id="PV">
|
<div id="PV">
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Page {{ .Image.Id }}_p{{ .Image.Part}}</title>
|
<title>Page {{ .Image.Id }}_p{{ .Image.Part}}</title>
|
||||||
<link href="style.css" type="text/css" rel="stylesheet"/>
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div class="content">
|
||||||
<img style="width:{{ .Image.Width }}px; height:{{ .Image.Height }}px" src="../Images/{{ .Image.Id }}_p{{ .Image.Part}}.jpg"/>
|
<img style="width:{{ .Image.Width }}px; height:{{ .Image.Height }}px" src="../Images/{{ .Image.Id }}_p{{ .Image.Part}}.jpg"/>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user