mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-24 15:52:38 +02:00
improve style
This commit is contained in:
parent
b27a826cd2
commit
d96e63bc50
@ -97,13 +97,8 @@ func (e *ePub) writeImage(wz *epubZip, img *Image) error {
|
||||
err := wz.WriteFile(
|
||||
fmt.Sprintf("OEBPS/%s", img.TextPath()),
|
||||
e.render(textTmpl, map[string]any{
|
||||
"Title": fmt.Sprintf("Image %d Part %d", img.Id, img.Part),
|
||||
"ViewPort": fmt.Sprintf("width=%d, height=%d", e.ViewWidth, e.ViewHeight),
|
||||
"ImageStyle": fmt.Sprintf(
|
||||
"width:%dpx; height:%dpx;",
|
||||
img.Width,
|
||||
img.Height,
|
||||
),
|
||||
"Title": fmt.Sprintf("Image %d Part %d", img.Id, img.Part),
|
||||
"ViewPort": fmt.Sprintf("width=%d,height=%d", e.ViewWidth, e.ViewHeight),
|
||||
"ImagePath": img.ImgPath(),
|
||||
}),
|
||||
)
|
||||
@ -120,7 +115,7 @@ func (e *ePub) writeBlank(wz *epubZip, img *Image) error {
|
||||
fmt.Sprintf("OEBPS/Text/%d_sp.xhtml", img.Id),
|
||||
e.render(blankTmpl, map[string]any{
|
||||
"Title": fmt.Sprintf("Blank Page %d", img.Id),
|
||||
"ViewPort": fmt.Sprintf("width=%d, height=%d", e.ViewWidth, e.ViewHeight),
|
||||
"ViewPort": fmt.Sprintf("width=%d,height=%d", e.ViewWidth, e.ViewHeight),
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>{{ .Title }}</title>
|
||||
<link href="style.css" type="text/css" rel="stylesheet"/>
|
||||
<meta name="viewport" content="{{ .ViewPort }}"/>
|
||||
|
@ -1,13 +1,22 @@
|
||||
body {
|
||||
color: #000;
|
||||
background: #FFF;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: {{ .PageWidth }}px;
|
||||
height: {{ .PageHeight }}px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div {
|
||||
img {
|
||||
position: absolute;
|
||||
margin:0;
|
||||
padding:0;
|
||||
z-index:0;
|
||||
top:0;
|
||||
left:0;
|
||||
width: {{ .PageWidth }}px;
|
||||
height: {{ .PageHeight }}px;
|
||||
}
|
@ -2,13 +2,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>{{ .Title }}</title>
|
||||
<link href="style.css" type="text/css" rel="stylesheet"/>
|
||||
<meta name="viewport" content="{{ .ViewPort }}"/>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<img style="{{ .ImageStyle }}" src="../{{ .ImagePath }}"/>
|
||||
<img src="../{{ .ImagePath }}" alt="{{ .Title }}"/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -2,6 +2,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Part {{ .Part }}</title>
|
||||
<link href="style.css" type="text/css" rel="stylesheet"/>
|
||||
<meta name="viewport" content="width={{ .Info.ViewWidth }}, height={{ .Info.ViewHeight }}"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user